Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support riscv64 platform #375

Merged
merged 44 commits into from
Dec 23, 2024
Merged
Show file tree
Hide file tree
Changes from 37 commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
923b802
Support riscv64 platform
eschnett Apr 9, 2024
378423f
Merge branch 'master' into eschnett/riscv64
eschnett May 26, 2024
d9c2aa3
Merge branch 'master' into eschnett/riscv64
eschnett Dec 21, 2024
9a12f5f
Pirate Base.BinaryPlatform functions to add riscv64 support
eschnett Dec 21, 2024
edd904f
Add riscv64 artifacts
eschnett Dec 21, 2024
0d20e28
Add riscv64 artifacts
eschnett Dec 21, 2024
58cbd25
Bump version
eschnett Dec 21, 2024
8ee15f6
Overwrite more BinaryPlatform functions
eschnett Dec 21, 2024
5ee88e7
Overwrite more BinaryPlatform functions
eschnett Dec 21, 2024
b818c10
Overwrite more BinaryPlatform functions
eschnett Dec 21, 2024
87150ce
Overwrite more BinaryPlatform functions
eschnett Dec 21, 2024
23b2d8f
More riscv64 support
eschnett Dec 21, 2024
f08131b
More riscv64 support
eschnett Dec 21, 2024
a21f391
More riscv64 support
eschnett Dec 21, 2024
159eb63
More riscv64 support
eschnett Dec 21, 2024
beb0845
More riscv64 support
eschnett Dec 21, 2024
06cbd65
More riscv64 support
eschnett Dec 22, 2024
eb35103
More riscv64 support
eschnett Dec 22, 2024
b4884fb
More riscv64 support
eschnett Dec 22, 2024
83dc17d
More riscv64 support
eschnett Dec 22, 2024
4082a50
More riscv64 support
eschnett Dec 22, 2024
50133af
More riscv64 support
eschnett Dec 22, 2024
1dcf9d5
More riscv64 support
eschnett Dec 22, 2024
2bcd78b
More riscv64 support
eschnett Dec 22, 2024
77e8c6f
More riscv64 support
eschnett Dec 22, 2024
9973159
More riscv64 support
eschnett Dec 22, 2024
bba0066
More riscv64 support
eschnett Dec 22, 2024
486c2ea
More riscv64 support
eschnett Dec 22, 2024
d5a16e3
More riscv64 support
eschnett Dec 22, 2024
a08a941
More riscv64 support
eschnett Dec 22, 2024
c24a05a
More riscv64 support
eschnett Dec 22, 2024
fdff0c5
More riscv64 support
eschnett Dec 22, 2024
7564170
Update tests for riscv64
eschnett Dec 22, 2024
76c9967
Update tests for riscv64
eschnett Dec 22, 2024
6f037ad
Make changes requested in code review
eschnett Dec 22, 2024
b409474
Make changes requested in code review
eschnett Dec 22, 2024
52e5caa
Support riscv64 for Go
eschnett Dec 22, 2024
edd7907
Specify riscv64 ABI
eschnett Dec 22, 2024
aa9cd98
Don't use experimental platforms
eschnett Dec 22, 2024
83445ab
Correct doctests
eschnett Dec 22, 2024
3d13f99
Correct doctests
eschnett Dec 22, 2024
28c7be3
Update default riscv64 ABI
eschnett Dec 22, 2024
dafa993
Remove outdated and unnecessary artifacts
eschnett Dec 22, 2024
fc2baa2
Correct typo in comment
eschnett Dec 23, 2024
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
206 changes: 200 additions & 6 deletions Artifacts.toml
Original file line number Diff line number Diff line change
Expand Up @@ -1956,6 +1956,94 @@ os = "linux"
sha256 = "d49106316ef5a4dc8cbce8665e720526a921cbba89dc38be41d53fc65c18007f"
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"

[["GCCBootstrap-riscv64-linux-gnu.v12.1.0.x86_64-linux-musl.squashfs"]]
arch = "x86_64"
git-tree-sha1 = "0e0e172850698ee5784355eebeaf661278cfc489"
lazy = true
libc = "musl"
os = "linux"

