Bug 259055 - www/firefox fails to build with DEBUG option enabled on FreeBSD_12-RELEASE
Summary: www/firefox fails to build with DEBUG option enabled on FreeBSD_12-RELEASE
Status: Open
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: freebsd-gecko (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-10-11 00:04 UTC by ddrinnon
Modified: 2023-04-27 12:15 UTC (History)
1 user (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 ddrinnon 2021-10-11 00:04:25 UTC
Firefox fails to build on my Poudriere builder FreeBSD_12-RELEASE with DEBUG option enabled.  Clip from the build log:

/usr/local/bin/clang++12 -std=gnu++17 -o Unified_cpp_image_decoders0.o -c  -I/wrkdirs/usr/ports/www/firefox/work/.build/dist/stl_wrappers -I/wrkdirs/usr/ports/www/firefox/work/.build/dist/system_wrappers -include /wrkdirs/usr/ports/www/firefox/work/firefox-93.0/config/gcc_hidden.h -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -fstack-protector-strong -fstack-clash-protection -ftrivial-auto-var-init=pattern -DDEBUG=1 -DOS_POSIX=1 -DOS_FREEBSD=1 -DOS_BSD=1 -DMOZ_HAS_MOZGLUE -DMOZILLA_INTERNAL_API -DIMPL_LIBXUL -DSTATIC_EXPORTABLE_JS_API -I/wrkdirs/usr/ports/www/firefox/work/firefox-93.0/image/decoders -I/wrkdirs/usr/ports/www/firefox/work/.build/image/decoders -I/wrkdirs/usr/ports/www/firefox/work/.build/ipc/ipdl/_ipdlheaders -I/wrkdirs/usr/ports/www/firefox/work/firefox-93.0/ipc/chromium/src -I/wrkdirs/usr/ports/www/firefox/work/firefox-93.0/gfx/2d -I/wrkdirs/usr/ports/www/firefox/work/firefox-93.0/image -I/wrkdirs/usr/ports/www/firefox/work/firefox-93.0/media/libyuv/libyuv/include -I/wrkdirs/usr/ports/www/firefox/work/firefox-93.0/gfx/skia -I/wrkdirs/usr/ports/www/firefox/work/firefox-93.0/gfx/skia/skia -I/wrkdirs/usr/ports/www/firefox/work/.build/dist/include -I/usr/local/include/nspr -I/usr/local/include -I/usr/local/include/nss -I/usr/local/include/nspr -I/wrkdirs/usr/ports/www/firefox/work/.build/dist/include/nss -I/usr/local/include -I/usr/local/include -I/usr/local/include/pixman-1 -I/usr/local/include -DMOZILLA_CLIENT -include /wrkdirs/usr/ports/www/firefox/work/.build/mozilla-config.h -Qunused-arguments -DLIBICONV_PLUG -isystem /usr/local/include -Qunused-arguments -Wall -Wbitfield-enum-conversion -Wdeprecated-this-capture -Wempty-body -Wformat-type-confusion -Wignored-qualifiers -Wpointer-arith -Wshadow-field-in-constructor-modified -Wshadow-uncaptured-local -Wsign-compare -Wtype-limits -Wno-error=tautological-type-limit-compare -Wunreachable-code -Wunreachable-code-return -Wno-invalid-offsetof -Wclass-varargs -Wempty-init-stmt -Wfloat-overflow-conversion -Wfloat-zero-conversion -Wloop-analysis -Wno-range-loop-analysis -Wc++2a-compat -Wcomma -Wenum-compare-conditional -Wimplicit-fallthrough -Wstring-conversion -Wno-inline-new-delete -Wno-error=deprecated-declarations -Wno-error=array-bounds -Wno-error=backend-plugin -Wno-error=free-nonheap-object -Wno-error=return-std-move -Wno-error=atomic-alignment -Wno-error=deprecated-copy -Wformat -Wformat-security -Wno-gnu-zero-variadic-macro-arguments -Wno-psabi -Wno-unknown-warning-option -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 -fno-strict-aliasing -fPIC -fno-rtti -fno-exceptions -fno-math-errno -pipe -g -O2 -O3 -fno-omit-frame-pointer -funwind-tables -Wno-error=shadow -Werror=switch -fexperimental-new-pass-manager  -MD -MP -MF .deps/Unified_cpp_image_decoders0.o.pp   Unified_cpp_image_decoders0.cpp
In file included from Unified_cpp_image_decoders0.cpp:11:
/wrkdirs/usr/ports/www/firefox/work/firefox-93.0/image/decoders/nsAVIFDecoder.cpp:1031:60: error: use of undeclared identifier 'AOM_PLANE_ALPHA'
  MOZ_ASSERT(aImage->stride[AOM_PLANE_Y] == aImage->stride[AOM_PLANE_ALPHA]);
                                                           ^
/wrkdirs/usr/ports/www/firefox/work/firefox-93.0/image/decoders/nsAVIFDecoder.cpp:1031:60: error: use of undeclared identifier 'AOM_PLANE_ALPHA'
2 errors generated.
gmake[4]: *** [/wrkdirs/usr/ports/www/firefox/work/firefox-93.0/config/rules.mk:676: Unified_cpp_image_decoders0.o] Error 1
gmake[4]: Leaving directory '/wrkdirs/usr/ports/www/firefox/work/.build/image/decoders'
gmake[3]: *** [/wrkdirs/usr/ports/www/firefox/work/firefox-93.0/config/recurse.mk:72: image/decoders/target-objects] Error 2
gmake[3]: Leaving directory '/wrkdirs/usr/ports/www/firefox/work/.build'
gmake[2]: *** [/wrkdirs/usr/ports/www/firefox/work/firefox-93.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-93.0/config/rules.mk:358: 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
Comment 1 Jan Beich freebsd_committer freebsd_triage 2021-10-11 00:49:32 UTC
Caused by files/patch-bug1559213. AOM_PLANE_ALPHA was removed in v1.0.0-835-gf1570f0c2 (2018-10-10 snapshot) but Firefox 93 still bundles v1.0.0-611-g1e227d41f (2018-08-06 snapshot). Firefox uses dav1d by default for AV1 video since 67 and for AVIF images since 78. A quick fix would be to drop alpha references until it builds but the proper fix is to get rid of bundled libaom or update it to a newer snapshot.

Switching back to the bundled version isn't a good idea e.g.,
https://nvd.nist.gov/vuln/detail/CVE-2021-30473
https://nvd.nist.gov/vuln/detail/CVE-2021-30474
https://nvd.nist.gov/vuln/detail/CVE-2021-30475
Comment 2 Jan Beich freebsd_committer freebsd_triage 2021-10-11 01:12:41 UTC
https://dev.gentoo.org/~whissi/mozilla/patchsets/firefox-93-patches-01.tar.xz doesn't have a fix as the patch is conditionally disabled per REQUIRED_USE="debug? ( !system-av1 )". Doing the same is kinda pointless because the MOZ_ASSERT line is elided in non-debug (release) builds and the condition within is always true as aom_image_t no longer has room for alpha i.e., stride[4] -> stride[3].
Comment 3 Jan Beich freebsd_committer freebsd_triage 2021-10-11 01:17:09 UTC
(In reply to Jan Beich from comment #2)
> Doing the same

Adding to USE_MOZILLA+=-av1 www/firefox/Makefile.local will elide --with-system-av1 from .mozconfig, effectively disabling the patch.
Comment 4 Graham Perrin freebsd_committer freebsd_triage 2023-04-23 13:18:29 UTC
Is this still an issue with 112.0.1_1,2 or greater on 12.4-RELEASE-p2?
Comment 5 ddrinnon 2023-04-27 12:15:22 UTC
(In reply to Graham Perrin from comment #4)

It still fails but later on in the build:

...
In file included from Unified_cpp_image_decoders0.cpp:11:
/wrkdirs/usr/ports/www/firefox/work/firefox-112.0.1/image/decoders/nsAVIFDecoder.cpp:1063:33: error: use of undeclared identifier 'AOM_PLANE_ALPHA'
             colorImage->stride[AOM_PLANE_ALPHA]);
                                ^
/wrkdirs/usr/ports/www/firefox/work/firefox-112.0.1/image/decoders/nsAVIFDecoder.cpp:1063:33: error: use of undeclared identifier 'AOM_PLANE_ALPHA'
2 errors generated.
gmake[4]: *** [/wrkdirs/usr/ports/www/firefox/work/firefox-112.0.1/config/rules.mk:670: Unified_cpp_image_decoders0.o] Error 1
gmake[4]: Leaving directory '/wrkdirs/usr/ports/www/firefox/work/.build/image/decoders'
gmake[3]: *** [/wrkdirs/usr/ports/www/firefox/work/firefox-112.0.1/config/recurse.mk:72: image/decoders/target-objects] Error 2
gmake[3]: Leaving directory '/wrkdirs/usr/ports/www/firefox/work/.build'
gmake[2]: *** [/wrkdirs/usr/ports/www/firefox/work/firefox-112.0.1/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-112.0.1/config/rules.mk:361: all] Error 2
gmake[1]: Leaving directory '/wrkdirs/usr/ports/www/firefox/work/.build'
*** Error code 1

...