@@ -1718,16 +1718,13 @@ exec "$@"
1718
1718
buildEnv . PATH = `${ phpSourceDir } :${ buildEnv . PATH } `
1719
1719
1720
1720
// Fix "fixup not sufficiently aligned" errors in OPcache JIT on macOS
1721
- // Add aggressive compiler flags to ensure proper alignment for inline assembly
1721
+ // Add macOS-compatible compiler flags to ensure proper alignment for inline assembly
1722
1722
const additionalCFlags = [
1723
- '-falign-functions=32' , // Align functions to 32-byte boundaries (more aggressive)
1724
- '-falign-loops=32' , // Align loops to 32-byte boundaries (more aggressive)
1725
- '-falign-jumps=32' , // Align jump targets to 32-byte boundaries
1726
- '-falign-labels=32' , // Align labels to 32-byte boundaries
1723
+ '-falign-functions=32' , // Align functions to 32-byte boundaries (supported on macOS)
1724
+ '-falign-loops=32' , // Align loops to 32-byte boundaries (supported on macOS)
1727
1725
'-fno-strict-aliasing' , // Prevent strict aliasing optimizations
1728
1726
'-fno-delete-null-pointer-checks' , // Prevent null pointer optimizations
1729
1727
'-fno-optimize-sibling-calls' , // Prevent tail call optimization that can affect alignment
1730
- '-fno-reorder-blocks' , // Prevent block reordering that can affect alignment
1731
1728
'-mstackrealign' , // Force stack realignment for better alignment guarantees
1732
1729
]
1733
1730
@@ -1736,6 +1733,11 @@ exec "$@"
1736
1733
additionalCFlags . push ( '-mno-unaligned-access' ) // ARM64-specific: prevent unaligned access
1737
1734
}
1738
1735
1736
+ // Remove unsupported flags on macOS clang:
1737
+ // - '-falign-jumps=32' (not supported by clang)
1738
+ // - '-falign-labels=32' (not supported by clang)
1739
+ // - '-fno-reorder-blocks' (not supported by clang)
1740
+
1739
1741
// Add these flags to CFLAGS and CXXFLAGS if they don't already exist
1740
1742
const currentCFlags = buildEnv . CFLAGS || ''
1741
1743
const currentCXXFlags = buildEnv . CXXFLAGS || ''
0 commit comments