
Description
tl;dr: #59652 (comment)
Cannot compile firefox anymore due to:
error: linking with ... cargo-linker
error: relocation refers to local symbol "" [12], which is defined in a discarded section
UPDATE bisect shows it's PR 59401
https://bugzilla.mozilla.org/show_bug.cgi?id=1541214
old info
This issue doesn't happen with Last **good** nightly:The issue happens with
First bad nightly:
nightly-2019-03-29-x86_64-unknown-linux-gnu (default)
rustc 1.35.0-nightly (237bf32 2019-03-28)
binary: rustc
commit-hash: 237bf32
commit-date: 2019-03-28
host: x86_64-unknown-linux-gnu
release: 1.35.0-nightly
LLVM version: 8.0
nightly-2019-03-30-x86_64-unknown-linux-gnu (default)
rustc 1.35.0-nightly (e782d79 2019-03-29)
binary: rustc
commit-hash: e782d79
commit-date: 2019-03-29
host: x86_64-unknown-linux-gnu
release: 1.35.0-nightly
LLVM version: 8.0
For each test I was using the same cargo:
cargo 1.35.0-dev (025b01ed 2019-04-01)
release: 1.35.0
commit-hash: 025b01edd0bba49b7e49c1cacc65bb1f6462ee57
commit-date: 2019-04-01
Errors look like this:
0:16.63 = note: /home/user/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libcompiler_builtins-9b00dedc0dda6ebf.rlib(compiler_builtins-9b00dedc0dda6ebf.compiler_builtins.cqcjgied-cgu.0.rcgu.o)(.stack_sizes+0x0): error: relocation refers to local symbol "" [12], which is defined in a discarded section
0:16.84 section group signature: "(null)"
0:16.84 /home/user/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libstd-e4188d26f42911c5.rlib(std-e4188d26f42911c5.std.b8iklw2d-cgu.0.rcgu.o)(.stack_sizes+0x1b): error: relocation refers to local symbol "" [696], which is defined in a discarded section
0:16.84 section group signature: "(null)"
Activity
ghost commentedon Apr 3, 2019
UPDATE: ignore this comment.
I was wrong about first bad nightly: it's not
nightly-2019-03-29-x86_64-unknown-linux-gnu
but instead it's:And
nightly-2019-03-29-x86_64-unknown-linux-gnu
is a good nightly.(confirmed firefox compilation succeeded with it!)I'm still double-checking but it takes some time...doneI'm also trying to do a rust bisect (even more time) [does anyone know if I have to do a
git submodule update
after eachgit bisect good/bad
? answer: not really,./x.py build
does it automatically for changed submodules, but just to be sure I'm doinggit submodule update --init --recursive --progress
followed by./x.py clean && time ./x.py build --stage 1 -j 5
then clean firefox build dir(ie. remove it) and retry compiling, error usually appears after 8mins, but to be sure I've to leave it compiling for like 23mins]mati865 commentedon Apr 3, 2019
You might want to use https://github.com/rust-lang-nursery/cargo-bisect-rustc/blob/master/TUTORIAL.md
ghost commentedon Apr 3, 2019
8b8488c is the first bad commit, made from PR #59401
Just tested commit f8673e0 (HEAD -> master, origin/master, origin/HEAD)
with this patch applied:
and can confirm that firefox compiled past the issue.
Will test without the patch next...done: confirmed the issue exists without the above patch!
Will test again with the patch and allow firefox to fully compile&install (done, it worked!)
mati865 commentedon Apr 4, 2019
CC @japaric
pnkfelix commentedon Apr 4, 2019
triage: P-high. Leaving nominated for now (What is going on here with
-Z emit-stack-sizes
...?)japaric commentedon Apr 9, 2019
Sorry for the breakage here. If PR #59401 is blocking anything feel free to revert it. It will probably be several days before I have some free time to dig into this (though my guess is that one of the extra, custom linker flags that firefox uses in their builds (see
MOZ_CARGO_WRAP_LDFLAGS
in the linked bugzilla ticket) is not playing nicely with the new .stack_sizes section)ghost commentedon Apr 10, 2019
If I remove
-Wl,--gc-sections
from the args tocargo-linker
then the issue doesn't happen!--gc-sections
is set not byMOZ_CARGO_WRAP_LDFLAGS
but rather bylib/librustc_codegen_ssa-6bcbc85a2479ae62.so
(I know because it's the only place I hexedited it to--hc-sections
and got/usr/bin/ld.gold: --hc-sections: unknown option
, and it also shows in the exact same place in the args tocargo-linker
)ghost commentedon Apr 10, 2019
Apparently one of these:
rust/src/librustc_codegen_ssa/back/linker.rs
Lines 297 to 305 in 3750348
rust/src/librustc_codegen_ssa/back/linker.rs
Lines 950 to 952 in 3750348
ghost commentedon Apr 10, 2019
By adding a digit to each of those two
--gc-sections
occurrences, recompiling rust and rerunning the (uhm, commented out line of the)script above(actually see the section at the end of this comment for the exact script) I determined it's exactly the first one, that is, this:rust/src/librustc_codegen_ssa/back/linker.rs
Lines 297 to 305 in 3750348
Does anyone think that maybe it's
--gc-sections
in combination with some other arg that's causing the issue? Or wants me to try something else? or can someone provide a simpler reproduction sample? Either way I'm out of ideas ;-)actual script ran
31 remaining items