Opened 4 years ago

Closed 3 years ago

#60348 closed enhancement (fixed)

libcxx: enable it to build on Leopard PPC

Reported by: DominusExult (Dominik Reichardt) Owned by: kencu (Ken)
Priority: Normal Milestone:
Component: ports Version: 2.6.2
Keywords: Cc:
Port: libcxx

Description

I followed the instructions of installing libcxx, first by completely reinstalling macports, then ran selfupdate, then applying the Leopard SDK fixes. Finally "sudo port install libcxx". All the dependencies installed but libcxx failed with:

:info:build + for FILE in '../src/*.cpp'
:info:build + /usr/bin/g++-4.2 -c -g -O3 -arch i386 -arch ppc -I/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_lang_libcxx/libcxx/work/libcxxabi-5.0.1.src/include -I/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_lang_libcxx/libcxx/work/libcxx-5.0.1.src/include -Os -std=c++11 -stdlib=libc++ -nostdinc++ -fstrict-aliasing -Wstrict-aliasing=2 -Wsign-conversion -Wshadow -Wconversion -Wunused-variable -Wmissing-field-initializers -Wchar-subscripts -Wmismatched-tags -Wmissing-braces -Wshorten-64-to-32 -Wsign-compare -Wstrict-aliasing=2 -Wstrict-overflow=4 -Wunused-parameter -Wnewline-eof -D_LIBCPP_BUILDING_LIBRARY -I../include ../src/abort_message.cpp
:info:build cc1plus: error: unrecognized command line option "-Wsign-conversion"
:info:build cc1plus: error: unrecognized command line option "-Wmismatched-tags"
:info:build cc1plus: error: unrecognized command line option "-std=c++11"
:info:build cc1plus: error: unrecognized command line option "-stdlib=libc++"
:info:build cc1plus: error: unrecognized command line option "-Wsign-conversion"
:info:build cc1plus: error: unrecognized command line option "-Wmismatched-tags"
:info:build cc1plus: error: unrecognized command line option "-std=c++11"
:info:build cc1plus: error: unrecognized command line option "-stdlib=libc++"
:info:build lipo: can't figure out the architecture type of: /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_lang_libcxx/libcxx/work/.tmp/ccj8UMSX.out
:info:build make: ***

Attachments (1)

main.log (38.7 KB) - added by DominusExult (Dominik Reichardt) 4 years ago.
log file

Download all attachments as: .zip

Change History (8)

Changed 4 years ago by DominusExult (Dominik Reichardt)

Attachment: main.log added

log file

comment:1 Changed 4 years ago by kencu (Ken)

OK, a few things, but we'll get you going.

At present, libc++ , clang, llvm, etc only work on Intel systems. I'm working on PPC with some other interested parties, but for now, you can't use PPC with the llvm infrastructure. So you need to set your "universal arches" in ${prefix}/etc/macports/macports.conf to "i386 x86_64" for this to work.

Then you have to follow the instructions step-by-step in LibcxxOnOlderSystems, as this process is not automated for MacPorts to do this automatically. Basically, you use the system tools to build newer cctools and ld64, then build clang-3.4. Then clang-3.4 is used to build libcxx. Then you set your setup to use libcxx as per the instructions, and build clang-3.7. Then you use clang-3.7 to build clang-5.0 or greater. And finally, you use clang-5.0 or greater to rebuild libcxx with the +emulated_tls variant, and you are in business.

MacPorts is not currently set up properly to use Leopard configured with libc++ using the default base options, so you need to override these default base options by setting you compiler list manually in macports.conf, as per the instructions.

I use Leopard / libc++ all the time, and in fact, I highly recommend it. I also have set things up to use Tiger Intel with libc++ as well, and that seems to be pretty solid as well, so far --- I have not yet pushed that to the main MacPorts repo.

If the LibcxxOnOlderSystems instructions don't work for you, if they are not clear enough, or if there is some other issue you come across that seems less-than-clear when following those instructions, please ask and I'll see if I can help clarify them further.

Last edited 4 years ago by kencu (Ken) (previous) (diff)

comment:2 Changed 4 years ago by kencu (Ken)

in your exact error above, the issue is that libcxx is trying to build with gcc-4.2, which is impossible. libcxx can only build with clang-3.4 at that stage of things. The defaults should have led to a situation where libcxx is building with clang3.4, but if it does not, then something might have changed since I last ran through this process myself.

comment:3 Changed 4 years ago by DominusExult (Dominik Reichardt)

hmm, yes, I wanted to explicitly use it for ppc and somehow missed to read on in the LibcxxOnOlderSystems - this seems to be futile to pursuit, bummer :( Can I follow your progress on this or is that not public at the moment?

BUT the instructions for intel either do miss that you first need to install clang-3.4 or the libcxx portfile does not correctly check for this on Leopard. Because as I wrote, I executed this on a fresh MacPorts installation and thus had not installed clang-3-4 previously. And the part of editing the port file to be intel only could also need a mention in these instructions :)

comment:4 Changed 4 years ago by kencu (Ken)

There is, at present, no real functional llvm/clang/libcxx infrastructure available for PPC. It is pretty close, though. There is a fully functional assembler for ppc/ppc64 based on the llvm backend, and you can build llvm and clang 7.1 for PPC, bootstrapping it with gcc.

The problem is there is an ABI issue to be still sorted out, wherein this toolchain doesn't use the official PowerPC ABI and so can't interact properly with other software, like the system software. But it is "internally" consistent.

The lonely genius working on all this, Iain, is also the gcc compiler lead for Darwin. His time is quite valuable, and he just hasn't yet got to the point of finishing off the final bits of the Darwin PowerPC ABI for the llvm backend.

His WIP is here, quite functional. I have not yet made a Portfile for it, as it is not as yet functional enough to do that <https://github.com/iains/LLVM-7-branch>, and there are some other useful Darwin PowerPC toolchain bits there, of which the PowerPC linker, ld64, is a bit newer than the one we currently have available in MacPorts.

Version 0, edited 4 years ago by kencu (Ken) (next)

comment:5 Changed 4 years ago by kencu (Ken)

Summary: libcxx fails to install on Leopardlibcxx: enable it to build on Leopard PPC
Type: defectenhancement

comment:6 Changed 4 years ago by kencu (Ken)

Owner: set to kencu
Status: newassigned

comment:7 Changed 3 years ago by kencu (Ken)

Resolution: fixed
Status: assignedclosed

the build of libcxx has been restricted to Intel systems.

That is all the fix we will be doing in this port at present.

If something outstanding happens in some upstream project, we'll see about bringing it into MacPorts.

Note: See TracTickets for help on using tickets.