From fea54ab97f8309f7258b19e7a6519032b7403ed6 Mon Sep 17 00:00:00 2001 From: mehrdadn Date: Tue, 11 Feb 2020 12:11:53 -0800 Subject: [PATCH] Use --force_pic to prevent Bazel from compiling the same files twice, which slows down the build considerably. (#7116) --- .bazelrc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.bazelrc b/.bazelrc index 2aef06b72..622921140 100644 --- a/.bazelrc +++ b/.bazelrc @@ -11,6 +11,9 @@ build --action_env=USE_CLANG_CL=1 build:linux --compilation_mode=opt build:macos --compilation_mode=opt build:windows --compilation_mode=fastbuild +# This workaround is needed to prevent Bazel from compiling the same file twice (once PIC and once not). +build:linux --force_pic +build:macos --force_pic # TODO(mehrdadn): Revert the "-\\.(asm|S)$" exclusion when this Bazel bug # for compiling assembly files is fixed on Windows: # https://github.com/bazelbuild/bazel/issues/8924