[["GCCBootstrap-riscv64-linux-gnu.v12.1.0.x86_64-linux-musl.squashfs".download]]
sha256 = "a51037a3b4eff64d08f63c48d16a5b873833d83a2085ac365cf11b0918c503cf"
url = "https://github.com/JuliaPackaging/Yggdrasil/releases/download/GCCBootstrap-v12.1.0/GCCBootstrap-riscv64-linux-gnu.v12.1.0.x86_64-linux-musl.squashfs.tar.gz"

[["GCCBootstrap-riscv64-linux-gnu.v12.1.0.x86_64-linux-musl.unpacked"]]
arch = "x86_64"
git-tree-sha1 = "55460cf13be2ec9fe829768b49ea5b2ba49954ef"
lazy = true
libc = "musl"
os = "linux"

[["GCCBootstrap-riscv64-linux-gnu.v12.1.0.x86_64-linux-musl.unpacked".download]]
sha256 = "671879f013264f1627b5bff6ec246fd2806b4bc1ae9db74390df7004e00891d5"
url = "https://github.com/JuliaPackaging/Yggdrasil/releases/download/GCCBootstrap-v12.1.0/GCCBootstrap-riscv64-linux-gnu.v12.1.0.x86_64-linux-musl.unpacked.tar.gz"

[["GCCBootstrap-riscv64-linux-gnu.v13.2.0.x86_64-linux-musl.squashfs"]]
arch = "x86_64"
git-tree-sha1 = "83e2aeef1b7ff0abe246d83065877e36f270bb32"
lazy = true
libc = "musl"
os = "linux"

[["GCCBootstrap-riscv64-linux-gnu.v13.2.0.x86_64-linux-musl.squashfs".download]]
sha256 = "a23f65e83be13b0eed7614b77e484dced1db4192732000edc1d4e52e39e4732e"
url = "https://github.com/JuliaPackaging/Yggdrasil/releases/download/GCCBootstrap-v13.2.0/GCCBootstrap-riscv64-linux-gnu.v13.2.0.x86_64-linux-musl.squashfs.tar.gz"

[["GCCBootstrap-riscv64-linux-gnu.v13.2.0.x86_64-linux-musl.unpacked"]]
arch = "x86_64"
git-tree-sha1 = "f62985d28a28baf1017c91dbd9f7fe504a718c12"
lazy = true
libc = "musl"
os = "linux"

[["GCCBootstrap-riscv64-linux-gnu.v13.2.0.x86_64-linux-musl.unpacked".download]]
sha256 = "fc2b0c57b83c22416cdab285b8e3efaa3c55988d1a771e2ade6308d6b24674f5"
url = "https://github.com/JuliaPackaging/Yggdrasil/releases/download/GCCBootstrap-v13.2.0/GCCBootstrap-riscv64-linux-gnu.v13.2.0.x86_64-linux-musl.unpacked.tar.gz"

[["GCCBootstrap-riscv64-linux-musl.v12.1.0.x86_64-linux-musl.squashfs"]]
arch = "x86_64"
git-tree-sha1 = "0a988108fd945733a2b493ae398b67588abc0e32"
lazy = true
libc = "musl"
os = "linux"

[["GCCBootstrap-riscv64-linux-musl.v12.1.0.x86_64-linux-musl.squashfs".download]]
sha256 = "2fe11e0f794df6af2ab39b8e6d1c4efc32cdb792fd045409cdcedd96d643a1c5"
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"

[["GCCBootstrap-riscv64-linux-musl.v12.1.0.x86_64-linux-musl.unpacked"]]
arch = "x86_64"
git-tree-sha1 = "a10265906d9a12bbc7a2a9a6ed0a4d67cb6a3ad0"
lazy = true
libc = "musl"
os = "linux"

[["GCCBootstrap-riscv64-linux-musl.v12.1.0.x86_64-linux-musl.unpacked".download]]
sha256 = "d958a67682d30ea9e04116db4f463c17f0bf63823e352692d5fe7982da86e220"
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"

[["GCCBootstrap-riscv64-linux-musl.v13.2.0.x86_64-linux-musl.squashfs"]]
arch = "x86_64"
git-tree-sha1 = "fa8d3617b8a7a823076c43315b19eea746e61ea0"
lazy = true
libc = "musl"
os = "linux"

