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 @@ -1442,6 +1442,25 @@ exec "$@"
1442
1442
1443
1443
// Update PATH to use our wrapper
1444
1444
buildEnv . PATH = `${ phpSourceDir } :${ buildEnv . PATH } `
1445
+
1446
+ // Fix "fixup not sufficiently aligned" errors in OPcache JIT on macOS
1447
+ // Add compiler flags to ensure proper alignment for inline assembly
1448
+ const additionalCFlags = [
1449
+ '-mno-unaligned-access' , // ARM64-specific: prevent unaligned access
1450
+ '-falign-functions=16' , // Align functions to 16-byte boundaries
1451
+ '-falign-loops=16' , // Align loops to 16-byte boundaries
1452
+ '-fno-strict-aliasing' , // Prevent strict aliasing optimizations
1453
+ '-fno-delete-null-pointer-checks' , // Prevent null pointer optimizations
1454
+ ]
1455
+
1456
+ // Add these flags to CFLAGS and CXXFLAGS if they don't already exist
1457
+ const currentCFlags = buildEnv . CFLAGS || ''
1458
+ const currentCXXFlags = buildEnv . CXXFLAGS || ''
1459
+
1460
+ buildEnv . CFLAGS = `${ currentCFlags } ${ additionalCFlags . join ( ' ' ) } ` . trim ( )
1461
+ buildEnv . CXXFLAGS = `${ currentCXXFlags } ${ additionalCFlags . join ( ' ' ) } ` . trim ( )
1462
+
1463
+ log ( '✅ Added macOS-specific compiler flags to prevent alignment errors' )
1445
1464
}
1446
1465
1447
1466
// Check if configure already exists (some PHP releases include it)
You can’t perform that action at this time.
0 commit comments