Opened 9 years ago

Closed 8 years ago

Last modified 8 years ago

#50845 closed defect (fixed)

libunwind: fails to find 'bits/c++config.h' on 10.5/PPC

Reported by: mojca (Mojca Miklavec) Owned by: jeremyhu (Jeremy Huddleston Sequoia)
Priority: Normal Milestone:
Component: ports Version:
Keywords: leopard Cc: michaelld (Michael Dickens), larryv (Lawrence Velázquez)
Port: libunwind

Description

Building libunwind fails on 10.5/PPC with:

--->  Building libunwind
make: Entering directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_devel_libunwind/libunwind/work/libunwind-3.7.0.src/src'
/opt/local/bin/clang-mp-3.4 -arch ppc  -I../include -I/opt/local/include -DUSE_MACPORTS_LIBUNWIND -DNDEBUG -Os -std=gnu99 -c -o UnwindLevel1.o UnwindLevel1.c
/opt/local/bin/clang-mp-3.4 -arch ppc  -I../include -I/opt/local/include -DUSE_MACPORTS_LIBUNWIND -DNDEBUG -Os -std=gnu99 -c -o UnwindLevel1-gcc-ext.o UnwindLevel1-gcc-ext.c
/opt/local/bin/clang-mp-3.4 -arch ppc  -I../include -I/opt/local/include -DUSE_MACPORTS_LIBUNWIND -DNDEBUG -Os -std=gnu99 -c -o Unwind-sjlj.o Unwind-sjlj.c
/opt/local/bin/clang++-mp-3.4 -arch ppc  -I../include -I/opt/local/include -DUSE_MACPORTS_LIBUNWIND -DNDEBUG -Os -stdlib=libstdc++ -c -o Unwind_AppleExtras.o Unwind_AppleExtras.cpp
/opt/local/bin/clang++-mp-3.4 -arch ppc  -I../include -I/opt/local/include -DUSE_MACPORTS_LIBUNWIND -DNDEBUG -Os -stdlib=libstdc++ -c -o libunwind.o libunwind.cpp
In file included from libunwind.cpp:19:
In file included from /usr/include/c++/4.0.0/algorithm:65:
/usr/include/c++/4.0.0/bits/stl_algobase.h:64:10: fatal error: 'bits/c++config.h' file not found
#include <bits/c++config.h>
         ^
1 error generated.
make: *** [libunwind.o] Error 1

The file exists though (I cheated from this site):

> locate c++config.h
/Developer/SDKs/MacOSX10.4u.sdk/[...]
/Developer/SDKs/MacOSX10.5.sdk/[...]
/usr/include/c++/4.0.0/i686-apple-darwin9/bits/c++config.h
/usr/include/c++/4.0.0/powerpc-apple-darwin9/bits/c++config.h
/usr/include/c++/4.0.0/powerpc64-apple-darwin9/bits/c++config.h
/usr/include/c++/4.0.0/x86_64-apple-darwin9/bits/c++config.h

Running

/opt/local/bin/clang++-mp-3.4 -arch ppc  -I../include -I/opt/local/include -DUSE_MACPORTS_LIBUNWIND -DNDEBUG -Os -stdlib=libstdc++ -I/usr/include/c++/4.0.0/powerpc-apple-darwin9 -c -o libunwind.o libunwind.cpp

manually seems to be successful. That is, adding "-I/usr/include/c++/4.0.0/powerpc-apple-darwin9" seems to help.

The build nevertheless fails later on:

/opt/local/bin/clang++-mp-3.4 -o libunwind.1.dylib -arch ppc  -L/opt/local/lib -Wl,-headerpad_max_install_names -lmacho -stdlib=libstdc++ \
	    -dynamiclib -install_name /opt/local/lib/libunwind.1.dylib \
	    -compatibility_version 1.0.0 -current_version 3.7.0 \
	    ./UnwindLevel1.o ./UnwindLevel1-gcc-ext.o ./Unwind-sjlj.o ./Unwind_AppleExtras.o ./libunwind.o ./Unwind-EHABI.o ./UnwindRegistersRestore.o ./UnwindRegistersSave.o
