Closed Gooberpatrol66 closed 1 year ago
note: /usr/lib/gcc/x86_64-pc-linux-gnu/12/../../../../x86_64-pc-linux-gnu/bin/ld: /var/tmp/portage/app-text/mdbook-linkcheck-0.7.7/work/mdbook-linkcheck-0.7.7/target/release/deps/libopenssl_sys-41acaa7dec2f671 e.rlib(x86_64cpuid.o):(.init+0x1): undefined reference to `OPENSSL_cpuid_setup'
This looks like an underlinking of openssl
in openssl-sys
crate bundled with linkchecker
. I'll try to reproduce locally with your *FLAGS
.
Reproduces with -flto
flags:CFLAGS="-flto" CXXFLAGS="-flto" emerge -v1 app-text/mdbook-linkcheck
.
I think it happens because we mix the code from multiple toolchains: gcc
when it comes to compiling c/c++
files, gcc
linker plugin (not sure) when it comes to linking files and llvm
when it comes to compiling rust
files.
It could even work if rust
were to only generate object code for ld
. It might even be the case, but I'm not sure. I'll debug in more detail and reduce to something shorter.
Meanwhile we can filter out any LTO-related flags to make things just work for mixed environments.
Try https://github.com/trofi/nix-guix-gentoo/commit/c95caa8da8dbeb38eb5fc58bd1529ceb73d04d9d. I wonder if it will be enough for your environment.
Filed https://bugs.gentoo.org/893658 against ::gentoo
. Looks like fllter-lto
workarounds against rust packages are proliferating for a while there.
The workaround should be good enough to use app-text/mdbook-linkcheck
with -flto
.
That fixed it, thanks.
build.log