Skip to content

Commit 8a4ba7a

Browse files
DubbleClickmhpcc
andauthored
fix libffi compiling without -fPIC because of missing env (#657)
Co-authored-by: Marc Henderkes <[email protected]>
1 parent 146a4d3 commit 8a4ba7a

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/SPC/builder/linux/library/libffi.php

+6-6
Original file line numberDiff line numberDiff line change
@@ -18,22 +18,22 @@ class libffi extends LinuxLibraryBase
1818
public function build(): void
1919
{
2020
[$lib, , $destdir] = SEPARATED_PATH;
21-
2221
$arch = getenv('SPC_ARCH');
2322

2423
shell()->cd($this->source_dir)
25-
->exec(
24+
->setEnv(['CFLAGS' => $this->getLibExtraCFlags(), 'LDFLAGS' => $this->getLibExtraLdFlags(), 'LIBS' => $this->getLibExtraLibs()])
25+
->execWithEnv(
2626
'./configure ' .
2727
'--enable-static ' .
2828
'--disable-shared ' .
2929
"--host={$arch}-unknown-linux " .
3030
"--target={$arch}-unknown-linux " .
31-
'--prefix= ' . // use prefix=/
31+
'--prefix= ' .
3232
"--libdir={$lib}"
3333
)
34-
->exec('make clean')
35-
->exec("make -j{$this->builder->concurrency}")
36-
->exec("make install DESTDIR={$destdir}");
34+
->execWithEnv('make clean')
35+
->execWithEnv("make -j{$this->builder->concurrency}")
36+
->execWithEnv("make install DESTDIR={$destdir}");
3737

3838
if (is_file(BUILD_ROOT_PATH . '/lib64/libffi.a')) {
3939
copy(BUILD_ROOT_PATH . '/lib64/libffi.a', BUILD_ROOT_PATH . '/lib/libffi.a');

0 commit comments

Comments
 (0)