cc_library(
name = "foo",
src = ["libfoo.a"],
visibility = ["//visibility:public"],
)
My C++ binary then depends on it and it gets linked in. However I need the library to be linked with "--whole-archive" option since it contains a bunch of object files that used "__attribute__((constructor))" but are not otherwise referenced.
What I'd like the GCC to execute at link time is:
-Wl,--whole-archive libfoo.a -Wl,--no-whole-archive
but I don't know how to specify it. As far as I see, linkopts does not let me specify which options to add before and which ones after.
Is there a workaround?
Thanks,
Eugene
--
You received this message because you are subscribed to the Google Groups "bazel-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to bazel-discus...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/bazel-discuss/6bc5c39a-4602-4090-b887-b7f9966982f4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "bazel-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to bazel-discus...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/bazel-discuss/32a0142d-ef96-45f9-bfe8-61998cb7dcab%40googlegroups.com.