Closed azriel91 closed 5 years ago
Hiya, when compiling the tests in release mode on Ubuntu 19.04, linking would fail with the following:
release
ld (/usr/bin/x86_64-linux-gnu-ld)
ld
/usr/bin/x86_64-linux-gnu-ld
..(redacted).. undefined reference to `__stop_linkme_EMPTY' ..(redacted).. undefined reference to `__start_linkme_EMPTY'
lld
ld: error: undefined symbol: __stop_linkme_EMPTY >>> referenced by distributed_slice.11cifgtw-cgu.5 ..(redacted).. ld: error: undefined symbol: __start_linkme_EMPTY >>> referenced by distributed_slice.11cifgtw-cgu.5 ..(redacted)..
Adding the #[used] annotation prevents the symbols from being optimized out and is tested to work with both ld and lld. Credit to @kabergstrom.
#[used]
I'm using cargo defaults -- haven't tweaked optimization settings.
cargo
Published in 0.1.3.
Hiya, when compiling the tests in
release
mode on Ubuntu 19.04, linking would fail with the following:ld
(/usr/bin/x86_64-linux-gnu-ld
)lld
Adding the
#[used]
annotation prevents the symbols from being optimized out and is tested to work with bothld
andlld
. Credit to @kabergstrom.I'm using
cargo
defaults -- haven't tweaked optimization settings.