diff --git a/MODULE.bazel.lock b/MODULE.bazel.lock index f090f93..ee63189 100644 --- a/MODULE.bazel.lock +++ b/MODULE.bazel.lock @@ -146,7 +146,7 @@ "//cc:extensions.bzl%swift_cc_toolchain_extension": { "general": { "bzlTransitiveDigest": "zDwq2yBSEJXdECtks4+trENu8MzrMfkm5FDsxbO1KrE=", - "usagesDigest": "Eb21Mwf0c/et3ETQBwhnFe0QVY+AocNmtuMarxHxpNc=", + "usagesDigest": "/6dsoamEyMs6vTiy7icOYdSA1kgYfntwG63tqnGYYGA=", "recordedFileInputs": {}, "recordedDirentsInputs": {}, "envVariables": {}, @@ -344,7 +344,7 @@ "//cc/toolchains/yocto_generic:yocto_generic_extension.bzl%yocto_generic_extension": { "general": { "bzlTransitiveDigest": "Q4v/HN5Wh/W0JsPpeExQzSqIslfepuWsd75kvW+25FI=", - "usagesDigest": "QXDNegoafg7lKCmQlnTCNf5dOvLNRGVtXN7GJRnvVW0=", + "usagesDigest": "xD6mwzfBp1P+bxuzyTiD6cabDa/oje/OCCqi3rsiOmE=", "recordedFileInputs": {}, "recordedDirentsInputs": {}, "envVariables": {}, diff --git a/cc/toolchains/gcc_arm_embedded/wrappers/wrapper b/cc/toolchains/gcc_arm_embedded/wrappers/wrapper index cda6215..1209255 100755 --- a/cc/toolchains/gcc_arm_embedded/wrappers/wrapper +++ b/cc/toolchains/gcc_arm_embedded/wrappers/wrapper @@ -33,7 +33,10 @@ if [ -n "$SWIFTNAV_VERBOSE_TOOLCHAIN" ]; then set -x fi -tool_name=$(basename "$0") +BASENAME=/usr/bin/basename +[ -x "$BASENAME" ] || BASENAME="basename" + +tool_name=$($BASENAME "$0") # In case the tool label is changed, a change in here is very likely needed # This establishes backwards compatibility with the old WORKSPACE file toolchain_bindir=external/x86_64_linux_gcc_arm_embedded_toolchain/bin @@ -57,7 +60,7 @@ elif case "$0" in /*) true;; *) false;; esac; then # # If the wrapper is relocated then this line needs to be adjusted. - execroot_path="${0%/*/*/*/*/*/*/*/*}" + execroot_path="${0%/*/*/*/*/*/*/*/*}" # Legacy path for non-bazelmod tool="${execroot_path}/${toolchain_bindir}/${tool_name}" diff --git a/cc/toolchains/gcc_arm_gnu_8_3/wrappers/wrapper b/cc/toolchains/gcc_arm_gnu_8_3/wrappers/wrapper index 98c063e..25f43f2 100755 --- a/cc/toolchains/gcc_arm_gnu_8_3/wrappers/wrapper +++ b/cc/toolchains/gcc_arm_gnu_8_3/wrappers/wrapper @@ -33,7 +33,10 @@ if [ -n "$SWIFTNAV_VERBOSE_TOOLCHAIN" ]; then set -x fi -tool_name=$(basename "$0") +BASENAME=/usr/bin/basename +[ -x "$BASENAME" ] || BASENAME="basename" + +tool_name=$($BASENAME "$0") # In case the tool label is changed, a change in here is very likely needed # This establishes backwards compatibility with the old WORKSPACE file toolchain_bindir=external/gcc_arm_gnu_8_3_toolchain/bin @@ -57,7 +60,7 @@ elif case "$0" in /*) true;; *) false;; esac; then # # If the wrapper is relocated then this line needs to be adjusted. - execroot_path="${0%/*/*/*/*/*/*/*/*}" + execroot_path="${0%/*/*/*/*/*/*/*/*}" # Legacy path for non-bazelmod tool="${execroot_path}/${toolchain_bindir}/${tool_name}" diff --git a/cc/toolchains/llvm/aarch64-darwin/wrappers/wrapper b/cc/toolchains/llvm/aarch64-darwin/wrappers/wrapper index 6018106..d0e08e0 100755 --- a/cc/toolchains/llvm/aarch64-darwin/wrappers/wrapper +++ b/cc/toolchains/llvm/aarch64-darwin/wrappers/wrapper @@ -33,7 +33,10 @@ if [ -n "$SWIFTNAV_VERBOSE_TOOLCHAIN" ]; then set -x fi -tool_name=$(basename "$0") +BASENAME=/usr/bin/basename +[ -x "$BASENAME" ] || BASENAME="basename" + +tool_name=$($BASENAME "$0") # In case the tool label is changed, a change in here is very likely needed # This establishes backwards compatibility with the old WORKSPACE file toolchain_bindir=external/aarch64-darwin-llvm/bin @@ -57,7 +60,7 @@ elif case "$0" in /*) true;; *) false;; esac; then # # If the wrapper is relocated then this line needs to be adjusted. - execroot_path="${0%/*/*/*/*/*/*/*/*}" + execroot_path="${0%/*/*/*/*/*/*/*/*}" # Legacy path for non-bazelmod tool="${execroot_path}/${toolchain_bindir}/${tool_name}" diff --git a/cc/toolchains/llvm/aarch64-linux/wrappers/wrapper b/cc/toolchains/llvm/aarch64-linux/wrappers/wrapper index 025fe0a..36bf3c8 100755 --- a/cc/toolchains/llvm/aarch64-linux/wrappers/wrapper +++ b/cc/toolchains/llvm/aarch64-linux/wrappers/wrapper @@ -33,7 +33,10 @@ if [ -n "$SWIFTNAV_VERBOSE_TOOLCHAIN" ]; then set -x fi -tool_name=$(basename "$0") +BASENAME=/usr/bin/basename +[ -x "$BASENAME" ] || BASENAME="basename" + +tool_name=$($BASENAME "$0") toolchain_bindir=external/aarch64-linux-llvm/bin toolchain_bindir_as_bzlmod="external/rules_swiftnav++swift_cc_toolchain_extension+aarch64-linux-llvm/bin" @@ -55,7 +58,7 @@ elif case "$0" in /*) true;; *) false;; esac; then # # If the wrapper is relocated then this line needs to be adjusted. - execroot_path="${0%/*/*/*/*/*/*/*/*}" + execroot_path="${0%/*/*/*/*/*/*/*/*}" # Legacy path for non-bazelmod tool="${execroot_path}/${toolchain_bindir}/${tool_name}" diff --git a/cc/toolchains/llvm/cc_toolchain_config.bzl b/cc/toolchains/llvm/cc_toolchain_config.bzl index dd9746b..089ca8e 100644 --- a/cc/toolchains/llvm/cc_toolchain_config.bzl +++ b/cc/toolchains/llvm/cc_toolchain_config.bzl @@ -103,6 +103,7 @@ def cc_toolchain_config( ]) else: link_flags.extend([ + "-B/usr/bin", # Tell clang where to find system linker "-headerpad_max_install_names", "-Wl,-no_warn_duplicate_libraries", ]) diff --git a/cc/toolchains/llvm/x86_64-aarch64-linux/wrappers/wrapper b/cc/toolchains/llvm/x86_64-aarch64-linux/wrappers/wrapper index fad9dd7..1583831 100755 --- a/cc/toolchains/llvm/x86_64-aarch64-linux/wrappers/wrapper +++ b/cc/toolchains/llvm/x86_64-aarch64-linux/wrappers/wrapper @@ -33,7 +33,10 @@ if [ -n "$SWIFTNAV_VERBOSE_TOOLCHAIN" ]; then set -x fi -tool_name=$(basename "$0") +BASENAME=/usr/bin/basename +[ -x "$BASENAME" ] || BASENAME="basename" + +tool_name=$($BASENAME "$0") toolchain_bindir=external/x86_64-linux-llvm/bin toolchain_bindir_as_bzlmod="external/rules_swiftnav++swift_cc_toolchain_extension+x86_64-linux-llvm/bin" @@ -55,7 +58,7 @@ elif case "$0" in /*) true;; *) false;; esac; then # # If the wrapper is relocated then this line needs to be adjusted. - execroot_path="${0%/*/*/*/*/*/*/*/*}" + execroot_path="${0%/*/*/*/*/*/*/*/*}" # Legacy path for non-bazelmod tool="${execroot_path}/${toolchain_bindir}/${tool_name}" diff --git a/cc/toolchains/llvm/x86_64-darwin/wrappers/wrapper b/cc/toolchains/llvm/x86_64-darwin/wrappers/wrapper index cac6559..08fc134 100755 --- a/cc/toolchains/llvm/x86_64-darwin/wrappers/wrapper +++ b/cc/toolchains/llvm/x86_64-darwin/wrappers/wrapper @@ -33,7 +33,10 @@ if [ -n "$SWIFTNAV_VERBOSE_TOOLCHAIN" ]; then set -x fi -tool_name=$(basename "$0") +BASENAME=/usr/bin/basename +[ -x "$BASENAME" ] || BASENAME="basename" + +tool_name=$($BASENAME "$0") toolchain_bindir=external/x86_64-darwin-llvm/bin toolchain_bindir_as_bzlmod="external/rules_swiftnav++swift_cc_toolchain_extension+x86_64-darwin-llvm/bin" diff --git a/cc/toolchains/llvm/x86_64-linux/wrappers/wrapper b/cc/toolchains/llvm/x86_64-linux/wrappers/wrapper index 6c7653e..26d4892 100755 --- a/cc/toolchains/llvm/x86_64-linux/wrappers/wrapper +++ b/cc/toolchains/llvm/x86_64-linux/wrappers/wrapper @@ -33,7 +33,10 @@ if [ -n "$SWIFTNAV_VERBOSE_TOOLCHAIN" ]; then set -x fi -tool_name=$(basename "$0") +BASENAME=/usr/bin/basename +[ -x "$BASENAME" ] || BASENAME="basename" + +tool_name=$($BASENAME "$0") # In case the tool label is changed, a change in here is very likely needed # This establishes backwards compatibility with the old WORKSPACE file toolchain_bindir=external/x86_64-linux-llvm/bin @@ -57,7 +60,7 @@ elif case "$0" in /*) true;; *) false;; esac; then # # If the wrapper is relocated then this line needs to be adjusted. - execroot_path="${0%/*/*/*/*/*/*/*/*}" + execroot_path="${0%/*/*/*/*/*/*/*/*}" # Legacy path for non-bazelmod tool="${execroot_path}/${toolchain_bindir}/${tool_name}" diff --git a/cc/toolchains/llvm20/aarch64-darwin/wrappers/wrapper b/cc/toolchains/llvm20/aarch64-darwin/wrappers/wrapper index 800eba3..a8ce17c 100755 --- a/cc/toolchains/llvm20/aarch64-darwin/wrappers/wrapper +++ b/cc/toolchains/llvm20/aarch64-darwin/wrappers/wrapper @@ -33,7 +33,10 @@ if [ -n "$SWIFTNAV_VERBOSE_TOOLCHAIN" ]; then set -x fi -tool_name=$(basename "$0") +BASENAME=/usr/bin/basename +[ -x "$BASENAME" ] || BASENAME="basename" + +tool_name=$($BASENAME "$0") # In case the tool label is changed, a change in here is very likely needed # This establishes backwards compatibility with the old WORKSPACE file toolchain_bindir=external/aarch64-darwin-llvm20/bin @@ -57,7 +60,7 @@ elif case "$0" in /*) true;; *) false;; esac; then # # If the wrapper is relocated then this line needs to be adjusted. - execroot_path="${0%/*/*/*/*/*/*/*/*}" + execroot_path="${0%/*/*/*/*/*/*/*/*}" # Legacy path for non-bazelmod tool="${execroot_path}/${toolchain_bindir}/${tool_name}" diff --git a/cc/toolchains/llvm20/aarch64-linux/wrappers/wrapper b/cc/toolchains/llvm20/aarch64-linux/wrappers/wrapper index e9f8735..85a22d3 100755 --- a/cc/toolchains/llvm20/aarch64-linux/wrappers/wrapper +++ b/cc/toolchains/llvm20/aarch64-linux/wrappers/wrapper @@ -10,7 +10,7 @@ # EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED # WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. -# Locates the actual tool paths relative to the location this script is +# Locates the actual tool paths relative to the location this script is # executed from. # # This is necessary because we download the toolchain using @@ -33,7 +33,10 @@ if [ -n "$SWIFTNAV_VERBOSE_TOOLCHAIN" ]; then set -x fi -tool_name=$(basename "$0") +BASENAME=/usr/bin/basename +[ -x "$BASENAME" ] || BASENAME="basename" + +tool_name=$($BASENAME "$0") # In case the tool label is changed, a change in here is very likely needed # This establishes backwards compatibility with the old WORKSPACE file toolchain_bindir=external/aarch64-linux-llvm20/bin @@ -57,7 +60,7 @@ elif case "$0" in /*) true;; *) false;; esac; then # # If the wrapper is relocated then this line needs to be adjusted. - execroot_path="${0%/*/*/*/*/*/*/*/*}" + execroot_path="${0%/*/*/*/*/*/*/*/*}" # Legacy path for non-bazelmod tool="${execroot_path}/${toolchain_bindir}/${tool_name}" diff --git a/cc/toolchains/llvm20/x86_64-aarch64-linux/wrappers/wrapper b/cc/toolchains/llvm20/x86_64-aarch64-linux/wrappers/wrapper index 83458dc..7d7dc7e 100755 --- a/cc/toolchains/llvm20/x86_64-aarch64-linux/wrappers/wrapper +++ b/cc/toolchains/llvm20/x86_64-aarch64-linux/wrappers/wrapper @@ -10,7 +10,7 @@ # EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED # WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. -# Locates the actual tool paths relative to the location this script is +# Locates the actual tool paths relative to the location this script is # executed from. # # This is necessary because we download the toolchain using @@ -33,7 +33,10 @@ if [ -n "$SWIFTNAV_VERBOSE_TOOLCHAIN" ]; then set -x fi -tool_name=$(basename "$0") +BASENAME=/usr/bin/basename +[ -x "$BASENAME" ] || BASENAME="basename" + +tool_name=$($BASENAME "$0") # In case the tool label is changed, a change in here is very likely needed # This establishes backwards compatibility with the old WORKSPACE file toolchain_bindir=external/x86_64-linux-llvm20/bin @@ -57,7 +60,7 @@ elif case "$0" in /*) true;; *) false;; esac; then # # If the wrapper is relocated then this line needs to be adjusted. - execroot_path="${0%/*/*/*/*/*/*/*/*}" + execroot_path="${0%/*/*/*/*/*/*/*/*}" # Legacy path for non-bazelmod tool="${execroot_path}/${toolchain_bindir}/${tool_name}" diff --git a/cc/toolchains/llvm20/x86_64-darwin/wrappers/wrapper b/cc/toolchains/llvm20/x86_64-darwin/wrappers/wrapper index ec205cd..88c6593 100755 --- a/cc/toolchains/llvm20/x86_64-darwin/wrappers/wrapper +++ b/cc/toolchains/llvm20/x86_64-darwin/wrappers/wrapper @@ -10,7 +10,7 @@ # EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED # WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. -# Locates the actual tool paths relative to the location this script is +# Locates the actual tool paths relative to the location this script is # executed from. # # This is necessary because we download the toolchain using @@ -33,7 +33,10 @@ if [ -n "$SWIFTNAV_VERBOSE_TOOLCHAIN" ]; then set -x fi -tool_name=$(basename "$0") +BASENAME=/usr/bin/basename +[ -x "$BASENAME" ] || BASENAME="basename" + +tool_name=$($BASENAME "$0") # In case the tool label is changed, a change in here is very likely needed # This establishes backwards compatibility with the old WORKSPACE file toolchain_bindir=external/x86_64-darwin-llvm20/bin @@ -57,7 +60,7 @@ elif case "$0" in /*) true;; *) false;; esac; then # # If the wrapper is relocated then this line needs to be adjusted. - execroot_path="${0%/*/*/*/*/*/*/*/*}" + execroot_path="${0%/*/*/*/*/*/*/*/*}" # Legacy path for non-bazelmod tool="${execroot_path}/${toolchain_bindir}/${tool_name}" diff --git a/cc/toolchains/llvm20/x86_64-linux/wrappers/wrapper b/cc/toolchains/llvm20/x86_64-linux/wrappers/wrapper index 8b96f2e..6eb5729 100755 --- a/cc/toolchains/llvm20/x86_64-linux/wrappers/wrapper +++ b/cc/toolchains/llvm20/x86_64-linux/wrappers/wrapper @@ -33,7 +33,10 @@ if [ -n "$SWIFTNAV_VERBOSE_TOOLCHAIN" ]; then set -x fi -tool_name=$(basename "$0") +BASENAME=/usr/bin/basename +[ -x "$BASENAME" ] || BASENAME="basename" + +tool_name=$($BASENAME "$0") # In case the tool label is changed, a change in here is very likely needed # This establishes backwards compatibility with the old WORKSPACE file toolchain_bindir=external/x86_64-linux-llvm20/bin @@ -57,7 +60,7 @@ elif case "$0" in /*) true;; *) false;; esac; then # # If the wrapper is relocated then this line needs to be adjusted. - execroot_path="${0%/*/*/*/*/*/*/*/*}" + execroot_path="${0%/*/*/*/*/*/*/*/*}" # Legacy path for non-bazelmod tool="${execroot_path}/${toolchain_bindir}/${tool_name}" diff --git a/cc/toolchains/llvm_x86_64_windows/wrappers/wrappers b/cc/toolchains/llvm_x86_64_windows/wrappers/wrappers index 92be8c8..f97fb89 100755 --- a/cc/toolchains/llvm_x86_64_windows/wrappers/wrappers +++ b/cc/toolchains/llvm_x86_64_windows/wrappers/wrappers @@ -33,7 +33,10 @@ if [ -n "$SWIFTNAV_VERBOSE_TOOLCHAIN" ]; then set -x fi -tool_name=$(basename "$0") +BASENAME=/usr/bin/basename +[ -x "$BASENAME" ] || BASENAME="basename" + +tool_name=$($BASENAME "$0") # In case the tool label is changed, a change in here is very likely needed # This establishes backwards compatibility with the old WORKSPACE file toolchain_bindir=external/llvm_mingw_toolchain/bin diff --git a/cc/toolchains/musl/aarch64/wrappers/wrapper b/cc/toolchains/musl/aarch64/wrappers/wrapper index 6338622..9c9b4fb 100755 --- a/cc/toolchains/musl/aarch64/wrappers/wrapper +++ b/cc/toolchains/musl/aarch64/wrappers/wrapper @@ -33,7 +33,10 @@ if [ -n "$SWIFTNAV_VERBOSE_TOOLCHAIN" ]; then set -x fi -tool_name=$(basename "$0") +BASENAME=/usr/bin/basename +[ -x "$BASENAME" ] || BASENAME="basename" + +tool_name=$($BASENAME "$0") toolchain_bindir=external/aarch64-linux-musl/bin toolchain_bindir_as_bzlmod="external/rules_swiftnav++swift_cc_toolchain_extension+aarch64-linux-musl/bin" @@ -55,7 +58,7 @@ elif case "$0" in /*) true;; *) false;; esac; then # # If the wrapper is relocated then this line needs to be adjusted. - execroot_path="${0%/*/*/*/*/*/*/*/*}" + execroot_path="${0%/*/*/*/*/*/*/*/*}" # Legacy path for non-bazelmod tool="${execroot_path}/${toolchain_bindir}/${tool_name}" diff --git a/cc/toolchains/musl/armhf/wrappers/wrapper b/cc/toolchains/musl/armhf/wrappers/wrapper index 82c2919..2e12662 100755 --- a/cc/toolchains/musl/armhf/wrappers/wrapper +++ b/cc/toolchains/musl/armhf/wrappers/wrapper @@ -33,7 +33,10 @@ if [ -n "$SWIFTNAV_VERBOSE_TOOLCHAIN" ]; then set -x fi -tool_name=$(basename "$0") +BASENAME=/usr/bin/basename +[ -x "$BASENAME" ] || BASENAME="basename" + +tool_name=$($BASENAME "$0") toolchain_bindir=external/arm-linux-musleabihf/bin toolchain_bindir_as_bzlmod="external/rules_swiftnav++swift_cc_toolchain_extension+arm-linux-musleabihf/bin" @@ -55,7 +58,7 @@ elif case "$0" in /*) true;; *) false;; esac; then # # If the wrapper is relocated then this line needs to be adjusted. - execroot_path="${0%/*/*/*/*/*/*/*/*}" + execroot_path="${0%/*/*/*/*/*/*/*/*}" # Legacy path for non-bazelmod tool="${execroot_path}/${toolchain_bindir}/${tool_name}" diff --git a/cc/toolchains/musl/x86_64/wrappers/wrapper b/cc/toolchains/musl/x86_64/wrappers/wrapper index fb170f4..5fc2f77 100755 --- a/cc/toolchains/musl/x86_64/wrappers/wrapper +++ b/cc/toolchains/musl/x86_64/wrappers/wrapper @@ -33,7 +33,10 @@ if [ -n "$SWIFTNAV_VERBOSE_TOOLCHAIN" ]; then set -x fi -tool_name=$(basename "$0") +BASENAME=/usr/bin/basename +[ -x "$BASENAME" ] || BASENAME="basename" + +tool_name=$($BASENAME "$0") toolchain_bindir=external/x86_64-linux-musl/bin toolchain_bindir_as_bzlmod="external/rules_swiftnav++swift_cc_toolchain_extension+x86_64-linux-musl/bin" @@ -55,7 +58,7 @@ elif case "$0" in /*) true;; *) false;; esac; then # # If the wrapper is relocated then this line needs to be adjusted. - execroot_path="${0%/*/*/*/*/*/*/*/*}" + execroot_path="${0%/*/*/*/*/*/*/*/*}" # Legacy path for non-bazelmod tool="${execroot_path}/${toolchain_bindir}/${tool_name}"