Merge pull request #723 from crazywhalecc/fix/xslt

fix libxslt build when trying to create a PIE executable using it
This commit is contained in:
Marc
2025-05-07 10:50:04 +07:00
committed by GitHub
2 changed files with 17 additions and 15 deletions

View File

@@ -25,12 +25,14 @@ trait libxslt
} }
} }
shell()->cd($this->source_dir) shell()->cd($this->source_dir)
->exec( ->setEnv([
'CFLAGS="-I' . BUILD_INCLUDE_PATH . '" ' . 'CFLAGS' => trim($this->getLibExtraCFlags() . ' -I' . BUILD_INCLUDE_PATH),
'LDFLAGS' => trim($this->getLibExtraLdFlags() . ' -L' . BUILD_LIB_PATH),
'LIBS' => trim($this->getLibExtraLibs() . "{$required_libs} -lstdc++"),
])
->execWithEnv(
"{$this->builder->getOption('library_path')} " . "{$this->builder->getOption('library_path')} " .
"{$this->builder->getOption('ld_library_path')} " . "{$this->builder->getOption('ld_library_path')} " .
'LDFLAGS="-L' . BUILD_LIB_PATH . '" ' .
"LIBS='{$required_libs} -lstdc++' " .
'./configure ' . './configure ' .
'--enable-static --disable-shared ' . '--enable-static --disable-shared ' .
'--without-python ' . '--without-python ' .
@@ -41,9 +43,9 @@ trait libxslt
'--with-libxml-prefix=' . escapeshellarg(BUILD_ROOT_PATH) . ' ' . '--with-libxml-prefix=' . escapeshellarg(BUILD_ROOT_PATH) . ' ' .
'--prefix=' '--prefix='
) )
->exec('make clean') ->execWithEnv('make clean')
->exec("make -j{$this->builder->concurrency}") ->execWithEnv("make -j{$this->builder->concurrency}")
->exec('make install DESTDIR=' . escapeshellarg(BUILD_ROOT_PATH)); ->execWithEnv('make install DESTDIR=' . escapeshellarg(BUILD_ROOT_PATH));
$this->patchPkgconfPrefix(['libexslt.pc']); $this->patchPkgconfPrefix(['libexslt.pc']);
} }
} }

View File

@@ -21,15 +21,15 @@ $test_php_version = [
// test os (macos-13, macos-14, macos-15, ubuntu-latest, windows-latest are available) // test os (macos-13, macos-14, macos-15, ubuntu-latest, windows-latest are available)
$test_os = [ $test_os = [
// 'macos-13', 'macos-13',
// 'macos-14', // 'macos-14',
// 'macos-15', 'macos-15',
// 'ubuntu-latest', 'ubuntu-latest',
// 'ubuntu-22.04', 'ubuntu-22.04',
// 'ubuntu-24.04', // 'ubuntu-24.04',
// 'ubuntu-22.04-arm', 'ubuntu-22.04-arm',
// 'ubuntu-24.04-arm', 'ubuntu-24.04-arm',
'windows-latest', // 'windows-latest',
]; ];
// whether enable thread safe // whether enable thread safe
@@ -45,7 +45,7 @@ $prefer_pre_built = false;
// If you want to test your added extensions and libs, add below (comma separated, example `bcmath,openssl`). // If you want to test your added extensions and libs, add below (comma separated, example `bcmath,openssl`).
$extensions = match (PHP_OS_FAMILY) { $extensions = match (PHP_OS_FAMILY) {
'Linux', 'Darwin' => 'pgsql', 'Linux', 'Darwin' => 'xsl,simplexml,xlswriter',
'Windows' => 'xlswriter,openssl', 'Windows' => 'xlswriter,openssl',
}; };