ld warning: codegen with reference kind 17 in libunwind::checkKeyMgrRegisteredFDEs(unsigned long, void*&)prevents image from loading in dyld shared cache
ld warning: codegen with reference kind 14 in libunwind::checkKeyMgrRegisteredFDEs(unsigned long, void*&)prevents image from loading in dyld shared cache
ld warning: codegen with reference kind 17 in _unw_init_local prevents image from loading in dyld shared cache
ld warning: codegen with reference kind 14 in _unw_init_local prevents image from loading in dyld shared cache
ld warning: codegen with reference kind 17 in __unw_add_dynamic_fde prevents image from loading in dyld shared cache
ld warning: codegen with reference kind 14 in __unw_add_dynamic_fde prevents image from loading in dyld shared cache
ld warning: codegen with reference kind 17 in libunwind::DwarfFDECache<libunwind::LocalAddressSpace>::iterateCacheEntries(void (*)(unsigned long long, unsigned long long, unsigned long long, unsigned long long))prevents image from loading in dyld shared cache
ld warning: codegen with reference kind 14 in libunwind::DwarfFDECache<libunwind::LocalAddressSpace>::iterateCacheEntries(void (*)(unsigned long long, unsigned long long, unsigned long long, unsigned long long))prevents image from loading in dyld shared cache
ld warning: codegen with reference kind 17 in libunwind::DwarfFDECache<libunwind::LocalAddressSpace>::iterateCacheEntries(void (*)(unsigned long long, unsigned long long, unsigned long long, unsigned long long))prevents image from loading in dyld shared cache
ld warning: codegen with reference kind 17 in libunwind::DwarfFDECache<libunwind::LocalAddressSpace>::iterateCacheEntries(void (*)(unsigned long long, unsigned long long, unsigned long long, unsigned long long))prevents image from loading in dyld shared cache
ld warning: codegen with reference kind 14 in libunwind::DwarfFDECache<libunwind::LocalAddressSpace>::iterateCacheEntries(void (*)(unsigned long long, unsigned long long, unsigned long long, unsigned long long))prevents image from loading in dyld shared cache
ld warning: codegen with reference kind 14 in libunwind::DwarfFDECache<libunwind::LocalAddressSpace>::iterateCacheEntries(void (*)(unsigned long long, unsigned long long, unsigned long long, unsigned long long))prevents image from loading in dyld shared cache
ld warning: codegen with reference kind 14 in libunwind::DwarfFDECache<libunwind::LocalAddressSpace>::iterateCacheEntries(void (*)(unsigned long long, unsigned long long, unsigned long long, unsigned long long))prevents image from loading in dyld shared cache
ld warning: codegen with reference kind 17 in libunwind::DwarfFDECache<libunwind::LocalAddressSpace>::add(unsigned int, unsigned int, unsigned int, unsigned int)prevents image from loading in dyld shared cache
ld warning: codegen with reference kind 14 in libunwind::DwarfFDECache<libunwind::LocalAddressSpace>::add(unsigned int, unsigned int, unsigned int, unsigned int)prevents image from loading in dyld shared cache
ld warning: codegen with reference kind 17 in libunwind::DwarfFDECache<libunwind::LocalAddressSpace>::add(unsigned int, unsigned int, unsigned int, unsigned int)prevents image from loading in dyld shared cache
ld warning: codegen with reference kind 17 in libunwind::DwarfFDECache<libunwind::LocalAddressSpace>::add(unsigned int, unsigned int, unsigned int, unsigned int)prevents image from loading in dyld shared cache
ld warning: codegen with reference kind 14 in libunwind::DwarfFDECache<libunwind::LocalAddressSpace>::add(unsigned int, unsigned int, unsigned int, unsigned int)prevents image from loading in dyld shared cache
ld warning: codegen with reference kind 14 in libunwind::DwarfFDECache<libunwind::LocalAddressSpace>::add(unsigned int, unsigned int, unsigned int, unsigned int)prevents image from loading in dyld shared cache
ld warning: codegen with reference kind 17 in libunwind::DwarfFDECache<libunwind::LocalAddressSpace>::add(unsigned int, unsigned int, unsigned int, unsigned int)prevents image from loading in dyld shared cache
ld warning: codegen with reference kind 14 in libunwind::DwarfFDECache<libunwind::LocalAddressSpace>::add(unsigned int, unsigned int, unsigned int, unsigned int)prevents image from loading in dyld shared cache
ld warning: codegen with reference kind 17 in libunwind::DwarfFDECache<libunwind::LocalAddressSpace>::add(unsigned int, unsigned int, unsigned int, unsigned int)prevents image from loading in dyld shared cache
ld warning: codegen with reference kind 14 in libunwind::DwarfFDECache<libunwind::LocalAddressSpace>::add(unsigned int, unsigned int, unsigned int, unsigned int)prevents image from loading in dyld shared cache
ld warning: codegen with reference kind 17 in libunwind::DwarfFDECache<libunwind::LocalAddressSpace>::add(unsigned int, unsigned int, unsigned int, unsigned int)prevents image from loading in dyld shared cache
ld warning: codegen with reference kind 17 in libunwind::DwarfFDECache<libunwind::LocalAddressSpace>::add(unsigned int, unsigned int, unsigned int, unsigned int)prevents image from loading in dyld shared cache
ld warning: codegen with reference kind 14 in libunwind::DwarfFDECache<libunwind::LocalAddressSpace>::add(unsigned int, unsigned int, unsigned int, unsigned int)prevents image from loading in dyld shared cache
ld warning: codegen with reference kind 14 in libunwind::DwarfFDECache<libunwind::LocalAddressSpace>::add(unsigned int, unsigned int, unsigned int, unsigned int)prevents image from loading in dyld shared cache
ld warning: codegen with reference kind 14 in libunwind::DwarfFDECache<libunwind::LocalAddressSpace>::add(unsigned int, unsigned int, unsigned int, unsigned int)prevents image from loading in dyld shared cache
ld warning: codegen with reference kind 17 in libunwind::DwarfFDECache<libunwind::LocalAddressSpace>::add(unsigned int, unsigned int, unsigned int, unsigned int)prevents image from loading in dyld shared cache
ld warning: codegen with reference kind 14 in libunwind::DwarfFDECache<libunwind::LocalAddressSpace>::add(unsigned int, unsigned int, unsigned int, unsigned int)prevents image from loading in dyld shared cache
ld warning: codegen with reference kind 14 in libunwind::DwarfFDECache<libunwind::LocalAddressSpace>::add(unsigned int, unsigned int, unsigned int, unsigned int)prevents image from loading in dyld shared cache
ld warning: codegen with reference kind 14 in libunwind::DwarfFDECache<libunwind::LocalAddressSpace>::add(unsigned int, unsigned int, unsigned int, unsigned int)prevents image from loading in dyld shared cache
ld warning: codegen with reference kind 17 in libunwind::DwarfFDECache<libunwind::LocalAddressSpace>::add(unsigned int, unsigned int, unsigned int, unsigned int)prevents image from loading in dyld shared cache
ld warning: codegen with reference kind 14 in libunwind::DwarfFDECache<libunwind::LocalAddressSpace>::add(unsigned int, unsigned int, unsigned int, unsigned int)prevents image from loading in dyld shared cache
ld warning: codegen with reference kind 17 in libunwind::DwarfFDECache<libunwind::LocalAddressSpace>::removeAllIn(unsigned int)prevents image from loading in dyld shared cache
ld warning: codegen with reference kind 14 in libunwind::DwarfFDECache<libunwind::LocalAddressSpace>::removeAllIn(unsigned int)prevents image from loading in dyld shared cache
ld warning: codegen with reference kind 17 in libunwind::DwarfFDECache<libunwind::LocalAddressSpace>::removeAllIn(unsigned int)prevents image from loading in dyld shared cache
ld warning: codegen with reference kind 17 in libunwind::DwarfFDECache<libunwind::LocalAddressSpace>::removeAllIn(unsigned int)prevents image from loading in dyld shared cache
ld warning: codegen with reference kind 14 in libunwind::DwarfFDECache<libunwind::LocalAddressSpace>::removeAllIn(unsigned int)prevents image from loading in dyld shared cache
ld warning: codegen with reference kind 14 in libunwind::DwarfFDECache<libunwind::LocalAddressSpace>::removeAllIn(unsigned int)prevents image from loading in dyld shared cache
ld warning: codegen with reference kind 14 in libunwind::DwarfFDECache<libunwind::LocalAddressSpace>::removeAllIn(unsigned int)prevents image from loading in dyld shared cache
ld warning: codegen with reference kind 17 in libunwind::DwarfFDECache<libunwind::LocalAddressSpace>::findFDE(unsigned int, unsigned int)prevents image from loading in dyld shared cache
ld warning: codegen with reference kind 14 in libunwind::DwarfFDECache<libunwind::LocalAddressSpace>::findFDE(unsigned int, unsigned int)prevents image from loading in dyld shared cache
ld warning: codegen with reference kind 17 in libunwind::DwarfFDECache<libunwind::LocalAddressSpace>::findFDE(unsigned int, unsigned int)prevents image from loading in dyld shared cache
ld warning: codegen with reference kind 17 in libunwind::DwarfFDECache<libunwind::LocalAddressSpace>::findFDE(unsigned int, unsigned int)prevents image from loading in dyld shared cache
ld warning: codegen with reference kind 14 in libunwind::DwarfFDECache<libunwind::LocalAddressSpace>::findFDE(unsigned int, unsigned int)prevents image from loading in dyld shared cache
ld warning: codegen with reference kind 14 in libunwind::DwarfFDECache<libunwind::LocalAddressSpace>::findFDE(unsigned int, unsigned int)prevents image from loading in dyld shared cache
ld: absolute addressing (perhaps -mdynamic-no-pic) used in _unwind_phase2 from ./UnwindLevel1.o not allowed in slidable image. Use '-read_only_relocs suppress' to enable text relocs
collect2: ld returned 1 exit status
clang: error: linker (via gcc) command failed with exit code 1 (use -v to see invocation)
make: *** [libunwind.1.dylib] Error 1
make: Leaving directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_devel_libunwind/libunwind/work/libunwind-3.7.0.src/src'
Command failed:  cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_devel_libunwind/libunwind/work/libunwind-3.7.0.src/src" && /usr/bin/make -w all PREFIX="/opt/local" CC="/opt/local/bin/clang-mp-3.4" CXX="/opt/local/bin/clang++-mp-3.4" CPPFLAGS="-I/opt/local/include -DUSE_MACPORTS_LIBUNWIND -DNDEBUG" CFLAGS="-Os -std=gnu99" CXXFLAGS="-Os -stdlib=libstdc++" ASFLAGS="" LDFLAGS="-L/opt/local/lib -Wl,-headerpad_max_install_names -lmacho -stdlib=libstdc++" RC_ARCHS="ppc" LIBUNWIND_CURRENT_VERSION=3.7.0 AR=/opt/local/bin/ar RANLIB=/opt/local/bin/ranlib 
Exit code: 2

