make sure -ldl is not taken as needed, problem on EL8

This commit is contained in:
henderkes 2025-09-18 22:47:01 +02:00
parent e323d7b155
commit 927d7f55ba

View File

@ -32,7 +32,10 @@ trait imagemagick
);
// special: linux-static target needs `-static`
$ldflags = SPCTarget::isStatic() ? ('-static -ldl') : '-ldl';
$ldflags = SPCTarget::isStatic() ? '-static -ldl' : '-ldl';
if (str_contains($this->builder->arch_ld_flags, '-Wl,--as-needed')) {
$ldflags = str_replace('-ldl', '-Wl,--no-as-needed -ldl -Wl,--as-needed', $ldflags);
}
// special: macOS needs -iconv
$libs = SPCTarget::getTargetOS() === 'Darwin' ? '-liconv' : '';