Skip to content

build: Pass --force_pic to bazel#1903

Merged
sayboras merged 1 commit into
mainfrom
bazel-force-pic
May 13, 2026
Merged

build: Pass --force_pic to bazel#1903
sayboras merged 1 commit into
mainfrom
bazel-force-pic

Conversation

@jrajahalme
Copy link
Copy Markdown
Member

@jrajahalme jrajahalme commented May 12, 2026

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 suppresses the .o compilation and saves build time.

Noticed when non-test sources (such as 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.

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>
@jrajahalme jrajahalme requested a review from a team as a code owner May 12, 2026 18:49
@jrajahalme jrajahalme requested a review from sayboras May 12, 2026 18:49
@jrajahalme jrajahalme added the enhancement New feature or request label May 12, 2026
@sayboras sayboras merged commit f7c5563 into main May 13, 2026
7 checks passed
@sayboras sayboras deleted the bazel-force-pic branch May 13, 2026 01:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants