Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 31 Jan 2024 12:11:03 +0000
From:      bugzilla-noreply@freebsd.org
To:        gecko@FreeBSD.org
Subject:   maintainer-feedback requested: [Bug 276746] www/firefox: fix build with libc++ 18
Message-ID:  <bug-276746-21738-ASHSlgdjnL@https.bugs.freebsd.org/bugzilla/>
In-Reply-To: <bug-276746-21738@https.bugs.freebsd.org/bugzilla/>
References:  <bug-276746-21738@https.bugs.freebsd.org/bugzilla/>

next in thread | previous in thread | raw e-mail | index | archive | help
Bugzilla Automation <bugzilla@FreeBSD.org> has asked freebsd-gecko (Nobody)
<gecko@FreeBSD.org> for maintainer-feedback:
Bug 276746: www/firefox: fix build with libc++ 18
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D276746



--- 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 <https://bugzilla.mozilla.org/1873379>;
in the mean time, upstream committed
<https://hg.mozilla.org/mozilla-central/rev/9e96d1447f6c>; 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
<https://github.com/llvm/llvm-project/issues/79027>, 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
<https://gcc.gnu.org/wiki/Visibility#line-91>).

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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-276746-21738-ASHSlgdjnL>