Skip to content

Commit

Permalink
Workaround for Bazel issue #8672 (broken fully_static_link)
Browse files Browse the repository at this point in the history
This is tracked at
bazelbuild/bazel#8672

and should only affect the tests for now.

PiperOrigin-RevId: 254943708
Change-Id: Iee18a3b8c1b570c7d04d09d533ecff33c3de7d57
  • Loading branch information
cblichmann authored and copybara-github committed Jun 25, 2019
1 parent 97b5f07 commit 0c4a803
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions sandboxed_api/sandbox2/testcases/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -103,6 +106,7 @@ cc_binary(
"-pie",
"fully_static_link", # link libc statically
],
linkopts = EXTRA_FULLY_STATIC_LINKOPTS,
linkstatic = 1, # prefer static libraries
)

Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand Down

0 comments on commit 0c4a803

Please sign in to comment.