I want to try out the LLVM linker to see if it will speed things up for me. I have worked out how to help lld find all the system libraries but it sounds like there's something wrong when build scripts (which I guess are compiled and executed?) not finding those libraries.
I am using the rustlang/rust:nightly container (freshly pulled today). The container is booted like this:
docker run --name=rust --workdir=/datascience-web --rm -it -p 8000:8000 -v $(shell pwd):/datascience-web -v $(shell pwd)/../../samuel-rs:/samuel-rs -v $(shell pwd)/target/linux-env-cargo-git:/usr/local/cargo/git -v $(shell pwd)/target/linux-env-cargo-registry:/usr/local/cargo/registry rustlang/rust:nightly bash
Then from inside the container, I got to /code
and run:
RUSTFLAGS='-C linker=rust-lld -L /usr/lib/x86_64-linux-gnu -L /usr/lib/gcc/x86_64-linux-gnu/8' cargo build
Compiling libc v0.2.65
Compiling proc-macro2 v1.0.6
Compiling byteorder v1.3.2
Compiling log v0.4.8
Compiling syn v1.0.5
Compiling semver v0.9.0
error: failed to run custom build command for `byteorder v1.3.2`
Caused by:
process didn't exit successfully: `/code/target/debug/build/byteorder-ce648015d7f0b8ef/build-script-build` (signal: 11, SIGSEGV: invalid memory reference)
warning: build failed, waiting for other jobs to finish...
error: failed to run custom build command for `libc v0.2.65`
Caused by:
process didn't exit successfully: `/code/target/debug/build/libc-00921b43cd2fe1bc/build-script-build` (signal: 11, SIGSEGV: invalid memory reference)
warning: build failed, waiting for other jobs to finish...
error: failed to run custom build command for `proc-macro2 v1.0.6`
Caused by:
process didn't exit successfully: `/code/target/debug/build/proc-macro2-12e6e3f6412e607e/build-script-build` (signal: 11, SIGSEGV: invalid memory reference)
warning: build failed, waiting for other jobs to finish...
error: failed to run custom build command for `log v0.4.8`
Caused by:
process didn't exit successfully: `/code/target/debug/build/log-f937be6d994db414/build-script-build` (signal: 11, SIGSEGV: invalid memory reference)
warning: build failed, waiting for other jobs to finish...
error: failed to run custom build command for `syn v1.0.5`
Caused by:
process didn't exit successfully: `/code/target/debug/build/syn-38e19eef1c830c5c/build-script-build` (signal: 11, SIGSEGV: invalid memory reference)
warning: build failed, waiting for other jobs to finish...
error: build failed
make: *** [Makefile:36: build-linux-lld] Error 101
It looks like those build-script-build things should be good to go:
# file /code/target/debug/build/syn-38e19eef1c830c5c/build-script-build
/code/target/debug/build/syn-38e19eef1c830c5c/build-script-build: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, with debug_info, not stripped
# root@59255e7d6349:/code# ldd /code/target/debug/build/syn-38e19eef1c830c5c/build-script-build
linux-vdso.so.1 (0x00007ffffc9de000)
libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007fe303b87000)
librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x00007fe303b7d000)
libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007fe303b5c000)
libgcc_s.so.1 => /usr/lib/gcc/x86_64-linux-gnu/8/libgcc_s.so.1 (0x00007fe303b42000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007fe303981000)
libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007fe3037fe000)
libutil.so.1 => /lib/x86_64-linux-gnu/libutil.so.1 (0x00007fe3037f7000)
/lib64/ld-linux-x86-64.so.2 (0x00007fe303b9d000)
# /code/target/debug/build/syn-38e19eef1c830c5c/build-script-build
Segmentation fault # :(
anyone know what's wrong with those build-script-build
files? What purpose do they have and why would they now blow up?