mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-09 09:39:39 +00:00
LibCore+Meta: Workaround some symbols not being exported on FreeBSD
On FreeBSD some symbols like `environ` or `__progname` are not exported anywhere and are filled in by the dynamic loader. `environ` is a special case because we make use of it explicitly so we need to mark it a weak symbol so the linker doesn't complain.
This commit is contained in:
parent
3056e54cd0
commit
2aa8c950ca
Notes:
github-actions[bot]
2025-07-15 19:46:35 +00:00
Author: https://github.com/cqundefine
Commit: 2aa8c950ca
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/5244
Reviewed-by: https://github.com/ADKaster ✅
Reviewed-by: https://github.com/clausecker
Reviewed-by: https://github.com/trflynn89
2 changed files with 7 additions and 1 deletions
|
@ -13,6 +13,9 @@
|
||||||
|
|
||||||
#if defined(AK_OS_MACOS) || defined(AK_OS_IOS)
|
#if defined(AK_OS_MACOS) || defined(AK_OS_IOS)
|
||||||
# include <crt_externs.h>
|
# include <crt_externs.h>
|
||||||
|
#elif defined(AK_OS_FREEBSD)
|
||||||
|
// FIXME: Remove this once FreeBSD exports environ from libc
|
||||||
|
extern "C" __attribute__((weak)) char** environ;
|
||||||
#elif !defined(AK_OS_WINDOWS)
|
#elif !defined(AK_OS_WINDOWS)
|
||||||
extern "C" char** environ;
|
extern "C" char** environ;
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -75,8 +75,11 @@ if (NOT WIN32 AND NOT APPLE AND NOT ENABLE_FUZZERS)
|
||||||
else()
|
else()
|
||||||
add_link_options(LINKER:-z,defs)
|
add_link_options(LINKER:-z,defs)
|
||||||
add_link_options(LINKER:--no-undefined)
|
add_link_options(LINKER:--no-undefined)
|
||||||
|
# FIXME: Remove this once FreeBSD exports environ from libc
|
||||||
|
if (NOT CMAKE_SYSTEM_NAME MATCHES "FreeBSD")
|
||||||
add_link_options(LINKER:--no-allow-shlib-undefined)
|
add_link_options(LINKER:--no-allow-shlib-undefined)
|
||||||
endif()
|
endif()
|
||||||
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if (ENABLE_LAGOM_COVERAGE_COLLECTION)
|
if (ENABLE_LAGOM_COVERAGE_COLLECTION)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue