8000 Use modern clang/libc++ for sanitizers by dmah42 · Pull Request #1171 · google/benchmark · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Use modern clang/libc++ for sanitizers #1171

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 10 commits into from
Jun 4, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions .github/.libcxx-setup.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#!/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=${C_COMPILER} \
-DCMAKE_CXX_COMPILER=${COMPILER} \
-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_PROJECTS='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 ..
19 changes: 7 additions & 12 deletions .github/workflows/sanitizer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@ on:
pull_request: {}

env:
CC: clang-3.8
CXX: clang++-3.8
CC: clang
CXX: clang++
EXTRA_CXX_FLAGS: "-stdlib=libc++"
UBSAN_OPTIONS: "print_stacktrace=1"

jobs:
job:
name: ${{ matrix.sanitizer }}.${{ matrix.build_type }}
runs-on: ubuntu-16.04
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
Expand All @@ -28,7 +28,7 @@ jobs:
run: |
echo "EXTRA_FLAGS=-g -O2 -fno-omit-frame-pointer -fsanitize=memory -fsanitize-memory-track-origins" >> $GITHUB_ENV
echo "LIBCXX_SANITIZER=MemoryWithOrigins" >> $GITHUB_ENV

- name: configure ubsan env
if: matrix.sanitizer == 'ubsan'
run: |
Expand All @@ -47,13 +47,8 @@ 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: install clang-3.8
run: |
sudo apt update
sudo apt -y install clang-3.8

- name: install libc++
run: "${GITHUB_WORKSPACE}/.libcxx-setup.sh"
- name: install llvm stuff
run: "${GITHUB_WORKSPACE}/.github/.libcxx-setup.sh"

- name: create build environment
run: cmake -E make_directory ${{ runner.workspace }}/_build
Expand All @@ -76,7 +71,7 @@ jobs:
shell: bash
working-directory: ${{ runner.workspace }}/_build
run: cmake --build . --config ${{ matrix.build_type }}

- name: test
shell: bash
working-directory: ${{ runner.workspace }}/_build
Expand Down
28 changes: 0 additions & 28 deletions .libcxx-setup.sh

This file was deleted.

0