Closed
Description
Compiling the elfc
crate at this commit of elfmalloc causes a linking failure with:
- the current nightly
- on Mac
- with ThinLTO enabled
- in release mode
- with
codegen-units=16
(RUSTFLAGS='-C codegen-units=16 -Z thinlto' cargo build --release
)
= note: Undefined symbols for architecture x86_64:
"___rg_realloc", referenced from:
___rust_realloc in elfc.crate.allocator.rust-cgu.o
"___rg_dealloc", referenced from:
___rust_dealloc in elfc.crate.allocator.rust-cgu.o
"___rg_oom", referenced from:
___rust_oom in elfc.crate.allocator.rust-cgu.o
"___rg_alloc", referenced from:
___rust_alloc in elfc.crate.allocator.rust-cgu.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Version: cargo 0.23.0-nightly (e447ac7e9 2017-09-27)
Building with cargo build --release
and either of -C codegen-units=16
or -Z thinlto
on their own works fine.