Bug 296825 - www/firefox: regression of bug 277021 – libgkcodecs.so: Undefined symbol "sin" (153.0,2)
Summary: www/firefox: regression of bug 277021 – libgkcodecs.so: Undefined symbol "sin...
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Many People
Assignee: Christoph Moench-Tegeder
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2026-07-16 00:25 UTC by Daniel Toschläger
Modified: 2026-07-21 10:36 UTC (History)
6 users (show)

See Also:
bugzilla: maintainer-feedback? (gecko)


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Daniel Toschläger 2026-07-16 00:25:09 UTC
See Also: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=277021

After a fresh git pull of the ports tree, www/firefox was updated from
152.0.6,2 to 153.0,2. After the update, Firefox fails to start with:

XPCOMGlueLoad error for file /usr/local/lib/firefox/libgkcodecs.so:
/usr/local/lib/firefox/libgkcodecs.so: Undefined symbol "sin"
Couldn't load XPCOM.

This is identical to the issue previously reported and fixed in bug 277021.
It appears to have regressed with the 153.0,2 update, likely due to the
av1/dav1d codec libraries linked into libgkcodecs.so again missing an
explicit -lm dependency for the lld linker.

Workaround: LD_PRELOAD=/lib/libm.so.5 firefox starts fine, confirming the
same root cause as 277021.

System: FreeBSD 15.1-CURRENT/STABLE (uname -a: <hier einfügen>)
Ports tree: fresh git pull as of 2026-07-16

Steps to reproduce:
1. csup/git pull ports tree
2. make -C /usr/ports/www/firefox clean install
3. Run firefox
4. Observe XPCOMGlueLoad error

Workaround that resolves the issue:
Adding LDFLAGS+= -lm for www/firefox in make.conf and rebuilding fixes it,
same as noted in comment #103 of bug 277021.
Comment 1 Daniel Toschläger 2026-07-16 00:31:42 UTC
uname -a
FreeBSD forty.40 15.1-RELEASE-p1 FreeBSD 15.1-RELEASE-p1 #0 -dirty: Tue Jun 30 03:16:39 UTC 2026     root@amd64-builder.daemonology.net:/usr/obj/usr/src/amd64.amd64/sys/GENERIC amd64

nm -D /usr/local/lib/firefox/libgkcodecs.so | grep " U sin"
                 U sin
ldd /usr/local/lib/firefox/libgkcodecs.so
/usr/local/lib/firefox/libgkcodecs.so:
	libthr.so.3 => /lib/libthr.so.3 (0x1e16978c1000)
	libc.so.7 => /lib/libc.so.7 (0x1e16947a0000)
	libsys.so.7 => /lib/libsys.so.7 (0x1e16962e4000)
Comment 2 Charlie Li freebsd_committer freebsd_triage 2026-07-16 16:03:25 UTC
Cannot reproduce here with poudriere. Do you have custom CPUTYPE or similar set, as in bug 277021?
Comment 3 commit-hook freebsd_committer freebsd_triage 2026-07-16 18:06:54 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=81447da5d16d2b4f73b4a04013df62a224737bad

commit 81447da5d16d2b4f73b4a04013df62a224737bad
Author:     Christoph Moench-Tegeder <cmt@FreeBSD.org>
AuthorDate: 2026-07-16 18:04:50 +0000
Commit:     Christoph Moench-Tegeder <cmt@FreeBSD.org>
CommitDate: 2026-07-16 18:04:50 +0000

    www/firefox: add libm to opus linker flags

    some combinations of custom CPUTYPE and compiler require special
    linker/compiler flags - try to chase this.

    PR:             296825
    Reported by:    Daniel Toschläger

 www/firefox/Makefile                                |  1 +
 www/firefox/files/patch-libwebrtc-generated         |  1 -
 .../files/patch-media_libopus_moz.build (new)       | 21 +++++++++++++++++++++
 3 files changed, 22 insertions(+), 1 deletion(-)
Comment 4 commit-hook freebsd_committer freebsd_triage 2026-07-16 18:07:55 UTC
A commit in branch 2026Q3 references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=18aa74c75e8415c0104d18701221f75fd88fbb51

commit 18aa74c75e8415c0104d18701221f75fd88fbb51
Author:     Christoph Moench-Tegeder <cmt@FreeBSD.org>
AuthorDate: 2026-07-16 18:04:50 +0000
Commit:     Christoph Moench-Tegeder <cmt@FreeBSD.org>
CommitDate: 2026-07-16 18:07:11 +0000

    www/firefox: add libm to opus linker flags

    some combinations of custom CPUTYPE and compiler require special
    linker/compiler flags - try to chase this.

    PR:             296825
    Reported by:    Daniel Toschläger

    (cherry picked from commit 81447da5d16d2b4f73b4a04013df62a224737bad)

 www/firefox/Makefile                                |  1 +
 www/firefox/files/patch-libwebrtc-generated         |  1 -
 .../files/patch-media_libopus_moz.build (new)       | 21 +++++++++++++++++++++
 3 files changed, 22 insertions(+), 1 deletion(-)
Comment 5 Daniel Toschläger 2026-07-21 10:36:08 UTC
Thank you, problem solved. 

lscpu                                                                        ~
Architecture:            amd64
Byte Order:              Little Endian
Total CPU(s):            16
Thread(s) per core:      2
Core(s) per socket:      8
Socket(s):               1
Vendor:                  AuthenticAMD
CPU family:              25
Model:                   80
Model name:              AMD Ryzen 7 5700G with Radeon Graphics         
Stepping:                0
L1d cache:               32K
L1i cache:               32K
L2 cache:                512K
L3 cache:                16M
Flags:                   fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 cflsh mmx fxsr sse sse2 htt sse3 pclmulqdq monitor ssse3 fma cx16 sse4_1 sse4_2 popcnt aes xsave osxsave avx f16c rdrnd syscall nx mmxext fxsr_opt pdpe1gb rdtscp lm lahf_lm cmp_legacy svm extapic cr8_legacy lzcnt sse4a misalignsse 3dnowprefetch osvw ibs skinit wdt tce topoext perfctr_core perfctr_nb pcx_l2i

this is my /etc/make.conf line concerning cpu types and options:

CPUTYPE?=native
CFLAGS+= -O2 -pipe
CXXFLAGS+= -O2 -pipe