-
-
Notifications
You must be signed in to change notification settings - Fork 248
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Do not pass "-arch ppc" to GCC 4.7 - 6 #249
base: master
Are you sure you want to change the base?
Conversation
Actually this makes sense, as it's your first contribution to macports-base. |
Any updates on this? Would be great to get it reviewed / merged. |
I haven't tried this but I am confused about the PowerPC-specific parts of the change. Are you saying there are compilers that accept Intel -arch flags but not PowerPC -arch flags? |
Correct. GCC 4.7 - 6 accepts |
2ac6824
to
5ae2ed2
Compare
Rebased against master |
Good idea, hopefully this will get some more ports working on old PowerPC macs :) |
Glad to have another PPC soldier in the good fight :-) |
Yeah, it's just something completely different and interesting. I need to fix GRUB for Void Linux too as it pretty much combusted when I upgraded the disk drive, but yeah, always nice to see other people interested in these quirky machines. |
So you're saying that on a PowerPC Mac I can use |
no gcc version can compile for a different arch. gcc’s idea of cross compiling is to call a whole different compiler to do it, eg on Intel, you build a specific powerpc-apple-darwin compiler (Intel code) that builds powerpc code. You cannot build powerpc code with the x86_64-apple-darwin compiler. Apple’s driver was simply a front end to multiple installed gccs that made this more seamless. They last made it available for gcc-4.2. It supported multiple arch flags and lipo’d the results together like clang does now. a given gcc can compile 32 and 64 bit for the same processor though, if so configured during the build. It uses -m32 and -m64 to drive this. The -arch xyz flags given to gcc are just translated to -mxy flags during parsing. Only one -arch xyz flag is supported. If multiple are given, I think the final one is used... or maybe it's the first one ... I don't recall for sure at the moment. Support for the flags -arch ppc and -arch ppc64 were added by Iain later; the flags -arch i386 and -arch x86_64 were supported earlier indeed, added by someone else. That’s just how it worked out. Cross-arch flags are just ignored. The gcc x86_64-apple-darwin compiler at present will just ignore the -arch ppc and -arch ppc64 flags, for example. Updating Apple’s driver to front end an installation of multiple gccs to again make it work like clang and gcc-4.2 work would be nice. People have talked about doing that work, but nobody has done it to the point of upstreaming it to gcc. Changing gcc to have multiple back ends like llvm has is unlikely to happen, but you never know. |
@evanmiller Any chance you know your way around GRUB and OpenFirmware a bit more than I do? This is off topic, but I have a GRUB issue with VOID Linux PPC that I worked around, details here: void-ppc/void-ppc-docs#15 If you could shed any light on why this might be happening it'd be super useful - I'd like to fix the bug(s) rather than stick with my hacky workaround forever. |
-arch ppc
is not a valid option to pass prior to GCC 7. As a consequence, configuring any port using GCC 4.7 - 6 on PPC results in a failed build. Update thearch_flag_supported
logic to reflect this reality and split offmultiple_arch_flags_supported
(used inuniversal_setup
) into a separate function for clarity.See: https://trac.macports.org/ticket/63723