[Bug 268328] www/firefox fails to build with LTO enabled

From: <bugzilla-noreply_at_freebsd.org>
Date: Thu, 01 Aug 2024 00:04:45 UTC
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=268328

robbak@gmail.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |robbak@gmail.com

--- Comment #8 from robbak@gmail.com ---
(In reply to Nuno Teixeira from comment #7)
I'm experiencing it, The error is happens fairly far back, and looks like this:

security/manager/ssl/builtins/dynamic-library/libnssckbi.so
rm -f ../../../../../dist/bin/libnssckbi.so
/usr/local/bin/clang17 -std=gnu99 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2
-fstack-protector-strong -fstack-clash-protection -DLIBICONV_PLUG -isystem
/usr/local/include -pthread -ffunction-sections -fdata-sections -fno-math-errno
-fPIC -O2 -pipe -march=core2 -O3 -DLIBICONV_PLUG -fstack-protector-strong
-isystem /usr/local/include -fno-strict-aliasing -O2 -O3 -fomit-frame-pointer
-funwind-tables -shared -Wl,-z,defs -Wl,--warn-unresolved-symbols
-Wl,--gc-sections -Wl,-h,libnssckbi.so -o ../../../../../dist/bin/libnssckbi.so
stub.o   -flto=thin -Wl,-plugin-opt=-import-instr-limit=10
-Wl,-plugin-opt=-import-hot-multiplier=30 -Wl,--as-needed
-Wl,--undefined-version -fstack-protector-strong -fuse-ld=lld -Wl,--icf=safe
-Wl,--build-id=sha1 -Wl,-z,noexecstack -Wl,-z,text -Wl,-z,relro -Wl,-z,now
-Wl,-z,nocopyreloc -fstack-protector-strong -fstack-clash-protection
-Wl,-rpath-link,/usr/home/obj/ports/usr/ports/www/firefox/work/.build/dist/bin
-O2 -O3  ../../../../../x86_64-unknown-freebsd/release/libbuiltins_static.a 
-Wl,--version-script,libnssckbi.so.symbols  -ldl
ld.lld: error:
../../../../../x86_64-unknown-freebsd/release/libbuiltins_static.a(builtins_static-3fc9a9f4a8be076d.builtins_static.91ec9682c27a3d0c-cgu.0.rcgu.o):
Unknown attribute kind (91) (Producer: 'LLVM18.1.7-rust-1.79.0-stable' Reader:
'LLVM 17.0.6')
clang: error: linker command failed with exit code 1 (use -v to see invocation)
gmake[3]: ***
[/usr/home/obj/ports/usr/ports/www/firefox/work/firefox-129.0/config/rules.mk:539:
../../../../../dist/bin/libnssckbi.so] Error 1
gmake[3]: Leaving directory
'/usr/home/obj/ports/usr/ports/www/firefox/work/.build/security/manager/ssl/builtins/dynamic-library'
gmake[2]: ***
[/usr/home/obj/ports/usr/ports/www/firefox/work/firefox-129.0/config/recurse.mk:72:
security/manager/ssl/builtins/dynamic-library/target] Error 2
gmake[2]: *** Waiting for unfinished jobs....

I'll turn off LTO and build again.

--- Comment #9 from Charlie Li <vishwin@freebsd.org> ---
(In reply to robbak from comment #8)
You must use the same LLVM version (from ports) building the C/C++ bits as the
LLVM in Rust. Right now you are indicating a version mismatch: port LLVM 17 and
Rust LLVM 18.

-- 
You are receiving this mail because:
You are the assignee for the bug.