File tree Expand file tree Collapse file tree 3 files changed +11
-2
lines changed
Expand file tree Collapse file tree 3 files changed +11
-2
lines changed Original file line number Diff line number Diff line change 1111use SPC \store \Config ;
1212use SPC \store \FileSystem ;
1313use SPC \util \SPCConfigUtil ;
14- use SPC \util \SPCTarget ;
1514
1615class Extension
1716{
Original file line number Diff line number Diff line change @@ -206,6 +206,16 @@ protected function sanityCheck(int $build_target): void
206206 if (SPCTarget::isStatic ()) {
207207 $ lens .= ' -static ' ;
208208 }
209+ // if someone changed to EMBED_TYPE=shared, we need to add LD_LIBRARY_PATH
210+ if (getenv ('SPC_CMD_VAR_PHP_EMBED_TYPE ' ) === 'shared ' ) {
211+ $ ext_path = 'LD_LIBRARY_PATH= ' . BUILD_LIB_PATH . ':$LD_LIBRARY_PATH ' ;
212+ FileSystem::removeFileIfExists (BUILD_LIB_PATH . '/libphp.a ' );
213+ } else {
214+ $ ext_path = '' ;
215+ foreach (glob (BUILD_LIB_PATH . '/libphp*.so ' ) as $ file ) {
216+ unlink ($ file );
217+ }
218+ }
209219 [$ ret , $ out ] = shell ()->cd ($ sample_file_path )->execWithResult (getenv ('CC ' ) . ' -o embed embed.c ' . $ lens );
210220 if ($ ret !== 0 ) {
211221 throw new RuntimeException ('embed failed sanity check: build failed. Error message: ' . implode ("\n" , $ out ));
@@ -320,6 +330,7 @@ protected function buildFrankenphp(): void
320330 $ debugFlags = $ this ->getOption ('no-strip ' ) ? "'-w -s' " : '' ;
321331 $ extLdFlags = "-extldflags '-pie' " ;
322332 $ muslTags = '' ;
333+ $ staticFlags = '' ;
323334 if (SPCTarget::isStatic ()) {
324335 $ extLdFlags = "-extldflags '-static-pie -Wl,-z,stack-size=0x80000' " ;
325336 $ muslTags = 'static_build, ' ;
Original file line number Diff line number Diff line change 66
77use SPC \exception \RuntimeException ;
88use SPC \exception \WrongUsageException ;
9- use SPC \store \pkg \Zig ;
109use SPC \toolchain \ToolchainManager ;
1110
1211/**
You can’t perform that action at this time.
0 commit comments