diff --git a/Cargo.toml b/Cargo.toml index b07f582d0..c372e0599 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -78,3 +78,11 @@ path = "tests/module.rs" [[test]] name = "sapi_tests" path = "tests/sapi.rs" + +# Patch clang-sys and bindgen for preserve_none calling convention support (libclang 19/20) +# Required for PHP 8.5+ on macOS ARM64 which uses TAILCALL VM mode +# - clang-sys: Adds libclang 19/20 bindings (https://github.com/KyleMayes/clang-sys/pull/195) +# - bindgen: Maps CXCallingConv_PreserveNone to C ABI +[patch.crates-io] +clang-sys = { git = "https://github.com/extphprs/clang-sys.git", branch = "preserve-none-support" } +bindgen = { git = "https://github.com/extphprs/rust-bindgen.git", branch = "preserve-none-support" } diff --git a/build.rs b/build.rs index f550b7b78..c740b3c4e 100644 --- a/build.rs +++ b/build.rs @@ -226,7 +226,27 @@ fn generate_bindings(defines: &[(&str, &str)], includes: &[PathBuf]) -> Result