Repository navigation
Bootstrapping i686->i686 on x86_64 host fails in stage0 #36800
Description
Activity
Interesting! I've never seen this error before:
/usr/bin/ld: /.../libstd-015eff4399913833.so: __moddi3: invalid version 21 (max 0)I wonder if may be we're compiling compiler-rt incorrectly?
cc @japaric
Removing a number of assembly specialisations for i386 makes stuff compile.
Perhaps gcc-rs doesn't correctly handle assembly when TARGET=i386 and HOST=x86_64. Because this sounds like the assembly may be being turned into a 64-bit ELF or something like that? (I could be talking nonsense here)
Some manual bisection shows that it stared happening after rust_builtins PR got merged.
You mean #35021? We were already using gcc-rs before that landed. Perhaps I mis-copy-pasted some code from
bootstrap?@nagisa This outcome is with rustbuild, right?
You mean #35021?
Yes
This outcome is with rustbuild, right?
Yes, as can clearly be seen from the command line invocation. Keep in mind that this bootstraps from i686 beta compiler (i.e. i686 -> i686).
turned into a 64-bit ELF or something like that?
Object files with failing functions were
elf32-i386and contain 32bit code, though I can’t say for sure if all that stayed intact after they got packed into some archive somewhere.in stage0
Ohhh, I think I know what's happening. Because the compiler still passes -lcompiler-rt in stage0 (more precisely, when building stage1 using stage0 compiler) but building std doesn't generate that artifact, we copy stage0 (the snapshot) libcompiler-rt.a into stage1 build artifacts. The logic for that is probably not correct for this case and we are
usingcopying the 64-bit version of libcompiler-rt.a instead of the 32-bit version --bootstrapshould have downloaded a 32-bit version of stage0, right?Instead of tweaking that logic we could simply create an empty libcompiler-rt.a and place that in stage1 build artifacts when we build stage1 compiler (before stage1 std). That should also work.
Oh that makes sense. This'll also get fixed on master very soon when we update the bootstrap compiler.
Ok #36811 landed so I think this is closed now
Some manual bisection shows that it stared happening after rust_builtins PR got merged.
Removing a number of assembly specialisations for i386 makes stuff compile.