Skip to content

Commit 2455159

Browse files
committed
chore: wip
1 parent a949c53 commit 2455159

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

scripts/build-php.ts

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1444,12 +1444,17 @@ exec "$@"
14441444
buildEnv.PATH = `${phpSourceDir}:${buildEnv.PATH}`
14451445

14461446
// Fix "fixup not sufficiently aligned" errors in OPcache JIT on macOS
1447-
// Add compiler flags to ensure proper alignment for inline assembly
1447+
// Add aggressive compiler flags to ensure proper alignment for inline assembly
14481448
const additionalCFlags = [
1449-
'-falign-functions=16', // Align functions to 16-byte boundaries
1450-
'-falign-loops=16', // Align loops to 16-byte boundaries
1449+
'-falign-functions=32', // Align functions to 32-byte boundaries (more aggressive)
1450+
'-falign-loops=32', // Align loops to 32-byte boundaries (more aggressive)
1451+
'-falign-jumps=32', // Align jump targets to 32-byte boundaries
1452+
'-falign-labels=32', // Align labels to 32-byte boundaries
14511453
'-fno-strict-aliasing', // Prevent strict aliasing optimizations
14521454
'-fno-delete-null-pointer-checks', // Prevent null pointer optimizations
1455+
'-fno-optimize-sibling-calls', // Prevent tail call optimization that can affect alignment
1456+
'-fno-reorder-blocks', // Prevent block reordering that can affect alignment
1457+
'-mstackrealign', // Force stack realignment for better alignment guarantees
14531458
]
14541459

14551460
// ARM64-specific flags that are not compatible with x86_64

0 commit comments

Comments
 (0)