maintainer-feedback requested: [Bug 276746] www/firefox: fix build with libc++ 18

From: <>
Date: Wed, 31 Jan 2024 12:11:03 UTC
Bugzilla Automation <> has asked freebsd-gecko (Nobody)
<> for maintainer-feedback:
Bug 276746: www/firefox: fix build with libc++ 18

--- Description ---
This fixes two problems in www/firefox related to libc++ 18:
* rust-bindgen problems with tuple definitions
* visibility issues caused by gcc_hidden.h

The first problem is that rust-bindgen uses some tricks to generate
bindings for C++ components, but gets confused by some new constructs in
libc++ 18 headers, causing it to generate faulty binding code.

This is described more fully in <>;
in the mean time, upstream committed
<> to fix it.

The second problem is that the firefox build uses a rather brute force
technique to suppress visibility of unwanted symbols in their shared
libraries: they include a file config/gcc_hidden.h in front of almost
every source file.

This file contains nothing but a line containing "#pragma GCC visibility
push(hidden)", forcing everything after it to have hidden visibility.
This causes link errors with libc++ 18 and later, similar to:

  ld.lld: error: undefined hidden symbol: std::__1::basic_string<char,
std::__1::char_traits<char>, std::__1::allocator<char>>::append(char const*,
unsigned long)

The issue is described more fully in
<>, but upstream has
not been able to decide if it is really a problem on their end, or if
they want to support the use case at all.

A better way to fix this is by using the more usual -fvisibility command
line flags, which are similar in effect, but do not override extern
declarations such as the ones in libc++ headers (see also

This is achieved by patching build/moz.configure/toolchain.configure, to
use the -fvisibility=hidden and -fvisibility-inlines-hidden flags on
FreeBSD in addition to Darwin. I am considering also sending this