deltachat-node
deltachat-node copied to clipboard
set lto=on when calling cargo
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.
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
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.