Skip to content

Commit f104d11

Browse files
Add --config no_sframe to work around linker errors.
Introduces a `no_sframe` config in `.bazelrc` to disable SFrame (Simple Frame) generation using `-Wa,--gsframe=no`. This helps resolve linker errors like "relocation refers to a discarded section" that can occur with GCC 15+ and LLD 19+ in non-release builds. The build documentation is updated to include this troubleshooting step. SFrame (Simple Frame): https://sourceware.org/binutils/wiki/sframe #codehealth PiperOrigin-RevId: 919460188
1 parent 0e3d3d0 commit f104d11

2 files changed

Lines changed: 13 additions & 0 deletions

File tree

docs/build_mozc_for_linux.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,16 @@ configurations. Try the following command to
130130
bazelisk clean --expunge
131131
```
132132

133+
### Troubleshooting: Linker error `relocation refers to a discarded section`
134+
135+
If you encounter linker errors related to `.sframe` sections (e.g., `relocation
136+
refers to a discarded section` when using GCC 15+ and LLD 19+ in non-release
137+
builds), you can append `--config no_sframe` to disable SFrame generation:
138+
139+
```sh
140+
bazelisk build package --config no_sframe
141+
```
142+
133143
### How to customize installation locations
134144

135145
Here is a table of contents in `mozc.zip` and their actual build target names.

src/.bazelrc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,3 +82,6 @@ build:win_universal_installer --//:win_universal_installer
8282
build:android_env --copt "-DOS_ANDROID"
8383
build:android_env --build_tag_filters=-noandroid
8484
test:android_env --test_tag_filters=-noandroid
85+
86+
## SFrame relocation errors workaround for GCC 15+ and LLD 19+
87+
build:no_sframe --copt="-Wa,--gsframe=no" --host_copt="-Wa,--gsframe=no"

0 commit comments

Comments
 (0)