[["GCCBootstrap-riscv64-linux-musl.v13.2.0.x86_64-linux-musl.squashfs".download]]
sha256 = "0b1e047575add41887b4706971bc36d34c235a0561e8e03b03698d76b61c7262"
url = "https://github.com/JuliaPackaging/Yggdrasil/releases/download/GCCBootstrap-v13.2.0/GCCBootstrap-riscv64-linux-musl.v13.2.0.x86_64-linux-musl.squashfs.tar.gz"

[["GCCBootstrap-riscv64-linux-musl.v13.2.0.x86_64-linux-musl.unpacked"]]
arch = "x86_64"
git-tree-sha1 = "87d33912a955c60bda8476493049f905092cd1db"
lazy = true
libc = "musl"
os = "linux"

[["GCCBootstrap-riscv64-linux-musl.v13.2.0.x86_64-linux-musl.unpacked".download]]
sha256 = "a45d64532488eccb57d65b1dc3fbc5aa65b1204a327f05a0db14d4ff582b2b59"
url = "https://github.com/JuliaPackaging/Yggdrasil/releases/download/GCCBootstrap-v13.2.0/GCCBootstrap-riscv64-linux-musl.v13.2.0.x86_64-linux-musl.unpacked.tar.gz"

[["GCCBootstrap-x86_64-apple-darwin14.v10.2.0.x86_64-linux-musl.squashfs"]]
arch = "x86_64"
git-tree-sha1 = "ceb591a6cf8b32224a2a62cf3d8a9572c1c83e62"
Expand Down Expand Up @@ -3344,25 +3432,25 @@ os = "linux"

[["LLVMBootstrap.v18.1.7.x86_64-linux-musl.squashfs"]]
arch = "x86_64"
git-tree-sha1 = "56e29a15fa1dc3da79b6da7476b826c6a989eda3"
git-tree-sha1 = "b639d2a33c52a6e5c9c6ba4b837478610801983e"
lazy = true
libc = "musl"
os = "linux"

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

[["LLVMBootstrap.v18.1.7.x86_64-linux-musl.unpacked"]]
arch = "x86_64"
git-tree-sha1 = "ba75276dcd66d7dbc627c61fc86e6d6ea2d4cd31"
git-tree-sha1 = "1943b45494f48fde6fbbef3f80ea06b1b35d0d86"
lazy = true
libc = "musl"
os = "linux"

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

[["LLVMBootstrap.v6.0.1.x86_64-linux-musl.squashfs"]]
arch = "x86_64"
Expand Down Expand Up @@ -4068,6 +4156,112 @@ os = "linux"
sha256 = "5368cefab3e9ebd704d60f13fa5982d1d8566d9025c47ad6288c0c4f3f02efb7"
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"

[["PlatformSupport-riscv64-linux-gnu.v2024.12.21.x86_64-linux-musl.squashfs"]]
arch = "x86_64"
git-tree-sha1 = "b176fca4332dbcd60e0f4195feafef712394be6d"
lazy = true
libc = "musl"
os = "linux"

[["PlatformSupport-riscv64-linux-gnu.v2024.12.21.x86_64-linux-musl.squashfs".download]]
sha256 = "6348339e933ca990739e4328a4bcf449cb2944feea590f84ca9b25a6dfba6cb4"
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"
[["PlatformSupport-riscv64-linux-gnu.v2024.12.21.x86_64-linux-musl.squashfs"]]
arch = "x86_64"
git-tree-sha1 = "b176fca4332dbcd60e0f4195feafef712394be6d"
lazy = true
libc = "musl"
os = "linux"

[["PlatformSupport-riscv64-linux-gnu.v2024.12.21.x86_64-linux-musl.squashfs".download]]
sha256 = "6348339e933ca990739e4328a4bcf449cb2944feea590f84ca9b25a6dfba6cb4"
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"

[["PlatformSupport-riscv64-linux-gnu.v2024.12.21.x86_64-linux-musl.unpacked"]]
arch = "x86_64"
git-tree-sha1 = "5b9695b4efe229b51926b4c9ffb9a0c891e8ccdd"
lazy = true
libc = "musl"
os = "linux"

