libc++/libc++abi - compilation on armv7

Hi,

I've been trying to use libcxx and libcxxabi on an armv7 sbc running
arch linux. Although arch is distributing it is unusable since linking
with it fails with undefined references to

'undefined reference to `_Unwind_VRS_Interpret'

This is fine since it relies on the 'buildit' script which hasn't been
updated in a while, and it doesn't attempt to compile the sources in
the Unwind dir.

A readelf -s on the resulting .so confirms the symbol is undefined.

However, when using latest from the git repos I also get

"
/home/goncalo/swdev/llvm/projects/libcxxabi/src/cxa_personality.cpp:(.text._ZN10__cxxabiv113set_registersEP21_Unwind_Control_BlockP15_Unwind_ContextRKNS_12_GLOBAL__N_112scan_resultsE+0x50):
undefined reference to `_Unwind_SetIP'"

since it appears to rely on
LIBCXXABI_USE_LLVM_UNWINDER, i.e,

cmake -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++
-DLIBCXXABI_USE_LLVM_UNWINDER=1 ..

but even with the above,

: undefined reference to `__aeabi_uidiv'

so it relies on linking against libgcc_s but that's missing from the
CMakeLists.txt. When adding it then I can build it :).

Although I haven't run the test suite a basic program links and
executes against it. A readelf -s against the .so confirms the symbols
exists.

The question then is the above expected, or simply arm sbc were never
considered as a possible platform and as such no one maintains it in
terms of getting it to compile and regression test?

Kind regards and thanks for reading!

Goncalo

: undefined reference to `__aeabi_uidiv'

so it relies on linking against libgcc_s but that's missing from the
CMakeLists.txt. When adding it then I can build it :).

Hi Goncalo,

The above dependency is with any compiler library, including libgcc
and compiler-rt. Just like the other dependencies are with any
unwinder libraries, being that libgcc or libunwind.

This issue with cross-dependencies between libc++, libc++abi and
compiler-rt are well known and we're trying to fix it by splitting the
Unwind part in its own repository called libunwind. In the future,
both libc++abi and compiler-rt will depend on libunwind, rather than
on each other, which will simplify the build process.

Also, we're planning on teaching Clang about these dependencies and
help the user chose the appropriate libraries in a way that is not
confusing or needing too many flags. This is not done yet, though.

The question then is the above expected, or simply arm sbc were never
considered as a possible platform and as such no one maintains it in
terms of getting it to compile and regression test?

ARM EHABI adds a few more dependencies than we'd like, so yes, this is
a complication to the general case.

The first few steps are in progress:

http://thread.gmane.org/gmane.comp.compilers.llvm.devel/81577

cheers,
--renato

Due to the f**ked up EHABI mess, I don't think it will be easy to solve
the interdependencies. With normal Itanium ABI, there is a clear
dependency chain:

libc++ -> libc++abi -> unwind -> compiler-rt

This ignores for a moment the C personality routine.

The problem is that with EHABI, *any* object build to allow unwinding of
the stack adds dependencies on the EHABI unwind helpers. As such, a
dependency between unwind and compiler-rt exists naturally.

Joerg