Skip to content

Commit e884f97

Browse files
authored
Merge pull request #723 from crazywhalecc/fix/xslt
fix libxslt build when trying to create a PIE executable using it
2 parents e7d6f37 + e4028da commit e884f97

File tree

2 files changed

+17
-15
lines changed

2 files changed

+17
-15
lines changed

src/SPC/builder/unix/library/libxslt.php

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,14 @@ protected function build(): void
2525
}
2626
}
2727
shell()->cd($this->source_dir)
28-
->exec(
29-
'CFLAGS="-I' . BUILD_INCLUDE_PATH . '" ' .
28+
->setEnv([
29+
'CFLAGS' => trim($this->getLibExtraCFlags() . ' -I' . BUILD_INCLUDE_PATH),
30+
'LDFLAGS' => trim($this->getLibExtraLdFlags() . ' -L' . BUILD_LIB_PATH),
31+
'LIBS' => trim($this->getLibExtraLibs() . "{$required_libs} -lstdc++"),
32+
])
33+
->execWithEnv(
3034
"{$this->builder->getOption('library_path')} " .
3135
"{$this->builder->getOption('ld_library_path')} " .
32-
'LDFLAGS="-L' . BUILD_LIB_PATH . '" ' .
33-
"LIBS='{$required_libs} -lstdc++' " .
3436
'./configure ' .
3537
'--enable-static --disable-shared ' .
3638
'--without-python ' .
@@ -41,9 +43,9 @@ protected function build(): void
4143
'--with-libxml-prefix=' . escapeshellarg(BUILD_ROOT_PATH) . ' ' .
4244
'--prefix='
4345
)
44-
->exec('make clean')
45-
->exec("make -j{$this->builder->concurrency}")
46-
->exec('make install DESTDIR=' . escapeshellarg(BUILD_ROOT_PATH));
46+
->execWithEnv('make clean')
47+
->execWithEnv("make -j{$this->builder->concurrency}")
48+
->execWithEnv('make install DESTDIR=' . escapeshellarg(BUILD_ROOT_PATH));
4749
$this->patchPkgconfPrefix(['libexslt.pc']);
4850
}
4951
}

src/globals/test-extensions.php

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,15 @@
2121

2222
// test os (macos-13, macos-14, macos-15, ubuntu-latest, windows-latest are available)
2323
$test_os = [
24-
// 'macos-13',
24+
'macos-13',
2525
// 'macos-14',
26-
// 'macos-15',
27-
// 'ubuntu-latest',
28-
// 'ubuntu-22.04',
26+
'macos-15',
27+
'ubuntu-latest',
28+
'ubuntu-22.04',
2929
// 'ubuntu-24.04',
30-
// 'ubuntu-22.04-arm',
31-
// 'ubuntu-24.04-arm',
32-
'windows-latest',
30+
'ubuntu-22.04-arm',
31+
'ubuntu-24.04-arm',
32+
// 'windows-latest',
3333
];
3434

3535
// whether enable thread safe
@@ -45,7 +45,7 @@
4545

4646
// If you want to test your added extensions and libs, add below (comma separated, example `bcmath,openssl`).
4747
$extensions = match (PHP_OS_FAMILY) {
48-
'Linux', 'Darwin' => 'pgsql',
48+
'Linux', 'Darwin' => 'xsl,simplexml,xlswriter',
4949
'Windows' => 'xlswriter,openssl',
5050
};
5151

0 commit comments

Comments
 (0)