fix libffi compiling without -fPIC because of missing env (#657)

Co-authored-by: Marc Henderkes <m.henderkes@pc-college.de>
This commit is contained in:
Marc 2025-03-19 07:49:25 +01:00 committed by GitHub
parent 146a4d334b
commit 8a4ba7a876
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -18,22 +18,22 @@ class libffi extends LinuxLibraryBase
public function build(): void public function build(): void
{ {
[$lib, , $destdir] = SEPARATED_PATH; [$lib, , $destdir] = SEPARATED_PATH;
$arch = getenv('SPC_ARCH'); $arch = getenv('SPC_ARCH');
shell()->cd($this->source_dir) shell()->cd($this->source_dir)
->exec( ->setEnv(['CFLAGS' => $this->getLibExtraCFlags(), 'LDFLAGS' => $this->getLibExtraLdFlags(), 'LIBS' => $this->getLibExtraLibs()])
->execWithEnv(
'./configure ' . './configure ' .
'--enable-static ' . '--enable-static ' .
'--disable-shared ' . '--disable-shared ' .
"--host={$arch}-unknown-linux " . "--host={$arch}-unknown-linux " .
"--target={$arch}-unknown-linux " . "--target={$arch}-unknown-linux " .
'--prefix= ' . // use prefix=/ '--prefix= ' .
"--libdir={$lib}" "--libdir={$lib}"
) )
->exec('make clean') ->execWithEnv('make clean')
->exec("make -j{$this->builder->concurrency}") ->execWithEnv("make -j{$this->builder->concurrency}")
->exec("make install DESTDIR={$destdir}"); ->execWithEnv("make install DESTDIR={$destdir}");
if (is_file(BUILD_ROOT_PATH . '/lib64/libffi.a')) { if (is_file(BUILD_ROOT_PATH . '/lib64/libffi.a')) {
copy(BUILD_ROOT_PATH . '/lib64/libffi.a', BUILD_ROOT_PATH . '/lib/libffi.a'); copy(BUILD_ROOT_PATH . '/lib64/libffi.a', BUILD_ROOT_PATH . '/lib/libffi.a');