(No problem in case this is not / will not be supported.)

Change History (14)

comment:1 Changed 9 years ago by michaelld (Michael Dickens)

Cc: michaelld@… added

Cc Me!

comment:2 Changed 8 years ago by dbevans (David B. Evans)

Keywords: leopard added

See discussion in #52468.

comment:3 Changed 8 years ago by ken-cunningham-webuse

adding these two bits to an area of the portfile that will be included when building on 10.5 PPC fixes the build

        configure.cppflags-append -I/usr/include/c++/4.0.0/powerpc-apple-darwin9
        configure.cppflags-append -fPIE -pie

evidence

LeopardG5:/ macportsdev$ port -v installed libun*
The following ports are currently installed:
  libunwind @3.9.0_0 (active) platform='darwin 9' archs='ppc'
  libunwind-headers @3.9.0_0 (active) platform='darwin 9' archs='noarch'

now to see if I can test it to see if it actually works correctly -- K

comment:4 Changed 8 years ago by ken-cunningham-webuse

Oh - should say I also deleted the universal requirement on PPC as trying to build it with i386 generated this error, which disappeared when building only for PPC, possibly because I don't have llvm-3.4 built universal. I also have not yet moved the 10.6 libgcc library Jeremy recommended into 10.5 yet.

make: Entering directory '/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_devel_libunwind/libunwind/work/libunwind-3.9.0.src/src'
/opt/local/bin/clang-mp-3.4 -arch i386 -arch ppc  -I../include -I/opt/local/include -DUSE_MACPORTS_LIBUNWIND -DNDEBUG -Os -std=gnu99 -c -o UnwindLevel1.o UnwindLevel1.c
/opt/local/bin/clang-mp-3.4 -arch i386 -arch ppc  -I../include -I/opt/local/include -DUSE_MACPORTS_LIBUNWIND -DNDEBUG -Os -std=gnu99 -c -o UnwindLevel1-gcc-ext.o UnwindLevel1-gcc-ext.c
UNREACHABLE executed!
UNREACHABLE executed!
0  libLLVM-3.4.dylib 0x01dc4b24 llvm::sys::PrintStackTrace(__sFILE*) + 56
0  libLLVM-3.4.dylib 0x01dc4b24 llvm::sys::PrintStackTrace(__sFILE*) + 56
1  libLLVM-3.4.dylib 0x01dc514c llvm::sys::SetInterruptFunction(void (*)()) + 396
2  libSystem.B.dylib1  0x9008389c libLLVM-3.4.dylib  0x01dc514c_sigtramp + 68 llvm::sys::SetInterruptFunction(void (*)()) + 396
2  libSystem.B.dylib 0x9008389c _sigtramp + 68
Stack dump:
0.	Program arguments: /opt/local/libexec/llvm-3.4/bin/clang -arch i386 -arch ppc -I../include -I/opt/local/include -DUSE_MACPORTS_LIBUNWIND -DNDEBUG -Os -std=gnu99 -c -o UnwindLevel1-gcc-ext.o UnwindLevel1-gcc-ext.c 
1.	Compilation construction
2.	Building compilation jobs
3.	Building compilation jobs

