deltachat-node icon indicating copy to clipboard operation
deltachat-node copied to clipboard

set lto=on when calling cargo

Open r10s opened this issue 5 years ago • 2 comments

in deltachat-core-rust, lto is no longer set, however it is possible to set that bit using RUSTFLAGS, see see https://github.com/deltachat/deltachat-android/pull/1512 and https://github.com/deltachat/deltachat-ios/pull/885 for details.

r10s avatar Jul 28 '20 16:07 r10s

LTO via rustflags seems to be something different than when specifing lto=true inside of deltachat-core's cargo.toml. It throws an error when using it with rustflags (atleast on macOS and linux).

to reproduce the error:

RUSTFLAGS="-C lto=on -C embed-bitcode=yes" cargo build --release --features vendored -p deltachat_ffi

Simon-Laux avatar Jul 28 '20 22:07 Simon-Laux

Linking is done by node-gyp against libdeltachat.a, this is where LTO should be enabled. For cargo LTO is already enabled in release profile, but it does not matter because cargo does not start the linker.

link2xt avatar Feb 27 '22 20:02 link2xt