Skip to content

Commit f08131b

Browse files
committed
More riscv64 support
1 parent 23b2d8f commit f08131b

File tree

5 files changed

+118
-39
lines changed

5 files changed

+118
-39
lines changed

Artifacts.toml

Lines changed: 96 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1956,6 +1956,28 @@ os = "linux"
19561956
sha256 = "d49106316ef5a4dc8cbce8665e720526a921cbba89dc38be41d53fc65c18007f"
19571957
url = "https://github.com/JuliaPackaging/Yggdrasil/releases/download/GCCBootstrap-v9.1.0+2/GCCBootstrap-powerpc64le-linux-gnu.v9.1.0.x86_64-linux-musl.unpacked.tar.gz"
19581958

1959+
[["GCCBootstrap-riscv64-linux-musl.v12.1.0.x86_64-linux-musl.squashfs"]]
1960+
arch = "x86_64"
1961+
git-tree-sha1 = "0a988108fd945733a2b493ae398b67588abc0e32"
1962+
lazy = true
1963+
libc = "musl"
1964+
os = "linux"
1965+
1966+
[["GCCBootstrap-riscv64-linux-musl.v12.1.0.x86_64-linux-musl.squashfs".download]]
1967+
sha256 = "2fe11e0f794df6af2ab39b8e6d1c4efc32cdb792fd045409cdcedd96d643a1c5"
1968+
url = "https://github.com/JuliaPackaging/Yggdrasil/releases/download/GCCBootstrap-v12.1.0/GCCBootstrap-riscv64-linux-musl.v12.1.0.x86_64-linux-musl.squashfs.tar.gz"
1969+
1970+
[["GCCBootstrap-riscv64-linux-musl.v12.1.0.x86_64-linux-musl.unpacked"]]
1971+
arch = "x86_64"
1972+
git-tree-sha1 = "a10265906d9a12bbc7a2a9a6ed0a4d67cb6a3ad0"
1973+
lazy = true
1974+
libc = "musl"
1975+
os = "linux"
1976+
1977+
[["GCCBootstrap-riscv64-linux-musl.v12.1.0.x86_64-linux-musl.unpacked".download]]
1978+
sha256 = "d958a67682d30ea9e04116db4f463c17f0bf63823e352692d5fe7982da86e220"
1979+
url = "https://github.com/JuliaPackaging/Yggdrasil/releases/download/GCCBootstrap-v12.1.0/GCCBootstrap-riscv64-linux-musl.v12.1.0.x86_64-linux-musl.unpacked.tar.gz"
1980+
19591981
[["GCCBootstrap-x86_64-apple-darwin14.v10.2.0.x86_64-linux-musl.squashfs"]]
19601982
arch = "x86_64"
19611983
git-tree-sha1 = "ceb591a6cf8b32224a2a62cf3d8a9572c1c83e62"
@@ -3344,25 +3366,25 @@ os = "linux"
33443366

33453367
[["LLVMBootstrap.v18.1.7.x86_64-linux-musl.squashfs"]]
33463368
arch = "x86_64"
3347-
git-tree-sha1 = "56e29a15fa1dc3da79b6da7476b826c6a989eda3"
3369+
git-tree-sha1 = "b639d2a33c52a6e5c9c6ba4b837478610801983e"
33483370
lazy = true
33493371
libc = "musl"
33503372
os = "linux"
33513373

33523374
[["LLVMBootstrap.v18.1.7.x86_64-linux-musl.squashfs".download]]
3353-
sha256 = "f8268c66097dc4bbd342fbc02c65b1e2cf882e32a06e2d5e93e634f76cf2f8f7"
3354-
url = "https://github.com/JuliaPackaging/Yggdrasil/releases/download/LLVMBootstrap-v18.1.7/LLVMBootstrap.v18.1.7.x86_64-linux-musl.squashfs.tar.gz"
3375+
sha256 = "40481110c912b88bd12599ace28c8022add889a6c02652f319fb43c05bd01b0c"
3376+
url = "https://github.com/JuliaPackaging/Yggdrasil/releases/download/LLVMBootstrap-v18.1.7+0/LLVMBootstrap.v18.1.7.x86_64-linux-musl.squashfs.tar.gz"
33553377

33563378
[["LLVMBootstrap.v18.1.7.x86_64-linux-musl.unpacked"]]
33573379
arch = "x86_64"
3358-
git-tree-sha1 = "ba75276dcd66d7dbc627c61fc86e6d6ea2d4cd31"
3380+
git-tree-sha1 = "1943b45494f48fde6fbbef3f80ea06b1b35d0d86"
33593381
lazy = true
33603382
libc = "musl"
33613383
os = "linux"
33623384