Stack dump:
0.	Program arguments: /opt/local/libexec/llvm-3.4/bin/clang -arch i386 -arch ppc -I../include -I/opt/local/include -DUSE_MACPORTS_LIBUNWIND -DNDEBUG -Os -std=gnu99 -c -o UnwindLevel1.o UnwindLevel1.c 
1.	Compilation construction
2.	Building compilation jobs
3.	Building compilation jobs
Makefile:76: recipe for target 'UnwindLevel1-gcc-ext.o' failed
make: *** [UnwindLevel1-gcc-ext.o] Trace/BPT trap
make: *** Waiting for unfinished jobs....
Makefile:76: recipe for target 'UnwindLevel1.o' failed
make: *** [UnwindLevel1.o] Trace/BPT trap
Last edited 8 years ago by ken-cunningham-webuse (previous) (diff)

comment:5 Changed 8 years ago by ken-cunningham-webuse

a bit more - for anyone who tries to build libunwind

it doesn't want to build universal (i386 + ppc simultaneously) on either intel or on ppc. It delivers errors such as above when it tries to build universal. It will build for i386 alone on 10.5 Intel - if you disable the universal build. No other portfile changes needed.

it will build for ppc with the configure lines mentioned above, even on an intel machine. also -fPIE -pie can be replaced with -fPIC and the build for ppc works as well.

