Skip to content

Commit faa5a49

Browse files
jmragutkin
authored andcommitted
.blazerc: Work around gcc/binutils version mismatch
GCC 15+ assembler generates `.sframe` stack trace sections by default. With binutils 2.45, the linker fails to handle `.sframe` references correctly during COMDAT section discarding ("relocation refers to local symbol... which is defined in a discarded section"). We disable `.sframe` generation in the assembler to fix the build. This can be removed when it no longer gives an error on gLinux Rodete. gcc 15.2.0 and binutils 2.45 gives an error. Add --config=host_gcc with this work-around and use it in test_bazel.sh. Both --config=llvm and --config=gcc are broken now, for different reasons. PiperOrigin-RevId: 881499803
1 parent 9deb58f commit faa5a49

File tree

2 files changed

+13
-2
lines changed

2 files changed

+13
-2
lines changed

.bazelrc

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,15 @@ build:gcc_clang --cxxopt=-Wno-overloaded-virtual
4343
build:gcc_clang --cxxopt=-Wno-defaulted-function-deleted
4444
build:gcc_clang --cxxopt=-Wno-nullability-completeness
4545

46+
# WORKAROUND: GCC 15+ assembler generates `.sframe` stack trace sections by
47+
# default. The linker fails to handle `.sframe` references correctly during
48+
# COMDAT section discarding ("relocation refers to local symbol... which is
49+
# defined in a discarded section"). We disable `.sframe` generation in the
50+
# assembler to fix the build. This can be removed when it no longer gives
51+
# an error on gLinux Rodete. gcc 15.2.0 and binutils 2.45 gives an error.
52+
# TOD0: b/491436022 - Try again with binutils 2.46.
53+
build:host_gcc --cxxopt=-Wa,--gsframe=no
54+
4655
# ------------------------------------------------------------------------------
4756
# Options for Linux.
4857
# ------------------------------------------------------------------------------

scripts/test_bazel.sh

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,10 @@ set -euxo pipefail
1818

1919
echo "--- Running Bazel tests ---"
2020

21-
# Mirroring the bazel_x64_linux workflow.
22-
bazel test -c fastbuild --config=dev \
21+
# Mirroring the bazel_x64_linux workflow, but we need --config=gcc
22+
# to be safe and work around the gcc/binutils version mismatch.
23+
# (See .bazelrc.)
24+
bazel test -c fastbuild --config=dev --config=host_gcc \
2325
--test_size_filters=-enormous \
2426
--test_output=errors \
2527
//openfst/...

0 commit comments

Comments
 (0)