| Summary: | graphics/librsvg2-rust: LTO fails under WITH_LLVM_BINUTILS (mismatched LLVM toolchain) | ||
|---|---|---|---|
| Product: | Ports & Packages | Reporter: | Luna <freebsd> |
| Component: | Individual Port(s) | Assignee: | freebsd-desktop (Team) <desktop> |
| Status: | Open --- | ||
| Severity: | Affects Only Me | CC: | cy, emaste, throwaway_vthgwq4, vishwin |
| Priority: | --- | Flags: | vishwin:
maintainer-feedback+
|
| Version: | Latest | ||
| Hardware: | amd64 | ||
| OS: | Any | ||
| Bug Depends on: | |||
| Bug Blocks: | 258872 | ||
|
Description
Luna
2023-03-23 18:50:02 UTC
I can't reproduce 12.3/12.4/13.1/-CURRENT amd64/i386. Need more details or a poudriere log. I've compiled the world with 'WITH_LLVM_BINUTILS=YES'. It seems like librsvg2-rust compiles without problems when using elftoolchain nm, but fails when using llvm-nm because of the version mismatch. Likely a regresion from ports 967022fd812c + ports c9c14b819fe4. However, WITH_LLVM_BINUTILS is generally not yet supported until bug 258872 is fixed. I have similar here with -CURRENT (base LLVM 15) and Rust using LLVM 16: [...] cargo --locked build --verbose --release --bin rsvg-convert libtool: link: /usr/bin/nm -B ./.libs/librsvg_c_api.a | /usr/bin/sed -n -e 's/^.*[ ]\([ABCDGIRSTW][ABCDGIRSTW]*\)[ ][ ]*\([_A-Za- z][_A-Za-z0-9]*\)$/\1 \2 \2/p' | /usr/bin/sed '/ __gnu_lto/d' | /usr/bin/sed 's/.* //' | sort | uniq > .libs/librsvg-2.exp /usr/bin/nm: error: ./.libs/librsvg_c_api.a(rsvg-6aae7815bd5a5a95.rsvg.f7c38f4e-cgu.0.rcgu.o): Unknown attribute kind (86) (Producer: 'LLVM16.0.3' Reader: 'LLVM 15.0.7') [...] /usr/bin/nm is detected in configure script: [...] checking if the linker (/usr/bin/ld) is GNU ld... yes checking for BSD- or MS-compatible name lister (nm)... /usr/bin/nm -B checking the name lister (/usr/bin/nm -B) interface... BSD nm [...] To avoid Rust LLVM and nm version match, try (adjust 16 for Rust LLVM version in use): diff --git a/graphics/librsvg2-rust/Makefile b/graphics/librsvg2-rust/Makefile --- a/graphics/librsvg2-rust/Makefile +++ b/graphics/librsvg2-rust/Makefile @@ -13,7 +13,8 @@ WWW= https://live.gnome.org/LibRsvg LICENSE= LGPL20 -BUILD_DEPENDS= rst2man:textproc/py-docutils +BUILD_DEPENDS= rst2man:textproc/py-docutils \ + llvm-nm16:devel/llvm16 LIB_DEPENDS= libfontconfig.so:x11-fonts/fontconfig \ libfreetype.so:print/freetype2 \ libharfbuzz.so:print/harfbuzz \ @@ -30,7 +31,7 @@ CONFIGURE_ARGS= --disable-Bsymbolic \ --disable-dependency-tracking \ --disable-static \ --enable-vala -CONFIGURE_ENV= ${CARGO_ENV} +CONFIGURE_ENV= ${CARGO_ENV} NM=/usr/local/bin/llvm-nm16 MAKE_ENV= ${CARGO_ENV} CARGO_ENV= RUST_TARGET=${CARGO_BUILD_TARGET} CARGO_BUILD= no Alternatively, investigate if parts of librsvg2-rust invoking cargo directly (rg 'CARGO_RELEASE_ARGS' in WRKDIR) could opt-out either from LTO (maybe ThinLTO is partly used, and switching to fat LTO would help) or build. This needs to be added to "Depends on" of Bug 258872 - [exp-run] WITH_LLVM_BINUTILS as that would hit a FreeBSD version built with WITH_LLVM_BINUTILS, and Rust LLVM of a mismatched version. I can't add this bug to the depends of bug 258872 LTO requires that the compiler and nm are matched, so we will have to find a way to make this happen for all ports that may be built with LTO and use an LLVM other than from the base system. USES=llvm makes matching LLVM versions easy, but there's more to the story. Since the Rust toolchain will never (unless something drastically changes) use base system LLVM, we may have to unconditionally use ports LLVM, like the gecko@ ports, if/when WITH_LLVM_BINUTILS becomes ready enough. > if/when WITH_LLVM_BINUTILS becomes ready enough
It is ready to go now, so I'm hopeful these few bugs (this one, and 270962 and 270963) can be addressed before we switch it on.
|