Can libc++ build for arm cross compiler?

The following web say the libc++abi is ready on arm.
http://libcxxabi.llvm.org/spec.html

I try to build libc++ and libc++abi for host x86_64(linux) and target arm(linux) but fail.
I have read the web http://llvm.org/docs/HowToCrossCompileLLVM.html

Does anyone know whether it’s available for my need? If you know how to build, what is the build options you use?

Best regards

cschen

I use libc++ and libc++abi (as well as compiler-rt) for the ELLCC cross compilation tool chain project (). I use makefiles to build the libc++ stuff, which are pretty dependent on being used in an ELLCC environment. You can get pre built binaries from . The tarballs contain pre built libraries for ARM (as well as Mips, x86, PowerPC, and semi-functional Microblaze). -Rich

Hi cschen,

Here are the test scripts which I written when I was developing ARM exception handling support:
https://github.com/loganchien/libcxx-scripts

The script should work on Debian wheezy (cross-compiling from amd64 to armhf.)

In general, here are the necessary steps:

  1. Get a working arm-linux-gnueabihf gcc/g++ toolchain (for the headers and libraries)

  2. Setup the include search path (e.g. /usr/arm-linux-gnueabihf/include)

  3. Compile with correct compiler/linker flags (e.g. -target arm-linux-gnueabihf and some cmake tricks)

Feel free to let me know if you have encountered any problem.

Sincerely,
Logan

Logan and Richard,

Thank your quick and kindly help. I am busy with something else today and will try these script tomorrow.

Best regards

cschen

Logan Chien tzuhsiang.chien@gmail.com 於 2014/10/1 (週三) 1:58 AM 寫道﹕

Hi cschen,

Here are the test scripts which I written when I was developing ARM exception handling support:
https://github.com/loganchien/libcxx-scripts

The script should work on Debian wheezy (cross-compiling from amd64 to armhf.)

In general, here are the necessary steps:

  1. Get a working arm-linux-gnueabihf gcc/g++ toolchain (for the headers and libraries)

  2. Setup the include search path (e.g. /usr/arm-linux-gnueabihf/include)

  3. Compile with correct compiler/linker flags (e.g. -target arm-linux-gnueabihf and some cmake tricks)

Feel free to let me know if you have encountered any problem.

Sincerely,
Logan

Hi,

I install Virtual Box on Linux and install debain on VB from web,
https://www.debian.org/releases/wheezy/
Attached file is the source.list I follow your README.md.

Paste the error as follows,
cschen@debian:~/test/libcxx-scripts$ sudo apt-get install binutils clang-3.5 cmake gcc make
[sudo] password for cschen:
Reading package lists… Done
Building dependency tree
Reading state information… Done
E: Unable to locate package clang-3.5
E: Couldn’t find any package by regex ‘clang-3.5’

My debian version as follows,
cschen@debian:~/test/libcxx-scripts$ cat /etc/issue
Debian GNU/Linux 7 \n \l

cschen@debian:~/test/libcxx-scripts$ cat /proc/version
Linux version 3.2.0-4-amd64 (debian-kernel@lists.debian.org) (gcc version 4.6.3 (Debian 4.6.3-14) ) #1 SMP Debian 3.2.60-1+deb7u3

I use Virtual Box to try it. Will it a problem with this?

cschen

gamma_chen gamma_chen@yahoo.com.tw 於 2014/10/1 (週三) 5:36 AM 寫道﹕

Logan and Richard,

Thank your quick and kindly help. I am busy with something else today and will try these script tomorrow.

Best regards

cschen

Logan Chien tzuhsiang.chien@gmail.com 於 2014/10/1 (週三) 1:58 AM 寫道﹕

Hi cschen,

Here are the test scripts which I written when I was developing ARM exception handling support:
https://github.com/loganchien/libcxx-scripts

The script should work on Debian wheezy (cross-compiling from amd64 to armhf.)

In general, here are the necessary steps:

  1. Get a working arm-linux-gnueabihf gcc/g++ toolchain (for the headers and libraries)

  2. Setup the include search path (e.g. /usr/arm-linux-gnueabihf/include)

  3. Compile with correct compiler/linker flags (e.g. -target arm-linux-gnueabihf and some cmake tricks)

