Skip to content

Commit

Permalink
Add HOST_PREFIX to toolchain
Browse files Browse the repository at this point in the history
  • Loading branch information
xhochy committed Jul 21, 2021
1 parent 0360ad5 commit 9b49dd2
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions recipe/custom_toolchain/cc_toolchain_config.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -300,6 +300,7 @@ def _impl(ctx):
"${BUILD_PREFIX}/lib/clang/${COMPILER_VERSION}/include",
"${BUILD_PREFIX}/include/c++/v1",
"${PREFIX}/include",
"${HOST_PREFIX}/include",
]
else:
cxx_builtin_include_directories = [
Expand Down
5 changes: 4 additions & 1 deletion recipe/gen-bazel-toolchain.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ function apply_cc_template() {
sed -ie "s:\${GCC}:${BAZEL_TOOLCHAIN_GCC}:" $1
sed -ie "s:\${PREFIX}:${PREFIX}:" $1
sed -ie "s:\${BUILD_PREFIX}:${BUILD_PREFIX}:" $1
sed -ie "s:\${HOST_PREFIX}:${HOST_PREFIX}:" $1
sed -ie "s:\${LD}:${LD}:" $1
sed -ie "s:\${CFLAGS}:${CFLAGS}:" $1
sed -ie "s:\${CPPFLAGS}:${CPPFLAGS}:" $1
Expand Down Expand Up @@ -40,7 +41,7 @@ pushd custom_toolchain
-e "s:\${INSTALL_NAME_TOOL}:${INSTALL_NAME_TOOL//${HOST}/${BUILD}}:" \
-e "s:\${CONDA_BUILD_SYSROOT}:${CONDA_BUILD_SYSROOT}:" \
cc_wrapper.sh.template > cc_wrapper_build.sh
chmod +x cc_wrapper.sh
chmod +x cc_wrapper_build.sh
export BAZEL_TOOLCHAIN_GCC="cc_wrapper.sh"
export BAZEL_TOOLCHAIN_LIBCXX="c++"
export BAZEL_TOOLCHAIN_AR=${LIBTOOL}
Expand Down Expand Up @@ -97,6 +98,8 @@ pushd custom_toolchain
sed -ie "s:TARGET_CPU:${TARGET_CPU}:" BUILD
sed -ie "s:BUILD_CPU:${BUILD_CPU}:" BUILD

HOST_PREFIX=${PREFIX}

cp cc_toolchain_config.bzl cc_toolchain_build_config.bzl
apply_cc_template cc_toolchain_config.bzl
(
Expand Down

0 comments on commit 9b49dd2

Please sign in to comment.