[Bug 269664] www/firefox: can't build Firefox 110.0.3 on FreeBSD 13.2 STABLE

From: <bugzilla-noreply_at_freebsd.org>
Date: Sun, 19 Feb 2023 17:50:18 UTC
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=269664

Soe Tun <soelinn@gmail.com> changed:

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

--- Comment #4 from Soe Tun <soelinn@gmail.com> ---
(In reply to Oleg Sidorkin from comment #3)

Like you said, I get LLVM errors with LTO (Link-Time Optimization) option.
I tried building www/firefox with two approaches -- (1) Ports (2) Poudriere
Both approaches fail with the same LLVM error near the very end for FreeBSD
13.1-RELEASE.

What "version mismatches" can there be to result in these LLVM errors?  
Isn't using Poudriere to build it in isolation good enough?
Why would it fail to build using LTO option in Poudriere?


==== APPROACH 1: Ports ====
$ cd /usr/ports/www/firefox
$ make config-recursive
$ make install clean

==== APPROACH 2: Poudriere ====

I simply followed instructions to setup Poudriere.
https://www.digitalocean.com/community/tutorials/how-to-set-up-a-poudriere-build-system-to-create-packages-for-your-freebsd-servers

$ poudriere jail -c -j 131Ramd64 -v 13.1-RELEASE
$ poudriere ports -c -p 2023Q1



The following is the Makefile config options I set for www/firefox.

---Begin OPTIONS List---
===> The following configuration options are available for firefox-110.0_3,2:
     CANBERRA=off: Sound theme alerts
     DBUS=on: D-Bus IPC system support
     DEBUG=off: Build with debugging support
     FFMPEG=on: FFmpeg support (WMA, AIFF, AC3, APE...)
     LIBPROXY=off: Proxy support via libproxy
     LTO=on: Use Link-Time Optimization
     OPTIMIZED_CFLAGS=on: Use extra compiler optimizations
     PROFILE=on: Build with profiling support
     TEST=off: Build and/or run tests
====> Extra cubeb audio backends (OSS is always available)
     ALSA=off: ALSA audio architecture support
     JACK=on: JACK audio server support
     PULSEAUDIO=on: PulseAudio sound server support
     SNDIO=on: Sndio audio support
===> Use 'make config' to modify these settings
---End OPTIONS List---





This is the same LLVM error I get for both approaches.

/usr/local/bin/clang++13 -Qunused-arguments -std=gnu++17 -U_FORTIFY_SOURCE
-D_FORTIFY_SOURCE=2 -fstack-protector-strong -fstack-clash-protection
-DLIBICONV_PLUG -isystem /usr/local/include -fno-sized-deallocation
-fno-aligned-new -O2 -pipe -O3 -DLIBICONV_PLUG -fstack-protector-strong
-isystem /usr/local/include -fno-strict-aliasing -DLIBICONV_PLUG -isystem
/usr/local/include -fno-exceptions -fPIC -fno-rtti -ffunction-sections
-fdata-sections -fno-exceptions -fno-math-errno -pipe -O2 -O3
-fno-omit-frame-pointer -funwind-tables  -shared -Wl,-z,defs
-Wl,--warn-unresolved-symbols -Wl,--gc-sections -Wl,-h,libxul.so -o libxul.so
/wrkdirs/usr/ports/www/firefox/work/.build/toolkit/library/build/libxul_so.list
 -flto=thin -Wl,-plugin-opt=-import-instr-limit=10
-Wl,-plugin-opt=-import-hot-multiplier=30 -pthread -Wl,--as-needed
-fstack-protector-strong -Wl,-z,noexecstack -Wl,-z,text -Wl,-z,relro
-Wl,-z,nocopyreloc -Wl,-Bsymbolic-functions -Wl,--build-id=sha1
-fstack-protector-strong -fstack-clash-protection
-Wl,-rpath-link,/wrkdirs/usr/ports/www/firefox/work/.build/dist/bin
-Wl,-rpath-link,/usr/local/lib  ../../../js/src/build/libjs_static.a
/wrkdirs/usr/ports/www/firefox/work/.build/x86_64-unknown-freebsd/release/libgkrust.a
../../../config/external/lgpllibs/liblgpllibs.so
../../../config/external/sqlite/libmozsqlite3.so
../../../widget/gtk/mozgtk/libmozgtk.so
../../../widget/gtk/mozwayland/libmozwayland.so   -L/usr/local/lib -licui18n
-L/usr/local/lib -licuuc -licudata -laom -ldav1d -lX11 -lXcomposite -lXdamage
-lXext -lXfixes -lXrandr -lXrender -lXtst -lpthread -lffi -lplds4 -lplc4
-lnspr4 -pthread -ldl -lz -lm -lnss3 -lsmime3 -lssl3 -lnssutil3 -lfreetype
-lfontconfig -lgtk-3 -lgdk-3 -lpangocairo-1.0 -lpango-1.0 -lharfbuzz -latk-1.0
-lcairo-gobject -lcairo -lgdk_pixbuf-2.0 -lgio-2.0 -lgobject-2.0 -lglib-2.0
-lintl -lutil -lpng16 -lwebpdemux -lwebp -lsharpyuv -lgraphite2 -levent -lvpx
-lpixman-1 -ldbus-glib-1 -ldbus-1 -lxcb-shm -lX11-xcb -lxcb -lXcursor -lXi
LLVM ERROR: Type mismatch in constant table!
PLEASE submit a bug report to https://bugs.llvm.org/ and include the crash
backtrace.
Stack dump:
0.      Program arguments: /usr/local/llvm13/bin/ld --eh-frame-hdr -Bshareable
--hash-style=both --enable-new-dtags -o libxul.so /usr/lib/crti.o
/usr/lib/crtbeginS.o -L/usr/local/lib -L/usr/local/lib -L/usr/lib -plugin
/usr/local/llvm13/bin/../lib/LLVMgold.so -plugin-opt=mcpu=x86-64 -plugin-opt=O3
-plugin-opt=thinlto -plugin-opt=-function-sections -plugin-opt=-data-sections
-z defs --warn-unresolved-symbols --gc-sections -h libxul.so
/wrkdirs/usr/ports/www/firefox/work/.build/toolkit/library/build/libxul_so.list
-plugin-opt=-import-instr-limit=10 -plugin-opt=-import-hot-multiplier=30
--as-needed -z noexecstack -z text -z relro -z nocopyreloc -Bsymbolic-functions
--build-id=sha1 -rpath-link /wrkdirs/usr/ports/www/firefox/work/.build/dist/bin
-rpath-link /usr/local/lib ../../../js/src/build/libjs_static.a
/wrkdirs/usr/ports/www/firefox/work/.build/x86_64-unknown-freebsd/release/libgkrust.a
../../../config/external/lgpllibs/liblgpllibs.so
../../../config/external/sqlite/libmozsqlite3.so
../../../widget/gtk/mozgtk/libmozgtk.so
../../../widget/gtk/mozwayland/libmozwayland.so -licui18n -licuuc -licudata
-laom -ldav1d -lX11 -lXcomposite -lXdamage -lXext -lXfixes -lXrandr -lXrender
-lXtst -lpthread -lffi -lplds4 -lplc4 -lnspr4 -ldl -lz -lm -lnss3 -lsmime3
-lssl3 -lnssutil3 -lfreetype -lfontconfig -lgtk-3 -lgdk-3 -lpangocairo-1.0
-lpango-1.0 -lharfbuzz -latk-1.0 -lcairo-gobject -lcairo -lgdk_pixbuf-2.0
-lgio-2.0 -lgobject-2.0 -lglib-2.0 -lintl -lutil -lpng16 -lwebpdemux -lwebp
-lsharpyuv -lgraphite2 -levent -lvpx -lpixman-1 -ldbus-glib-1 -ldbus-1
-lxcb-shm -lX11-xcb -lxcb -lXcursor -lXi -lc++ -lm -lgcc --as-needed -lgcc_s
--no-as-needed -lpthread -lc -lgcc --as-needed -lgcc_s --no-as-needed
/usr/lib/crtendS.o /usr/lib/crtn.o
 #0 0x0000000825db08f8 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int)
(/usr/local/llvm13/lib/libLLVM-13.so+0x2bb08f8)
 #1 0x0000000825daec25 llvm::sys::RunSignalHandlers()
(/usr/local/llvm13/lib/libLLVM-13.so+0x2baec25)
 #2 0x0000000825db10c1 (/usr/local/llvm13/lib/libLLVM-13.so+0x2bb10c1)
 #3 0x0000000822917580 (/lib/libthr.so.3+0x1a580)
 #4 0x0000000822916b3f (/lib/libthr.so.3+0x19b3f)
 #5 0x00007ffffffff8a3 ([vdso]+0x2d3)
 #6 0x000000082a0b033a thr_kill (/lib/libc.so.7+0x13733a)
 #7 0x000000082a028c74 _raise (/lib/libc.so.7+0xafc74)
 #8 0x000000082a0da109 abort (/lib/libc.so.7+0x161109)
 #9 0x0000000825cf3f1d (/usr/local/llvm13/lib/libLLVM-13.so+0x2af3f1d)
#10 0x0000000825cf3d59 (/usr/local/llvm13/lib/libLLVM-13.so+0x2af3d59)
#11 0x000000082674756e (/usr/local/llvm13/lib/libLLVM-13.so+0x354756e)
#12 0x000000082672367e (/usr/local/llvm13/lib/libLLVM-13.so+0x352367e)
#13 0x000000082672c0e8 (/usr/local/llvm13/lib/libLLVM-13.so+0x352c0e8)
#14 0x00000008267147d3 llvm::BitcodeModule::getModuleImpl(llvm::LLVMContext&,
bool, bool, bool,
llvm::function_ref<llvm::Optional<std::__1::basic_string<char,
std::__1::char_traits<char>, std::__1::allocator<char> > > (llvm::StringRef)>)
(/usr/local/llvm13/lib/libLLVM-13.so+0x35147d3)
#15 0x0000000826714e94 llvm::BitcodeModule::getLazyModule(llvm::LLVMContext&,
bool, bool) (/usr/local/llvm13/lib/libLLVM-13.so+0x3514e94)
#16 0x00000008272fb1b9 (/usr/local/llvm13/lib/libLLVM-13.so+0x40fb1b9)
#17 0x00000008272faee7 llvm::irsymtab::readBitcode(llvm::BitcodeFileContents
const&) (/usr/local/llvm13/lib/libLLVM-13.so+0x40faee7)
#18 0x00000008272f875b llvm::object::readIRSymtab(llvm::MemoryBufferRef)
(/usr/local/llvm13/lib/libLLVM-13.so+0x40f875b)
#19 0x0000000827158a57 llvm::lto::InputFile::create(llvm::MemoryBufferRef)
(/usr/local/llvm13/lib/libLLVM-13.so+0x3f58a57)
#20 0x0000000000497a55
lld::elf::BitcodeFile::BitcodeFile(llvm::MemoryBufferRef, llvm::StringRef,
unsigned long) (/usr/local/llvm13/bin/ld+0x497a55)
#21 0x0000000000498930 lld::elf::BitcodeFile* lld::make<lld::elf::BitcodeFile,
llvm::MemoryBufferRef&, llvm::StringRef&, unsigned
long&>(llvm::MemoryBufferRef&, llvm::StringRef&, unsigned long&)
(/usr/local/llvm13/bin/ld+0x498930)
#22 0x0000000000496656 lld::elf::createObjectFile(llvm::MemoryBufferRef,
llvm::StringRef, unsigned long) (/usr/local/llvm13/bin/ld+0x496656)
#23 0x00000000004963da
lld::elf::ArchiveFile::fetch(llvm::object::Archive::Symbol const&)
(/usr/local/llvm13/bin/ld+0x4963da)
#24 0x000000000055da95 lld::elf::SymbolTable::addSymbol(lld::elf::Symbol
const&) (/usr/local/llvm13/bin/ld+0x55da95)
#25 0x0000000000496093 lld::elf::ArchiveFile::parse()
(/usr/local/llvm13/bin/ld+0x496093)
#26 0x00000000004943f4 lld::elf::parseFile(lld::elf::InputFile*)
(/usr/local/llvm13/bin/ld+0x4943f4)
#27 0x000000000046700c void
lld::elf::LinkerDriver::link<llvm::object::ELFType<(llvm::support::endianness)1,
true> >(llvm::opt::InputArgList&) (/usr/local/llvm13/bin/ld+0x46700c)
#28 0x000000000045bd43 lld::elf::LinkerDriver::linkerMain(llvm::ArrayRef<char
const*>) (/usr/local/llvm13/bin/ld+0x45bd43)
#29 0x0000000000459ea7 lld::elf::link(llvm::ArrayRef<char const*>, bool,
llvm::raw_ostream&, llvm::raw_ostream&) (/usr/local/llvm13/bin/ld+0x459ea7)
#30 0x00000000003a0558 (/usr/local/llvm13/bin/ld+0x3a0558)
clang-13: error: unable to execute command: Abort trap (core dumped)
clang-13: error: linker command failed due to signal (use -v to see invocation)
gmake[4]: ***
[/wrkdirs/usr/ports/www/firefox/work/firefox-110.0/config/rules.mk:540:
libxul.so] Error 254
gmake[4]: Leaving directory
'/wrkdirs/usr/ports/www/firefox/work/.build/toolkit/library/build'
gmake[3]: ***
[/wrkdirs/usr/ports/www/firefox/work/firefox-110.0/config/recurse.mk:72:
toolkit/library/build/target] Error 2
gmake[3]: Leaving directory '/wrkdirs/usr/ports/www/firefox/work/.build'
gmake[2]: ***
[/wrkdirs/usr/ports/www/firefox/work/firefox-110.0/config/recurse.mk:34:
compile] Error 2
gmake[2]: Leaving directory '/wrkdirs/usr/ports/www/firefox/work/.build'
gmake[1]: ***
[/wrkdirs/usr/ports/www/firefox/work/firefox-110.0/config/rules.mk:361: all]
Error 2
gmake[1]: Leaving directory '/wrkdirs/usr/ports/www/firefox/work/.build'
*** Error code 1

Stop.
make: stopped in /usr/ports/www/firefox
=>> Cleaning up wrkdir
===>  Cleaning for firefox-110.0_3,2
build of www/firefox | firefox-110.0_3,2 ended at Sun Feb 19 11:29:09 EST 2023
build time: 02:42:09
!!! build failure encountered !!!

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