Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 944056 - www-client/firefox:rapid does not build with bundled graphite2 (or +wasm) on llvm profile
Summary: www-client/firefox:rapid does not build with bundled graphite2 (or +wasm) on ...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Mozilla Gentoo Team
URL:
Whiteboard:
Keywords: PATCH
Depends on:
Blocks:
 
Reported: 2024-11-19 23:01 UTC by Red
Modified: 2024-12-12 06:58 UTC (History)
5 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
Build log (xz compressed) (firefox-build.log.xz,424.05 KB, application/x-xz)
2024-11-19 23:02 UTC, Red
Details
emerge --info (firefox-emerge-info.txt,28.57 KB, text/plain)
2024-11-19 23:02 UTC, Red
Details
llvm-profile -default/linux/amd64/23.0/llvm - build.log.bz2 (build.log.bz2,479.15 KB, application/x-bzip2)
2024-11-26 22:57 UTC, Gino McCarty
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Red 2024-11-19 23:01:26 UTC
=www-client/firefox-132.0.2 does not build with USE=wasm
Builds fine without USE=wasm

Error log and emerge --info attached.

Reproducible: Always
Comment 1 Red 2024-11-19 23:02:33 UTC
Created attachment 910403 [details]
Build log (xz compressed)
Comment 2 Red 2024-11-19 23:02:56 UTC
Created attachment 910404 [details]
emerge --info
Comment 3 Joonas Niilola gentoo-dev 2024-11-20 16:54:08 UTC
Always try without ccache first when the build fails with it.
Comment 4 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2024-11-20 17:45:04 UTC
 0:42.20 In file included from Unified_cpp_gfx_graphite2_src0.cpp:29:
 0:42.20 In file included from /var/tmp/portage/www-client/firefox-132.0.2/work/firefox-132.0.2/gfx/graphite2/src/Collider.cpp:31:
 0:42.20 In file included from /var/tmp/portage/www-client/firefox-132.0.2/work/firefox_build/dist/stl_wrappers/functional:62:
 0:42.20 In file included from /usr/include/c++/v1/functional:526:
 0:42.21 In file included from /usr/include/c++/v1/__functional/boyer_moore_searcher.h:27:
 0:42.21 In file included from /var/tmp/portage/www-client/firefox-132.0.2/work/firefox_build/dist/stl_wrappers/vector:62:
 0:42.21 In file included from /usr/include/c++/v1/vector:325:
 0:42.21 In file included from /usr/include/c++/v1/__format/formatter_bool.h:20:
 0:42.21 In file included from /usr/include/c++/v1/__format/formatter_integral.h:35:
 0:42.21 /usr/include/c++/v1/locale:2429:26: error: no member named 'moz_xrealloc' in namespace 'std'; did you mean simply 'moz_xrealloc'?
 0:42.21  2429 |   _Tp* __t       = (_Tp*)std::realloc(__owns ? __b.get() : 0, __new_cap);
Comment 5 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2024-11-20 17:45:27 UTC
Do you have USE=default-libcxx on sys-devel/clang-common or something?
Comment 6 Red 2024-11-20 22:25:09 UTC
(In reply to Sam James from comment #5)
> Do you have USE=default-libcxx on sys-devel/clang-common or something?

Yes, apparently I do.
Comment 7 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2024-11-22 19:01:34 UTC
I'd just suggest not doing that.
Comment 8 Gino McCarty 2024-11-26 19:32:04 UTC
(In reply to Sam James from comment #7)
> I'd just suggest not doing that.

For us few foolish enough to run llvm profiles is there a work around here?

sys-devel/clang-common-18.1.8-r3::gentoo  USE="cet (default-compiler-rt) (default-libcxx) (default-lld) (llvm-libunwind) -bootstrap-prefix -hardened -verify-sig" 

I could try setting an profile.env?
Comment 9 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2024-11-26 22:11:21 UTC
If it happens on LLVM profiles too (rather than those mix-and-matching where they're seemingly accidentally using default-libcxx), then it's more interesting, but I don't yet have an answer.

Needs investigation.
Comment 10 Gino McCarty 2024-11-26 22:57:19 UTC
Created attachment 912207 [details]
llvm-profile -default/linux/amd64/23.0/llvm  - build.log.bz2

(In reply to Sam James from comment #9)
> If it happens on LLVM profiles too (rather than those mix-and-matching where
> they're seemingly accidentally using default-libcxx), then it's more
> interesting, but I don't yet have an answer.
> 
> Needs investigation.

Attached build.log for llvm profile, appears to be the same error


819:12.34 In file included from /usr/include/c++/v1/__format/formatter_integral.h:35:
819:12.34 /usr/include/c++/v1/locale:2429:26: error: no member named 'moz_xrealloc' in namespace 'std'; did you mean simply 'moz_xrealloc'?
819:12.34  2429 |   _Tp* __t       = (_Tp*)std::realloc(__owns ? __b.get() : 0, __new_cap);
819:12.35       |                          ^~~~~
Comment 11 Joonas Niilola gentoo-dev 2024-11-27 18:42:17 UTC
This is a bundled graphite2 problem. For whatever reason using the system-graphite2 works, however wasm is going to use the bundled one because system-graphite2 can't obviously be rlboxed when compiling Firefox.

So to clarify: -system-harfbuzz OR +wasm is broken on llvm profiles due to this issue. Upstream probably doesn't support libc++ so if you find a patch, let me know and it can be added.
Comment 12 Joonas Niilola gentoo-dev 2024-11-27 18:47:03 UTC
There might be a patch on our graphite2 package that fixes libcxx issues, something like https://gitweb.gentoo.org/repo/gentoo.git/tree/media-gfx/graphite2/files/graphite2-1.3.14-fix-nodefaultlibs-deux.patch that could be applied to firefox's bundled graphite2 too. If someone wants to give it a try.
Comment 13 12101111 2024-11-28 14:04:02 UTC
A simple fix:

--- a/gfx/graphite2/src/MozGrMalloc.h
+++ b/gfx/graphite2/src/MozGrMalloc.h
@@ -12,7 +12,7 @@

 #include "mozilla/mozalloc.h"

-#if defined(XP_LINUX) && !defined(ANDROID)
+#if defined(XP_LINUX) && !defined(_LIBCPP_VERSION)

 #define malloc moz_xmalloc
 #define calloc moz_xcalloc

See also: 

https://phabricator.services.mozilla.com/D216900
https://bugzilla.mozilla.org/show_bug.cgi?id=1893001
Comment 14 Larry the Git Cow gentoo-dev 2024-12-12 06:58:30 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=fd9fb06f801f46839b0b8c2510693416f6dcba2d

commit fd9fb06f801f46839b0b8c2510693416f6dcba2d
Author:     Joonas Niilola <juippis@gentoo.org>
AuthorDate: 2024-12-12 06:55:39 +0000
Commit:     Joonas Niilola <juippis@gentoo.org>
CommitDate: 2024-12-12 06:55:39 +0000

    www-client/firefox: add 133.0.3
    
     - add python-3.13 compatibility through upstream patches,
     - include a patch from bgo#944056 to (hopefully) fix compilation when using
       +wasm or -system-harfbuzz use flags on llvm profile.
    
    Closes: https://bugs.gentoo.org/944056
    Signed-off-by: Joonas Niilola <juippis@gentoo.org>

 www-client/firefox/Manifest               |  102 +++
 www-client/firefox/firefox-133.0.3.ebuild | 1370 +++++++++++++++++++++++++++++
 2 files changed, 1472 insertions(+)