Skip to content

Commit bd84959

Browse files
authored
Fix bazel build gcc 15 (#185)
1 parent 393b365 commit bd84959

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

.bazelrc

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,13 @@
11
common --enable_bzlmod --enable_workspace
2+
3+
# Automatically apply build:<os> sections based on host OS.
4+
common --enable_platform_specific_config
5+
26
build --cxxopt='-std=c++20'
7+
8+
# Needed to fix issues like this which arose in GCC 15 on Linux:
9+
# "error: relocation refers to local symbol [...], which is defined in a discarded section"
10+
# We keep it linux-only so macos does not receive GNU ld flags
11+
build:linux --copt=-ffunction-sections
12+
build:linux --copt=-fdata-sections
13+
build:linux --linkopt=-Wl,--gc-sections

0 commit comments

Comments
 (0)