File tree Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -1469,7 +1469,26 @@ exec "$@"
1469
1469
buildEnv . CFLAGS = `${ currentCFlags } ${ additionalCFlags . join ( ' ' ) } ` . trim ( )
1470
1470
buildEnv . CXXFLAGS = `${ currentCXXFlags } ${ additionalCFlags . join ( ' ' ) } ` . trim ( )
1471
1471
1472
+ // Also add flags to EXTRA_CFLAGS and EXTRA_CXXFLAGS for PHP build system
1473
+ buildEnv . EXTRA_CFLAGS = `${ buildEnv . EXTRA_CFLAGS || '' } ${ additionalCFlags . join ( ' ' ) } ` . trim ( )
1474
+ buildEnv . EXTRA_CXXFLAGS = `${ buildEnv . EXTRA_CXXFLAGS || '' } ${ additionalCFlags . join ( ' ' ) } ` . trim ( )
1475
+
1476
+ // Add flags to CC and CXX directly to ensure they're always used
1477
+ const currentCC = buildEnv . CC || 'clang'
1478
+ const currentCXX = buildEnv . CXX || 'clang++'
1479
+ buildEnv . CC = `${ currentCC } ${ additionalCFlags . join ( ' ' ) } `
1480
+ buildEnv . CXX = `${ currentCXX } ${ additionalCFlags . join ( ' ' ) } `
1481
+
1482
+ // Ensure make passes flags to all compilation commands
1483
+ const makeFlags = `CFLAGS="${ buildEnv . CFLAGS } " CXXFLAGS="${ buildEnv . CXXFLAGS } "`
1484
+ buildEnv . MAKEFLAGS = `${ buildEnv . MAKEFLAGS || '' } ${ makeFlags } ` . trim ( )
1485
+
1472
1486
log ( '✅ Added macOS-specific compiler flags to prevent alignment errors' )
1487
+ log ( `🔧 CC: ${ buildEnv . CC } ` )
1488
+ log ( `🔧 CFLAGS: ${ buildEnv . CFLAGS } ` )
1489
+ if ( config . arch === 'arm64' ) {
1490
+ log ( '🔧 ARM64-specific flags applied: -mno-unaligned-access' )
1491
+ }
1473
1492
}
1474
1493
1475
1494
// Check if configure already exists (some PHP releases include it)
You can’t perform that action at this time.
0 commit comments