From 890c9992251e1138a309f5682863070e5431b641 Mon Sep 17 00:00:00 2001 From: Sebastian Pop Date: Tue, 19 Feb 2019 23:16:46 -0600 Subject: [PATCH] enable builds of base images for AArch64 (#2176) First step to enable oss-fuzzers to run on native aarch64 as mentioned in https://github.com/google/oss-fuzz/issues/1754#issuecomment-461926649 --- .../base-clang/checkout_build_install_llvm.sh | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/infra/base-images/base-clang/checkout_build_install_llvm.sh b/infra/base-images/base-clang/checkout_build_install_llvm.sh index 16242b892..f2ad1375c 100755 --- a/infra/base-images/base-clang/checkout_build_install_llvm.sh +++ b/infra/base-images/base-clang/checkout_build_install_llvm.sh @@ -66,9 +66,22 @@ cd $SRC/llvm/projects && checkout_with_retries https://llvm.org/svn/llvm-project # Build & install mkdir -p $WORK/llvm cd $WORK/llvm +TARGET_TO_BUILD= +case $(uname -m) in + x86_64) + TARGET_TO_BUILD=X86 + ;; + aarch64) + TARGET_TO_BUILD=AArch64 + ;; + *) + echo "Error: unsupported target $(uname -m)" + exit 1 + ;; +esac cmake -G "Ninja" \ -DLIBCXX_ENABLE_SHARED=OFF -DLIBCXX_ENABLE_STATIC_ABI_LIBRARY=ON \ - -DCMAKE_BUILD_TYPE=Release -DLLVM_TARGETS_TO_BUILD="X86" \ + -DCMAKE_BUILD_TYPE=Release -DLLVM_TARGETS_TO_BUILD="$TARGET_TO_BUILD" \ $SRC/llvm ninja ninja install @@ -86,7 +99,7 @@ cmake -G "Ninja" \ -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ \ -DLLVM_USE_SANITIZER=Memory -DCMAKE_INSTALL_PREFIX=/usr/msan/ \ -DLIBCXX_ENABLE_SHARED=OFF -DLIBCXX_ENABLE_STATIC_ABI_LIBRARY=ON \ - -DCMAKE_BUILD_TYPE=Release -DLLVM_TARGETS_TO_BUILD="X86" \ + -DCMAKE_BUILD_TYPE=Release -DLLVM_TARGETS_TO_BUILD="$TARGET_TO_BUILD" \ -DCMAKE_CXX_FLAGS="-fsanitize-blacklist=$WORK/msan/blacklist.txt" \ $SRC/llvm ninja cxx