From 0c4a80352703d2137601a81ee774911aa9fe1391 Mon Sep 17 00:00:00 2001 From: Christian Blichmann Date: Tue, 25 Jun 2019 04:31:56 -0700 Subject: [PATCH] Workaround for Bazel issue #8672 (broken fully_static_link) This is tracked at https://github.com/bazelbuild/bazel/issues/8672 and should only affect the tests for now. PiperOrigin-RevId: 254943708 Change-Id: Iee18a3b8c1b570c7d04d09d533ecff33c3de7d57 --- sandboxed_api/sandbox2/testcases/BUILD.bazel | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/sandboxed_api/sandbox2/testcases/BUILD.bazel b/sandboxed_api/sandbox2/testcases/BUILD.bazel index 4cd91e7..83c4021 100644 --- a/sandboxed_api/sandbox2/testcases/BUILD.bazel +++ b/sandboxed_api/sandbox2/testcases/BUILD.bazel @@ -40,6 +40,9 @@ STATIC_LINKOPTS = [ "-Wl,--no-whole-archive", ] +# TODO(https://github.com/bazelbuild/bazel/issues/8672): Remove this workaround +EXTRA_FULLY_STATIC_LINKOPTS = ["-l:libstdc++.a"] + cc_binary( name = "abort", testonly = 1, @@ -71,7 +74,7 @@ cc_binary( "-pie", "fully_static_link", # link libc statically ], - linkopts = STATIC_LINKOPTS, + linkopts = STATIC_LINKOPTS + EXTRA_FULLY_STATIC_LINKOPTS, linkstatic = 1, # prefer static libraries deps = [ "//sandboxed_api/sandbox2:buffer", @@ -103,6 +106,7 @@ cc_binary( "-pie", "fully_static_link", # link libc statically ], + linkopts = EXTRA_FULLY_STATIC_LINKOPTS, linkstatic = 1, # prefer static libraries ) @@ -149,7 +153,7 @@ cc_binary( "-pie", "fully_static_link", # link libc statically ], - linkopts = STATIC_LINKOPTS, + linkopts = STATIC_LINKOPTS + EXTRA_FULLY_STATIC_LINKOPTS, linkstatic = 1, # prefer static libraries deps = [ "//sandboxed_api/sandbox2:client", @@ -220,6 +224,7 @@ cc_binary( "-pie", "fully_static_link", # link libc statically ], + linkopts = EXTRA_FULLY_STATIC_LINKOPTS, linkstatic = 1, # prefer static libraries deps = [ "//sandboxed_api/sandbox2/util:temp_file",