comment:6 Changed 8 years ago by larryv (Lawrence Velázquez)

Cc: larryv added

comment:7 Changed 8 years ago by mascondante

Per https://trac.macports.org/wiki/LibcxxOnOlderSystems#Leopardppc I stall at what is described in this ticket. My specific log (should it help) can be found here: https://ghostbin.com/paste/gpxuz My configuration: https://ghostbin.com/paste/nd557

Hoping to get up to C++ 11. The older systems file (unrelated I realize) seems to show it's doable. Hoping some love for the last of the PPC generation continues to be shown as you folks have been so fabulously spearheading so far.

Thank you.

Last edited 8 years ago by mascondante (previous) (diff)

comment:8 Changed 8 years ago by jeremyhu (Jeremy Huddleston Sequoia)

Resolution: fixed
Status: newclosed

The reported problem with incorrect include paths on Leopard was fixed in dca2c7ae4a4e4ad1164b389ae82ae9f8c3dc6e90, and I provided that fix upstream in https://llvm.org/bugs/show_bug.cgi?id=30858

I've got libunwind built on Leopard, so I believe this is resolved.

@mascondante, Leopard/ppc support is *very* experimental, and no support is offered for that configuration.

Please open another ticket to track your issue.

What architecture is /opt/local/bin/clang-mp-3.4? I suspect there might be a bug in the compiler as I remember seeing something like that in the past. Are you able to execute it x86_64 or just i386? Can you try using macports-clang-3.3 to build libunwind?

