forked from lix-project/lix
Fix build on FreeBSD
FreeBSD defines environ in crt1.o, so allow undefined symbols when
linking libraries to fix libutil build.
Also set defines in libutil to fix boost headers.
Change-Id: I094b8ac97469b26fd5d096617a58d7fd279103ae
This commit is contained in:
parent
dd53bce476
commit
6a945e1d2b
|
@ -138,6 +138,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.
|
||||
|
@ -454,6 +455,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`.
|
||||
#
|
||||
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.
|
||||
#
|
||||
|
|
|
@ -27,7 +27,7 @@ stdenv.mkDerivation (finalAttrs: {
|
|||
platforms = lib.platforms.unix;
|
||||
# `long long int` != `size_t`
|
||||
# There's no convenient lib.platforms.32bit or anything, but it's easy enough to do ourselves.
|
||||
badPlatforms = lib.filter (plat: (lib.systems.elaborate plat).is32bit) lib.platforms.all;
|
||||
badPlatforms = (lib.filter (plat: (lib.systems.elaborate plat).is32bit) lib.platforms.all) ++ lib.platforms.freebsd;
|
||||
mainProgram = "ClangBuildAnalyzer";
|
||||
};
|
||||
})
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
#include <optional>
|
||||
#include <boost/format.hpp>
|
||||
// Darwin stdenv does not define _GNU_SOURCE but does have _Unwind_Backtrace.
|
||||
#ifdef __APPLE__
|
||||
#if __APPLE__ || __FreeBSD__
|
||||
#define BOOST_STACKTRACE_GNU_SOURCE_NOT_REQUIRED
|
||||
#endif
|
||||
#include <boost/stacktrace.hpp>
|
||||
|
|
Loading…
Reference in a new issue