Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove use of -undefined dynamic_lookup on darwin #189

Merged
merged 5 commits into from
Jul 17, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion tests/scripts/bazel.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ readonly url="https://github.com/bazelbuild/bazelisk/releases/download/${bazelis
bazel="${TMPDIR:-/tmp}/bazelisk"
readonly bazel

readonly common_test_args=(
common_test_args=(
--incompatible_enable_cc_toolchain_resolution
--symlink_prefix=/
--color=yes
Expand All @@ -40,6 +40,12 @@ readonly common_test_args=(
--test_output=errors
)

# TODO: Remove this once we no longer support bazel 6.x.
# This feature isn't intentionally supported on macOS.
if [[ $(uname -s) == 'Darwin' ]]; then
common_test_args+=(--features=-supports_dynamic_linker)
fi

# Do not run autoconf to configure local CC toolchains.
export BAZEL_DO_NOT_DETECT_CPP_TOOLCHAIN=1

Expand Down
6 changes: 1 addition & 5 deletions toolchain/cc_toolchain_config.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -156,11 +156,7 @@ def cc_toolchain_config(
use_lld = False
link_flags.extend([
"-headerpad_max_install_names",
# This will issue a warning on macOS ventura; see:
# https://github.com/python/cpython/issues/97524
# https://developer.apple.com/forums/thread/719961
"-undefined",
"dynamic_lookup",
"-fobjc-link-runtime",
])
else:
# Note that for xcompiling from darwin to linux, the native ld64 is
Expand Down