halloy
halloy copied to clipboard
Unable to build with LTO enabled
When compiling with LTO enabled, the build process fails.
See log: https://bpa.st/V4KQ
(Couldn't paste the log directly because it's longer than GitHub's maximum character limit)
+1
I cannot reproduce on Linux with cargo build --release --config profile.release.lto=\"on\"
cargo build --release --config profile.release.lto=\"on\"
also works for me, but this doesn't: https://aur.archlinux.org/cgit/aur.git/tree/PKGBUILD?h=halloy
@tarkah The AUR packages do not build with the lto
option which is enabled for makepkg
by default.
It has to be explicitly disabled for halloy to build.
I tried using your --config
suggestion in tandem with the lto
build option but that doesn't work either.
Seems like an issue in the AUR packaging environment then. What linker is being used? Are other rust flags enabled behind the scenes? Which rust version?
Seems like an issue in the AUR packaging environment then. What linker is being used? Are other rust flags enabled behind the scenes? Which rust version?
$ cat .cargo/config.toml
[profile.release]
strip = true
lto = "thin"
[build]
rustc-wrapper = "sccache"
$ rustc --version
rustc 1.77.2 (25ef9e3d8 2024-04-09)
I have no idea what linker is being used, the only one I have installed is the GNU ld
There's a known bug that LTO does weird things if you
- include some C in your rust code
- compile with GCC (not clang)
- use lto.
Not doing just one of those three appears to "fix" it
See these: https://github.com/gyscos/zstd-rs/issues?q=is%3Aissue+undefined+reference+to