File tree Expand file tree Collapse file tree 3 files changed +16
-10
lines changed
Expand file tree Collapse file tree 3 files changed +16
-10
lines changed Original file line number Diff line number Diff line change 6969 ])
7070 ->setFinder (
7171 PhpCsFixer \Finder::create ()->in ([__DIR__ . '/src ' , __DIR__ . '/tests/SPC ' ])
72- );
72+ )
73+ ->setParallelConfig (PhpCsFixer \Runner \Parallel \ParallelConfigFactory::detect ());
Original file line number Diff line number Diff line change 1313use SPC \toolchain \ToolchainManager ;
1414use SPC \toolchain \ZigToolchain ;
1515use SPC \util \GlobalEnvManager ;
16+ use SPC \util \SPCTarget ;
1617
1718class LinuxBuilder extends UnixBuilderBase
1819{
@@ -92,7 +93,9 @@ public function buildPHP(int $build_target = BUILD_TARGET_NONE): void
9293 $ zts = '' ;
9394 }
9495 $ disable_jit = $ this ->getOption ('disable-opcache-jit ' , false ) ? '--disable-opcache-jit ' : '' ;
95-
96+ if (!$ disable_jit && $ this ->getExt ('opcache ' )) {
97+ f_putenv ('COMPILER_EXTRA=-fno-sanitize=undefined ' );
98+ }
9699 $ config_file_path = $ this ->getOption ('with-config-file-path ' , false ) ?
97100 ('--with-config-file-path= ' . $ this ->getOption ('with-config-file-path ' ) . ' ' ) : '' ;
98101 $ config_file_scan_dir = $ this ->getOption ('with-config-file-scan-dir ' , false ) ?
@@ -123,6 +126,12 @@ public function buildPHP(int $build_target = BUILD_TARGET_NONE): void
123126 }
124127
125128 $ embed_type = getenv ('SPC_CMD_VAR_PHP_EMBED_TYPE ' ) ?: 'static ' ;
129+ if ($ embed_type !== 'static ' && SPCTarget::isStatic ()) {
130+ throw new WrongUsageException (
131+ 'Linux does not support loading shared libraries when linking libc statically. ' .
132+ 'Change SPC_CMD_VAR_PHP_EMBED_TYPE to static. '
133+ );
134+ }
126135 shell ()->cd (SOURCE_PATH . '/php-src ' )
127136 ->exec (
128137 getenv ('SPC_CMD_PREFIX_PHP_CONFIGURE ' ) . ' ' .
Original file line number Diff line number Diff line change 44
55namespace SPC \builder \unix \library ;
66
7- use SPC \exception \FileSystemException ;
8- use SPC \exception \RuntimeException ;
97use SPC \toolchain \ToolchainManager ;
108use SPC \toolchain \ZigToolchain ;
119use SPC \util \executor \UnixCMakeExecutor ;
1210
1311trait libaom
1412{
15- /**
16- * @throws RuntimeException
17- * @throws FileSystemException
18- */
1913 protected function build (): void
2014 {
15+ $ extra = getenv ('COMPILER_EXTRA ' );
2116 if (ToolchainManager::getToolchainClass () === ZigToolchain::class) {
22- f_putenv ('COMPILER_EXTRA=-D_GNU_SOURCE ' );
17+ $ new = trim ($ extra . ' -D_GNU_SOURCE ' );
18+ f_putenv ("COMPILER_EXTRA= {$ new }" );
2319 }
2420 UnixCMakeExecutor::create ($ this )
2521 ->setBuildDir ("{$ this ->source_dir }/builddir " )
2622 ->addConfigureArgs ('-DAOM_TARGET_CPU=generic ' )
2723 ->build ();
28- f_putenv (' COMPILER_EXTRA ' );
24+ f_putenv (" COMPILER_EXTRA= { $ extra }" );
2925 $ this ->patchPkgconfPrefix (['aom.pc ' ]);
3026 }
3127}
You can’t perform that action at this time.
0 commit comments