Skip to content

Commit d5a16e3

Browse files
committed
More riscv64 support
1 parent 486c2ea commit d5a16e3

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

src/riscv64.jl

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ using Base: BinaryPlatforms
66
# These changes have been upstreamed to newer Julia versions, but we are stuck with Julia 1.7.
77
# This is not pretty. It seems to work.
88

9-
function __init__()
9+
function setup_riscv64()
1010
CPUID.ISAs_by_family["riscv64"] = [
1111
# We have no way to test riscv64 features yet, so we're only going to declare the lowest ISA:
1212
"riscv64" => CPUID.ISA(Set{UInt32}()),
@@ -21,6 +21,8 @@ function __init__()
2121
BinaryPlatforms.arch_march_isa_mapping["riscv64"] = ["riscv64" => get_set("riscv64", "riscv64")]
2222
end
2323

24+
__init__() = setup_riscv64()
25+
2426
function Base.BinaryPlatforms.validate_tags(tags::Dict)
2527
throw_invalid_key(k) = throw(ArgumentError("Key \"$(k)\" cannot have value \"$(tags[k])\""))
2628
# Validate `arch`
@@ -89,13 +91,7 @@ using .BinaryPlatforms: arch_mapping, os_mapping, libc_mapping, call_abi_mapping
8991
libgfortran_version_mapping, cxxstring_abi_mapping, libstdcxx_version_mapping
9092

9193
function Base.parse(::Type{Platform}, triplet::AbstractString; validate_strict::Bool = false)
92-
# # Re-insert the architecture because the global assignments above don't stick
93-
# CPUID.ISAs_by_family["riscv64"] = [
94-
# # We have no way to test riscv64 features yet, so we're only going to declare the lowest ISA:
95-
# "riscv64" => CPUID.ISA(Set{UInt32}()),
96-
# ]
97-
# BinaryPlatforms.arch_mapping["riscv64"] = "(rv64|riscv64)"
98-
# BinaryPlatforms.arch_march_isa_mapping["riscv64"] = ["riscv64" => get_set("riscv64", "riscv64")]
94+
setup_riscv64()
9995

10096
# Helper function to collapse dictionary of mappings down into a regex of
10197
# named capture groups joined by "|" operators

0 commit comments

Comments
 (0)