33633385
[["LLVMBootstrap.v18.1.7.x86_64-linux-musl.unpacked".download]]
3364-
sha256 = "48619ac29449608f86bab79c798e597753a1a6cc398e818a602cc951b1e270d9"
3365-
url = "https://github.com/JuliaPackaging/Yggdrasil/releases/download/LLVMBootstrap-v18.1.7/LLVMBootstrap.v18.1.7.x86_64-linux-musl.unpacked.tar.gz"
3386+
sha256 = "97691f4fa92ec323131595b61ce90b5fe84e881770a31d479ab955748035baad"
3387+
url = "https://github.com/JuliaPackaging/Yggdrasil/releases/download/LLVMBootstrap-v18.1.7+0/LLVMBootstrap.v18.1.7.x86_64-linux-musl.unpacked.tar.gz"
33663388

33673389
[["LLVMBootstrap.v6.0.1.x86_64-linux-musl.squashfs"]]
33683390
arch = "x86_64"
@@ -3584,28 +3606,6 @@ os = "linux"
35843606
sha256 = "5169c970367462dd820ba1d4a7b490997e46da48e1c0248718ed556f3271136f"
35853607
url = "https://github.com/JuliaPackaging/Yggdrasil/releases/download/PlatformSupport-v2024.8.10/PlatformSupport-aarch64-linux-gnu.v2024.8.10.x86_64-linux-musl.unpacked.tar.gz"
35863608

3587-
[["PlatformSupport-riscv64-linux-gnu.v2024.4.7.x86_64-linux-musl.squashfs"]]
3588-
arch = "x86_64"
3589-
git-tree-sha1 = "0e6ee4055c36b0931644528bf89ebfa74da8be6b"
3590-
lazy = true
3591-
libc = "musl"
3592-
os = "linux"
3593-
3594-
[["PlatformSupport-riscv64-linux-gnu.v2024.4.7.x86_64-linux-musl.squashfs".download]]
3595-
sha256 = "e691f0639f64304a78ea93e4bcf4e5e052538b85b5aaa9bcad8760e9732a1edc"
3596-
url = "https://github.com/JuliaPackaging/Yggdrasil/releases/download/PlatformSupport-v2024.4.7/PlatformSupport-riscv64-linux-gnu.v2024.4.7.x86_64-linux-musl.squashfs.tar.gz"
3597-
3598-
[["PlatformSupport-riscv64-linux-gnu.v2024.4.7.x86_64-linux-musl.unpacked"]]
3599-
arch = "x86_64"
3600-
git-tree-sha1 = "5b9695b4efe229b51926b4c9ffb9a0c891e8ccdd"
3601-
lazy = true
3602-
libc = "musl"
3603-
os = "linux"
3604-
3605-
[["PlatformSupport-riscv64-linux-gnu.v2024.4.7.x86_64-linux-musl.unpacked".download]]
3606-
sha256 = "757fe58ba7561cb61051ef22e8a36f3066fb63b0978cf14ad276313368c43a5f"
3607-
url = "https://github.com/JuliaPackaging/Yggdrasil/releases/download/PlatformSupport-v2024.4.7/PlatformSupport-riscv64-linux-gnu.v2024.4.7.x86_64-linux-musl.unpacked.tar.gz"
3608-
36093609
[["PlatformSupport-aarch64-linux-musl.v2021.8.10.x86_64-linux-musl.squashfs"]]
36103610
arch = "x86_64"
36113611
git-tree-sha1 = "c10506f4f885ab358b54b4714036be25ca003a90"
@@ -4090,17 +4090,16 @@ os = "linux"
40904090
sha256 = "5368cefab3e9ebd704d60f13fa5982d1d8566d9025c47ad6288c0c4f3f02efb7"
40914091
url = "https://github.com/JuliaPackaging/Yggdrasil/releases/download/PlatformSupport-v2024.8.10/PlatformSupport-powerpc64le-linux-gnu.v2024.8.10.x86_64-linux-musl.unpacked.tar.gz"
40924092

4093-
[["PlatformSupport-x86_64-apple-darwin14.v2021.8.10.x86_64-linux-musl.squashfs"]]
4093+
[["PlatformSupport-riscv64-linux-gnu.v2024.12.21.x86_64-linux-musl.squashfs"]]
40944094
arch = "x86_64"
4095-
git-tree-sha1 = "bc7f1d08ee0ff50a8665304159d0038d4ece04eb"
4095+
git-tree-sha1 = "b176fca4332dbcd60e0f4195feafef712394be6d"
40964096
lazy = true
40974097
libc = "musl"
40984098
os = "linux"
40994099

