From cac46994c9db9531813c9a80b5b1ca9c26f05240 Mon Sep 17 00:00:00 2001 From: Thomas <9749173+uhthomas@users.noreply.github.com> Date: Tue, 19 Apr 2022 16:54:23 +0100 Subject: [PATCH] Pass '-undefined error' non sysroot ldflag on macOS (#894) --- foreign_cc/built_tools/make_build.bzl | 3 +++ 1 file changed, 3 insertions(+) diff --git a/foreign_cc/built_tools/make_build.bzl b/foreign_cc/built_tools/make_build.bzl index cc15a55a..90667fcf 100644 --- a/foreign_cc/built_tools/make_build.bzl +++ b/foreign_cc/built_tools/make_build.bzl @@ -71,6 +71,9 @@ def _make_tool_impl(ctx): if absolute_ar == "libtool" or absolute_ar.endswith("/libtool"): arflags.append("-o") + if os_name(ctx) == "macos": + non_sysroot_ldflags += ["-undefined", "error"] + env.update({ "AR": absolute_ar, "ARFLAGS": _join_flags_list(ctx.workspace_name, arflags),