For example, given an empty lib.rs, this happens:
rustc --lib lib.rs & rustc --rlib lib.rs
error: linking with `cc` failed: exit code: 1
note: cc arguments: '-m64' '-L/usr/local/lib/rustc/x86_64-unknown-linux-gnu/lib' '-o' 'liblib-9ed81b85-0.0.so' 'lib.o' 'lib.metadata.o' '-Wl,--as-needed' '-L/tmp/.rust' '-L/tmp' '-L/usr/local/lib/rustc/x86_64-unknown-linux-gnu/lib' '-lstd-04ff901e-0.9-pre' '-lrt' '-ldl' '-lm' '-lpthread' '-lstdc++' '-shared' '-lmorestack' '-Wl,-rpath,$ORIGIN/../usr/local/lib/rustc/x86_64-unknown-linux-gnu/lib' '-Wl,-rpath,/usr/local/lib/rustc/x86_64-unknown-linux-gnu/lib'
note: /usr/bin/ld: reopening lib.o: No such file or directory
/usr/bin/ld: final link failed: No such file or directory
collect2: error: ld returned 1 exit status
error: aborting due to previous error
task 'rustc' failed at 'explicit failure', /home/siege/src/rust2/src/libsyntax/diagnostic.rs:102
task '<main>' failed at 'explicit failure', /home/siege/src/rust2/src/librustc/lib.rs:398
This could be fixed in two main ways.
- Add an option (e.g.
--temps-path) to store the intermediates in a specific location
- Add some kind of hash to the names of the intermediates to stop them from colliding. Can't just be the pkgid hash, as it'd still fail the above test.
For example, given an empty lib.rs, this happens:
This could be fixed in two main ways.
--temps-path) to store the intermediates in a specific location