4100-
[["PlatformSupport-x86_64-apple-darwin14.v2021.8.10.x86_64-linux-musl.squashfs".download]]
4101-
sha256 = "91a599a698f8de58480c60b5b70c9be6e93a97936430b11a435f8955afae4cc4"
4102-
url = "https://github.com/JuliaPackaging/Yggdrasil/releases/download/PlatformSupport-v2021.8.10/PlatformSupport-x86_64-apple-darwin14.v2021.8.10.x86_64-linux-musl.squashfs.tar.gz"
4103-
4100+
[["PlatformSupport-riscv64-linux-gnu.v2024.12.21.x86_64-linux-musl.squashfs".download]]
4101+
sha256 = "6348339e933ca990739e4328a4bcf449cb2944feea590f84ca9b25a6dfba6cb4"
4102+
url = "https://github.com/JuliaPackaging/Yggdrasil/releases/download/PlatformSupport-v2024.12.21/PlatformSupport-riscv64-linux-gnu.v2024.12.21.x86_64-linux-musl.squashfs.tar.gz"
41044103
[["PlatformSupport-riscv64-linux-gnu.v2024.12.21.x86_64-linux-musl.squashfs"]]
41054104
arch = "x86_64"
41064105
git-tree-sha1 = "b176fca4332dbcd60e0f4195feafef712394be6d"
@@ -4117,6 +4116,16 @@ arch = "x86_64"
41174116
git-tree-sha1 = "5b9695b4efe229b51926b4c9ffb9a0c891e8ccdd"
41184117
lazy = true
41194118
libc = "musl"
4119+
os = "linux"
4120+
4121+
[["PlatformSupport-riscv64-linux-gnu.v2024.12.21.x86_64-linux-musl.unpacked".download]]
4122+
sha256 = "757fe58ba7561cb61051ef22e8a36f3066fb63b0978cf14ad276313368c43a5f"
4123+
url = "https://github.com/JuliaPackaging/Yggdrasil/releases/download/PlatformSupport-v2024.12.21/PlatformSupport-riscv64-linux-gnu.v2024.12.21.x86_64-linux-musl.unpacked.tar.gz"
4124+
[["PlatformSupport-riscv64-linux-gnu.v2024.12.21.x86_64-linux-musl.unpacked"]]
4125+
arch = "x86_64"
4126+
git-tree-sha1 = "5b9695b4efe229b51926b4c9ffb9a0c891e8ccdd"
4127+
lazy = true
4128+
libc = "musl"
41204129
os = "linux"
41214130

41224131
[["PlatformSupport-riscv64-linux-gnu.v2024.12.21.x86_64-linux-musl.unpacked".download]]
@@ -4128,6 +4137,16 @@ arch = "x86_64"
41284137
git-tree-sha1 = "0e6ee4055c36b0931644528bf89ebfa74da8be6b"
41294138
lazy = true
41304139
libc = "musl"
4140+
os = "linux"
4141+
4142+
[["PlatformSupport-riscv64-linux-gnu.v2024.4.7.x86_64-linux-musl.squashfs".download]]
4143+
sha256 = "e691f0639f64304a78ea93e4bcf4e5e052538b85b5aaa9bcad8760e9732a1edc"
4144+
url = "https://github.com/JuliaPackaging/Yggdrasil/releases/download/PlatformSupport-v2024.4.7/PlatformSupport-riscv64-linux-gnu.v2024.4.7.x86_64-linux-musl.squashfs.tar.gz"
4145+
[["PlatformSupport-riscv64-linux-gnu.v2024.4.7.x86_64-linux-musl.squashfs"]]
4146+
arch = "x86_64"
4147+
git-tree-sha1 = "0e6ee4055c36b0931644528bf89ebfa74da8be6b"
4148+
lazy = true
4149+
libc = "musl"
41314150
os = "linux"
41324151

