Skip to content

Commit

Permalink
#Centipede Move runner-only linkopts to the related targets.
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 686689166
  • Loading branch information
xinhaoyuan authored and copybara-github committed Oct 16, 2024
1 parent 3b21c1e commit 44f5a57
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 3 deletions.
2 changes: 0 additions & 2 deletions .bazelrc
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,6 @@ build --host_cxxopt=-std=c++17
build --define absl=1

build:macos --macos_minimum_os=10.15
# For compatible behavior on weak symbols.
build:macos --linkopt=-Wl,-undefined,dynamic_lookup

# To create this file, please run:
#
Expand Down
5 changes: 4 additions & 1 deletion centipede/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -1034,7 +1034,10 @@ RUNNER_LINKOPTS = [
"-ldl", # for dlsym
"-lpthread", # for pthread_once
] + select({
"@platforms//os:macos": [],
"@platforms//os:macos": [
# For compatible behavior on weak symbols.
"-Wl,-undefined,dynamic_lookup",
],
"//conditions:default": [
"-lrt", # for shm_open
],
Expand Down
9 changes: 9 additions & 0 deletions centipede/testing/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,15 @@ cc_library(

cc_shared_library(
name = "multi_dso_target_shared_lib",
user_link_flags = select(
{
"@platforms//os:macos": [
# For compatible behavior on weak symbols.
"-Wl,-undefined,dynamic_lookup",
],
"//conditions:default": [],
},
),
deps = [":multi_dso_target_lib"],
)

Expand Down

0 comments on commit 44f5a57

Please sign in to comment.