Last edited 8 years ago by jeremyhu (Jeremy Huddleston Sequoia) (previous) (diff)

comment:9 Changed 8 years ago by jeremyhu (Jeremy Huddleston Sequoia)

Also, why are you trying to build libunwind for ppc with 3.4? You should really be using a much newer toolchain for the ppc support. Use the older intel toolchain to bootstrap the newer toolchains, and use that to build your ppc executables.

comment:10 in reply to:  7 Changed 8 years ago by kencu (Ken)

Replying to mascondante:

Per https://trac.macports.org/wiki/LibcxxOnOlderSystems#Leopardppc I stall at what is described in this ticket. My specific log (should it help) can be found here: https://ghostbin.com/paste/gpxuz

Comment 4 above indicates the exact same error you had. If you look at comment 5, the solution is to disable universal building of libunwind (it will build as PPC or as intel code, but for some reason not as both at the same time). At least that is what it did for me, using clang-3.4. Best, K

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

comment:11 Changed 8 years ago by jeremyhu (Jeremy Huddleston Sequoia)

Thanks, Ken. Is this something we should get added to the LibcxxOnOlderSystems guide? Can you send me a suggested edit to make things clearer?

comment:12 Changed 8 years ago by kencu (Ken)

It's still fairly mind-bending, isn't it? You seemed to be able to build the libraries universally with both ppc and intel code using clang-3.7. I'm just trying to see if I can recreate that process now on an Intel Leopard machine I have here. With clang-3.4 on Leopard PPC or Leopard Intel I had the 'no universal' issue above...

I wonder if it might be possible to build clang-3.7 with a PPC slice, for Leopard, on Intel. If so, given how hard this is to build and how long it takes to get set up, perhaps I might make that and the four libraries available somewhere so people could bootstrap that far.

That would still leave us with the exception bugs, but it would be closer to something useful...maybe...

comment:13 Changed 8 years ago by kencu (Ken)

Jeremy, all works as you've outlined, through to the end of that LibcxxOnOlderSystems document. Only thing I would add that might not be clear is that the Leopard instructions for Leopard(ppc) only work on Leopard Intel at present.

clang-3.7 will install on Leopard intel and generate ppc code that runs, but on Leopard PPC clang-3.4 is as far as you go and doesn't work on PPC as it does on Intel to complete the compiles of the libraries (or clang-3.7).

Leopard PPC with clang-3.4 did build libunwind for me, but not universally -- only for PPC. It did build libmacho universally. It would not build libcxxabi just now on PPC, however.

  libunwind @3.9.0_0 platform='darwin 9' archs='ppc'
  libunwind @3.9.0_3 (active) platform='darwin 9' archs='ppc'
  libunwind-headers @3.9.0_0 (active) platform='darwin 9' archs='noarch'
  libmacho @886_0+universal (active) platform='darwin 9' archs='i386 ppc'
  libmacho-headers @886_0 (active) platform='darwin 9' archs='noarch'

attempt to build libcxxabi:

