From 08a11ff3efeba84a36a56025a6a25e9492dfc169 Mon Sep 17 00:00:00 2001 From: Chandler Carruth Date: Thu, 24 Sep 2026 13:51:02 +0000 Subject: [PATCH] Avoid passing `-unwindlib` on macOS where it isn't needed (#7825) Removes some warnings from our links on macs when the flag is ignored. --- bazel/cc_toolchains/cc_toolchain_cpp_features.bzl | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/bazel/cc_toolchains/cc_toolchain_cpp_features.bzl b/bazel/cc_toolchains/cc_toolchain_cpp_features.bzl index d178d156c544..3618b0bbce7f 100644 --- a/bazel/cc_toolchains/cc_toolchain_cpp_features.bzl +++ b/bazel/cc_toolchains/cc_toolchain_cpp_features.bzl @@ -321,8 +321,13 @@ def libcxx_feature(llvm_bindir = None, clang_bindir = None): "-unwindlib=libunwind", ])], with_features = [ - # libc++ is only used on non-Windows platforms. - with_feature_set(not_features = ["windows_target"]), + # libc++ is only used on non-Windows platforms, and macOS + # doesn't support a custom unwinding library (or need one) + # even when using libc++. + with_feature_set(not_features = [ + "macos_target", + "windows_target", + ]), ], ), flag_set(