@@ -284,8 +284,6 @@ protected function buildEmbed(): void
284284 // process libphp.so for shared embed
285285 $ libphpSo = BUILD_LIB_PATH . '/libphp.so ' ;
286286 if (file_exists ($ libphpSo )) {
287- // post actions: rename libphp.so to libphp-<release>.so if -release is set in LDFLAGS
288- $ this ->processLibphpSoFile ($ libphpSo );
289287 // deploy libphp.so
290288 $ this ->deployBinary ($ libphpSo , $ libphpSo , false );
291289 }
@@ -319,40 +317,11 @@ private function getMakeExtraVars(): array
319317 return array_filter ([
320318 'EXTRA_CFLAGS ' => getenv ('SPC_CMD_VAR_PHP_MAKE_EXTRA_CFLAGS ' ),
321319 'EXTRA_LIBS ' => $ config ['libs ' ],
322- 'EXTRA_LDFLAGS ' => preg_replace ( ' /-release\s+(\S+)/ ' , '' , getenv ('SPC_CMD_VAR_PHP_MAKE_EXTRA_LDFLAGS ' ) ),
320+ 'EXTRA_LDFLAGS ' => getenv ('SPC_CMD_VAR_PHP_MAKE_EXTRA_LDFLAGS ' ),
323321 'EXTRA_LDFLAGS_PROGRAM ' => "-L {$ lib } {$ static } -pie " ,
324322 ]);
325323 }
326324
327- private function processLibphpSoFile (string $ libphpSo ): void
328- {
329- $ ldflags = getenv ('SPC_CMD_VAR_PHP_MAKE_EXTRA_LDFLAGS ' ) ?: '' ;
330- $ libDir = BUILD_LIB_PATH ;
331- $ cwd = getcwd ();
332-
333- if (preg_match ('/-release\s+(\S+)/ ' , $ ldflags , $ matches )) {
334- $ release = $ matches [1 ];
335- $ releaseName = "libphp- {$ release }.so " ;
336- $ libphpRelease = "{$ libDir }/ {$ releaseName }" ;
337- if (!file_exists ($ libphpRelease ) && file_exists ($ libphpSo )) {
338- rename ($ libphpSo , $ libphpRelease );
339- }
340- if (file_exists ($ libphpRelease )) {
341- chdir ($ libDir );
342- if (file_exists ($ libphpSo )) {
343- unlink ($ libphpSo );
344- }
345- symlink ($ releaseName , 'libphp.so ' );
346- shell ()->exec (sprintf (
347- 'patchelf --set-soname %s %s ' ,
348- escapeshellarg ($ releaseName ),
349- escapeshellarg ($ libphpRelease )
350- ));
351- }
352- chdir ($ cwd );
353- }
354- }
355-
356325 /**
357326 * Patch micro.sfx after UPX compression.
358327 * micro needs special section handling in LinuxBuilder.
0 commit comments