https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87891
Iain Sandoe <iains at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |RESOLVED Resolution|--- |WORKSFORME --- Comment #12 from Iain Sandoe <iains at gcc dot gnu.org> --- (In reply to Douglas Mencken from comment #11) 1. I would advise against using "*-unknown-darwin" as the tail of the triple. - this is because -- there are a couple of configure places that match -apple- (I mean to get rid of them at some point, but ...) -- the top level libtool.sh will most likely pick options relevant to the lowest version of OS X (10.0) which are not generally most compatible with 10.5 I suggest using powerpc{,64}-apple-darwin9 as the triple. 2. Note that, even in the best of times, powerpc64-apple-darwin{8,9} was much less tested than the powerpc version. 3. there is at least one nasty 64b code-gen bug that i've not had a chance to squish (patches welcome!) See PR65342 as an example (it occurs for all languages, not just fortran). Having said all that ... I do expect it to "work" FSDO "work". > sudo cat << EOF > /usr/bin/powerpc64-unknown-darwin-ranlib > #!/bin/sh > exec ranlib \${1+"\$@"} > EOF ^^ the original "libtool" utility figures out it is being invoked as "ranlib" by looking at the command name. If it matches "ranlib" all is good .. but powerpc64-apple-dariwn9-ranlib doesn't match ;) - I "fixed" this in the xtools version of libtool (it looks at the tail only now) - https://github.com/iains/darwin-xtools/commit/6bbb627144efb637b79a2b340e6e14c316c46348 ==== now as for configuring and building, you seem to be jumping through a number of extra hoops anf they are confusing the issue ... ----- (best to first build and install the native compiler for the branch you're using) Note : YOU MUST DO THIS IF YOU WANT TO BUILD ADA (Ada doesn't cross between different versions). option 1: cross compiler: ========= suppose you are going to install in /opt/iains/powerpc-apple-darwin9/gcc-8-3r0 make /opt/iains/powerpc-apple-darwin9/gcc-8-3r0/powerpc64-apple-darwin9/bin in that dir you can symlink the cctools and ld64. In fact, even ranlib should work here, since it is symlinked as "ranlib". OS X has a convenience in that all the tools work for both m32 and m64, and the system contains libraries at the same paths for both (FAT works in our favor here). So the following should work. /src-local/gcc-8-branch/configure --prefix=/opt/iains/powerpc-apple-darwin9/gcc-8-3r0 --target=powerpc64-apple-darwin9 --host=powerpc-apple-darwin9 --build=powerpc-apple-darwin9 --enable-checking=release --disable-nls --enable-version-specific-runtime-libs --with-sysroot=/ --enable-languages=c,c++,ada NOTE; you need to tell it that the sysroot is "/". option 2: Bootstrap a powerpc64 compiler. ========= This is another neat feature, since the kernel is happy to launch m64 processes, and the system contains all the necessary stuff we can do this: /src-local/gcc-8-branch/configure --prefix=/opt/iains/powerpc64-apple-darwin9/gcc-8-3r0 --target=powerpc64-apple-darwin9 --host=powerpc64-apple-darwin9 --build=powerpc64-apple-darwin9 --enable-checking=release --disable-nls --enable-version-specific-runtime-libs --enable-languages=c,c++,ada CC='gcc -m64' CXX='g++ -m64' GNATMAKE='gnatmake -m64' ^^^ NOTE: here we've made the powerpc bootstrap compilers generate 64b code, once stage#1 is complete, we have a 64b compiler anyway. ======= Both of these schemes work for me today, with 8.3. ======== FWIW, IFF you want a complete 64b toolchain (including the linker and assembler) that means building cctools and ld64 as 64b. I've not tested that out much and have some doubt as to whether unpatched cctools/ld64 would work.