Looks like I got it working (beyond a toy example). This is still via mrustc, but it serves the purpose.
Here is as-tree port:
Here is as-tree port:
Is PPCPorts able to be installed on top of an existing MacPorts installation? I run `sudo port sync` and then `sudo port install mrustc` and I get "mrustc cannot be installed for the configured build_arch 'ppc' because it only supports the arch(s) 'arm64 x86_64'.
I haven't had much success with PPCPorts, and I'm not sure if it's because of the way I set it up or if there's something I'm doing wrong. Trying to install `fastfetch` for example fails when installing dependency `brotli` (failed to build brotli: command execution failed).
edit: I forgot the main difference between your environment and mine is that I'm running 10.5 and you're probably testing all of this stuff on 10.6. I ran into issues with Xcode on 10.6 but I'll have to take another crack at it.
I ran into issues with Xcode on 10.6 but I'll have to take another crack at it.
Thank you for your hard work on this. I was trying to build last night, but unfortunately it requires posix_spawn stuff, which doesn't exist on Tiger. I know @kencu mentioned he was working on a posix_spawn implementation for Tiger at one point. If he is able to share that work, it would help immensely. Otherwise I will need to patch out all the unsupported posix_spawn functions and try to replace them with something that works. Trivial compared to the immense work you have put in to get this working on PowerPC Mac OS X at all, but still difficult by my standards.@Forest Expertise If you still want to try this on 10.4, now it is meaningful, since at least you can build something and confirm it works.
This is cool! Possibly stupid question—if mrustc works, why doesn't mainline Rust? Can't you just use mrustc to compile Rust?
The rust compiler is a frontend that generates intermediate representation (IR) code. By default, it then uses LLVM to optimize and generate machine code.Possibly stupid question—if mrustc works, why doesn't mainline Rust? Can't you just use mrustc to compile Rust?
LLVM has somewhat limited support for architectures, especially old or very niche architectures, and does not support powerpc-darwin-* as a target triple, so if you try to make it use that triple, it just tells you that and stops.
EDIT: I get an error related to Unwind semantics when I build mrustc on Leopard. I think I can edit the `config.toml` to tell rustbuild to build std using abort-only panics, but I'm not sure if that's the move here...View attachment 2594618
I need to get better at checking GitHub and opening issues for things... will continue over there if I find any way forward.Yeah, that’s what @Matias_ reported recently: https://github.com/macos-powerpc/powerpc-ports/issues/62#issuecomment-3720532444
The issue is that while 10.6 (incl. unofficial powerpc version) has libunwind in the system, 10.5 does not. It should work if libunwind (from ports) is linked, we just need to figure out how exactly to do that in this case.