Skip to content

Commit a949c53

Browse files
committed
chore: wip
1 parent 00a1d8c commit a949c53

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

scripts/build-php.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1446,13 +1446,17 @@ exec "$@"
14461446
// Fix "fixup not sufficiently aligned" errors in OPcache JIT on macOS
14471447
// Add compiler flags to ensure proper alignment for inline assembly
14481448
const additionalCFlags = [
1449-
'-mno-unaligned-access', // ARM64-specific: prevent unaligned access
14501449
'-falign-functions=16', // Align functions to 16-byte boundaries
14511450
'-falign-loops=16', // Align loops to 16-byte boundaries
14521451
'-fno-strict-aliasing', // Prevent strict aliasing optimizations
14531452
'-fno-delete-null-pointer-checks', // Prevent null pointer optimizations
14541453
]
14551454

1455+
// ARM64-specific flags that are not compatible with x86_64
1456+
if (config.arch === 'arm64') {
1457+
additionalCFlags.push('-mno-unaligned-access') // ARM64-specific: prevent unaligned access
1458+
}
1459+
14561460
// Add these flags to CFLAGS and CXXFLAGS if they don't already exist
14571461
const currentCFlags = buildEnv.CFLAGS || ''
14581462
const currentCXXFlags = buildEnv.CXXFLAGS || ''

0 commit comments

Comments
 (0)