diff options
author | Artemis Tosini <lix@artem.ist> | 2024-06-16 14:42:54 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@localhost> | 2024-06-16 14:42:54 +0000 |
commit | ce2070139cc732dd253c2aa8fe511725f7e22d88 (patch) | |
tree | 495d481805f6098d9f3639813371cc4aa2927b2b | |
parent | dd70044cde0bee5cd66fca6347e294f6c7724001 (diff) | |
parent | f70b4258cdfd5d1d98e908dfc16fa15073d251ff (diff) |
Merge changes I81e76796,Iba319126 into main
* changes:
libutil: Set boost defines for FreeBSD
meson.build: Allow undefined symbols on FreeBSD
-rw-r--r-- | meson.build | 7 | ||||
-rw-r--r-- | src/libutil/fmt.hh | 4 |
2 files changed, 9 insertions, 2 deletions
diff --git a/meson.build b/meson.build index 7a6283ca2..5a772888d 100644 --- a/meson.build +++ b/meson.build @@ -167,6 +167,7 @@ message('canonical Nix system name:', host_system) is_linux = host_machine.system() == 'linux' is_darwin = host_machine.system() == 'darwin' +is_freebsd = host_machine.system() == 'freebsd' is_x64 = host_machine.cpu_family() == 'x86_64' # Per-platform arguments that you should probably pass to shared_module() invocations. @@ -462,6 +463,12 @@ if cxx.get_linker_id() in ['ld.bfd', 'ld.gold'] add_project_link_arguments('-Wl,--no-copy-dt-needed-entries', language : 'cpp') endif +if is_freebsd + # FreeBSD's `environ` is defined in `crt1.o`, not `libc.so`, + # so the linker thinks it's undefined + add_project_link_arguments('-Wl,-z,undefs', language: 'cpp') +endif + # Generate Chromium tracing files for each compiled file, which enables # maintainers/buildtime_report.sh BUILD-DIR to simply work in clang builds. # diff --git a/src/libutil/fmt.hh b/src/libutil/fmt.hh index df4492993..d015f7e5f 100644 --- a/src/libutil/fmt.hh +++ b/src/libutil/fmt.hh @@ -5,8 +5,8 @@ #include <string> #include <optional> #include <boost/format.hpp> -// Darwin stdenv does not define _GNU_SOURCE but does have _Unwind_Backtrace. -#ifdef __APPLE__ +// Darwin and FreeBSD stdenv do not define _GNU_SOURCE but do have _Unwind_Backtrace. +#if __APPLE__ || __FreeBSD__ #define BOOST_STACKTRACE_GNU_SOURCE_NOT_REQUIRED #endif #include <boost/stacktrace.hpp> |