File tree Expand file tree Collapse file tree 4 files changed +17
-1
lines changed
Expand file tree Collapse file tree 4 files changed +17
-1
lines changed Original file line number Diff line number Diff line change @@ -108,6 +108,9 @@ SPC_CMD_VAR_PHP_MAKE_EXTRA_LDFLAGS=""
108108; EXTRA_LDFLAGS_PROGRAM for `make` php
109109SPC_CMD_VAR_PHP_MAKE_EXTRA_LDFLAGS_PROGRAM =" -all-static -pie"
110110
111+ # Zig
112+ ZIG_SHARED_EXTENSION_EXTRA_OBJECTS =" /usr/lib/gcc/x86_64-redhat-linux/14/crtbeginS.o /usr/lib/gcc/x86_64-redhat-linux/14/crtendS.o"
113+
111114[macos]
112115; compiler environments
113116CC =clang
Original file line number Diff line number Diff line change @@ -215,7 +215,16 @@ public function patchBeforeSharedConfigure(): bool
215215 */
216216 public function patchBeforeSharedMake (): bool
217217 {
218- return false ;
218+ if (!str_contains (getenv ('CC ' ), 'zig ' )) {
219+ return false ;
220+ }
221+ $ extra = getenv ('ZIG_SHARED_EXTENSION_EXTRA_OBJECTS ' );
222+ FileSystem::replaceFileRegex (
223+ $ this ->source_dir . '/Makefile ' ,
224+ "/^(shared_objects_ {$ this ->getName ()}\s*=.*)$/m " ,
225+ "$1 {$ extra }" ,
226+ );
227+ return true ;
219228 }
220229
221230 /**
Original file line number Diff line number Diff line change @@ -20,6 +20,7 @@ public function validate(): void
2020
2121 public function patchBeforeSharedMake (): bool
2222 {
23+ parent ::patchBeforeSharedMake ();
2324 if (PHP_OS_FAMILY !== 'Linux ' || arch2gnu (php_uname ('m ' )) !== 'aarch64 ' ) {
2425 return false ;
2526 }
Original file line number Diff line number Diff line change @@ -308,6 +308,9 @@ protected function buildEmbed(): void
308308 }
309309 if (file_exists ($ libphpRelease )) {
310310 chdir (BUILD_LIB_PATH );
311+ if (file_exists ($ libphpPath )) {
312+ unlink ($ libphpPath );
313+ }
311314 symlink ($ realLibName , 'libphp.so ' );
312315 }
313316 if (is_dir (BUILD_MODULES_PATH )) {
You can’t perform that action at this time.
0 commit comments