Bug 1874059: fix build with libc++>=18 on OpenBSD and FreeBSD r=sylvestre a=RyanVM DONTBUILD

without -fvisibility=hidden, linking libxul fails with undefined hidden symbol
references to std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>

Differential Revision: https://phabricator.services.mozilla.com/D262230
This commit is contained in:
Landry Breuil
2025-08-31 08:12:02 +00:00
committed by rvandermeulen@mozilla.com
parent 90bc3d36c3
commit ede5e748f7

View File

@@ -2443,7 +2443,7 @@ set_define("_LIBCPP_HIDE_FROM_ABI", libcxx_override_visibility.hide_from_abi)
@depends(target, build_environment) @depends(target, build_environment)
def visibility_flags(target, env): def visibility_flags(target, env):
if target.os != "WINNT": if target.os != "WINNT":
if target.kernel == "Darwin": if target.kernel in ("Darwin", "FreeBSD", "OpenBSD"):
return ("-fvisibility=hidden", "-fvisibility-inlines-hidden") return ("-fvisibility=hidden", "-fvisibility-inlines-hidden")
return ( return (
"-I%s/system_wrappers" % os.path.join(env.dist), "-I%s/system_wrappers" % os.path.join(env.dist),