Skip to content

Commit f0d99c2

Browse files
committed
link everything statically
1 parent 69a8f61 commit f0d99c2

File tree

2 files changed

+12
-6
lines changed

2 files changed

+12
-6
lines changed

cc/defs.bzl

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -220,6 +220,8 @@ def swift_c_library(**kwargs):
220220

221221
kwargs["tags"] = [LIBRARY] + kwargs.get("tags", [])
222222

223+
kwargs["linkstatic"] = kwargs.get("linkstatic", True)
224+
223225
native.cc_library(**kwargs)
224226

225227
def swift_cc_library(**kwargs):
@@ -271,6 +273,8 @@ def swift_cc_library(**kwargs):
271273

272274
kwargs["tags"] = [LIBRARY] + kwargs.get("tags", [])
273275

276+
kwargs["linkstatic"] = kwargs.get("linkstatic", True)
277+
274278
native.cc_library(**kwargs)
275279

276280
def swift_c_tool_library(**kwargs):
@@ -313,6 +317,8 @@ def swift_c_tool_library(**kwargs):
313317

314318
kwargs["copts"] = copts + c_standard + kwargs.get("copts", [])
315319

320+
kwargs["linkstatic"] = kwargs.get("linkstatic", True)
321+
316322
native.cc_library(**kwargs)
317323

318324
def swift_cc_tool_library(**kwargs):
@@ -358,6 +364,8 @@ def swift_cc_tool_library(**kwargs):
358364

359365
kwargs["copts"] = copts + cxxopts + kwargs.get("copts", [])
360366

367+
kwargs["linkstatic"] = kwargs.get("linkstatic", True)
368+
361369
native.cc_library(**kwargs)
362370

363371
def swift_c_binary(**kwargs):
@@ -404,6 +412,8 @@ def swift_c_binary(**kwargs):
404412

405413
kwargs["tags"] = [BINARY] + kwargs.get("tags", [])
406414

415+
kwargs["linkstatic"] = kwargs.get("linkstatic", True)
416+
407417
native.cc_binary(**kwargs)
408418

409419
def swift_cc_binary(**kwargs):
@@ -568,6 +578,8 @@ def swift_cc_test_library(**kwargs):
568578

569579
kwargs["target_compatible_with"] = kwargs.get("target_compatible_with", []) + _test_compatible_with()
570580

581+
kwargs["linkstatic"] = kwargs.get("linkstatic", True)
582+
571583
native.cc_library(**kwargs)
572584

573585
def swift_cc_test(name, type, **kwargs):

cc/toolchains/llvm/cc_toolchain_config.bzl

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -108,12 +108,6 @@ def cc_toolchain_config(
108108
use_lld = False
109109
link_flags.extend([
110110
"-headerpad_max_install_names",
111-
# This will issue a warning on macOS ventura; see:
112-
# https://github.com/python/cpython/issues/97524
113-
# https://developer.apple.com/forums/thread/719961
114-
"-undefined",
115-
"dynamic_lookup",
116-
"-Wl,-no_fixup_chains",
117111
])
118112
else:
119113
use_lld = True

0 commit comments

Comments
 (0)