forked from redpanda-data/redpanda
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added ability to use custom LLVM installation Signed-off-by: Michał Maślanka <[email protected]>
- Loading branch information
1 parent
e95d97e
commit a214114
Showing
3 changed files
with
40 additions
and
0 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
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 |
---|---|---|
|
@@ -265,3 +265,4 @@ vbuild/ | |
|
||
# bazel | ||
user.bazelrc | ||
llvm.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
# copied from Envoy project(https://github.com/envoyproxy/envoy/blob/main/bazel/setup_clang.sh) | ||
|
||
#!/usr/bin/env bash | ||
|
||
set -e | ||
|
||
BAZELRC_FILE="${BAZELRC_FILE:-./llvm.bazelrc}" | ||
|
||
LLVM_PREFIX=$1 | ||
|
||
if [[ ! -e "${LLVM_PREFIX}/bin/llvm-config" ]]; then | ||
echo "Error: cannot find local llvm-config in ${LLVM_PREFIX}." | ||
exit 1 | ||
fi | ||
|
||
PATH="$("${LLVM_PREFIX}"/bin/llvm-config --bindir):${PATH}" | ||
export PATH | ||
|
||
LLVM_VERSION="$(llvm-config --version)" | ||
LLVM_LIBDIR="$(llvm-config --libdir)" | ||
LLVM_TARGET="$(llvm-config --host-target)" | ||
|
||
RT_LIBRARY_PATH="${LLVM_LIBDIR}/clang/${LLVM_VERSION}/lib/${LLVM_TARGET}" | ||
|
||
echo "# Generated file, do not edit. If you want to disable custom llvm, just delete this file. | ||
build:llvm --action_env='PATH=${PATH}' --host_action_env='PATH=${PATH}' | ||
build:llvm --action_env='LLVM_CONFIG=${LLVM_PREFIX}/bin/llvm-config' --host_action_env='LLVM_CONFIG=${LLVM_PREFIX}/bin/llvm-config' | ||
build:llvm --repo_env='LLVM_CONFIG=${LLVM_PREFIX}/bin/llvm-config' | ||
build:llvm --linkopt='-L$(llvm-config --libdir)' | ||
build:llvm --linkopt='-Wl,-rpath,$(llvm-config --libdir)' | ||
build:llvm-sanitizers --linkopt='-L${RT_LIBRARY_PATH}' | ||
" >"${BAZELRC_FILE}" |