summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLars Kanis <lars@greiz-reinsdorf.de>2021-05-12 07:08:26 +0200
committerGitHub <noreply@github.com>2021-05-12 07:08:26 +0200
commit4ad6fd5f825c6d673d542571d015e198a4d0acff (patch)
tree5b05696ff473286a56c6259abf53644b3b8ee6a5
parent4430b6d5fe720f9cb84a845a0bee9abf23e22cea (diff)
parent305600997c5d2a513cf788850faa208f4aecfcb8 (diff)
downloadffi-4ad6fd5f825c6d673d542571d015e198a4d0acff.tar.gz
Merge pull request #899 from andrewferk/apple-m1-arm-aarch64
Use arm or aarch64 to identify Apple ARM CPU arch
-rw-r--r--ext/ffi_c/extconf.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/ext/ffi_c/extconf.rb b/ext/ffi_c/extconf.rb
index cdeaa9b..aaf558a 100644
--- a/ext/ffi_c/extconf.rb
+++ b/ext/ffi_c/extconf.rb
@@ -57,7 +57,7 @@ if RUBY_ENGINE == 'ruby' || RUBY_ENGINE == 'rbx'
append_ldflags "-Wl,--exclude-libs,ALL"
end
- ffi_alloc_default = RbConfig::CONFIG['host_os'] =~ /darwin/i && RbConfig::CONFIG['host'] =~ /arm/i
+ ffi_alloc_default = RbConfig::CONFIG['host_os'] =~ /darwin/i && RbConfig::CONFIG['host'] =~ /arm|aarch64/i
if enable_config('libffi-alloc', ffi_alloc_default)
$defs << "-DUSE_FFI_ALLOC"
end
@@ -71,7 +71,7 @@ if RUBY_ENGINE == 'ruby' || RUBY_ENGINE == 'rbx'
File.open("Makefile", "a") do |mf|
mf.puts "LIBFFI_HOST=--host=#{RbConfig::CONFIG['host_alias']}" if RbConfig::CONFIG.has_key?("host_alias")
if RbConfig::CONFIG['host_os'] =~ /darwin/i
- if RbConfig::CONFIG['host'] =~ /arm/i
+ if RbConfig::CONFIG['host'] =~ /arm|aarch64/i
mf.puts "LIBFFI_HOST=--host=aarch64-apple-#{RbConfig::CONFIG['host_os']}"
end
mf.puts "include ${srcdir}/libffi.darwin.mk"