meson: Configure with -Db_lundef=false on FreeBSD
Meson sets a default for all platforms which is -Db_lundef=true, meaning always add the --no-undefined flag to linker invocations. This is a consistently bad idea on FreeBSD, since the `environ` variable is provided not by libc but by the csu, leading to the linker complaining whenever it is used.
This commit is contained in:
parent
daad8c8069
commit
e27c288c0b
@ -249,7 +249,6 @@ stdenv.mkDerivation (finalAttrs: {
|
||||
"-Dlibelf=disabled"
|
||||
]
|
||||
++ lib.optionals stdenv.hostPlatform.isFreeBSD [
|
||||
"-Db_lundef=false"
|
||||
"-Dxattr=false"
|
||||
"-Dsysprof=disabled" # sysprof-capture does not build on FreeBSD
|
||||
];
|
||||
|
@ -144,6 +144,7 @@ python3.pkgs.buildPythonApplication rec {
|
||||
'';
|
||||
|
||||
setupHook = ./setup-hook.sh;
|
||||
env.hostPlatform = stdenv.targetPlatform.system;
|
||||
|
||||
meta = {
|
||||
homepage = "https://mesonbuild.com";
|
||||
|
@ -26,6 +26,11 @@ mesonConfigurePhase() {
|
||||
"--buildtype=${mesonBuildType:-plain}"
|
||||
)
|
||||
|
||||
# --no-undefined is universally a bad idea on freebsd because environ is in the csu
|
||||
if [[ "@hostPlatform@" == *-freebsd ]]; then
|
||||
flagsArray+=("-Db_lundef=false")
|
||||
fi
|
||||
|
||||
concatTo flagsArray mesonFlags mesonFlagsArray
|
||||
|
||||
echoCmd 'mesonConfigurePhase flags' "${flagsArray[@]}"
|
||||
|
Loading…
x
Reference in New Issue
Block a user