From 823f6ddb22c554131997f02414bf7174d08d9f4e Mon Sep 17 00:00:00 2001 From: notoriaga Date: Thu, 11 Sep 2025 13:27:56 -0700 Subject: [PATCH 1/9] use /usr/bin/basename for rules_cc --- cc/toolchains/gcc_arm_embedded/wrappers/wrapper | 7 +++++-- cc/toolchains/gcc_arm_gnu_8_3/wrappers/wrapper | 7 +++++-- cc/toolchains/llvm/aarch64-darwin/wrappers/wrapper | 7 +++++-- cc/toolchains/llvm/aarch64-linux/wrappers/wrapper | 7 +++++-- cc/toolchains/llvm/x86_64-aarch64-linux/wrappers/wrapper | 7 +++++-- cc/toolchains/llvm/x86_64-darwin/wrappers/wrapper | 5 ++++- cc/toolchains/llvm/x86_64-linux/wrappers/wrapper | 7 +++++-- cc/toolchains/llvm20/aarch64-darwin/wrappers/wrapper | 7 +++++-- cc/toolchains/llvm20/aarch64-linux/wrappers/wrapper | 9 ++++++--- .../llvm20/x86_64-aarch64-linux/wrappers/wrapper | 9 ++++++--- cc/toolchains/llvm20/x86_64-darwin/wrappers/wrapper | 9 ++++++--- cc/toolchains/llvm20/x86_64-linux/wrappers/wrapper | 7 +++++-- cc/toolchains/llvm_x86_64_windows/wrappers/wrappers | 5 ++++- cc/toolchains/musl/aarch64/wrappers/wrapper | 7 +++++-- cc/toolchains/musl/armhf/wrappers/wrapper | 7 +++++-- cc/toolchains/musl/x86_64/wrappers/wrapper | 7 +++++-- 16 files changed, 81 insertions(+), 33 deletions(-) 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/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}" From 03fec384676e47e8080b278ec051ff4854a4b3a3 Mon Sep 17 00:00:00 2001 From: notoriaga Date: Thu, 11 Sep 2025 15:39:24 -0700 Subject: [PATCH 2/9] add missing ld.lld template --- cc/toolchains/llvm/aarch64-darwin/wrappers/ld.lld | 1 + 1 file changed, 1 insertion(+) create mode 120000 cc/toolchains/llvm/aarch64-darwin/wrappers/ld.lld diff --git a/cc/toolchains/llvm/aarch64-darwin/wrappers/ld.lld b/cc/toolchains/llvm/aarch64-darwin/wrappers/ld.lld new file mode 120000 index 0000000..22cb46f --- /dev/null +++ b/cc/toolchains/llvm/aarch64-darwin/wrappers/ld.lld @@ -0,0 +1 @@ +wrapper \ No newline at end of file From 5db66a085617894203790fbb30b415387b562584 Mon Sep 17 00:00:00 2001 From: notoriaga Date: Thu, 11 Sep 2025 15:48:28 -0700 Subject: [PATCH 3/9] also ld? --- cc/toolchains/llvm/aarch64-darwin/wrappers/ld | 1 + 1 file changed, 1 insertion(+) create mode 120000 cc/toolchains/llvm/aarch64-darwin/wrappers/ld diff --git a/cc/toolchains/llvm/aarch64-darwin/wrappers/ld b/cc/toolchains/llvm/aarch64-darwin/wrappers/ld new file mode 120000 index 0000000..22cb46f --- /dev/null +++ b/cc/toolchains/llvm/aarch64-darwin/wrappers/ld @@ -0,0 +1 @@ +wrapper \ No newline at end of file From 72f0a9d4b5bad9776f1f793e287e5b80c92e2fee Mon Sep 17 00:00:00 2001 From: notoriaga Date: Thu, 11 Sep 2025 16:03:05 -0700 Subject: [PATCH 4/9] update linker files --- cc/toolchains/llvm/aarch64-darwin/BUILD.bazel | 3 ++- cc/toolchains/llvm/aarch64-darwin/wrappers/ld | 1 - 2 files changed, 2 insertions(+), 2 deletions(-) delete mode 120000 cc/toolchains/llvm/aarch64-darwin/wrappers/ld diff --git a/cc/toolchains/llvm/aarch64-darwin/BUILD.bazel b/cc/toolchains/llvm/aarch64-darwin/BUILD.bazel index 0b66795..4b24f4f 100644 --- a/cc/toolchains/llvm/aarch64-darwin/BUILD.bazel +++ b/cc/toolchains/llvm/aarch64-darwin/BUILD.bazel @@ -60,6 +60,7 @@ filegroup( ":wrappers", "@aarch64-darwin-llvm//:ar", "@aarch64-darwin-llvm//:clang", + "@aarch64-darwin-llvm//:ld", "@aarch64-darwin-llvm//:lib", ], ) @@ -111,7 +112,7 @@ cc_toolchain_config( "gcov": "wrappers/llvm-profdata", "llvm-cov": "wrappers/llvm-cov", "llvm-profdata": "wrappers/llvm-profdata", - "ld": "/usr/bin/ld", + "ld": "wrappers/ld.ldd", "nm": "wrappers/llvm-nm", "objcopy": "wrappers/llvm-objcopy", "objdump": "wrappers/llvm-objdump", diff --git a/cc/toolchains/llvm/aarch64-darwin/wrappers/ld b/cc/toolchains/llvm/aarch64-darwin/wrappers/ld deleted file mode 120000 index 22cb46f..0000000 --- a/cc/toolchains/llvm/aarch64-darwin/wrappers/ld +++ /dev/null @@ -1 +0,0 @@ -wrapper \ No newline at end of file From d28700e0b391f4ab2672b52f8ccbf6255a83a64c Mon Sep 17 00:00:00 2001 From: notoriaga Date: Thu, 11 Sep 2025 16:07:22 -0700 Subject: [PATCH 5/9] try use_lld --- cc/toolchains/llvm/aarch64-darwin/BUILD.bazel | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cc/toolchains/llvm/aarch64-darwin/BUILD.bazel b/cc/toolchains/llvm/aarch64-darwin/BUILD.bazel index 4b24f4f..9fc8eaa 100644 --- a/cc/toolchains/llvm/aarch64-darwin/BUILD.bazel +++ b/cc/toolchains/llvm/aarch64-darwin/BUILD.bazel @@ -120,7 +120,7 @@ cc_toolchain_config( }, toolchain_identifier = "clang-aarch64-darwin", toolchain_path_prefix = "external/aarch64-darwin-llvm", - use_lld = False, + use_lld = True, ) cc_toolchain( From c4ede37f113274e5cd2b2525aead5a833a57914e Mon Sep 17 00:00:00 2001 From: notoriaga Date: Thu, 11 Sep 2025 16:10:11 -0700 Subject: [PATCH 6/9] ld? --- cc/toolchains/llvm/aarch64-darwin/BUILD.bazel | 4 ++-- cc/toolchains/llvm/aarch64-darwin/wrappers/{ld.lld => ld} | 0 2 files changed, 2 insertions(+), 2 deletions(-) rename cc/toolchains/llvm/aarch64-darwin/wrappers/{ld.lld => ld} (100%) diff --git a/cc/toolchains/llvm/aarch64-darwin/BUILD.bazel b/cc/toolchains/llvm/aarch64-darwin/BUILD.bazel index 9fc8eaa..6436fa5 100644 --- a/cc/toolchains/llvm/aarch64-darwin/BUILD.bazel +++ b/cc/toolchains/llvm/aarch64-darwin/BUILD.bazel @@ -112,7 +112,7 @@ cc_toolchain_config( "gcov": "wrappers/llvm-profdata", "llvm-cov": "wrappers/llvm-cov", "llvm-profdata": "wrappers/llvm-profdata", - "ld": "wrappers/ld.ldd", + "ld": "wrappers/ld", "nm": "wrappers/llvm-nm", "objcopy": "wrappers/llvm-objcopy", "objdump": "wrappers/llvm-objdump", @@ -120,7 +120,7 @@ cc_toolchain_config( }, toolchain_identifier = "clang-aarch64-darwin", toolchain_path_prefix = "external/aarch64-darwin-llvm", - use_lld = True, + use_lld = False, ) cc_toolchain( diff --git a/cc/toolchains/llvm/aarch64-darwin/wrappers/ld.lld b/cc/toolchains/llvm/aarch64-darwin/wrappers/ld similarity index 100% rename from cc/toolchains/llvm/aarch64-darwin/wrappers/ld.lld rename to cc/toolchains/llvm/aarch64-darwin/wrappers/ld From bd38e4323b7749e3f181d7000e4306b1401fd2b5 Mon Sep 17 00:00:00 2001 From: notoriaga Date: Thu, 11 Sep 2025 16:16:31 -0700 Subject: [PATCH 7/9] revert --- MODULE.bazel.lock | 4 ++-- cc/toolchains/llvm/aarch64-darwin/BUILD.bazel | 2 +- cc/toolchains/llvm/aarch64-darwin/wrappers/ld | 1 - 3 files changed, 3 insertions(+), 4 deletions(-) delete mode 120000 cc/toolchains/llvm/aarch64-darwin/wrappers/ld 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/llvm/aarch64-darwin/BUILD.bazel b/cc/toolchains/llvm/aarch64-darwin/BUILD.bazel index 6436fa5..5786d66 100644 --- a/cc/toolchains/llvm/aarch64-darwin/BUILD.bazel +++ b/cc/toolchains/llvm/aarch64-darwin/BUILD.bazel @@ -112,7 +112,7 @@ cc_toolchain_config( "gcov": "wrappers/llvm-profdata", "llvm-cov": "wrappers/llvm-cov", "llvm-profdata": "wrappers/llvm-profdata", - "ld": "wrappers/ld", + "ld": "/usr/bin/ld", "nm": "wrappers/llvm-nm", "objcopy": "wrappers/llvm-objcopy", "objdump": "wrappers/llvm-objdump", diff --git a/cc/toolchains/llvm/aarch64-darwin/wrappers/ld b/cc/toolchains/llvm/aarch64-darwin/wrappers/ld deleted file mode 120000 index 22cb46f..0000000 --- a/cc/toolchains/llvm/aarch64-darwin/wrappers/ld +++ /dev/null @@ -1 +0,0 @@ -wrapper \ No newline at end of file From 3174c21db9da0e2f13d45af54f2d1eb415ef79df Mon Sep 17 00:00:00 2001 From: notoriaga Date: Thu, 11 Sep 2025 16:24:00 -0700 Subject: [PATCH 8/9] add bin path to clang --- cc/toolchains/llvm/cc_toolchain_config.bzl | 1 + 1 file changed, 1 insertion(+) 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", ]) From 676f5783f1aad9e277589d458dace1b3c6aa56d8 Mon Sep 17 00:00:00 2001 From: notoriaga Date: Thu, 11 Sep 2025 18:38:36 -0700 Subject: [PATCH 9/9] remove ld label from linker_files --- cc/toolchains/llvm/aarch64-darwin/BUILD.bazel | 1 - 1 file changed, 1 deletion(-) diff --git a/cc/toolchains/llvm/aarch64-darwin/BUILD.bazel b/cc/toolchains/llvm/aarch64-darwin/BUILD.bazel index 5786d66..0b66795 100644 --- a/cc/toolchains/llvm/aarch64-darwin/BUILD.bazel +++ b/cc/toolchains/llvm/aarch64-darwin/BUILD.bazel @@ -60,7 +60,6 @@ filegroup( ":wrappers", "@aarch64-darwin-llvm//:ar", "@aarch64-darwin-llvm//:clang", - "@aarch64-darwin-llvm//:ld", "@aarch64-darwin-llvm//:lib", ], )