Skip to content

Commit 507e0c1

Browse files
ohadravidgoniz
authored andcommitted
gnumake: unsets -undefined dynamic_build if found from bazel-contrib#1099
1 parent e157364 commit 507e0c1

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

foreign_cc/built_tools/make_build.bzl

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -74,17 +74,20 @@ def _make_tool_impl(ctx):
7474
arflags = [e for e in frozen_arflags]
7575
if absolute_ar == "libtool" or absolute_ar.endswith("/libtool"):
7676
arflags.append("-o")
77-
77+
78+
_joined_non_sysroot_ldflags = _join_flags_list(ctx.workspace_name, non_sysroot_ldflags)
79+
7880
if os_name(ctx) == "macos":
79-
non_sysroot_ldflags += ["-undefined", "error"]
81+
_joined_non_sysroot_ldflags = _joined_non_sysroot_ldflags.replace("-undefined dynamic_lookup", "")
82+
_joined_non_sysroot_ldflags += " -undefined error"
8083

8184
env.update({
8285
"AR": absolute_ar,
8386
"ARFLAGS": _join_flags_list(ctx.workspace_name, arflags),
8487
"CC": absolute_cc,
8588
"CFLAGS": _join_flags_list(ctx.workspace_name, non_sysroot_cflags),
8689
"LD": absolute_ld,
87-
"LDFLAGS": _join_flags_list(ctx.workspace_name, non_sysroot_ldflags),
90+
"LDFLAGS": _joined_non_sysroot_ldflags,
8891
})
8992

9093
configure_env = " ".join(["%s=\"%s\"" % (key, value) for key, value in env.items()])

0 commit comments

Comments
 (0)