Skip to content

Commit

Permalink
Merge pull request #899 from andrewferk/apple-m1-arm-aarch64
Browse files Browse the repository at this point in the history
Use arm or aarch64 to identify Apple ARM CPU arch
  • Loading branch information
larskanis committed May 12, 2021
2 parents 4430b6d + 3056009 commit 4ad6fd5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions ext/ffi_c/extconf.rb
Expand Up @@ -57,7 +57,7 @@ def system_libffi_usable?
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
Expand All @@ -71,7 +71,7 @@ def system_libffi_usable?
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"
Expand Down

0 comments on commit 4ad6fd5

Please sign in to comment.