Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 1 addition & 7 deletions bazel/external/Dockerfile.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -74,13 +74,7 @@ RUN git apply /tmp/bazel-v7.7.1.patch && \
# Use clang instead of gcc as it's more stable under QEMU emulation
ENV CC=clang
ENV CXX=clang++
ENV EXTRA_BAZEL_ARGS="--tool_java_runtime_version=local_jdk \
--jobs=1 \
--local_ram_resources=2048 \
-c dbg \
--host_compilation_mode=dbg \
--copt=-O0 --host_copt=-O0 \
--copt=-g0 --host_copt=-g0"
ENV EXTRA_BAZEL_ARGS="--tool_java_runtime_version=local_jdk"
RUN bash ./compile.sh && \
cp /tmp/src/bazel/output/bazel /tmp/bazel && \
chmod +x /tmp/bazel && \
Expand Down
29 changes: 0 additions & 29 deletions bazel/external/bazel-v7.7.1.patch
Original file line number Diff line number Diff line change
Expand Up @@ -22,32 +22,3 @@ index 0a5ea5b..82411c9 100755

local_path_override(
module_name = "remoteapis",
diff --git a/tools/cpp/bsd_cc_toolchain_config.bzl b/tools/cpp/bsd_cc_toolchain_config.bzl
index 8dbecd9..7f5ab3e 100755
--- a/tools/cpp/bsd_cc_toolchain_config.bzl
+++ b/tools/cpp/bsd_cc_toolchain_config.bzl
@@ -149,7 +149,7 @@ def _impl(ctx):
flag_group(
flags = [
"-g0",
- "-O2",
+ "-O0",
"-DNDEBUG",
"-ffunction-sections",
"-fdata-sections",
diff --git a/tools/cpp/unix_cc_configure.bzl b/tools/cpp/unix_cc_configure.bzl
index bbbba7e..d2b37ee 100755
--- a/tools/cpp/unix_cc_configure.bzl
+++ b/tools/cpp/unix_cc_configure.bzl
@@ -688,10 +688,7 @@ def configure_unix_toolchain(repository_ctx, cpu_value, overriden_tools):
# handling in Bazel.
"-g0",

- # Conservative choice for -O
- # -O3 can increase binary size and even slow down the resulting binaries.
- # Profile first and / or use FDO if you need better performance than this.
- "-O2",
+ "-O0",

# Security hardening on by default.
# Conservative choice; -D_FORTIFY_SOURCE=2 may be unsafe in some cases.
Loading