mirror of
https://github.com/google/benchmark.git
synced 2025-03-14 11:20:07 +08:00
replace complexity with simplicity for faster libc++ setup (#1539)
* replace complexity with simplicity for faster libc++ setup * fix script reference * ignore error from stdlib in clang+asan * add missing run
This commit is contained in:
parent
84c71faa81
commit
6ebd82f2be
24
.github/.libcxx-setup.sh
vendored
24
.github/.libcxx-setup.sh
vendored
@ -1,24 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# Checkout LLVM sources
|
||||
git clone --depth=1 https://github.com/llvm/llvm-project.git llvm-project
|
||||
|
||||
# Setup libc++ options
|
||||
if [ -z "$BUILD_32_BITS" ]; then
|
||||
export BUILD_32_BITS=OFF && echo disabling 32 bit build
|
||||
fi
|
||||
|
||||
# Build and install libc++ (Use unstable ABI for better sanitizer coverage)
|
||||
cd ./llvm-project
|
||||
cmake -DCMAKE_C_COMPILER=${CC} \
|
||||
-DCMAKE_CXX_COMPILER=${CXX} \
|
||||
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
|
||||
-DCMAKE_INSTALL_PREFIX=/usr \
|
||||
-DLIBCXX_ABI_UNSTABLE=OFF \
|
||||
-DLLVM_USE_SANITIZER=${LIBCXX_SANITIZER} \
|
||||
-DLLVM_BUILD_32_BITS=${BUILD_32_BITS} \
|
||||
-DLLVM_ENABLE_RUNTIMES='libcxx;libcxxabi' \
|
||||
-S llvm -B llvm-build -G "Unix Makefiles"
|
||||
make -C llvm-build -j3 cxx cxxabi
|
||||
sudo make -C llvm-build install-cxx install-cxxabi
|
||||
cd ..
|
27
.github/libcxx-setup.sh
vendored
Executable file
27
.github/libcxx-setup.sh
vendored
Executable file
@ -0,0 +1,27 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# Checkout LLVM sources
|
||||
#git clone --depth=1 https://github.com/llvm/llvm-project.git llvm-project
|
||||
#
|
||||
## Setup libc++ options
|
||||
#if [ -z "$BUILD_32_BITS" ]; then
|
||||
# export BUILD_32_BITS=OFF && echo disabling 32 bit build
|
||||
#fi
|
||||
#
|
||||
## Build and install libc++ (Use unstable ABI for better sanitizer coverage)
|
||||
#cd ./llvm-project
|
||||
#cmake -DCMAKE_C_COMPILER=${CC} \
|
||||
# -DCMAKE_CXX_COMPILER=${CXX} \
|
||||
# -DCMAKE_BUILD_TYPE=RelWithDebInfo \
|
||||
# -DCMAKE_INSTALL_PREFIX=/usr \
|
||||
# -DLIBCXX_ABI_UNSTABLE=OFF \
|
||||
# -DLLVM_USE_SANITIZER=${LIBCXX_SANITIZER} \
|
||||
# -DLLVM_BUILD_32_BITS=${BUILD_32_BITS} \
|
||||
# -DLLVM_ENABLE_RUNTIMES='libcxx;libcxxabi' \
|
||||
# -S llvm -B llvm-build -G "Unix Makefiles"
|
||||
#make -C llvm-build -j3 cxx cxxabi
|
||||
#sudo make -C llvm-build install-cxx install-cxxabi
|
||||
#cd ..
|
||||
|
||||
sudo apt update
|
||||
sudo apt -y install libc++-dev libc++abi-dev
|
8
.github/workflows/sanitizer.yml
vendored
8
.github/workflows/sanitizer.yml
vendored
@ -45,6 +45,12 @@ jobs:
|
||||
echo "EXTRA_FLAGS=-g -O2 -fno-omit-frame-pointer -fsanitize=thread -fno-sanitize-recover=all" >> $GITHUB_ENV
|
||||
echo "LIBCXX_SANITIZER=Thread" >> $GITHUB_ENV
|
||||
|
||||
- name: fine-tune asan options
|
||||
# in clang+asan we get an error from std::regex. ignore it.
|
||||
if: matrix.sanitizer == 'asan' && matrix.compiler == 'clang'
|
||||
run: |
|
||||
echo "ASAN_OPTIONS=alloc_dealloc_mismatch=0" >> $GITHUB_ENV
|
||||
|
||||
- name: setup clang
|
||||
if: matrix.compiler == 'clang'
|
||||
uses: egor-tensin/setup-clang@v1
|
||||
@ -68,7 +74,7 @@ jobs:
|
||||
- name: install llvm stuff
|
||||
if: matrix.compiler == 'clang'
|
||||
run: |
|
||||
"${GITHUB_WORKSPACE}/.github/.libcxx-setup.sh"
|
||||
"${GITHUB_WORKSPACE}/.github/libcxx-setup.sh"
|
||||
echo "EXTRA_CXX_FLAGS=\"-stdlib=libc++\"" >> $GITHUB_ENV
|
||||
|
||||
- name: create build environment
|
||||
|
Loading…
Reference in New Issue
Block a user