[cfe-dev] Failing android unit test

David Greene via cfe-dev cfe-dev at lists.llvm.org
Mon Jul 9 08:59:44 PDT 2018


Hello,

I'm trying to build and test clang in our local environment and I'm
getting failures in a number of sysroot-type unit tests.  A typical
one is android-standalone.cpp:

/test/clang/test/Driver/android-standalone.cpp:12:11: error: expected string not found in input
// CHECK: "-internal-externc-isystem" "{{.*}}/sysroot/include"
          ^
<stdin>:5:1438: note: scanning from here

 "/test/build/bin/clang" "-cc1" "-triple" "armv4t--linux-android" "-emit-obj" "-mrelax-all" "-disable-free" "-main-file-name" "android-standalone.cpp" "-mrelocation-model" "pic" "-pic-level" "1" "-mthread-model" "posix" "-mdisable-fp-elim" "-fmath-errno" "-masm-verbose" "-mconstructor-aliases" "-fuse-init-array" "-target-cpu" "arm7tdmi" "-target-feature" "+soft-float" "-target-feature" "+soft-float-abi" "-target-feature" "-fp-only-sp" "-target-feature" "-d16" "-target-feature" "-vfp2" "-target-feature" "-vfp3" "-target-feature" "-fp16" "-target-feature" "-vfp4" "-target-feature" "-fp-armv8" "-target-feature" "-neon" "-target-feature" "-crypto" "-target-feature" "+strict-align" "-target-abi" "aapcs-linux" "-msoft-float" "-mfloat-abi" "soft" "-fallow-half-arguments-and-returns" "-dwarf-column-info" "-debugger-tuning=gdb" "-resource-dir" "/test/build/lib/clang/7.0.0" "-isysroot" "/test/clang/test/Driver/Inputs/basic_android_tree/sysroot" "-internal-isystem" "/test/clang/test/Driver/Inputs/basic_android_tree/lib/gcc/arm-linux-androideabi/4.4.3/../../../../arm-linux-androideabi/include/c++/4.4.3" "-internal-isystem" "/test/clang/test/Driver/Inputs/basic_android_tree/lib/gcc/arm-linux-androideabi/4.4.3/../../../../arm-linux-androideabi/include/c++/4.4.3/arm-linux-androideabi" "-internal-isystem" "/test/clang/test/Driver/Inputs/basic_android_tree/lib/gcc/arm-linux-androideabi/4.4.3/../../../../arm-linux-androideabi/include/c++/4.4.3/backward" "-internal-isystem" "/test/clang/test/Driver/Inputs/basic_android_tree/sysroot/usr/local/include" "-internal-isystem" "/test/build/lib/clang/7.0.0/include" "-internal-externc-isystem" "/test/clang/test/Driver/Inputs/basic_android_tree/sysroot/opt/gcc/6.1.0/snos/include/g++" "-internal-externc-isystem" "/test/clang/test/Driver/Inputs/basic_android_tree/sysroot/opt/gcc/6.1.0/snos/include/g++/x86_64-suse-linux" "-internal-externc-isystem" "/test/clang/test/Driver/Inputs/basic_android_tree/sysroot/usr/include" "-fdeprecated-macro" "-fdebug-compilation-dir" "/test/build/tools/clang/test/Driver" "-ferror-limit" "19" "-fmessage-length" "0" "-fno-signed-char" "-fobjc-runtime=gcc" "-fcxx-exceptions" "-fexceptions" "-fdiagnostics-show-option" "-o" "/tmp/lit_tmp_SrGo50/android-standalone-eaa140.o" "-x" "c++" "/test/clang/test/Driver/android-standalone.cpp"

We've built clang with a gcc installed in a non-standard location, which
seems to result in the following:

"-internal-externc-isystem"
"/test/clang/test/Driver/Inputs/basic_android_tree/sysroot/opt/gcc/6.1.0/snos/include/g++"
"-internal-externc-isystem"
"/test/clang/test/Driver/Inputs/basic_android_tree/sysroot/opt/gcc/6.1.0/snos/include/g++/x86_64-suse-linux"
"-internal-externc-isystem"
"/test/clang/test/Driver/Inputs/basic_android_tree/sysroot/usr/include"

This doesn't match what the test is expecting.  I configured clang with:

-DCMAKE_C_COMPILER=/opt/gcc/6.1.0/snos/bin/gcc
 -DCMAKE_CXX_COMPILER=/opt/gcc/6.1.0/snos/bin/g++
 -DC_INCLUDE_DIRS=/opt/gcc/6.1.0/snos/include/g++:/opt/gcc/6.1.0/snos/include/g++/x86_64-suse-linux:/usr/include
 -DGCC_INSTALL_PREFIX=/opt/gcc/6.1.0/snos

I gather clang is getting the include paths from the above.

Is there something wrong with the way I'm configuring clang or does the
test need to be changed to be more flexible about where gcc headers are
located?  I'm building on x86_64 so these headers would not work with
android, but I gather that's not the point of the test.

Thanks for any help!

                      -David


More information about the cfe-dev mailing list