Skip to content

Commit 1e5edad

Browse files
authored
[Android] Remove unneeded -stdlib and -I flags for C++ (#66)
A recent Clang driver will assume -stdlib=libc++ automatically for Android and will also automatically add $SYSROOT/usr/include/c++/v1 to the include search path. This explicit -I path breaks libFuzzer when it builds and links its own copy of libc++ because there are two different libc++ copies on the include path.
1 parent e459b04 commit 1e5edad

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

zorg/buildbot/builders/sanitizers/buildbot_android_functions.sh

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,6 @@ function configure_android { # ARCH triple
5353
local ANDROID_LIBRARY_OUTPUT_DIR=$(ls -d $ROOT/llvm_build64/lib/clang/* | tail -1)
5454
local ANDROID_EXEC_OUTPUT_DIR=$ROOT/llvm_build64/bin
5555
local ANDROID_FLAGS="--target=${_triple}${ANDROID_API} --sysroot=$ANDROID_TOOLCHAIN/sysroot --gcc-toolchain=$ANDROID_TOOLCHAIN -B$ANDROID_TOOLCHAIN"
56-
local ANDROID_CXX_FLAGS="$ANDROID_FLAGS -stdlib=libc++ -I/$ANDROID_TOOLCHAIN/sysroot/usr/include/c++/v1"
5756

5857
local CLANG_PATH=$ROOT/llvm_build64/bin/clang
5958
local CLANGXX_PATH=$ROOT/llvm_build64/bin/clang++
@@ -72,7 +71,7 @@ function configure_android { # ARCH triple
7271
-DCMAKE_CXX_COMPILER=$CLANGXX_PATH \
7372
-DCMAKE_ASM_FLAGS="$ANDROID_FLAGS" \
7473
-DCMAKE_C_FLAGS="$ANDROID_FLAGS" \
75-
-DCMAKE_CXX_FLAGS="$ANDROID_CXX_FLAGS" \
74+
-DCMAKE_CXX_FLAGS="$ANDROID_FLAGS" \
7675
-DLLVM_BINUTILS_INCDIR=/usr/include \
7776
-DCMAKE_EXE_LINKER_FLAGS="-pie" \
7877
-DCMAKE_SKIP_RPATH=ON \
@@ -92,7 +91,7 @@ function configure_android { # ARCH triple
9291
-DCOMPILER_RT_ENABLE_WERROR=ON \
9392
-DCMAKE_ASM_FLAGS="$ANDROID_FLAGS" \
9493
-DCMAKE_C_FLAGS="$ANDROID_FLAGS" \
95-
-DCMAKE_CXX_FLAGS="$ANDROID_CXX_FLAGS" \
94+
-DCMAKE_CXX_FLAGS="$ANDROID_FLAGS" \
9695
-DSANITIZER_CXX_ABI="libcxxabi" \
9796
-DCOMPILER_RT_TEST_COMPILER_CFLAGS="$ANDROID_FLAGS" \
9897
-DCOMPILER_RT_DEFAULT_TARGET_TRIPLE=$_triple \

0 commit comments

Comments
 (0)