Alternate to “`--whole-archive`” in bazel
问题 I want to link an external static lib in one of my bazel based c++ project. I need " whole-archive " option for linking the library like gcc or g++ build: g++ main.cc -Wl,--whole-archive -lhttp -Wl,--no-whole-archive Can anybody suggest what is the alternate to " --whole-archive " in bazel? 回答1: Sadly, alwayslink doesn't work with precompiled libraries, only with cc_library compiled and linked by Bazel. There is one undocumented hack (I guess I'm just documenting it by mentioning it here),