From c069bd19ecb97525911ae262a00dac5b08660405 Mon Sep 17 00:00:00 2001 From: Thomas Date: Tue, 19 Apr 2022 16:43:55 +0100 Subject: [PATCH] Pass '-undefined error' non sysroot ldflag on macOS --- 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 cc15a55a6..90667fcf1 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),