41334152
[["PlatformSupport-riscv64-linux-gnu.v2024.4.7.x86_64-linux-musl.squashfs".download]]
@@ -4144,6 +4163,49 @@ os = "linux"
41444163
[["PlatformSupport-riscv64-linux-gnu.v2024.4.7.x86_64-linux-musl.unpacked".download]]
41454164
sha256 = "757fe58ba7561cb61051ef22e8a36f3066fb63b0978cf14ad276313368c43a5f"
41464165
url = "https://github.com/JuliaPackaging/Yggdrasil/releases/download/PlatformSupport-v2024.4.7/PlatformSupport-riscv64-linux-gnu.v2024.4.7.x86_64-linux-musl.unpacked.tar.gz"
4166+
[["PlatformSupport-riscv64-linux-gnu.v2024.4.7.x86_64-linux-musl.unpacked"]]
4167+
arch = "x86_64"
4168+
git-tree-sha1 = "5b9695b4efe229b51926b4c9ffb9a0c891e8ccdd"
4169+
lazy = true
4170+
libc = "musl"
4171+
os = "linux"
4172+
4173+
[["PlatformSupport-riscv64-linux-gnu.v2024.4.7.x86_64-linux-musl.unpacked".download]]
4174+
sha256 = "757fe58ba7561cb61051ef22e8a36f3066fb63b0978cf14ad276313368c43a5f"
4175+
url = "https://github.com/JuliaPackaging/Yggdrasil/releases/download/PlatformSupport-v2024.4.7/PlatformSupport-riscv64-linux-gnu.v2024.4.7.x86_64-linux-musl.unpacked.tar.gz"
4176+
4177+
[["PlatformSupport-riscv64-linux-musl.v2024.12.21.x86_64-linux-musl.squashfs"]]
4178+
arch = "x86_64"
4179+
git-tree-sha1 = "72708b43067d2c5b35e46fee91fc1f1164f540af"
4180+
lazy = true
4181+
libc = "musl"
4182+
os = "linux"
4183+
4184+
[["PlatformSupport-riscv64-linux-musl.v2024.12.21.x86_64-linux-musl.squashfs".download]]
4185+
sha256 = "a8330a71a91ada1eebad7874911ca51cdba7cef5ad0512495384e44fea564507"
4186+
url = "https://github.com/JuliaPackaging/Yggdrasil/releases/download/PlatformSupport-v2024.12.21/PlatformSupport-riscv64-linux-musl.v2024.12.21.x86_64-linux-musl.squashfs.tar.gz"
4187+
4188+
[["PlatformSupport-riscv64-linux-musl.v2024.12.21.x86_64-linux-musl.unpacked"]]
4189+
arch = "x86_64"
4190+
git-tree-sha1 = "e15c076bcd4f0ed54f8c7db8bded7da61d6eab30"
4191+
lazy = true
4192+
libc = "musl"
4193+
os = "linux"
4194+
4195+
[["PlatformSupport-riscv64-linux-musl.v2024.12.21.x86_64-linux-musl.unpacked".download]]
4196+
sha256 = "e9f16e6893bf2815a975ffd37ae12b8f74f81e2da5b2d061126fee62833a2bab"
4197+
url = "https://github.com/JuliaPackaging/Yggdrasil/releases/download/PlatformSupport-v2024.12.21/PlatformSupport-riscv64-linux-musl.v2024.12.21.x86_64-linux-musl.unpacked.tar.gz"
4198+
4199+
[["PlatformSupport-x86_64-apple-darwin14.v2021.8.10.x86_64-linux-musl.squashfs"]]
4200+
arch = "x86_64"
4201+
git-tree-sha1 = "bc7f1d08ee0ff50a8665304159d0038d4ece04eb"
4202+
lazy = true
4203+
libc = "musl"
4204+
os = "linux"
4205+
4206+
[["PlatformSupport-x86_64-apple-darwin14.v2021.8.10.x86_64-linux-musl.squashfs".download]]
4207+
sha256 = "91a599a698f8de58480c60b5b70c9be6e93a97936430b11a435f8955afae4cc4"
4208+
url = "https://github.com/JuliaPackaging/Yggdrasil/releases/download/PlatformSupport-v2021.8.10/PlatformSupport-x86_64-apple-darwin14.v2021.8.10.x86_64-linux-musl.squashfs.tar.gz"
41474209

41484210
[["PlatformSupport-x86_64-apple-darwin14.v2021.8.10.x86_64-linux-musl.unpacked"]]
41494211
arch = "x86_64"