[["PlatformSupport-riscv64-linux-gnu.v2024.12.21.x86_64-linux-musl.unpacked".download]]
sha256 = "757fe58ba7561cb61051ef22e8a36f3066fb63b0978cf14ad276313368c43a5f"
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"
[["PlatformSupport-riscv64-linux-gnu.v2024.12.21.x86_64-linux-musl.unpacked"]]
arch = "x86_64"
git-tree-sha1 = "5b9695b4efe229b51926b4c9ffb9a0c891e8ccdd"
lazy = true
libc = "musl"
os = "linux"

[["PlatformSupport-riscv64-linux-gnu.v2024.12.21.x86_64-linux-musl.unpacked".download]]
sha256 = "757fe58ba7561cb61051ef22e8a36f3066fb63b0978cf14ad276313368c43a5f"
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"

[["PlatformSupport-riscv64-linux-gnu.v2024.4.7.x86_64-linux-musl.squashfs"]]
arch = "x86_64"
git-tree-sha1 = "0e6ee4055c36b0931644528bf89ebfa74da8be6b"
lazy = true
libc = "musl"
os = "linux"

[["PlatformSupport-riscv64-linux-gnu.v2024.4.7.x86_64-linux-musl.squashfs".download]]
sha256 = "e691f0639f64304a78ea93e4bcf4e5e052538b85b5aaa9bcad8760e9732a1edc"
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"
[["PlatformSupport-riscv64-linux-gnu.v2024.4.7.x86_64-linux-musl.squashfs"]]
arch = "x86_64"
git-tree-sha1 = "0e6ee4055c36b0931644528bf89ebfa74da8be6b"
lazy = true
libc = "musl"
os = "linux"

[["PlatformSupport-riscv64-linux-gnu.v2024.4.7.x86_64-linux-musl.squashfs".download]]
sha256 = "e691f0639f64304a78ea93e4bcf4e5e052538b85b5aaa9bcad8760e9732a1edc"
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"

[["PlatformSupport-riscv64-linux-gnu.v2024.4.7.x86_64-linux-musl.unpacked"]]
arch = "x86_64"
git-tree-sha1 = "5b9695b4efe229b51926b4c9ffb9a0c891e8ccdd"
lazy = true
libc = "musl"
os = "linux"

[["PlatformSupport-riscv64-linux-gnu.v2024.4.7.x86_64-linux-musl.unpacked".download]]
sha256 = "757fe58ba7561cb61051ef22e8a36f3066fb63b0978cf14ad276313368c43a5f"
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"
[["PlatformSupport-riscv64-linux-gnu.v2024.4.7.x86_64-linux-musl.unpacked"]]
arch = "x86_64"
git-tree-sha1 = "5b9695b4efe229b51926b4c9ffb9a0c891e8ccdd"
lazy = true
libc = "musl"
os = "linux"

[["PlatformSupport-riscv64-linux-gnu.v2024.4.7.x86_64-linux-musl.unpacked".download]]
sha256 = "757fe58ba7561cb61051ef22e8a36f3066fb63b0978cf14ad276313368c43a5f"
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"

[["PlatformSupport-riscv64-linux-musl.v2024.12.21.x86_64-linux-musl.squashfs"]]
arch = "x86_64"
git-tree-sha1 = "72708b43067d2c5b35e46fee91fc1f1164f540af"
lazy = true
libc = "musl"
os = "linux"

[["PlatformSupport-riscv64-linux-musl.v2024.12.21.x86_64-linux-musl.squashfs".download]]
sha256 = "a8330a71a91ada1eebad7874911ca51cdba7cef5ad0512495384e44fea564507"
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"

[["PlatformSupport-riscv64-linux-musl.v2024.12.21.x86_64-linux-musl.unpacked"]]
arch = "x86_64"
git-tree-sha1 = "e15c076bcd4f0ed54f8c7db8bded7da61d6eab30"
lazy = true
libc = "musl"
os = "linux"

[["PlatformSupport-riscv64-linux-musl.v2024.12.21.x86_64-linux-musl.unpacked".download]]
sha256 = "e9f16e6893bf2815a975ffd37ae12b8f74f81e2da5b2d061126fee62833a2bab"
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"

