Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions src/BinaryPlatforms.jl
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ struct MacOS <: Platform
libc::Union{Nothing,Symbol}=nothing,
call_abi::Union{Nothing,Symbol}=nothing,
compiler_abi::CompilerABI=CompilerABI())
if arch !== :x86_64
if arch !== :x86_64 && arch !== :aarch64
throw(ArgumentError("Unsupported architecture '$arch' for macOS"))
end
if libc !== nothing
Expand Down Expand Up @@ -404,7 +404,7 @@ function platform_key_abi(machine::AbstractString)
arch_mapping = Dict(
:x86_64 => "(x86_|amd)64",
:i686 => "i\\d86",
:aarch64 => "aarch64",
:aarch64 => "(aarch|arm)64",
:armv7l => "arm(v7l)?", # if we just see `arm-linux-gnueabihf`, we assume it's `armv7l`
:armv6l => "armv6l",
:powerpc64le => "p(ower)?pc64le",
Expand Down Expand Up @@ -458,6 +458,7 @@ function platform_key_abi(machine::AbstractString)
))

m = match(triplet_regex, machine)
msg = ""
if m !== nothing
# Helper function to find the single named field within the giant regex
# that is not `nothing` for each mapping we give it.
Expand Down Expand Up @@ -502,11 +503,14 @@ function platform_key_abi(machine::AbstractString)
cxxstring_abi=cxxstring_abi
)
return T(arch, libc=libc, call_abi=call_abi, compiler_abi=compiler_abi)
catch
catch err
if isa(err, ArgumentError)
msg = " ($(err.msg))"
end
end
end

@warn("Platform `$(machine)` is not an officially supported platform")
@warn("Platform `$(machine)` is not an officially supported platform$msg")
return UnknownPlatform()
end

Expand Down
1 change: 1 addition & 0 deletions test/binaryplatforms.jl
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@ const platform = platform_key_abi()
@test platform_key_abi("i686-unknown-freebsd11.1") == FreeBSD(:i686)
@test platform_key_abi("amd64-unknown-freebsd12.0") == FreeBSD(:x86_64)
@test platform_key_abi("i386-unknown-freebsd10.3") == FreeBSD(:i686)
@test platform_key_abi("arm64-apple-darwin20.0") == MacOS(:aarch64)

# Test inclusion of ABI stuff, both old-style and new-style
@test platform_key_abi("x86_64-linux-gnu-gcc7") == Linux(:x86_64, compiler_abi=CompilerABI(libgfortran_version=v"4"))
Expand Down