sudo port -v install libcxxabi
--->  Computing dependencies for libcxxabi.
--->  Building libcxxabi
+ for FILE in '../src/*.cpp'
+ /opt/local/bin/clang++-mp-3.4 -I/opt/local/include -c -g -O3 -arch ppc -std=c++11 -stdlib=libc++ -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 -I../include ../src/abort_message.cpp
/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_lang_libcxxabi/libcxxabi/work/.tmp/abort_message-a08a1d.s:22:Missing string
/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_lang_libcxxabi/libcxxabi/work/.tmp/abort_message-a08a1d.s:22:Rest of line ignored. 1st junk character valued 49 (1).
/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_lang_libcxxabi/libcxxabi/work/.tmp/abort_message-a08a1d.s:30:Unknown pseudo-op: .loc
/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_lang_libcxxabi/libcxxabi/work/.tmp/abort_message-a08a1d.s:30:Rest of line ignored. 1st junk character valued 49 (1).
/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_lang_libcxxabi/libcxxabi/work/.tmp/abort_message-a08a1d.s:43:Unknown pseudo-op: .loc
/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_lang_libcxxabi/libcxxabi/work/.tmp/abort_message-a08a1d.s:43:Rest of line ignored. 1st junk character valued 49 (1).
/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_lang_libcxxabi/libcxxabi/work/.tmp/abort_message-a08a1d.s:60:Unknown pseudo-op: .loc
/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_lang_libcxxabi/libcxxabi/work/.tmp/abort_message-a08a1d.s:60:Rest of line ignored. 1st junk character valued 49 (1).
/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_lang_libcxxabi/libcxxabi/work/.tmp/abort_message-a08a1d.s:65:Unknown pseudo-op: .loc
/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_lang_libcxxabi/libcxxabi/work/.tmp/abort_message-a08a1d.s:65:Rest of line ignored. 1st junk character valued 49 (1).
/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_lang_libcxxabi/libcxxabi/work/.tmp/abort_message-a08a1d.s:67:Unknown pseudo-op: .loc
/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_lang_libcxxabi/libcxxabi/work/.tmp/abort_message-a08a1d.s:67:Rest of line ignored. 1st junk character valued 49 (1).
/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_lang_libcxxabi/libcxxabi/work/.tmp/abort_message-a08a1d.s:69:Unknown pseudo-op: .loc
/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_lang_libcxxabi/libcxxabi/work/.tmp/abort_message-a08a1d.s:69:Rest of line ignored. 1st junk character valued 49 (1).
/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_lang_libcxxabi/libcxxabi/work/.tmp/abort_message-a08a1d.s:75:Unknown pseudo-op: .loc
/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_lang_libcxxabi/libcxxabi/work/.tmp/abort_message-a08a1d.s:75:Rest of line ignored. 1st junk character valued 49 (1).
clang: error: assembler (via gcc) command failed with exit code 1 (use -v to see invocation)
Command failed:  cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_lang_libcxxabi/libcxxabi/work/libcxxabi-3.9.0.src/lib" && ./buildit all 
Exit code: 1
Error: org.macports.build for port libcxxabi returned: command execution failed

Next immediate step for bootstrapping a clang-libcxx plan for leopard PPC would appear to be to

  1. get the runtimes (libcxx, libcxxabi, libmacho, libunwind) onto Leopard PPC by building them with clang-3.7 on Leopard Intel (done) and getting them over as binaries. That's reasonably easy.
  2. build a few simple cxx11 ports on Leopard Intel with PPC slices, and get them onto the Leopard PPC machine as binary installs and see what happens.

I tried building a simple cxx11 port, aria2, on Leopard Intel with a ppc slice and it died early with various errors - libtool being the first -- so this might take some thinking.

sudo port -v install aria2 +universal universal_archs="x86_64 i386 ppc" configure.compiler=macports-clang-3.7
Password:
Error: Cannot install aria2 for the arch(s) 'i386 ppc x86_64' because
Error: its dependency libtool is only installed for the arch 'i386'
Error: and the configured universal_archs 'i386 ppc' are not sufficient.
Error: Unable to execute port: architecture mismatch
sudo port -v -n upgrade --force libtool +universal universal_archs="x86_64 i386 ppc" configure.compiler=macports-clang-3.7

fails with

