-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
46 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,6 @@ | ||
build --strategy=ObjcLink=standalone | ||
build --disk_cache=/tmp/bazel | ||
build --swiftcopt=-whole-module-optimization | ||
|
||
try-import clang.bazelrc | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
#!/bin/bash | ||
|
||
BAZELRC_FILE="${BAZELRC_FILE:-$(bazel info workspace)/clang.bazelrc}" | ||
|
||
LLVM_PREFIX=$1 | ||
|
||
if [[ ! -e "${LLVM_PREFIX}/bin/llvm-config" ]]; then | ||
echo "Error: cannot find llvm-config in ${LLVM_PREFIX}." | ||
exit 1 | ||
fi | ||
|
||
export PATH="$(${LLVM_PREFIX}/bin/llvm-config --bindir):${PATH}" | ||
|
||
RT_LIBRARY_PATH="$(dirname $(find $(llvm-config --libdir) -name libclang_rt.ubsan_standalone_cxx-x86_64.a | head -1))" | ||
|
||
echo "# Generated file, do not edit. If you want to disable clang, just delete this file. | ||
build:clang --action_env='PATH=${PATH}' | ||
build:clang --action_env=CC=clang | ||
build:clang --action_env=CXX=clang++ | ||
build:clang --action_env='LLVM_CONFIG=${LLVM_PREFIX}/bin/llvm-config' | ||
build:clang --repo_env='LLVM_CONFIG=${LLVM_PREFIX}/bin/llvm-config' | ||
build:clang --linkopt='-L$(llvm-config --libdir)' | ||
build:clang --linkopt='-Wl,-rpath,$(llvm-config --libdir)' | ||
build:clang-asan --action_env=ENVOY_UBSAN_VPTR=1 | ||
build:clang-asan --copt=-fsanitize=vptr,function | ||
build:clang-asan --linkopt=-fsanitize=vptr,function | ||
build:clang-asan --linkopt='-L${RT_LIBRARY_PATH}' | ||
build:clang-asan --linkopt=-l:libclang_rt.ubsan_standalone-x86_64.a | ||
build:clang-asan --linkopt=-l:libclang_rt.ubsan_standalone_cxx-x86_64.a | ||
" > ${BAZELRC_FILE} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters