Skip to content

Commit f7c5563

Browse files
jrajahalmesayboras
authored andcommitted
build: Pass --force_pic to bazel
We already pass the -fPIC option in envoy.bazelrc (build:linux --copt=-fPIC) to the compiler, but bazel does not know about it and still builds both .pic.o and .o objects. Passing --force_pic to bazel supresses the .o compilation and saves build time. Noticed when non-test sources (such as Compiling source/common/network/address_impl.cc) were compiled for tests right after cilium-envoy was built. With the --force_pic option the tests build shows building only test files. Signed-off-by: Jarno Rajahalme <jarno@isovalent.com>
1 parent 94c2d1b commit f7c5563

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

.bazelrc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@ import %workspace%/envoy.bazelrc
1010
build --incompatible_enable_cc_toolchain_resolution
1111
build --platform_mappings=bazel/platform_mappings
1212

13+
# envoy.bazelrc always sets -fPIC, tell bazel about it to suppress building both .o and .pic.o
14+
# objects from the same C++ sources.
15+
build --force_pic
16+
1317
# Enable path normalization by default.
1418
# See: https://github.com/envoyproxy/envoy/pull/6519
1519
build --define path_normalization_by_default=true

0 commit comments

Comments
 (0)