Feel free to let me know if you have encountered any problem.

Sincerely,
Logan

sources.list (850 Bytes)

Hi cschen,

Did you run the following command before the apt-get install?

$ sudo apt-get update

Thanks.

Logan

I try to build libc++ and libc++abi for host x86_64(linux) and target
arm(linux) but fail.

Failing in what way? If this isn't working out of the box, we've done
something wrong.

jroelofs might know more...

I try to build libc++ and libc++abi for host x86_64(linux) and target
arm(linux) but fail.

Failing in what way? If this isn't working out of the box, we've done
something wrong.

Yeah, it would help to know more specifics about where you're getting stuck.

jroelofs might know more...

For my baremetal arm toolchain, I use buildit&testit for libc++abi, and
buildit&lit for libc++... Which is a bit different than what you'll get out of
using cmake for it. Also, I've customized both buildits, the testit, and
libc++'s lit config file to do this, and those changes are very specific to my
environment (I don't recommend using buildit/testit to build either library
unless you're working on porting them to a new platform. Even then, just do it
the "right way" with cmake, and don't be stupid like me ;] ).

Cheers,

Jon

After do “sudo apt-get update”, the following are pass.

Install the dependencies:

$ sudo apt-get install binutils clang-3.5 cmake gcc make

To cross-compile for ARM, install following dependencies as well:

$ sudo apt-get install binutils-multiarch
gcc-4.7-arm-linux-gnueabihf
g+±4.7-arm-linux-gnueabihf

But now fail as follows,

cschen@debian:~/test/libcxx-scripts$ export CROSS_COMPILING=arm
cschen@debian:~/test/libcxx-scripts$ CROSS_COMPILING=arm ./scripts/compile-all.sh
compile: /home/cschen/test/libcxx-scripts/libcxxabi/src/abort_message.cpp
compile: /home/cschen/test/libcxx-scripts/libcxxabi/src/cxa_aux_runtime.cpp
compile: /home/cschen/test/libcxx-scripts/libcxxabi/src/cxa_default_handlers.cpp
compile: /home/cschen/test/libcxx-scripts/libcxxabi/src/cxa_demangle.cpp
compile: /home/cschen/test/libcxx-scripts/libcxxabi/src/cxa_exception.cpp
compile: /home/cschen/test/libcxx-scripts/libcxxabi/src/cxa_exception_storage.cpp
compile: /home/cschen/test/libcxx-scripts/libcxxabi/src/cxa_guard.cpp
compile: /home/cschen/test/libcxx-scripts/libcxxabi/src/cxa_handlers.cpp
compile: /home/cschen/test/libcxx-scripts/libcxxabi/src/cxa_new_delete.cpp
compile: /home/cschen/test/libcxx-scripts/libcxxabi/src/cxa_personality.cpp
compile: /home/cschen/test/libcxx-scripts/libcxxabi/src/cxa_unexpected.cpp
compile: /home/cschen/test/libcxx-scripts/libcxxabi/src/cxa_vector.cpp
compile: /home/cschen/test/libcxx-scripts/libcxxabi/src/cxa_virtual.cpp
compile: /home/cschen/test/libcxx-scripts/libcxxabi/src/exception.cpp
compile: /home/cschen/test/libcxx-scripts/libcxxabi/src/private_typeinfo.cpp
compile: /home/cschen/test/libcxx-scripts/libcxxabi/src/stdexcept.cpp
compile: /home/cschen/test/libcxx-scripts/libcxxabi/src/typeinfo.cpp
link: libc++abi.so.1.0
installing …
done.
– The CXX compiler identification is Clang 3.5.0
– The C compiler identification is Clang 3.5.0
– Check for working CXX compiler: /usr/bin/clang++
– Check for working CXX compiler: /usr/bin/clang++ – works
– Detecting CXX compiler ABI info
– Detecting CXX compiler ABI info - done
– Check for working C compiler: /usr/bin/clang
– Check for working C compiler: /usr/bin/clang – works
– Detecting C compiler ABI info
– Detecting C compiler ABI info - done
– Host triple: x86_64-pc-linux
– Target triple: arm-pc-linux
– Performing Test LIBCXX_HAS_STDCXX11_FLAG
– Performing Test LIBCXX_HAS_STDCXX11_FLAG - Success
– Performing Test LIBCXX_HAS_STDCXX1Y_FLAG
– Performing Test LIBCXX_HAS_STDCXX1Y_FLAG - Success
– Performing Test LIBCXX_HAS_FPIC_FLAG
– Performing Test LIBCXX_HAS_FPIC_FLAG - Success
– Performing Test LIBCXX_HAS_NO_OMIT_FRAME_POINTER_FLAG
– Performing Test LIBCXX_HAS_NO_OMIT_FRAME_POINTER_FLAG - Success
– Performing Test LIBCXX_HAS_NODEFAULTLIBS_FLAG
– Performing Test LIBCXX_HAS_NODEFAULTLIBS_FLAG - Success
– Performing Test LIBCXX_HAS_NOSTDINCXX_FLAG
– Performing Test LIBCXX_HAS_NOSTDINCXX_FLAG - Success
– Performing Test LIBCXX_HAS_WALL_FLAG
– Performing Test LIBCXX_HAS_WALL_FLAG - Success
– Performing Test LIBCXX_HAS_W_FLAG
– Performing Test LIBCXX_HAS_W_FLAG - Success
– Performing Test LIBCXX_HAS_WNO_UNUSED_PARAMETER_FLAG
– Performing Test LIBCXX_HAS_WNO_UNUSED_PARAMETER_FLAG - Success
– Performing Test LIBCXX_HAS_WWRITE_STRINGS_FLAG
– Performing Test LIBCXX_HAS_WWRITE_STRINGS_FLAG - Success
– Performing Test LIBCXX_HAS_WNO_LONG_LONG_FLAG
– Performing Test LIBCXX_HAS_WNO_LONG_LONG_FLAG - Success
– Performing Test LIBCXX_HAS_PEDANTIC_FLAG
– Performing Test LIBCXX_HAS_PEDANTIC_FLAG - Success
– Performing Test LIBCXX_HAS_WERROR_FLAG
– Performing Test LIBCXX_HAS_WERROR_FLAG - Success
– Performing Test LIBCXX_HAS_WNO_ERROR_FLAG
– Performing Test LIBCXX_HAS_WNO_ERROR_FLAG - Success
– Performing Test LIBCXX_HAS_FNO_EXCEPTIONS_FLAG
– Performing Test LIBCXX_HAS_FNO_EXCEPTIONS_FLAG - Success
– Performing Test LIBCXX_HAS_FNO_RTTI_FLAG
– Performing Test LIBCXX_HAS_FNO_RTTI_FLAG - Success
– Performing Test LIBCXX_HAS_WX_FLAG
– Performing Test LIBCXX_HAS_WX_FLAG - Failed
– Performing Test LIBCXX_HAS_NO_WX_FLAG
– Performing Test LIBCXX_HAS_NO_WX_FLAG - Failed
– Performing Test LIBCXX_HAS_EHSC_FLAG
– Performing Test LIBCXX_HAS_EHSC_FLAG - Failed
– Performing Test LIBCXX_HAS_NO_EHS_FLAG
– Performing Test LIBCXX_HAS_NO_EHS_FLAG - Failed
– Performing Test LIBCXX_HAS_NO_EHA_FLAG
– Performing Test LIBCXX_HAS_NO_EHA_FLAG - Failed
– Performing Test LIBCXX_HAS_NO_GR_FLAG
– Performing Test LIBCXX_HAS_NO_GR_FLAG - Failed
– Looking for pthread_create in pthread
– Looking for pthread_create in pthread - found
– Looking for printf in c
– Looking for printf in c - found
– Looking for ccos in m
– Looking for ccos in m - found
– Looking for clock_gettime in rt
– Looking for clock_gettime in rt - found
– Looking for gcc_personality_v0 in gcc_s
– Looking for gcc_personality_v0 in gcc_s - found
– Found PythonInterp: /usr/bin/python (found version “2.7.3”)
– Configuring done
– Generating done
– Build files have been written to: /home/cschen/test/libcxx-scripts/objs-arm/libcxx
Scanning dependencies of target cxx
[ 3%] [ 7%] [ 11%] [ 15%] Building CXX object lib/CMakeFiles/cxx.dir/
/src/iostream.cpp.o
Building CXX object lib/CMakeFiles/cxx.dir/
/src/future.cpp.o
Building CXX object lib/CMakeFiles/cxx.dir//src/algorithm.cpp.o
Building CXX object lib/CMakeFiles/cxx.dir/
/src/shared_mutex.cpp.o
[ 19%] [ 23%] [ 26%] [ 30%] Building CXX object lib/CMakeFiles/cxx.dir//src/optional.cpp.o
Building CXX object lib/CMakeFiles/cxx.dir/
/src/typeinfo.cpp.o
[ 34%] Building CXX object lib/CMakeFiles/cxx.dir//src/locale.cpp.o
[ 46%] [ 38%] Building CXX object lib/CMakeFiles/cxx.dir/
/src/regex.cpp.o
Building CXX object lib/CMakeFiles/cxx.dir//src/utility.cpp.o
[ 42%] Building CXX object lib/CMakeFiles/cxx.dir/
/src/valarray.cpp.o
Building CXX object lib/CMakeFiles/cxx.dir//src/hash.cpp.o
Building CXX object lib/CMakeFiles/cxx.dir/
/src/bind.cpp.o
[ 53%] [ 57%] [ 50%] Building CXX object lib/CMakeFiles/cxx.dir//src/mutex.cpp.o
Building CXX object lib/CMakeFiles/cxx.dir/
/src/thread.cpp.o
Building CXX object lib/CMakeFiles/cxx.dir//src/debug.cpp.o
[ 61%] Building CXX object lib/CMakeFiles/cxx.dir/
/src/exception.cpp.o
[ 65%] [ 69%] Building CXX object lib/CMakeFiles/cxx.dir//src/chrono.cpp.o
Building CXX object lib/CMakeFiles/cxx.dir/
/src/strstream.cpp.o
[ 73%] Building CXX object lib/CMakeFiles/cxx.dir//src/stdexcept.cpp.o
[ 76%] Building CXX object lib/CMakeFiles/cxx.dir/
/src/memory.cpp.o
[ 80%] Building CXX object lib/CMakeFiles/cxx.dir//src/string.cpp.o
[ 84%] [ 88%] Building CXX object lib/CMakeFiles/cxx.dir/
/src/random.cpp.o
Building CXX object lib/CMakeFiles/cxx.dir//src/new.cpp.o
[ 92%] Building CXX object lib/CMakeFiles/cxx.dir/
/src/ios.cpp.o
[ 96%] Building CXX object lib/CMakeFiles/cxx.dir//src/condition_variable.cpp.o
[100%] Building CXX object lib/CMakeFiles/cxx.dir/
/src/system_error.cpp.o
Linking CXX shared library libc++.so
clang: warning: argument unused during compilation: ‘-nostdinc++’
[100%] Built target cxx
[100%] Built target cxx
Install the project…
– Install configuration: “Release”
– Installing: /home/cschen/test/libcxx-scripts/out-arm/include/c++/v1/cxxabi.h
– Installing: /home/cschen/test/libcxx-scripts/out-arm/include/c++/v1/.
– Installing: /home/cschen/test/libcxx-scripts/out-arm/include/c++/v1/./vector
– Installing: /home/cschen/test/libcxx-scripts/out-arm/include/c++/v1/./ratio
– Installing: /home/cschen/test/libcxx-scripts/out-arm/include/c++/v1/./queue
– Installing: /home/cschen/test/libcxx-scripts/out-arm/include/c++/v1/./deque
– Installing: /home/cschen/test/libcxx-scripts/out-arm/include/c++/v1/./cmath
– Installing: /home/cschen/test/libcxx-scripts/out-arm/include/c++/v1/./thread
– Installing: /home/cschen/test/libcxx-scripts/out-arm/include/c++/v1/./__locale
– Installing: /home/cschen/test/libcxx-scripts/out-arm/include/c++/v1/./clocale
– Installing: /home/cschen/test/libcxx-scripts/out-arm/include/c++/v1/./cstdlib
– Installing: /home/cschen/test/libcxx-scripts/out-arm/include/c++/v1/./cfloat
– Installing: /home/cschen/test/libcxx-scripts/out-arm/include/c++/v1/./stdexcept
– Installing: /home/cschen/test/libcxx-scripts/out-arm/include/c++/v1/./__mutex_base
– Installing: /home/cschen/test/libcxx-scripts/out-arm/include/c++/v1/./iostream
– Installing: /home/cschen/test/libcxx-scripts/out-arm/include/c++/v1/./numeric
– Installing: /home/cschen/test/libcxx-scripts/out-arm/include/c++/v1/./strstream
– Installing: /home/cschen/test/libcxx-scripts/out-arm/include/c++/v1/./iosfwd
– Installing: /home/cschen/test/libcxx-scripts/out-arm/include/c++/v1/./algorithm
– Installing: /home/cschen/test/libcxx-scripts/out-arm/include/c++/v1/./array
– Installing: /home/cschen/test/libcxx-scripts/out-arm/include/c++/v1/./iomanip
– Installing: /home/cschen/test/libcxx-scripts/out-arm/include/c++/v1/./chrono
– Installing: /home/cschen/test/libcxx-scripts/out-arm/include/c++/v1/./__std_stream
– Installing: /home/cschen/test/libcxx-scripts/out-arm/include/c++/v1/./istream
– Installing: /home/cschen/test/libcxx-scripts/out-arm/include/c++/v1/./__tuple_03
– Installing: /home/cschen/test/libcxx-scripts/out-arm/include/c++/v1/./utility
– Installing: /home/cschen/test/libcxx-scripts/out-arm/include/c++/v1/./climits
– Installing: /home/cschen/test/libcxx-scripts/out-arm/include/c++/v1/./__tree
– Installing: /home/cschen/test/libcxx-scripts/out-arm/include/c++/v1/./locale
– Installing: /home/cschen/test/libcxx-scripts/out-arm/include/c++/v1/./cstdint
– Installing: /home/cschen/test/libcxx-scripts/out-arm/include/c++/v1/./scoped_allocator
– Installing: /home/cschen/test/libcxx-scripts/out-arm/include/c++/v1/./atomic
– Installing: /home/cschen/test/libcxx-scripts/out-arm/include/c++/v1/./__tuple
– Installing: /home/cschen/test/libcxx-scripts/out-arm/include/c++/v1/./cstring
– Installing: /home/cschen/test/libcxx-scripts/out-arm/include/c++/v1/./ctgmath
– Installing: /home/cschen/test/libcxx-scripts/out-arm/include/c++/v1/./csetjmp
– Installing: /home/cschen/test/libcxx-scripts/out-arm/include/c++/v1/./initializer_list
– Installing: /home/cschen/test/libcxx-scripts/out-arm/include/c++/v1/./__functional_base_03
– Installing: /home/cschen/test/libcxx-scripts/out-arm/include/c++/v1/./new
– Installing: /home/cschen/test/libcxx-scripts/out-arm/include/c++/v1/./__functional_base
– Installing: /home/cschen/test/libcxx-scripts/out-arm/include/c++/v1/./complex.h
– Installing: /home/cschen/test/libcxx-scripts/out-arm/include/c++/v1/./string
– Installing: /home/cschen/test/libcxx-scripts/out-arm/include/c++/v1/./cassert
– Installing: /home/cschen/test/libcxx-scripts/out-arm/include/c++/v1/./condition_variable
– Installing: /home/cschen/test/libcxx-scripts/out-arm/include/c++/v1/./__undef_min_max
– Installing: /home/cschen/test/libcxx-scripts/out-arm/include/c++/v1/./memory
– Installing: /home/cschen/test/libcxx-scripts/out-arm/include/c++/v1/./cctype
– Installing: /home/cschen/test/libcxx-scripts/out-arm/include/c++/v1/./ctime
– Installing: /home/cschen/test/libcxx-scripts/out-arm/include/c++/v1/./system_error
– Installing: /home/cschen/test/libcxx-scripts/out-arm/include/c++/v1/./cstdarg
– Installing: /home/cschen/test/libcxx-scripts/out-arm/include/c++/v1/./unordered_set
– Installing: /home/cschen/test/libcxx-scripts/out-arm/include/c++/v1/./ostream
– Installing: /home/cschen/test/libcxx-scripts/out-arm/include/c++/v1/./tuple
– Installing: /home/cschen/test/libcxx-scripts/out-arm/include/c++/v1/./__config
– Installing: /home/cschen/test/libcxx-scripts/out-arm/include/c++/v1/./typeindex
– Installing: /home/cschen/test/libcxx-scripts/out-arm/include/c++/v1/./regex
– Installing: /home/cschen/test/libcxx-scripts/out-arm/include/c++/v1/./ext
– Installing: /home/cschen/test/libcxx-scripts/out-arm/include/c++/v1/./ext/hash_map
– Installing: /home/cschen/test/libcxx-scripts/out-arm/include/c++/v1/./ext/__hash
– Installing: /home/cschen/test/libcxx-scripts/out-arm/include/c++/v1/./ext/hash_set
– Installing: /home/cschen/test/libcxx-scripts/out-arm/include/c++/v1/./ciso646
– Installing: /home/cschen/test/libcxx-scripts/out-arm/include/c++/v1/./list
– Installing: /home/cschen/test/libcxx-scripts/out-arm/include/c++/v1/./mutex
– Installing: /home/cschen/test/libcxx-scripts/out-arm/include/c++/v1/./cstddef
– Installing: /home/cschen/test/libcxx-scripts/out-arm/include/c++/v1/./__refstring
– Installing: /home/cschen/test/libcxx-scripts/out-arm/include/c++/v1/./unordered_map
– Installing: /home/cschen/test/libcxx-scripts/out-arm/include/c++/v1/./exception
– Installing: /home/cschen/test/libcxx-scripts/out-arm/include/c++/v1/./cinttypes
– Installing: /home/cschen/test/libcxx-scripts/out-arm/include/c++/v1/./limits
– Installing: /home/cschen/test/libcxx-scripts/out-arm/include/c++/v1/./type_traits
– Installing: /home/cschen/test/libcxx-scripts/out-arm/include/c++/v1/./forward_list
– Installing: /home/cschen/test/libcxx-scripts/out-arm/include/c++/v1/./sstream
– Installing: /home/cschen/test/libcxx-scripts/out-arm/include/c++/v1/./cwchar
– Installing: /home/cschen/test/libcxx-scripts/out-arm/include/c++/v1/./stack
– Installing: /home/cschen/test/libcxx-scripts/out-arm/include/c++/v1/./random
– Installing: /home/cschen/test/libcxx-scripts/out-arm/include/c++/v1/./ccomplex
– Installing: /home/cschen/test/libcxx-scripts/out-arm/include/c++/v1/./__debug
– Installing: /home/cschen/test/libcxx-scripts/out-arm/include/c++/v1/./tgmath.h
– Installing: /home/cschen/test/libcxx-scripts/out-arm/include/c++/v1/./streambuf
– Installing: /home/cschen/test/libcxx-scripts/out-arm/include/c++/v1/./shared_mutex
– Installing: /home/cschen/test/libcxx-scripts/out-arm/include/c++/v1/./typeinfo
– Installing: /home/cschen/test/libcxx-scripts/out-arm/include/c++/v1/./__split_buffer
– Installing: /home/cschen/test/libcxx-scripts/out-arm/include/c++/v1/./bitset
– Installing: /home/cschen/test/libcxx-scripts/out-arm/include/c++/v1/./module.modulemap
– Installing: /home/cschen/test/libcxx-scripts/out-arm/include/c++/v1/./map
– Installing: /home/cschen/test/libcxx-scripts/out-arm/include/c++/v1/./complex
– Installing: /home/cschen/test/libcxx-scripts/out-arm/include/c++/v1/./__hash_table
– Installing: /home/cschen/test/libcxx-scripts/out-arm/include/c++/v1/./cfenv
– Installing: /home/cschen/test/libcxx-scripts/out-arm/include/c++/v1/./codecvt
– Installing: /home/cschen/test/libcxx-scripts/out-arm/include/c++/v1/./cstdio
– Installing: /home/cschen/test/libcxx-scripts/out-arm/include/c++/v1/./iterator
– Installing: /home/cschen/test/libcxx-scripts/out-arm/include/c++/v1/./__sso_allocator
– Installing: /home/cschen/test/libcxx-scripts/out-arm/include/c++/v1/./valarray
– Installing: /home/cschen/test/libcxx-scripts/out-arm/include/c++/v1/./cerrno
– Installing: /home/cschen/test/libcxx-scripts/out-arm/include/c++/v1/./support
– Installing: /home/cschen/test/libcxx-scripts/out-arm/include/c++/v1/./support/android
– Installing: /home/cschen/test/libcxx-scripts/out-arm/include/c++/v1/./support/android/locale_bionic.h
– Installing: /home/cschen/test/libcxx-scripts/out-arm/include/c++/v1/./support/ibm
– Installing: /home/cschen/test/libcxx-scripts/out-arm/include/c++/v1/./support/ibm/xlocale.h
– Installing: /home/cschen/test/libcxx-scripts/out-arm/include/c++/v1/./support/ibm/limits.h
– Installing: /home/cschen/test/libcxx-scripts/out-arm/include/c++/v1/./support/ibm/support.h
– Installing: /home/cschen/test/libcxx-scripts/out-arm/include/c++/v1/./support/win32
– Installing: /home/cschen/test/libcxx-scripts/out-arm/include/c++/v1/./support/win32/math_win32.h
– Installing: /home/cschen/test/libcxx-scripts/out-arm/include/c++/v1/./support/win32/support.h
– Installing: /home/cschen/test/libcxx-scripts/out-arm/include/c++/v1/./support/win32/limits_win32.h
– Installing: /home/cschen/test/libcxx-scripts/out-arm/include/c++/v1/./support/win32/locale_win32.h
– Installing: /home/cschen/test/libcxx-scripts/out-arm/include/c++/v1/./support/newlib
– Installing: /home/cschen/test/libcxx-scripts/out-arm/include/c++/v1/./support/newlib/xlocale.h
– Installing: /home/cschen/test/libcxx-scripts/out-arm/include/c++/v1/./support/solaris
– Installing: /home/cschen/test/libcxx-scripts/out-arm/include/c++/v1/./support/solaris/floatingpoint.h
– Installing: /home/cschen/test/libcxx-scripts/out-arm/include/c++/v1/./support/solaris/xlocale.h
– Installing: /home/cschen/test/libcxx-scripts/out-arm/include/c++/v1/./support/solaris/wchar.h
– Installing: /home/cschen/test/libcxx-scripts/out-arm/include/c++/v1/./support/xlocale
– Installing: /home/cschen/test/libcxx-scripts/out-arm/include/c++/v1/./support/xlocale/xlocale.h
– Installing: /home/cschen/test/libcxx-scripts/out-arm/include/c++/v1/./cwctype
– Installing: /home/cschen/test/libcxx-scripts/out-arm/include/c++/v1/./set
– Installing: /home/cschen/test/libcxx-scripts/out-arm/include/c++/v1/./ios
– Installing: /home/cschen/test/libcxx-scripts/out-arm/include/c++/v1/./functional
– Installing: /home/cschen/test/libcxx-scripts/out-arm/include/c++/v1/./cstdbool
– Installing: /home/cschen/test/libcxx-scripts/out-arm/include/c++/v1/./__bit_reference
– Installing: /home/cschen/test/libcxx-scripts/out-arm/include/c++/v1/./future
– Installing: /home/cschen/test/libcxx-scripts/out-arm/include/c++/v1/./__functional_03
– Installing: /home/cschen/test/libcxx-scripts/out-arm/include/c++/v1/./fstream
– Installing: /home/cschen/test/libcxx-scripts/out-arm/include/c++/v1/./experimental
– Installing: /home/cschen/test/libcxx-scripts/out-arm/include/c++/v1/./experimental/optional
– Installing: /home/cschen/test/libcxx-scripts/out-arm/include/c++/v1/./experimental/utility
– Installing: /home/cschen/test/libcxx-scripts/out-arm/include/c++/v1/./experimental/dynarray
– Installing: /home/cschen/test/libcxx-scripts/out-arm/include/c++/v1/./experimental/string_view
– Installing: /home/cschen/test/libcxx-scripts/out-arm/include/c++/v1/./experimental/__config
– Installing: /home/cschen/test/libcxx-scripts/out-arm/include/c++/v1/./csignal
– Installing: /home/cschen/test/libcxx-scripts/out-arm/lib/libc++.so.1.0
– Installing: /home/cschen/test/libcxx-scripts/out-arm/lib/libc++.so.1
– Installing: /home/cschen/test/libcxx-scripts/out-arm/lib/libc++.so
/home/cschen/test/libcxx-scripts/libcxxabi/test/backtrace_test.cpp
/home/cschen/test/libcxx-scripts/out-arm/lib/libc++abi.so: undefined reference to `_Unwind_VRS_Interpret’
clang: error: linker command failed with exit code 1 (use -v to see invocation)

cschen

Jonathan Roelofs jonathan@codesourcery.com 於 2014/10/3 (週五) 12:35 PM 寫道﹕

I try to build libc++ and libc++abi for host x86_64(linux) and target
arm(linux) but fail.

Failing in what way? If this isn’t working out of the box, we’ve done
something wrong.
Yeah, it would help to know more specifics about where you’re getting stuck.

jroelofs might know more…

For my baremetal arm toolchain, I use buildit&testit for libc++abi, and
buildit&lit for libc++… Which is a bit different than what you’ll get out of
using cmake for it. Also, I’ve customized both buildits, the testit, and
libc++'s lit config file to do this, and those changes are very specific to my
environment (I don’t recommend using buildit/testit to build either library
unless you’re working on porting them to a new platform. Even then, just do it
the “right way” with cmake, and don’t be stupid like me ;] ).

Cheers,

Jon

-- Installing: /home/cschen/test/libcxx-scripts/out-arm/lib/libc++.so
/home/cschen/test/libcxx-scripts/libcxxabi/test/backtrace_test.cpp
/home/cschen/test/libcxx-scripts/out-arm/lib/libc++abi.so: undefined reference
to `_Unwind_VRS_Interpret'
clang: error: linker command failed with exit code 1 (use -v to see invocation)

  seems while compiling backtrace_test.cpp, linker fails to link the
correct library?

Regards,
chenwj

Hi cschen,

It seems that libunwind (the one included in libcxxabi) is mandatory at the moment. Use the second build command instead:

$ CROSS_COMPILING=arm ENABLE_LIBUNWIND=1 ./scripts/compile-all.sh

Logan

Thank you! I can build arm libcxx.so and compile it now. I want to run it with qemu further but fail as below. Do you know how to run the compiled code on qemu.

cschen@debian:~/test/libcxx-scripts$ clang++ -target arm-linux-gnueabihf -mcpu=cortex-a9 -mfloat-abi=hard -mfpu=neon -isystem out-arm/include -isystem out-arm/include/c++/v1 -isystem /usr/arm-linux-gnueabihf/include -Lout-arm/lib -lc++ -lpthread -lc++abi -lm -lc -lgcc_s -lgcc hello-world.cpp -o aa
cschen@debian:~/test/libcxx-scripts$ ./aa
bash: ./aa: cannot execute binary file
cschen@debian:~/test/libcxx-scripts$ qemu-arm aa

Best regards

cschen

Logan Chien tzuhsiang.chien@gmail.com 於 2014/10/7 (週二) 2:40 PM 寫道﹕

Hi cschen,

It seems that libunwind (the one included in libcxxabi) is mandatory at the moment. Use the second build command instead:

$ CROSS_COMPILING=arm ENABLE_LIBUNWIND=1 ./scripts/compile-all.sh

Logan

cschen,

When testing my baremetal stuff, I usually do something like this:

$ qemu-system-arm -semihosting -M integratorcp -cpu arm1026 -kernel ./aa

For your target, the process will be a little different because you'll need to
set up the whole OS within QEMU, and then scp ./aa over to the guest OS and run
it there. Unfortunately, I don't have a script that I can share that does that
for non-baremetal toolchains.

Cheers,

Jon