Hello,
I have successfully cross-compiled libc++ for various armv7 targets but cannot build the benchmarks. It looks like the google-benchmark configure step is not respecting the compiler flags used for the library build. The build fails at this step:
[5/92] Performing configure step for ‘google-benchmark-libcxx’
My cross-compile build is in the arm subdirectory and I ran “ninja -C arm cxx-benchmarks” to build the benchmarks.
The error log shows the check is trying to use the native compiler with the cross-compiler libraries which inevitably ends in tears!
Performing C++ SOURCE FILE Test HAVE_CXX_FLAG_WD654 failed with the following output:
Change Dir: /build/arm/libcxx/benchmarks/benchmark-libcxx/src/google-benchmark-libcxx-build/CMakeFiles/CMakeTmpRun Build Command(s):/usr/bin/ninja cmTC_7b911 && [1/2] Building CXX object CMakeFiles/cmTC_7b911.dir/src.cxx.o
FAILED: CMakeFiles/cmTC_7b911.dir/src.cxx.o
/usr/bin/clang+±16 -DHAVE_CXX_FLAG_WD654 -Wno-unused-command-line-argument -nostdinc++ -isystem /build/arm/include/c++/v1 -L/build/arm/lib -Wl,-rpath,/build/arm/lib -std=c++11 -Wall -Wextra -Wshadow -Wsuggest-override -pedantic -
pedantic-errors -Wshorten-64-to-32 -fstrict-aliasing -Wno-deprecated-declarations -Wstrict-aliasing -wd654 -wd654 -MD -MT CMakeFiles/cmTC_7b911.dir/src.cxx.o -MF CMakeFiles/cmTC_7b911.dir/src.cxx.o.d -o CMakeFiles/cmTC_7b911.dir/sr
c.cxx.o -c /build/arm/libcxx/benchmarks/benchmark-libcxx/src/google-benchmark-libcxx-build/CMakeFiles/CMakeTmp/src.cxx
clang: error: unknown argument: ‘-wd654’
clang: error: unknown argument: ‘-wd654’
ninja: build stopped: subcommand failed.Source file was:
int main() { return 0; }
Performing C++ SOURCE FILE Test HAVE_CXX_FLAG_STDLIB_LIBCXX failed with the following output:
Change Dir: /build/arm/libcxx/benchmarks/benchmark-libcxx/src/google-benchmark-libcxx-build/CMakeFiles/CMakeTmpRun Build Command(s):/usr/bin/ninja cmTC_60aa7 && [1/2] Building CXX object CMakeFiles/cmTC_60aa7.dir/src.cxx.o
[2/2] Linking CXX executable cmTC_60aa7
FAILED: cmTC_60aa7
: && /usr/bin/clang+±16 -Wno-unused-command-line-argument -nostdinc++ -isystem /build/arm/include/c++/v1 -L/build/arm/lib -Wl,-rpath,/build/arm/lib -std=c++11 -Wall -Wextra -Wshadow -Wsuggest-override -pedantic -pedantic-errors -
Wshorten-64-to-32 -fstrict-aliasing -Wno-deprecated-declarations -Wstrict-aliasing -Wthread-safety -stdlib=libc++ CMakeFiles/cmTC_60aa7.dir/src.cxx.o -o cmTC_60aa7 && :
/usr/bin/ld: skipping incompatible /build/arm/lib/libc++.so.1 when searching for libc++.so.1
/usr/bin/ld: skipping incompatible /build/arm/lib/libc++.so.1 when searching for libc++.so.1
/usr/bin/ld: skipping incompatible /build/arm/lib/libc++abi.so when searching for -lc++abi
/usr/bin/ld: /build/arm/lib/libc++abi.a: error adding symbols: file format not recognized
clang: error: linker command failed with exit code 1 (use -v to see invocation)
ninja: build stopped: subcommand failed.Source file was:
int main() { return 0; }