Closed
Description
Because that's what the old build system does:
LD_LIBRARY_PATH=/home/japaric/x86_64-unknown-linux-gnu/stage2/lib:/usr/lib:$LD_LIBRARY_PATH x86_64-unknown-linux-gnu/stage2/bin/rustc --cfg stage2 -O --cfg rtopt -C rpath --target=x86_64-pc-windows-gnu -C linker=x86_64-w64-mingw32-gcc -C ar=x86_64-w64-mingw32-ar --emit=obj -o x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-pc-windows-gnu/lib/rsbegin.o /shared/rust/master/src/rtstartup/rsbegin.rs
but rustbuild doesn't pass the --target
and rsbegin.o ends up being an ELF on linux:
$ file $(find -name rsbegin.o)
./build/x86_64-unknown-linux-gnu/stage1/lib/rustlib/x86_64-pc-windows-gnu/lib/rsbegin.o: ELF 64-bit LSB relocatable, x86-64, version 1 (SYSV), not stripped
The fix should be simple in theory. You just have to pass --target $TARGET
to the Command
in the code linked above. But then you run in problems with the order of the operations: "core
not found for $TARGET".
Meta
$ git rev-parse HEAD
e77d86c142ae668038dd43594d04022cbd6bf4d8