libtool: compile:  /opt/local/bin/clang-mp-3.7 -DHAVE_CONFIG_H -I. -DLTDLOPEN=libltdl "-DLT_CONFIG_H=<config.h>" -DLTDL -I. -I. -Ilibltdl -I./libltdl -Ilibltdl/libltdl -I./libltdl/libltdl -I/opt/local/include -pipe -Os -arch x86_64 -arch i386 -arch ppc -c libltdl/ltdl.c -o libltdl/libltdl_libltdl_la-ltdl.o >/dev/null 2>&1
/bin/sh ./libtool  --tag=CC   --mode=link /opt/local/bin/clang-mp-3.7  -pipe -Os -arch x86_64 -arch i386 -arch ppc -no-undefined -version-info 10:1:3 -dlpreopen libltdl/dlopen.la  -L/opt/local/lib -Wl,-headerpad_max_install_names -arch x86_64 -arch i386 -arch ppc -o libltdl/libltdl.la -rpath /opt/local/lib libltdl/loaders/libltdl_libltdl_la-preopen.lo libltdl/libltdl_libltdl_la-lt__alloc.lo libltdl/libltdl_libltdl_la-lt_dlloader.lo libltdl/libltdl_libltdl_la-lt_error.lo libltdl/libltdl_libltdl_la-ltdl.lo libltdl/libltdl_libltdl_la-slist.lo libltdl/lt__argz.lo 
libtool:   error: not configured to extract global symbols from dlpreopened files
libtool: link: (cd /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_devel_libtool/libtool/work/libtool-2.4.6/libltdl/.libs/libltdl.lax/dlopen.a/unfat-13206/dlopen.a-x86_64 && ar x "dlopen.a")
libtool: link: (cd /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_devel_libtool/libtool/work/libtool-2.4.6/libltdl/.libs/libltdl.lax/dlopen.a/unfat-13206/dlopen.a-i386 && ar x "dlopen.a")
libtool: link: (cd /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_devel_libtool/libtool/work/libtool-2.4.6/libltdl/.libs/libltdl.lax/dlopen.a/unfat-13206/dlopen.a-ppc && ar x "dlopen.a")
libtool: link: /opt/local/bin/clang-mp-3.7 -dynamiclib  -o libltdl/.libs/libltdl.7.dylib  libltdl/loaders/.libs/libltdl_libltdl_la-preopen.o libltdl/.libs/libltdl_libltdl_la-lt__alloc.o libltdl/.libs/libltdl_libltdl_la-lt_dlloader.o libltdl/.libs/libltdl_libltdl_la-lt_error.o libltdl/.libs/libltdl_libltdl_la-ltdl.o libltdl/.libs/libltdl_libltdl_la-slist.o libltdl/.libs/lt__argz.o   libltdl/.libs/libltdl.lax/dlopen.a/dlopen.o   -L/opt/local/lib  -Os -arch x86_64 -arch i386 -arch ppc -Wl,-headerpad_max_install_names -arch x86_64 -arch i386 -arch ppc   -install_name  /opt/local/lib/libltdl.7.dylib -compatibility_version 11 -current_version 11.1 -Wl,-single_module
Undefined symbols for architecture x86_64:
  "_lt_libltdl_LTX_preloaded_symbols", referenced from:
      _lt_dlinit in libltdl_libltdl_la-ltdl.o
ld: symbol(s) not found for architecture x86_64

Perhaps I'll invent a simple 'hello world' port and see if I can get the process at least started with this.

But this sounds like a new ticket, rather than adding it here where it doesn't belong...

comment:14 Changed 8 years ago by kencu (Ken)

So - finally - yes, that all works. I copied over libunwind, libmacho, libcxxabi, and libcxx from the Leopard Intel machine to the Leopard PPC machine, and they all appear to work well there. (you scp the fat binaries from the Leopard Intel machine into /opt/local/var/macports/incoming/verified/ on the Leopard PPC machine, and then install them with sudo port install -v -b.

I can build a c++ hello world app on Leopard PPC against libc++ with clang-3.4, and it works.

A c++ hello world app built against libc++ on Leopard Intel with clang-3.7 also works when copied over to Leopard PPC.

Note: See TracTickets for help on using tickets.