#53184 closed enhancement (wontfix)
A cxx11-compatible clang compiler on 10.5 PPC ?Some progress...
Reported by: | kencu (Ken) | Owned by: | kencu (Ken) |
---|---|---|---|
Priority: | Normal | Milestone: | |
Component: | ports | Version: | |
Keywords: | leopard powerpc | Cc: | jeremyhu (Jeremy Huddleston Sequoia), dbevans (David B. Evans), svensen, ccorn, potmj (Michael Pot), fhgwright (Fred Wright), khepler, michaelld (Michael Dickens), mascguy (Christopher Nielsen), barracuda156, Dave-Allured (Dave Allured) |
Port: |
Description
We have been trying for a while now to get a current version of clang working on 10.5 - specifically PPC - and this ticket is keep a log of successes and failures in this regard. Jeremy's recent 10.5 fixes have enabled 10.5 Intel to have a working version of libc++ and clang-3.7 that can cross-compile simple PPC apps.
I have had some success with clang-3.6 on 10.5 PPC, so I thought I would document how that worked in case anyone would like to try it, or alternatively has some ideas how to better test it and/or improve the situation.
When I tried, I could not build libcxx on PPC with clang-3.4, but it does (as Jeremy documents) build with clang-3.4 on 10.5 Intel with PPC slices. I copied the following files built on the 10.5 Intel system
libcxx-3.9.0_0+universal.darwin_9.i386-ppc-x86_64.tbz2 libcxxabi-3.9.0_0+universal.darwin_9.i386-ppc-x86_64.tbz2 libffi-3.2.1_0+universal.darwin_9.i386-ppc-x86_64.tbz2 libmacho-886_0+universal.darwin_9.i386-ppc-x86_64.tbz2 libedit-20160618-3.1_1+universal.darwin_9.i386-ppc-x86_64.tbz2 libunwind-3.9.0_3+universal.darwin_9.i386-ppc-x86_64.tbz2 libunwind-headers-3.9.0_0.darwin_9.noarch.tbz2 ncurses-6.0_0+universal.darwin_9.i386-ppc-x86_64.tbz2
over to a 10.5 PPC machine, placing them into /opt/local/var/macports/incoming/verified
, and then installed each one like this:
sudo port -v install PORTNAME +universal universal_arches="i386 ppc x86_64" supported_arches="i386 ppc x86_64"
I believe that was the full list of cross-compiled files that I had to move over.
Next, I tried to cross-compile clang-3.7 and clang-3.8 with ppc slices. LLVM-3.7 and 3.8 did build with ppc slices, but they segfault when moved to the 10.5 ppc machine with what appears to be an error in the address lookup for strlen(). Neither clang-3.7 nor clang-3.8 would cross-compile on 10.5 Intel, in each case delivering up error 12
during the link phase. Whether or not that can be overcome is to be discovered.
Back to the 10.5 PPC machine, clang-3.4 proved to be quite touchy compiling software, however with some modifications as below, it would compile llvm/clang-3.6 through to completion.
adding this to the clang-3.6 portfile
configure.cflags-append -fPIE configure.cxxflags-append -fPIE configure.ldflags-append -fPIE -nodefaultlibs -lc++ -lc++abi -lgcc_s.10.5 configure.ldflags-append -lSystem and editing this to include ppc supported_archs i386 x86_64 ppc
updating macports.conf as usual
cxx_stdlib libc++ buildfromsurce always delete_la_files yes default_compilers macports-clang-3.4 gcc-4.2
and installing clang-3.6 did go through to completion.
clang-3.6 @3.6.2_5+analyzer (active) platform='darwin 9' archs='ppc' llvm-3.6 @3.6.2_4 (active) platform='darwin 9' archs='ppc'
clang-3.6 appears to work correctly
$ clang --version clang version 3.6.2 (tags/RELEASE_362/final) Target: powerpc-apple-darwin9.8.0 Thread model: posix
and the llvm-binaries don't segfault (like the cross-compiled ones did)
$ /opt/local/bin/llvm-tblgen-mp-3.6 --version LLVM (http://llvm.org/): LLVM version 3.6.2 Optimized build. Built Dec 29 2016 (18:30:54). Default target: powerpc-apple-darwin9.8.0 Host CPU: 970
and so far simple apps build and link against libc++
$ helloworld Hello World! $ otool -L /opt/local/bin/helloworld /opt/local/bin/helloworld: /usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 3.9.0) /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 111.1.7) /usr/lib/libgcc_s.1.dylib (compatibility version 1.0.0, current version 697.0.0) /usr/lib/libc++abi.dylib (compatibility version 1.0.0, current version 3.9.0)
and a few more complex apps also build and run
$ otool -L /opt/local/bin/nzbget /opt/local/bin/nzbget: /opt/local/lib/libz.1.dylib (compatibility version 1.0.0, current version 1.2.8) /opt/local/lib/libgnutls.30.dylib (compatibility version 37.0.0, current version 37.8.0) /opt/local/lib/libncurses.6.dylib (compatibility version 6.0.0, current version 6.0.0) /opt/local/lib/libxml2.2.dylib (compatibility version 12.0.0, current version 12.4.0) /usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 3.9.0) /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 111.1.7) /usr/lib/libgcc_s.1.dylib (compatibility version 1.0.0, current version 697.0.0) /usr/lib/libc++abi.dylib (compatibility version 1.0.0, current version 3.9.0) $ nzbget --version nzbget version: 14.1
at this time, clang-3.7 / llvm-3.7 will not build through on 10.5 PPC, and the cross-compiled llvm-3.7 segfaults on PPC.
Hope this helps someone. K
Attachments (2)
Change History (40)
comment:1 Changed 8 years ago by dbevans (David B. Evans)
Cc: | dbevans added |
---|
comment:2 Changed 8 years ago by mf2k (Frank Schima)
Keywords: | powerpc added; PPC removed |
---|
comment:3 Changed 8 years ago by kencu (Ken)
Changed 8 years ago by kencu (Ken)
Attachment: | clang-3.9.ppc.32bit.10.5.libcxx.error.log added |
---|
comment:4 Changed 8 years ago by kencu (Ken)
And success in end, with clang-3.7, building it with gcc6, with this build line
sudo port -v install clang-3.7 configure.compiler=macports-gcc-6 supported_archs="ppc ppc64" build_arch="ppc"`
$ port -v installed clang-3.7 The following ports are currently installed: clang-3.7 @3.7.1_4+analyzer (active) platform='darwin 9' archs='ppc' date='2017-05-14T16:54:46-0700'
and
$ clang --version clang version 3.7.1 (tags/RELEASE_371/final) Target: powerpc-apple-darwin9.8.0 Thread model: posix
Yeah, well. That is satisfying, to an extent. It built through to completion without errors, at least. Now to see if the bugs Jeremy points out on the LibcxxOnOlderSystems page are the same on this build, and to give it a test run.
comment:5 Changed 8 years ago by kencu (Ken)
building clang-3.8 with gcc6 also works, with one small error in the lipo script:
projects/compiler-rt/lib/builtins/CMakeFiles/clang_rt.10.4.dir/build make[2]: Entering directory `/opt/local/var/macports/build/_opt_peggedports_lang_llvm-3.8/clang-3.8/work/build' [ 14%] Generating ../../../../lib/clang/3.8.1/lib/darwin/libclang_rt.10.4.a cd /opt/local/var/macports/build/_opt_peggedports_lang_llvm-3.8/clang-3.8/work/build/projects/compiler-rt/lib/builtins && /opt/local/bin/cmake -E make_directory /opt/local/var/macports/build/_opt_peggedports_lang_llvm-3.8/clang-3.8/work/build/./lib/clang/3.8.1/lib/darwin cd /opt/local/var/macports/build/_opt_peggedports_lang_llvm-3.8/clang-3.8/work/build/projects/compiler-rt/lib/builtins && lipo -output /opt/local/var/macports/build/_opt_peggedports_lang_llvm-3.8/clang-3.8/work/build/./lib/clang/3.8.1/lib/darwin/libclang_rt.10.4.a -create -arch i386 /opt/local/var/macports/build/_opt_peggedports_lang_llvm-3.8/clang-3.8/work/build/lib/libclang_rt.builtins_i386_10.4.a -arch x86_64 /opt/local/var/macports/build/_opt_peggedports_lang_llvm-3.8/clang-3.8/work/build/lib/libclang_rt.builtins_x86_64_10.4.a fatal error: lipo: specifed architecture type (i386) for file (/opt/local/var/macports/build/_opt_peggedports_lang_llvm-3.8/clang-3.8/work/build/lib/libclang_rt.builtins_i386_10.4.a) does not match its cputype (18) and cpusubtype (0) (should be cputype (7) and cpusubtype (3)) make[2]: *** [lib/clang/3.8.1/lib/darwin/libclang_rt.10.4.a] Error 1 make[2]: Leaving directory `/opt/local/var/macports/build/_opt_peggedports_lang_llvm-3.8/clang-3.8/work/build' make[1]: *** [projects/compiler-rt/lib/builtins/CMakeFiles/clang_rt.10.4.dir/all] Error 2 make[1]: *** Waiting for unfinished jobs.... [ 14%] Building CXX object tools/clang/utils/TableGen/CMakeFiles/obj.clang-tblgen.dir/ClangCommentCommandInfoEmitter.cpp.o
This probably is due to an assumption in the script that the build is on Intel, because this file is actually ppc code libclang_rt.builtins_i386_10.4.a
and this is worked around quite easily by going into this folder:
cd /opt/local/var/macports/build/_opt_peggedports_lang_llvm-3.8/clang-3.8/work/build/projects/compiler-rt/lib/builtins
And executing this slightly altered line:
sudo lipo -output /opt/local/var/macports/build/_opt_peggedports_lang_llvm-3.8/clang-3.8/work/build/./lib/clang/3.8.1/lib/darwin/libclang_rt.10.4.a -create -arch ppc /opt/local/var/macports/build/_opt_peggedports_lang_llvm-3.8/clang-3.8/work/build/lib/libclang_rt.builtins_i386_10.4.a
That then gives you a completed installation of clang-3.8. llvm-3.8 also builds nicely through to completion using gcc6, so in the end we have success:
$ clang --version clang version 3.8.1 (tags/RELEASE_381/final) Target: powerpc-apple-darwin9.8.0 Thread model: posix InstalledDir: /opt/local/libexec/llvm-3.8/bin
We then have two clang compilers, 3.7 and 3.8, that work without segfaulting on 10.5 PPC. This was successful at building a fairly complex cxx11 port, aria2, with a build line like this:
sudo port -v install aria2 configure.compiler=macports-clang-3.7 configure.cxx_stdlib=libc++
$ port -v installed aria2 The following ports are currently installed: aria2 @1.31.0_0 (active) platform='darwin 9' archs='ppc' date='2017-05-14T18:21:11-0700'
which has proper linking against libc++:
$ otool -L /opt/local/bin/aria2c /opt/local/bin/aria2c: /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation (compatibility version 150.0.0, current version 476.19.0) /opt/local/lib/libz.1.dylib (compatibility version 1.0.0, current version 1.2.11) /opt/local/lib/libxml2.2.dylib (compatibility version 12.0.0, current version 12.4.0) /opt/local/lib/libgnutls.30.dylib (compatibility version 45.0.0, current version 45.2.0) /opt/local/lib/libnettle.6.dylib (compatibility version 6.0.0, current version 6.1.0) /opt/local/lib/libgmp.10.dylib (compatibility version 14.0.0, current version 14.2.0) /opt/local/lib/libintl.8.dylib (compatibility version 10.0.0, current version 10.5.0) /System/Library/Frameworks/Security.framework/Versions/A/Security (compatibility version 1.0.0, current version 26935.0.0) /usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 3.9.0) /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 111.1.7) /usr/lib/libgcc_s.1.dylib (compatibility version 1.0.0, current version 697.0.0) /usr/lib/libc++abi.dylib (compatibility version 1.0.0, current version 3.9.0)
which runs, finds it's libraries, and appears to work normally so far, with limited testing:
$ aria2c Specify at least one URL. Usage: aria2c [OPTIONS] [URI | MAGNET | TORRENT_FILE | METALINK_FILE]... See 'aria2c -h'.
comment:6 Changed 8 years ago by kencu (Ken)
Trying to build some software such as aria2c with clang-3.8 on PPC runs into the standard missing llrintf
long long types that were excluded from < 10.7, which we can also see on 10.6.
In file included from /opt/local/libexec/llvm-3.8/bin/../include/c++/v1/cmath:301: /opt/local/libexec/llvm-3.8/bin/../include/c++/v1/math.h:1199:91: error: use of undeclared identifier 'llrintf' inline _LIBCPP_INLINE_VISIBILITY long long llrint(float __lcpp_x) _NOEXCEPT {return llrintf(__lcpp_x);}
Jeremy has fixed this error already, and it no longer shows up on 10.6. I suspect this is fixed in a slightly newer version of the clang-3.8 portfile.
comment:7 Changed 7 years ago by kencu (Ken)
On the niche clang-on-ppc front, comes some progress I wasn't certain would ever be possible.
Indeed however, clang-3.8 and llvm-3.8 do in the end build, install, and function to build and install working ports on 10.4 PPC Tiger without too much trouble.
$ port -v installed clang-3.8 llvm-3.8 The following ports are currently installed: clang-3.8 @3.8.1_8+analyzer (active) platform='darwin 8' archs='ppc' date='2017-06-03T16:14:41-0700' llvm-3.8 @3.8.1_3 (active) platform='darwin 8' archs='ppc' date='2017-06-03T01:16:16-0700' $ clang --version clang version 3.8.1 (tags/RELEASE_381/final) Target: powerpc-apple-darwin8.11.0 Thread model: posix InstalledDir: /opt/local/libexec/llvm-3.8/bin
The same potholes about exceptions are likely still present -- although if backended with libstdc++ from gcc perhaps there will be better luck.
I've completed backporting the libgcc5abi compatability functions from clang-3.9+ into clang-3.8 with the kind help from Debian patches that did the heavy lifting, and also backed Marcus' macports-libstdc++ modifications into clang-3.8, so for the moment, the system can use libstdc++ from gcc6. Libc++ might be next.
The last linker in MacPorts for Tiger is ld-97, but a kind soul has already ported ld64 versions in the 200's to PPC, so hopefully we can get at least ld64-136 working, and maybe something newer.
comment:8 Changed 7 years ago by kencu (Ken)
Owner: | set to kencu |
---|---|
Status: | new → assigned |
comment:9 Changed 7 years ago by svensen
Cc: | svensen added |
---|
comment:10 Changed 7 years ago by svensen
Cc: | svensen removed |
---|
comment:11 Changed 7 years ago by svensen
Cc: | svensen added |
---|
comment:12 Changed 7 years ago by ccorn
Cc: | ccorn added |
---|
comment:13 Changed 7 years ago by potmj (Michael Pot)
Cc: | potmj added |
---|
comment:14 follow-ups: 15 16 Changed 7 years ago by kencu (Ken)
Well, I wasn't sure this was ever going to be possible, but in the end, at least in part, it just might be. clang-3.8 on Tiger PPC.
Welcome to Darwin! tigerg5: $ port -v installed clang-3.8 llvm-3.8 The following ports are currently installed: clang-3.8 @3.8.1_9+analyzer+libstdcxx (active) platform='darwin 8' archs='ppc' date='2018-04-28T19:49:08-0700' llvm-3.8 @3.8.1_3 (active) platform='darwin 8' archs='ppc' date='2018-04-28T22:12:39-0700' tigerg5:~ $ which clang /opt/local/bin/clang tigerg5:~ $ clang --version clang version 3.8.1 (tags/RELEASE_381/final) Target: powerpc-apple-darwin8.11.0 Thread model: posix InstalledDir: /opt/local/libexec/llvm-3.8/bin
There is still the issue with c++ exceptions on PPC to be fixed someday, and there is a bit of fine tuning to do with compiler_rt to get all the right symbols in. But it builds, and works well enough to play with.
comment:15 Changed 7 years ago by kencu (Ken)
comment:16 Changed 7 years ago by ccorn
Replying to kencu:
Well, I wasn't sure this was ever going to be possible, but in the end, at least in part, it just might be. clang-3.8 on Tiger PPC.
Thanks for the good news!
Is bootstrapping on Intel still required? If so, (how) could a binary PPC bootstrap package be made?
comment:17 Changed 7 years ago by kencu (Ken)
Is bootstrapping on Intel still required?
Thankfully no, it builds with gcc6 on PPC.
If so, (how) could a binary PPC bootstrap package be made?
Certainly! I will make a binary available.
There are three issues that remain that I know about.
- The llvm compiler-rt project's cmake scripts don't support PPC building out of the box, and are quite complicated. David Fang has fixed this on an older version of the compiler-rt, and with some slight mods, this works to generate a PPC version of compiler_rt_10.4.a that appears to have all the correct parts in it. At the moment, I am subbing this in post-build. I would like to integrate this into the clang-3.8 build directly.
- c++ exceptions don't work yet, due to some low-level assembly issues that delve into the depths a
eh_frame
addresses. - va_args work, but apparently still not for every data type yet. I had some help on this several months ago from an agreeable llvm/clang developer and we thought we had it licked, but something just showed up when building git on Tiger PPC with clang-3.8.
Despite that, many things can be built.
clang-3.8 on Tiger Intel seems to work perfectly when built the same way, and the compiler-rt, va_args, and exceptions are all debugged and working when building for i386 as far as I can tell.
comment:18 Changed 6 years ago by fhgwright (Fred Wright)
Cc: | fhgwright added |
---|
comment:19 Changed 6 years ago by khepler
Cc: | khepler added |
---|
comment:20 Changed 6 years ago by kencu (Ken)
More excitement:
$ port -v installed llvm-5.0 The following ports are currently installed: llvm-5.0 @5.0.2_0 (active) platform='darwin 9' archs='ppc' date='2018-12-20T18:16:42-0800'
with any luck clang-5.0
should be right around the corner, and then we're getting into serious territory. Building compiler_rt
is still a bit messy; I have to spend some time on that and fix that build up for PowerPC.
You can get the WIP for clang-5.0 here <https://github.com/kencu/LeopardPorts/tree/master/lang/llvm-5.0> . clang-5.0 will likely build, but will get bogged down in the compiler_rt
as above, I suspect.
If you have interest and want to help, dive in and share! My current plan is to try to write a new CMakeLists.txt for projects/compiler_rt/lib/darwin and skip most of the fancy stuff currently done that confuses things.
Plan B (which may become Plan A) is to see if I can get this older compiler_rt from David Fang building <https://github.com/kencu/compiler-rt>. Dunno how much clang-5.0 will like that ...
comment:21 Changed 6 years ago by kencu (Ken)
As expected, clang-5.0 does build, with the compiler_rt disabled:
$ port -v installed clang-5.0 The following ports are currently installed: clang-5.0 @5.0.2_3+analyzer+emulated_tls+libstdcxx (active) platform='darwin 9' archs='ppc' date='2018-12-21T08:22:31-0800'
one tiny hiccup with a std::log
call that is broken on gcc6
and less on Darwin 10.5. I just edited that in source to log
, but building with gcc7
should also fix that, as that error was fixed in gcc7
.
If you would like to try this out at present, because I disabled clang_rt
and libcxx
for now, you need to make a link to where clang-5.0 will look for the includes:
$ cd /opt/local/libexec/llvm-5.0/include $ sudo ln -s /opt/local/libexec/llvm-5.0/lib/c++ .
and then you're in business, sorta -- had to manually add the -lstdc++
for now:
$ clang -v -Wl,-v -lstdc++ -stdlib=libstdc++ -o helloworld helloworld.cpp clang version 5.0.2 (tags/RELEASE_502/final) Target: powerpc-apple-darwin9.8.0 Thread model: posix InstalledDir: /opt/local/libexec/llvm-5.0/bin "/opt/local/libexec/llvm-5.0/bin/clang" -cc1 -triple powerpc-apple-macosx10.5.0 -emit-obj -mrelax-all -disable-free -disable-llvm-verifier -discard-value-names -main-file-name helloworld.cpp -mrelocation-model pic -pic-level 2 -mthread-model posix -mdisable-fp-elim -masm-verbose -munwind-tables -faligned-alloc-unavailable -mfloat-abi hard -target-linker-version 127.2 -v -dwarf-column-info -debugger-tuning=lldb -resource-dir /opt/local/libexec/llvm-5.0/lib/clang/5.0.2 -stdlib=libstdc++ -fdeprecated-macro -fdebug-compilation-dir /opt/local/var/macports/build/_opt_myports_devel_helloworld/helloworld/work/helloworld-9767fc3cc248797fa2df16b0f8926131aed9d6ce -ferror-limit 19 -fmessage-length 160 -femulated-tls -stack-protector 1 -fobjc-runtime=macosx-fragile-10.5.0 -fencode-extended-block-signature -fcxx-exceptions -fexceptions -fmax-type-align=16 -fdiagnostics-show-option -fcolor-diagnostics -o /var/folders/zz/zzzivhrRnAmviuee+++++++++++/-Tmp-/helloworld-dc942f.o -x c++ helloworld.cpp clang -cc1 version 5.0.2 based upon LLVM 5.0.2 default target powerpc-apple-darwin9.8.0 ignoring nonexistent directory "/usr/include/c++/4.2.1" ignoring nonexistent directory "/usr/include/c++/4.2.1/powerpc-apple-darwin10/" ignoring nonexistent directory "/usr/include/c++/4.2.1/backward" ignoring nonexistent directory "/usr/local/include" #include "..." search starts here: #include <...> search starts here: /usr/include/c++/4.0.0 /usr/include/c++/4.0.0/powerpc-apple-darwin8 /usr/include/c++/4.0.0/backward /opt/local/libexec/llvm-5.0/lib/clang/5.0.2/include /usr/include /System/Library/Frameworks (framework directory) /Library/Frameworks (framework directory) End of search list. "/opt/local/libexec/llvm-5.0/bin/ld" -demangle -dynamic -arch ppc -macosx_version_min 10.5.0 -o helloworld -lcrt1.10.5.o -v /usr/lib/libstdc++.6.dylib /var/folders/zz/zzzivhrRnAmviuee+++++++++++/-Tmp-/helloworld-dc942f.o -lSystem -lgcc_s.10.5 @(#)PROGRAM:ld PROJECT:ld64-127.2 configured to support archs: i386 x86_64 ppc ppc64 armv6 armv7 Library search paths: /usr/lib /usr/local/lib Framework search paths: /Library/Frameworks/ /System/Library/Frameworks/ $ ./helloworld Hello World!
or with libc++ (copy over from an Intel system for now where you build it with a PPC slice):
$ clang -v -Wl,-v -lc++ -stdlib=libc++ -o helloworld helloworld.cpp clang version 5.0.2 (tags/RELEASE_502/final) Target: powerpc-apple-darwin9.8.0 Thread model: posix InstalledDir: /opt/local/libexec/llvm-5.0/bin "/opt/local/libexec/llvm-5.0/bin/clang" -cc1 -triple powerpc-apple-macosx10.5.0 -emit-obj -mrelax-all -disable-free -disable-llvm-verifier -discard-value-names -main-file-name helloworld.cpp -mrelocation-model pic -pic-level 2 -mthread-model posix -mdisable-fp-elim -masm-verbose -munwind-tables -faligned-alloc-unavailable -mfloat-abi hard -target-linker-version 127.2 -v -dwarf-column-info -debugger-tuning=lldb -resource-dir /opt/local/libexec/llvm-5.0/lib/clang/5.0.2 -stdlib=libc++ -fdeprecated-macro -fdebug-compilation-dir /opt/local/var/macports/build/_opt_myports_devel_helloworld/helloworld/work/helloworld-9767fc3cc248797fa2df16b0f8926131aed9d6ce -ferror-limit 19 -fmessage-length 160 -femulated-tls -stack-protector 1 -fobjc-runtime=macosx-fragile-10.5.0 -fencode-extended-block-signature -fcxx-exceptions -fexceptions -fmax-type-align=16 -fdiagnostics-show-option -fcolor-diagnostics -o /var/folders/zz/zzzivhrRnAmviuee+++++++++++/-Tmp-/helloworld-a22afc.o -x c++ helloworld.cpp clang -cc1 version 5.0.2 based upon LLVM 5.0.2 default target powerpc-apple-darwin9.8.0 ignoring nonexistent directory "/usr/include/c++/v1" ignoring nonexistent directory "/usr/local/include" #include "..." search starts here: #include <...> search starts here: /opt/local/libexec/llvm-5.0/include/c++/v1 /opt/local/libexec/llvm-5.0/lib/clang/5.0.2/include /usr/include /System/Library/Frameworks (framework directory) /Library/Frameworks (framework directory) End of search list. "/opt/local/libexec/llvm-5.0/bin/ld" -demangle -dynamic -arch ppc -macosx_version_min 10.5.0 -o helloworld -lcrt1.10.5.o -v -lc++ /var/folders/zz/zzzivhrRnAmviuee+++++++++++/-Tmp-/helloworld-a22afc.o -lSystem -lgcc_s.10.5 @(#)PROGRAM:ld PROJECT:ld64-127.2 configured to support archs: i386 x86_64 ppc ppc64 armv6 armv7 Library search paths: /usr/lib /usr/local/lib Framework search paths: /Library/Frameworks/ /System/Library/Frameworks/ $ ./helloworld Hello World!
Now have to get clang_rt
sorted out.
comment:22 Changed 6 years ago by kencu (Ken)
If anyone cares to assist in the compiler_rt
fix, Iain Sandoe did a bunch of it here <https://gist.github.com/iains/3a04c0b24dfb0665ab16a2e79accd4ce> and although it's outdated now for the current clang_rt
, it's a good start.
And here's his fix for the error in building libcxx
on PPC with gcc
<https://gist.github.com/iains/3b2e074d65263cd4be456c36839823d1>
comment:23 Changed 6 years ago by kencu (Ken)
Sadly, Iain's fixes don't fix the build of compiler_rt
. (BTW, I found his patches apply cleanly to clang-3.8
, but not to clang-3.9
, for anyone who wants to test it.)
The problem is most likely right at the premise of how the CMake logic in compiler_rt
works, I think. It tries to do a test-compile of a hello, world
program with different archs to see if a target can be built. But this doesn't work with gcc6
and presumably other gcc
versions. If you pass gcc6
that can build only ppc
and ppc64
a build line like this:
gcc -arch i386 -o helloworld helloworld.c
It does not generate an error -- instead, it helpfully lets you know in a message that it assumes you had a stroke or something, passed it -arch i386
by accident, and it builds it anyway, but using what I presume is the host
arch, and you get a ppc
executable.
CMake apparently doesn't notice this detail, so it registers the i386
build a success, adds it to the list of archs
, and same with x86_64
. So you wind up, in the end, with two identical binaries, both in actual fact ppc
binaries, one labelled i386
and one labelled x86_64
.
And that is where the lipo stage above errors out 53184#comment:5, because it has no idea what is going on now.
At least I think I know what the problem is now :> Maybe this will lead to a fix once I understand how to fix that. (Notably, there is still no build of the rt
recognized as ppc, it appears.)
comment:24 Changed 6 years ago by kencu (Ken)
Sadly, the llvm
project has given up on Darwin PPC support due to unresolved bugs and lack on developer interest and support. All the backend support has been disabled in trunk, and the supporting files and parts are to be stripped completely out of the source tree.
They leave the day open that this might be re-added, but that seems to me extremely unlikely if they've reached this point after all this time.
I may still try to get a working version of clang-6.0 or maybe clang-7.0 for PPC going, but to be noted it's now a dead end. Still, clang-6.0 or 7.0 would last us many years.
comment:25 Changed 6 years ago by kencu (Ken)
I reran the test-suite
assessment test on the clang-3.8 PPC installation, and found it a bit better:
Failing Tests (14): test-suite :: MultiSource/Benchmarks/MiBench/telecomm-FFT/telecomm-fft.test test-suite :: SingleSource/Benchmarks/Shootout-C++/EH/except.test test-suite :: SingleSource/Regression/C++/EH/class_hierarchy.test test-suite :: SingleSource/Regression/C++/EH/ctor_dtor_count-2.test test-suite :: SingleSource/Regression/C++/EH/ctor_dtor_count.test test-suite :: SingleSource/Regression/C++/EH/exception_spec_test.test test-suite :: SingleSource/Regression/C++/EH/function_try_block.test test-suite :: SingleSource/Regression/C++/EH/inlined_cleanup.test test-suite :: SingleSource/Regression/C++/EH/recursive-throw.test test-suite :: SingleSource/Regression/C++/EH/simple_rethrow.test test-suite :: SingleSource/Regression/C++/EH/throw_rethrow_test.test test-suite :: SingleSource/UnitTests/2003-05-07-VarArgs.test test-suite :: SingleSource/UnitTests/2003-08-11-VaListArg.test test-suite :: SingleSource/UnitTests/byval-alignment.test Expected Passes : 486 Unexpected Failures: 14
The EH
frame c++ failures are completely expected, and most of the varargs
failures seen before are fixed by the patch from upstream I included.
486/500 passes is 97.2% success, and the failures are all as expected...
comment:26 Changed 6 years ago by kencu (Ken)
Type: | defect → enhancement |
---|
comment:27 Changed 6 years ago by michaelld (Michael Dickens)
Cc: | michaelld added |
---|
comment:28 Changed 6 years ago by kencu (Ken)
As much as I would have liked to fix this for everyone, someone much smarter about compilers than I am has taken this up, and seems to be a lot further down the road.
<https://github.com/iains/LLVM-7-branch>
Iain also has a current ld64 274 building on PPC, and many other similar enhancements. Kudos!
comment:29 Changed 5 years ago by kencu (Ken)
Resolution: | → wontfix |
---|---|
Status: | assigned → closed |
I'll close this and leave it to Iain's project to see if a clang compiler springs to life for PowerPC someday.
comment:30 Changed 3 years ago by hamishmb (Hamish Mcintyre-Bhatty)
NB: If an Intel bootstrap isn't needed, does this mean the instructions at: https://trac.macports.org/wiki/LibcxxOnOlderSystems are wrong?
I'm only asking because I'm interested in this for future powerPC ports of my programs so want to retest or improve those instructions if new things are now possible.
comment:31 Changed 3 years ago by kencu (Ken)
Those MacPorts instructions are correct for Intel systems, but will not work properly on PowerPC systems.
For PowerPC systems, you can build certain early versions of clang (clang-3.4 up to about clang-7.0) in various ways on PowerPC systems. For clang-3.4, gcc-4.2 from MacPorts can build it in MacPorts, with minor Portfile surgery.
I have built up to clang-5.0 myself on PowerPC, and as per Iain's repo above, he has built up to clang-7.0 (plus llvm-7.0 and libcxx-7.0) on PowerPC bootstrapping them with gcc-5.0.
However, the built clangs (all of them) are broken in various ways. Most prominently, they do not have a completed Darwin PowerPC ABI infrastructure, so when they build software, the calling conventions are wrong for using system libraries and other libraries that are properly built against the Darwin PowerPC ABI. This is obviously a deal-breaker right now.
In addition, the c++ exception handling never worked, and still doesn't.
If you want to get a working clang/llvm compiler on PowerPC darwin, your best approach at present would be to take Iain's fork of llvm above, try building it, and then (if you know PowerPC assembly and can read the Darwin PowerPC ABI manual clearly enough) help him fix the clang lowering for PowerPC darwin.
I know Iain would like to finish it, but he has a lot of other things on the plate. I thought I would be able to learn enough to help him finish it, but I was not able to.
Now I just installed debian linux on my PowerPC systems, and they run rust, llvm/clang-13, gcc-11, etc with no trouble at all. So that is what I did, in the end.
comment:32 Changed 3 years ago by mascguy (Christopher Nielsen)
Cc: | mascguy added |
---|
comment:33 Changed 3 years ago by hamishmb (Hamish Mcintyre-Bhatty)
Thanks for replying.
Sadly I don't know any PowerPC Assembly, or any assembly at all for that matter. I am interested in learning, though that may be in the distant future. Macports installs GCC 9 as a dependency for something else so I will maybe check if GCC 9 produces properly working executables, though I suspect it won't.
What does clang lowering mean in this case?
At any rate, I will see if I can get the wiki updated to use Iain's repo and link to the bugs linked to in the Libcxx for older platforms page.
Cheers :)
comment:34 Changed 3 years ago by hamishmb (Hamish Mcintyre-Bhatty)
Also of note is that perhaps this is useful to anyone else reading this thread: https://github.com/autc04/Retro68
comment:35 Changed 3 years ago by kencu (Ken)
I am not an expert, but as I understand the term in this context, lowering refers to the process of taking a higher level language representation and changing it towards something "lower", ie closer to machine language.
So c++ becomes LLVM-IR and that becomes intermediate steps until the final assembly language is printed out. That then used to be sent to a separate assembler, but on Intel LLVM does the assembly by itself too for many targets.
The stage that I believe has never been finished is the stage where arguments from the LLVM-IR are modified into the proper spacing and register assignments to match the Darwin PowerPC ABI.
This has been done for the ELF (Linux) PowerPC ABI, and I currently run llvm-13, clang-13, rust, etc on my G4 and G5 PowerMacs using Debian Linux 11. So it is possible to do the fixing for the Darwin PowerPC ABI, but nobody has done it.
See, for example:
https://llvm.org/doxygen/structllvm_1_1PPCTargetLowering_1_1CallFlags.html#details
comment:36 Changed 3 years ago by barracuda156
Just for the record, while llvm-3.5
has built on 10.6.8 Rosetta, clang-3.5
failed on this:
:info:build llvm[3]: Compiling SanitizerBlacklist.cpp for Release+Debug build :info:build if /opt/local/bin/g++-mp-7 -I/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_lang_llvm-3.5/clang-3.5/work/build/include -I/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_lang_llvm-3.5/clang-3.5/work/build/tools/clang/lib/CodeGen -I/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_lang_llvm-3.5/clang-3.5/work/llvm-3.5.2.src/include -I/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_lang_llvm-3.5/clang-3.5/work/llvm-3.5.2.src/tools/clang/lib/CodeGen -DNDEBUG -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -I/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_lang_llvm-3.5/clang-3.5/work/llvm-3.5.2.src/tools/clang/lib/CodeGen/../../include -I/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_lang_llvm-3.5/clang-3.5/work/build/tools/clang/lib/CodeGen/../../include -Os -g -std=c++11 -fvisibility-inlines-hidden -fno-exceptions -fno-common -Woverloaded-virtual -Wcast-qual -fno-strict-aliasing -pipe -Os -arch ppc -I/opt/local/include -mmacosx-version-min=10.6 -pedantic -Wno-long-long -Wall -W -Wno-unused-parameter -Wwrite-strings -Wno-maybe-uninitialized -Wno-missing-field-initializers -c -MMD -MP -MF "/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_lang_llvm-3.5/clang-3.5/work/build/tools/clang/lib/CodeGen/Release+Debug/SanitizerBlacklist.d.tmp" -MT "/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_lang_llvm-3.5/clang-3.5/work/build/tools/clang/lib/CodeGen/Release+Debug/SanitizerBlacklist.o" -MT "/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_lang_llvm-3.5/clang-3.5/work/build/tools/clang/lib/CodeGen/Release+Debug/SanitizerBlacklist.d" /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_lang_llvm-3.5/clang-3.5/work/llvm-3.5.2.src/tools/clang/lib/CodeGen/SanitizerBlacklist.cpp -o /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_lang_llvm-3.5/clang-3.5/work/build/tools/clang/lib/CodeGen/Release+Debug/SanitizerBlacklist.o ; \ :info:build then /bin/mv -f "/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_lang_llvm-3.5/clang-3.5/work/build/tools/clang/lib/CodeGen/Release+Debug/SanitizerBlacklist.d.tmp" "/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_lang_llvm-3.5/clang-3.5/work/build/tools/clang/lib/CodeGen/Release+Debug/SanitizerBlacklist.d"; else /bin/rm "/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_lang_llvm-3.5/clang-3.5/work/build/tools/clang/lib/CodeGen/Release+Debug/SanitizerBlacklist.d.tmp"; exit 1; fi :info:build llvm[3]: Compiling TargetInfo.cpp for Release+Debug build :info:build if /opt/local/bin/g++-mp-7 -I/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_lang_llvm-3.5/clang-3.5/work/build/include -I/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_lang_llvm-3.5/clang-3.5/work/build/tools/clang/lib/CodeGen -I/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_lang_llvm-3.5/clang-3.5/work/llvm-3.5.2.src/include -I/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_lang_llvm-3.5/clang-3.5/work/llvm-3.5.2.src/tools/clang/lib/CodeGen -DNDEBUG -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -I/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_lang_llvm-3.5/clang-3.5/work/llvm-3.5.2.src/tools/clang/lib/CodeGen/../../include -I/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_lang_llvm-3.5/clang-3.5/work/build/tools/clang/lib/CodeGen/../../include -Os -g -std=c++11 -fvisibility-inlines-hidden -fno-exceptions -fno-common -Woverloaded-virtual -Wcast-qual -fno-strict-aliasing -pipe -Os -arch ppc -I/opt/local/include -mmacosx-version-min=10.6 -pedantic -Wno-long-long -Wall -W -Wno-unused-parameter -Wwrite-strings -Wno-maybe-uninitialized -Wno-missing-field-initializers -c -MMD -MP -MF "/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_lang_llvm-3.5/clang-3.5/work/build/tools/clang/lib/CodeGen/Release+Debug/TargetInfo.d.tmp" -MT "/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_lang_llvm-3.5/clang-3.5/work/build/tools/clang/lib/CodeGen/Release+Debug/TargetInfo.o" -MT "/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_lang_llvm-3.5/clang-3.5/work/build/tools/clang/lib/CodeGen/Release+Debug/TargetInfo.d" /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_lang_llvm-3.5/clang-3.5/work/llvm-3.5.2.src/tools/clang/lib/CodeGen/TargetInfo.cpp -o /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_lang_llvm-3.5/clang-3.5/work/build/tools/clang/lib/CodeGen/Release+Debug/TargetInfo.o ; \ :info:build then /bin/mv -f "/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_lang_llvm-3.5/clang-3.5/work/build/tools/clang/lib/CodeGen/Release+Debug/TargetInfo.d.tmp" "/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_lang_llvm-3.5/clang-3.5/work/build/tools/clang/lib/CodeGen/Release+Debug/TargetInfo.d"; else /bin/rm "/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_lang_llvm-3.5/clang-3.5/work/build/tools/clang/lib/CodeGen/Release+Debug/TargetInfo.d.tmp"; exit 1; fi :info:build llvm[3]: Building Release+Debug Archive Library libclangSema.a :info:build /bin/rm -f /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_lang_llvm-3.5/clang-3.5/work/build/Release+Debug/lib/libclangSema.a :info:build ar cru /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_lang_llvm-3.5/clang-3.5/work/build/Release+Debug/lib/libclangSema.a /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_lang_llvm-3.5/clang-3.5/work/build/tools/clang/lib/Sema/Release+Debug/AnalysisBasedWarnings.o /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_lang_llvm-3.5/clang-3.5/work/build/tools/clang/lib/Sema/Release+Debug/AttributeList.o /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_lang_llvm-3.5/clang-3.5/work/build/tools/clang/lib/Sema/Release+Debug/CodeCompleteConsumer.o /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_lang_llvm-3.5/clang-3.5/work/build/tools/clang/lib/Sema/Release+Debug/DeclSpec.o /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_lang_llvm-3.5/clang-3.5/work/build/tools/clang/lib/Sema/Release+Debug/DelayedDiagnostic.o /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_lang_llvm-3.5/clang-3.5/work/build/tools/clang/lib/Sema/Release+Debug/IdentifierResolver.o /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_lang_llvm-3.5/clang-3.5/work/build/tools/clang/lib/Sema/Release+Debug/JumpDiagnostics.o /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_lang_llvm-3.5/clang-3.5/work/build/tools/clang/lib/Sema/Release+Debug/MultiplexExternalSemaSource.o /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_lang_llvm-3.5/clang-3.5/work/build/tools/clang/lib/Sema/Release+Debug/Scope.o /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_lang_llvm-3.5/clang-3.5/work/build/tools/clang/lib/Sema/Release+Debug/ScopeInfo.o /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_lang_llvm-3.5/clang-3.5/work/build/tools/clang/lib/Sema/Release+Debug/Sema.o /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_lang_llvm-3.5/clang-3.5/work/build/tools/clang/lib/Sema/Release+Debug/SemaAccess.o /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_lang_llvm-3.5/clang-3.5/work/build/tools/clang/lib/Sema/Release+Debug/SemaAttr.o /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_lang_llvm-3.5/clang-3.5/work/build/tools/clang/lib/Sema/Release+Debug/SemaCXXScopeSpec.o /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_lang_llvm-3.5/clang-3.5/work/build/tools/clang/lib/Sema/Release+Debug/SemaCast.o /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_lang_llvm-3.5/clang-3.5/work/build/tools/clang/lib/Sema/Release+Debug/SemaChecking.o /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_lang_llvm-3.5/clang-3.5/work/build/tools/clang/lib/Sema/Release+Debug/SemaCodeComplete.o /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_lang_llvm-3.5/clang-3.5/work/build/tools/clang/lib/Sema/Release+Debug/SemaConsumer.o /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_lang_llvm-3.5/clang-3.5/work/build/tools/clang/lib/Sema/Release+Debug/SemaDecl.o /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_lang_llvm-3.5/clang-3.5/work/build/tools/clang/lib/Sema/Release+Debug/SemaDeclAttr.o /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_lang_llvm-3.5/clang-3.5/work/build/tools/clang/lib/Sema/Release+Debug/SemaDeclCXX.o /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_lang_llvm-3.5/clang-3.5/work/build/tools/clang/lib/Sema/Release+Debug/SemaDeclObjC.o /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_lang_llvm-3.5/clang-3.5/work/build/tools/clang/lib/Sema/Release+Debug/SemaExceptionSpec.o /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_lang_llvm-3.5/clang-3.5/work/build/tools/clang/lib/Sema/Release+Debug/SemaExpr.o /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_lang_llvm-3.5/clang-3.5/work/build/tools/clang/lib/Sema/Release+Debug/SemaExprCXX.o /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_lang_llvm-3.5/clang-3.5/work/build/tools/clang/lib/Sema/Release+Debug/SemaExprMember.o /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_lang_llvm-3.5/clang-3.5/work/build/tools/clang/lib/Sema/Release+Debug/SemaExprObjC.o /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_lang_llvm-3.5/clang-3.5/work/build/tools/clang/lib/Sema/Release+Debug/SemaFixItUtils.o /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_lang_llvm-3.5/clang-3.5/work/build/tools/clang/lib/Sema/Release+Debug/SemaInit.o /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_lang_llvm-3.5/clang-3.5/work/build/tools/clang/lib/Sema/Release+Debug/SemaLambda.o /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_lang_llvm-3.5/clang-3.5/work/build/tools/clang/lib/Sema/Release+Debug/SemaLookup.o /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_lang_llvm-3.5/clang-3.5/work/build/tools/clang/lib/Sema/Release+Debug/SemaObjCProperty.o /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_lang_llvm-3.5/clang-3.5/work/build/tools/clang/lib/Sema/Release+Debug/SemaOpenMP.o /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_lang_llvm-3.5/clang-3.5/work/build/tools/clang/lib/Sema/Release+Debug/SemaOverload.o /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_lang_llvm-3.5/clang-3.5/work/build/tools/clang/lib/Sema/Release+Debug/SemaPseudoObject.o /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_lang_llvm-3.5/clang-3.5/work/build/tools/clang/lib/Sema/Release+Debug/SemaStmt.o /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_lang_llvm-3.5/clang-3.5/work/build/tools/clang/lib/Sema/Release+Debug/SemaStmtAsm.o /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_lang_llvm-3.5/clang-3.5/work/build/tools/clang/lib/Sema/Release+Debug/SemaStmtAttr.o /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_lang_llvm-3.5/clang-3.5/work/build/tools/clang/lib/Sema/Release+Debug/SemaTemplate.o /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_lang_llvm-3.5/clang-3.5/work/build/tools/clang/lib/Sema/Release+Debug/SemaTemplateDeduction.o /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_lang_llvm-3.5/clang-3.5/work/build/tools/clang/lib/Sema/Release+Debug/SemaTemplateInstantiate.o /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_lang_llvm-3.5/clang-3.5/work/build/tools/clang/lib/Sema/Release+Debug/SemaTemplateInstantiateDecl.o /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_lang_llvm-3.5/clang-3.5/work/build/tools/clang/lib/Sema/Release+Debug/SemaTemplateVariadic.o /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_lang_llvm-3.5/clang-3.5/work/build/tools/clang/lib/Sema/Release+Debug/SemaType.o /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_lang_llvm-3.5/clang-3.5/work/build/tools/clang/lib/Sema/Release+Debug/TypeLocBuilder.o :info:build ranlib /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_lang_llvm-3.5/clang-3.5/work/build/Release+Debug/lib/libclangSema.a :info:build make[3]: Leaving directory `/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_lang_llvm-3.5/clang-3.5/work/build/tools/clang/lib/Sema' :info:build llvm[3]: Building Release+Debug Archive Library libclangCodeGen.a :info:build /bin/rm -f /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_lang_llvm-3.5/clang-3.5/work/build/Release+Debug/lib/libclangCodeGen.a :info:build ar cru /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_lang_llvm-3.5/clang-3.5/work/build/Release+Debug/lib/libclangCodeGen.a /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_lang_llvm-3.5/clang-3.5/work/build/tools/clang/lib/CodeGen/Release+Debug/BackendUtil.o /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_lang_llvm-3.5/clang-3.5/work/build/tools/clang/lib/CodeGen/Release+Debug/CGAtomic.o /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_lang_llvm-3.5/clang-3.5/work/build/tools/clang/lib/CodeGen/Release+Debug/CGBlocks.o /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_lang_llvm-3.5/clang-3.5/work/build/tools/clang/lib/CodeGen/Release+Debug/CGBuiltin.o /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_lang_llvm-3.5/clang-3.5/work/build/tools/clang/lib/CodeGen/Release+Debug/CGCUDANV.o /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_lang_llvm-3.5/clang-3.5/work/build/tools/clang/lib/CodeGen/Release+Debug/CGCUDARuntime.o /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_lang_llvm-3.5/clang-3.5/work/build/tools/clang/lib/CodeGen/Release+Debug/CGCXX.o /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_lang_llvm-3.5/clang-3.5/work/build/tools/clang/lib/CodeGen/Release+Debug/CGCXXABI.o /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_lang_llvm-3.5/clang-3.5/work/build/tools/clang/lib/CodeGen/Release+Debug/CGCall.o /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_lang_llvm-3.5/clang-3.5/work/build/tools/clang/lib/CodeGen/Release+Debug/CGClass.o /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_lang_llvm-3.5/clang-3.5/work/build/tools/clang/lib/CodeGen/Release+Debug/CGCleanup.o /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_lang_llvm-3.5/clang-3.5/work/build/tools/clang/lib/CodeGen/Release+Debug/CGDebugInfo.o /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_lang_llvm-3.5/clang-3.5/work/build/tools/clang/lib/CodeGen/Release+Debug/CGDecl.o /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_lang_llvm-3.5/clang-3.5/work/build/tools/clang/lib/CodeGen/Release+Debug/CGDeclCXX.o /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_lang_llvm-3.5/clang-3.5/work/build/tools/clang/lib/CodeGen/Release+Debug/CGException.o /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_lang_llvm-3.5/clang-3.5/work/build/tools/clang/lib/CodeGen/Release+Debug/CGExpr.o /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_lang_llvm-3.5/clang-3.5/work/build/tools/clang/lib/CodeGen/Release+Debug/CGExprAgg.o /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_lang_llvm-3.5/clang-3.5/work/build/tools/clang/lib/CodeGen/Release+Debug/CGExprCXX.o /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_lang_llvm-3.5/clang-3.5/work/build/tools/clang/lib/CodeGen/Release+Debug/CGExprComplex.o /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_lang_llvm-3.5/clang-3.5/work/build/tools/clang/lib/CodeGen/Release+Debug/CGExprConstant.o /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_lang_llvm-3.5/clang-3.5/work/build/tools/clang/lib/CodeGen/Release+Debug/CGExprScalar.o /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_lang_llvm-3.5/clang-3.5/work/build/tools/clang/lib/CodeGen/Release+Debug/CGLoopInfo.o /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_lang_llvm-3.5/clang-3.5/work/build/tools/clang/lib/CodeGen/Release+Debug/CGObjC.o /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_lang_llvm-3.5/clang-3.5/work/build/tools/clang/lib/CodeGen/Release+Debug/CGObjCGNU.o /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_lang_llvm-3.5/clang-3.5/work/build/tools/clang/lib/CodeGen/Release+Debug/CGObjCMac.o /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_lang_llvm-3.5/clang-3.5/work/build/tools/clang/lib/CodeGen/Release+Debug/CGObjCRuntime.o /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_lang_llvm-3.5/clang-3.5/work/build/tools/clang/lib/CodeGen/Release+Debug/CGOpenCLRuntime.o /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_lang_llvm-3.5/clang-3.5/work/build/tools/clang/lib/CodeGen/Release+Debug/CGOpenMPRuntime.o /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_lang_llvm-3.5/clang-3.5/work/build/tools/clang/lib/CodeGen/Release+Debug/CGRecordLayoutBuilder.o /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_lang_llvm-3.5/clang-3.5/work/build/tools/clang/lib/CodeGen/Release+Debug/CGStmt.o /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_lang_llvm-3.5/clang-3.5/work/build/tools/clang/lib/CodeGen/Release+Debug/CGStmtOpenMP.o /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_lang_llvm-3.5/clang-3.5/work/build/tools/clang/lib/CodeGen/Release+Debug/CGVTT.o /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_lang_llvm-3.5/clang-3.5/work/build/tools/clang/lib/CodeGen/Release+Debug/CGVTables.o /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_lang_llvm-3.5/clang-3.5/work/build/tools/clang/lib/CodeGen/Release+Debug/CodeGenABITypes.o /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_lang_llvm-3.5/clang-3.5/work/build/tools/clang/lib/CodeGen/Release+Debug/CodeGenAction.o /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_lang_llvm-3.5/clang-3.5/work/build/tools/clang/lib/CodeGen/Release+Debug/CodeGenFunction.o /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_lang_llvm-3.5/clang-3.5/work/build/tools/clang/lib/CodeGen/Release+Debug/CodeGenModule.o /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_lang_llvm-3.5/clang-3.5/work/build/tools/clang/lib/CodeGen/Release+Debug/CodeGenPGO.o /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_lang_llvm-3.5/clang-3.5/work/build/tools/clang/lib/CodeGen/Release+Debug/CodeGenTBAA.o /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_lang_llvm-3.5/clang-3.5/work/build/tools/clang/lib/CodeGen/Release+Debug/CodeGenTypes.o /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_lang_llvm-3.5/clang-3.5/work/build/tools/clang/lib/CodeGen/Release+Debug/ItaniumCXXABI.o /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_lang_llvm-3.5/clang-3.5/work/build/tools/clang/lib/CodeGen/Release+Debug/MicrosoftCXXABI.o /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_lang_llvm-3.5/clang-3.5/work/build/tools/clang/lib/CodeGen/Release+Debug/ModuleBuilder.o /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_lang_llvm-3.5/clang-3.5/work/build/tools/clang/lib/CodeGen/Release+Debug/SanitizerBlacklist.o /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_lang_llvm-3.5/clang-3.5/work/build/tools/clang/lib/CodeGen/Release+Debug/TargetInfo.o :info:build ranlib /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_lang_llvm-3.5/clang-3.5/work/build/Release+Debug/lib/libclangCodeGen.a :info:build make[3]: Leaving directory `/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_lang_llvm-3.5/clang-3.5/work/build/tools/clang/lib/CodeGen' :info:build make[2]: Leaving directory `/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_lang_llvm-3.5/clang-3.5/work/build/tools/clang/lib' :info:build make[1]: *** [all] Error 1 :info:build make[1]: Leaving directory `/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_lang_llvm-3.5/clang-3.5/work/build/tools/clang' :info:build make: *** [all] Error 1 :info:build make: Leaving directory `/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_lang_llvm-3.5/clang-3.5/work/build' :info:build Command failed: cd "/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_lang_llvm-3.5/clang-3.5/work/build" && /usr/bin/make -j4 -w clang-only :info:build Exit code: 2 :error:build Failed to build clang-3.5: command execution failed :debug:build Error code: CHILDSTATUS 225 2 :debug:build Backtrace: command execution failed :debug:build while executing :debug:build "system {*}$notty {*}$callback {*}$nice $fullcmdstring" :debug:build invoked from within :debug:build "command_exec -callback portprogress::target_progress_callback build" :debug:build (procedure "portbuild::build_main" line 8) :debug:build invoked from within :debug:build "$procedure $targetname"
Sergey-Fedorovs-Mac-mini:~ svacchanda$ port -v installed llvm-3.5 The following ports are currently installed: llvm-3.5 @3.5.2_9 (active) requested_variants='' platform='darwin 10' archs='ppc' date='2022-02-05T14:24:52+0800'
comment:37 Changed 3 years ago by barracuda156
Cc: | barracuda156 added |
---|
comment:38 Changed 2 years ago by Dave-Allured (Dave Allured)
Cc: | Dave-Allured added |
---|
I continue to attempt to make progress on this issue trying to get a current clang on ppc. I have taken a new approach, of trying to build llvm and clang-3.[89] using gcc6, with some success. Once the prerequisites have been built with ppc slices on Leopard intel and moved over to the Leopard PPC machine, the following can work: a build line something like this
results in success with llvm versions:
clang is more difficult to build, and I haven't been able to get past a build of clang-3.6 built with clang-3.4 on ppc.
Libomp has no ppc architecture targets, only ppc64, which is one hiccup. Rebuilding everything as ppc64 is probably what I will come to do in the end (as ppc64 has been fairly actively worked on compared to ppc32). To get around that, there is an option in clang's build to link against libgomp instead, which builds fine on ppc.
I'm currently running into a strange error during the clang build that has also been noted on the linux forums when building clang for ppc:
I'm not sure how to work around that error just now. There is an option during the clang build to build against libstdxx instead of libcxx, not the same thing as the modification Marcus made, but perhaps in some way similar - it's used on MSVC.
I'll put up the clang-3.9.ppc32 build log in case someone becomes curious about it.