[["PlatformSupport-x86_64-apple-darwin14.v2021.8.10.x86_64-linux-musl.squashfs"]]
arch = "x86_64"
git-tree-sha1 = "bc7f1d08ee0ff50a8665304159d0038d4ece04eb"
Expand Down
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "BinaryBuilderBase"
uuid = "7f725544-6523-48cd-82d1-3fa08ff4056e"
authors = ["Elliot Saba <[email protected]>"]
version = "1.32.0"
version = "1.33.0"

[deps]
Bzip2_jll = "6e34b625-4abd-537c-b88f-471c36dfa7a0"
Expand Down
2 changes: 2 additions & 0 deletions src/BinaryBuilderBase.jl
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ export AbstractSource, AbstractDependency, SetupSource, PatchSource,

include("compat.jl")

include("riscv64.jl")

include("ArchiveUtils.jl")
include("Sources.jl")
include("Dependencies.jl")
Expand Down
2 changes: 2 additions & 0 deletions src/BuildToolchains.jl
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,8 @@ function meson_cpu_family(p::AbstractPlatform)
return "aarch64"
elseif startswith(arch(p)::String, "arm")
return "arm"
elseif arch(p) == "riscv64"
return "riscv64"
end
end

Expand Down
7 changes: 5 additions & 2 deletions src/Platforms.jl
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ const ARCHITECTURE_FLAGS = Dict(
"arm1176jzfs" => ["-mcpu=arm1176jzf-s", "-mfpu=vfp", "-mfloat-abi=hard"],
),
"armv7l" => OrderedDict(
# Base armv7l architecture, with the most basic of FPU's
# Base armv7l architecture, with the most basic of FPUs
"armv7l" => ["-march=armv7-a", "-mtune=generic-armv7-a", "-mfpu=vfpv3", "-mfloat-abi=hard"],
# armv7l plus NEON and vfpv4, (Raspberry Pi 2B+, RK3328, most boards Elliot has access to)
"neonvfpv4" => ["-mcpu=cortex-a53", "-mfpu=neon-vfpv4", "-mfloat-abi=hard"],
Expand All @@ -158,7 +158,10 @@ const ARCHITECTURE_FLAGS = Dict(
#"power9" => ["-mcpu=power9", "-mtune=power9"],
# Eventually, we'll support power10, once we have compilers that support it.
#"power10" => ["-mcpu=power10", "-mtune=power10"],
)
),
"riscv64" => OrderedDict(
"riscv64" => [],
eschnett marked this conversation as resolved.
Show resolved Hide resolved
),
),
"gcc" => Dict(
"aarch64" => OrderedDict(
Expand Down
21 changes: 18 additions & 3 deletions src/Rootfs.jl
Original file line number Diff line number Diff line change
Expand Up @@ -431,7 +431,8 @@ the only GCC versions available to be picked from are `4.8.5` and `5.2.0`, it
will return `4.8.5`, as binaries compiled with that version will run on this
platform, whereas binaries compiled with `5.2.0` may not.
"""
function gcc_version(p::AbstractPlatform,GCC_builds::Vector{GCCBuild},
function gcc_version(p::AbstractPlatform,
GCC_builds::Vector{GCCBuild},
compilers::Vector{Symbol}=[:c];
llvm_version::Union{Nothing,VersionNumber}=nothing)
# First, filter by libgfortran version.
Expand Down Expand Up @@ -471,6 +472,12 @@ function gcc_version(p::AbstractPlatform,GCC_builds::Vector{GCCBuild},
GCC_builds = filter(b -> getversion(b) ≥ v"7", GCC_builds)
end

# We only have GCC 12 or newer for RISC-V.
# (This could be changed down to GCC 7.1.)
eschnett marked this conversation as resolved.
Show resolved Hide resolved
if arch(p) == "riscv64"
GCC_builds = filter(b -> getversion(b) ≥ v"12", GCC_builds)
end

# Rust on Windows requires binutils 2.25 (it invokes `ld` with `--high-entropy-va`),
# which we bundle with GCC 5.
if :rust in compilers && Sys.iswindows(p)
Expand Down Expand Up @@ -525,6 +532,7 @@ function llvm_version(p::AbstractPlatform, LLVM_builds::Vector{LLVMBuild})
# The target `apple-m1` was introduced in LLVM 13
LLVM_builds = filter(b -> getversion(b) >= v"13.0", LLVM_builds)
end

return getversion.(LLVM_builds)
end

Expand Down Expand Up @@ -631,9 +639,11 @@ function choose_shards(p::AbstractPlatform;
)

# We _always_ need Rootfs and PlatformSupport for our target, at least
# We don't have old platform support for riscv64. Remove this once all platfor support is aligned in time.
giordano marked this conversation as resolved.
Show resolved Hide resolved
ps_build_new = arch(p) == "riscv64" ? max(ps_build, v"2024.12.21") : ps_build
append!(shards, [
find_shard("Rootfs", rootfs_build, archive_type),
find_shard("PlatformSupport", ps_build, archive_type; target=p)
find_shard("PlatformSupport", ps_build_new, archive_type; target=p)
eschnett marked this conversation as resolved.
Show resolved Hide resolved
])

if :c in compilers
Expand Down Expand Up @@ -741,6 +751,8 @@ function supported_platforms(;exclude::Union{Vector{<:Platform},Function}=Return
# We have experimental support for some platforms, allow easily including them
if experimental
append!(standard_platforms, [
Platform("riscv64", "linux"),
Platform("riscv64", "linux"; libc="musl"),
])
end
return exclude_platforms!(standard_platforms,exclude)
Expand Down Expand Up @@ -773,6 +785,9 @@ function expand_gfortran_versions(platform::AbstractPlatform)
libgfortran_versions = [v"5"]
elseif Sys.isfreebsd(platform) && arch(platform) == "aarch64"
libgfortran_versions = [v"4", v"5"]
elseif arch(platform) == "riscv64"
# We don't have older GCC versions
libgfortran_versions = [v"5"]
else
libgfortran_versions = [v"3", v"4", v"5"]
end
Expand Down Expand Up @@ -810,7 +825,7 @@ function expand_cxxstring_abis(platform::AbstractPlatform; skip=Sys.isbsd)

if sanitize(platform) == "memory"
p = deepcopy(platform)
p["cxxstring_abi"] = "cxx11" #Clang only seems to generate cxx11 abi
p["cxxstring_abi"] = "cxx11" # Clang only seems to generate cxx11 abi
return [p]
end

Expand Down
7 changes: 6 additions & 1 deletion src/Runner.jl
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ const default_host_platform = Platform("x86_64", "linux"; libc="musl", cxxstring
function nbits(p::AbstractPlatform)
if arch(p) in ("i686", "armv6l", "armv7l")
return 32
elseif arch(p) in ("x86_64", "aarch64", "powerpc64le")
elseif arch(p) in ("x86_64", "aarch64", "powerpc64le", "riscv64")
return 64
else
error("Unknown bitwidth for architecture $(arch(p))")
Expand All @@ -32,6 +32,8 @@ function proc_family(p::AbstractPlatform)
return "arm"
elseif arch(p) == "powerpc64le"
return "power"
elseif arch(p) == "riscv64"
return "riscv"
else
error("Unknown processor family for architecture $(arch(p))")
end
Expand Down Expand Up @@ -662,6 +664,7 @@ function generate_compiler_wrappers!(platform::AbstractPlatform; bin_path::Abstr
"x86_64" => "amd64",
"i686" => "386",
"powerpc64le" => "ppc64le",
"riscv64" => "riscv64",
)
return arch_mapping[arch(p)]
end
Expand Down Expand Up @@ -1288,6 +1291,8 @@ function platform_envs(platform::AbstractPlatform, src_name::AbstractString;
mapping["GNU_LIBC_VERSION"] = "glibc 2.19"
elseif arch(platform) in ("x86_64", "i686", "powerpc64le")
mapping["GNU_LIBC_VERSION"] = "glibc 2.17"
elseif arch(platform) in ("riscv64",)
mapping["GNU_LIBC_VERSION"] = "glibc 2.35"
end
end

Expand Down
Loading
Loading