src/Platforms.jl

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ const ARCHITECTURE_FLAGS = Dict(
135135
"arm1176jzfs" => ["-mcpu=arm1176jzf-s", "-mfpu=vfp", "-mfloat-abi=hard"],
136136
),
137137
"armv7l" => OrderedDict(
138-
# Base armv7l architecture, with the most basic of FPU's
138+
# Base armv7l architecture, with the most basic of FPUs
139139
"armv7l" => ["-march=armv7-a", "-mtune=generic-armv7-a", "-mfpu=vfpv3", "-mfloat-abi=hard"],
140140
# armv7l plus NEON and vfpv4, (Raspberry Pi 2B+, RK3328, most boards Elliot has access to)
141141
"neonvfpv4" => ["-mcpu=cortex-a53", "-mfpu=neon-vfpv4", "-mfloat-abi=hard"],
@@ -158,7 +158,9 @@ const ARCHITECTURE_FLAGS = Dict(
158158
#"power9" => ["-mcpu=power9", "-mtune=power9"],
159159
# Eventually, we'll support power10, once we have compilers that support it.
160160
#"power10" => ["-mcpu=power10", "-mtune=power10"],
161-
)
161+
),
162+
"riscv64" => OrderedDict(
163+
),
162164
),
163165
"gcc" => Dict(
164166
"aarch64" => OrderedDict(

src/Rootfs.jl

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -472,7 +472,8 @@ function gcc_version(p::AbstractPlatform,
472472
GCC_builds = filter(b -> getversion(b) v"7", GCC_builds)
473473
end
474474

475-
# We only have GCC 13 or newer for RISC-V (this could be changed)
475+
# We only have GCC 13 or newer for RISC-V.
476+
# (This could be changed down to GCC 7.1.)
476477
if arch(p) == "riscv64"
477478
GCC_builds = filter(b -> getversion(b) v"13", GCC_builds)
478479
end
@@ -523,6 +524,12 @@ function gcc_version(p::AbstractPlatform,
523524
end
524525

525526
function llvm_version(p::AbstractPlatform, LLVM_builds::Vector{LLVMBuild})
527+
# # We only have LLVM 18 or newer for RISC-V.
528+
# # (This could be changed down to LLVM 6.0.)
529+
# if arch(p) == "riscv64"
530+
# LLVM_builds = filter(b -> getversion(b) ≥ v"6", LLVM_builds)
531+
# end
532+
526533
if march(p) in ("armv8_2_crypto",)
527534
LLVM_builds = filter(b -> getversion(b) >= v"9.0", LLVM_builds)
528535
elseif march(p) in ("a64fx",)
@@ -748,6 +755,7 @@ function supported_platforms(;exclude::Union{Vector{<:Platform},Function}=Return
748755
if experimental
749756
append!(standard_platforms, [
750757
Platform("riscv64", "linux"),
758+
Platform("riscv64", "linux"; libc="musl"),
751759
])
752760
end
753761
return exclude_platforms!(standard_platforms,exclude)
@@ -780,6 +788,9 @@ function expand_gfortran_versions(platform::AbstractPlatform)
780788
libgfortran_versions = [v"5"]
781789
elseif Sys.isfreebsd(platform) && arch(platform) == "aarch64"
782790
libgfortran_versions = [v"4", v"5"]
791+
elseif arch(platform) == "riscv64"
792+
# TODO: That might change if we build older GCC versions
793+
libgfortran_versions = [v"5"]
783794
else
784795
libgfortran_versions = [v"3", v"4", v"5"]
785796
end
@@ -817,7 +828,7 @@ function expand_cxxstring_abis(platform::AbstractPlatform; skip=Sys.isbsd)
817828

818829
if sanitize(platform) == "memory"
819830
p = deepcopy(platform)
820-
p["cxxstring_abi"] = "cxx11" #Clang only seems to generate cxx11 abi
831+
p["cxxstring_abi"] = "cxx11" # Clang only seems to generate cxx11 abi
821832
return [p]
822833
end
823834

src/Runner.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1291,7 +1291,7 @@ function platform_envs(platform::AbstractPlatform, src_name::AbstractString;
12911291
elseif arch(platform) in ["x86_64", "i686", "powerpc64le"]
12921292
mapping["GNU_LIBC_VERSION"] = "glibc 2.17"
12931293
elseif arch(platform) in ["riscv64"]
1294-
mapping["GNU_LIBC_VERSION"] = "glibc 2.28"
1294+
mapping["GNU_LIBC_VERSION"] = "glibc 2.35"
12951295
end
12961296
end
12971297

src/riscv64.jl

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@ using Base: BinaryPlatforms
22

33
@static if !haskey(BinaryPlatforms.arch_mapping, "riscv64")
44

5+
# We pirate a few functions and global variables from Base.BinaryPlatforms.
6+
# These changes have been upstreamed to newer Julia versions, but we are stuck with Julia 1.7.
7+
# This is not pretty. It seems to work.
8+
59
using .BinaryPlatforms: CPUID
610
CPUID.ISAs_by_family["riscv64"] = [
711
# We have no way to test riscv64 features yet, so we're only going to declare the lowest ISA:

0 commit comments

Comments
 (0)