From 923b80293d5fd53812738e5d4e275f0c4894efcf Mon Sep 17 00:00:00 2001 From: Erik Schnetter Date: Tue, 9 Apr 2024 09:39:22 -0400 Subject: [PATCH 01/42] Support riscv64 platform --- src/Rootfs.jl | 1 + src/Runner.jl | 6 ++++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/Rootfs.jl b/src/Rootfs.jl index 560108b5..6feb0759 100644 --- a/src/Rootfs.jl +++ b/src/Rootfs.jl @@ -735,6 +735,7 @@ 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"), ]) end return exclude_platforms!(standard_platforms,exclude) diff --git a/src/Runner.jl b/src/Runner.jl index b6632dbc..b7c4813c 100644 --- a/src/Runner.jl +++ b/src/Runner.jl @@ -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))") @@ -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 @@ -1288,7 +1290,7 @@ function platform_envs(platform::AbstractPlatform, src_name::AbstractString; mapping["GNU_LIBC_VERSION"] = "glibc 2.12.2" elseif arch(platform) in ("armv7l", "aarch64") mapping["GNU_LIBC_VERSION"] = "glibc 2.19" - elseif arch(platform) === "powerpc64le" + elseif arch(platform) in ("powerpc64le", "riscv64") mapping["GNU_LIBC_VERSION"] = "glibc 2.17" end end From 9a12f5f8db5a6476fa7185a5de908d2b4d263654 Mon Sep 17 00:00:00 2001 From: Erik Schnetter Date: Sat, 21 Dec 2024 09:40:57 -0500 Subject: [PATCH 02/42] Pirate Base.BinaryPlatform functions to add riscv64 support --- src/BinaryBuilderBase.jl | 2 + src/riscv64.jl | 84 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 86 insertions(+) create mode 100644 src/riscv64.jl diff --git a/src/BinaryBuilderBase.jl b/src/BinaryBuilderBase.jl index e8f91a07..e51cf27b 100644 --- a/src/BinaryBuilderBase.jl +++ b/src/BinaryBuilderBase.jl @@ -27,6 +27,8 @@ export AbstractSource, AbstractDependency, SetupSource, PatchSource, include("compat.jl") +include("riscv64.jl") + include("ArchiveUtils.jl") include("Sources.jl") include("Dependencies.jl") diff --git a/src/riscv64.jl b/src/riscv64.jl new file mode 100644 index 00000000..16fb9074 --- /dev/null +++ b/src/riscv64.jl @@ -0,0 +1,84 @@ +using Base: BinaryPlatforms + +@static if !haskey(BinaryPlatforms.arch_mapping, "riscv64") + +using .BinaryPlatforms: CPUID +CPUID.ISAs_by_family["riscv64"] = [ + # We have no way to test riscv64 features yet, so we're only going to declare the lowest ISA: + "riscv64" => CPUID.ISA(Set{UInt32}()), +] + +function Base.BinaryPlatforms.validate_tags(tags::Dict) + throw_invalid_key(k) = throw(ArgumentError("Key \"$(k)\" cannot have value \"$(tags[k])\"")) + # Validate `arch` + if tags["arch"] ∉ ("x86_64", "i686", "armv7l", "armv6l", "aarch64", "powerpc64le", "riscv64") + throw_invalid_key("arch") + end + # Validate `os` + if tags["os"] ∉ ("linux", "macos", "freebsd", "windows") + throw_invalid_key("os") + end + # Validate `os`/`arch` combination + throw_os_mismatch() = throw(ArgumentError("Invalid os/arch combination: $(tags["os"])/$(tags["arch"])")) + if tags["os"] == "windows" && tags["arch"] ∉ ("x86_64", "i686", "armv7l", "aarch64") + throw_os_mismatch() + end + if tags["os"] == "macos" && tags["arch"] ∉ ("x86_64", "aarch64") + throw_os_mismatch() + end + + # Validate `os`/`libc` combination + throw_libc_mismatch() = throw(ArgumentError("Invalid os/libc combination: $(tags["os"])/$(tags["libc"])")) + if tags["os"] == "linux" + # Linux always has a `libc` entry + if tags["libc"] ∉ ("glibc", "musl") + throw_libc_mismatch() + end + else + # Nothing else is allowed to have a `libc` entry + if haskey(tags, "libc") + throw_libc_mismatch() + end + end + + # Validate `os`/`arch`/`call_abi` combination + throw_call_abi_mismatch() = throw(ArgumentError("Invalid os/arch/call_abi combination: $(tags["os"])/$(tags["arch"])/$(tags["call_abi"])")) + if tags["os"] == "linux" && tags["arch"] ∈ ("armv7l", "armv6l") + # If an ARM linux has does not have `call_abi` set to something valid, be sad. + if !haskey(tags, "call_abi") || tags["call_abi"] ∉ ("eabihf", "eabi") + throw_call_abi_mismatch() + end + else + # Nothing else should have a `call_abi`. + if haskey(tags, "call_abi") + throw_call_abi_mismatch() + end + end + + # Validate `libgfortran_version` is a parsable `VersionNumber` + throw_version_number(k) = throw(ArgumentError("\"$(k)\" cannot have value \"$(tags[k])\", must be a valid VersionNumber")) + if "libgfortran_version" in keys(tags) && tryparse(VersionNumber, tags["libgfortran_version"]) === nothing + throw_version_number("libgfortran_version") + end + + # Validate `cxxstring_abi` is one of the two valid options: + if "cxxstring_abi" in keys(tags) && tags["cxxstring_abi"] ∉ ("cxx03", "cxx11") + throw_invalid_key("cxxstring_abi") + end + + # Validate `libstdcxx_version` is a parsable `VersionNumber` + if "libstdcxx_version" in keys(tags) && tryparse(VersionNumber, tags["libstdcxx_version"]) === nothing + throw_version_number("libstdcxx_version") + end +end + +BinaryPlatforms.arch_mapping["riscv64"] = "(rv64|riscv64)" + +function get_set(arch, name) + all = BinaryPlatforms.CPUID.ISAs_by_family[arch] + return all[findfirst(x -> x.first == name, all)].second +end +BinaryPlatforms.arch_march_isa_mapping["riscv64"] = + ["riscv64" => get_set("riscv64", "riscv64")] + +end From edd904f6e92ce6a3fdbb28b43c18ff8ab8688628 Mon Sep 17 00:00:00 2001 From: Erik Schnetter Date: Sat, 21 Dec 2024 09:41:08 -0500 Subject: [PATCH 03/42] Add riscv64 artifacts --- Artifacts.toml | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/Artifacts.toml b/Artifacts.toml index 5a871359..406417ef 100644 --- a/Artifacts.toml +++ b/Artifacts.toml @@ -3584,6 +3584,28 @@ os = "linux" sha256 = "5169c970367462dd820ba1d4a7b490997e46da48e1c0248718ed556f3271136f" 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" +"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-aarch64-linux-musl.v2021.8.10.x86_64-linux-musl.squashfs"]] arch = "x86_64" git-tree-sha1 = "c10506f4f885ab358b54b4714036be25ca003a90" From 0d20e2826186880b03a0056ce872cf2b5e9b521b Mon Sep 17 00:00:00 2001 From: Erik Schnetter Date: Sat, 21 Dec 2024 09:45:18 -0500 Subject: [PATCH 04/42] Add riscv64 artifacts --- Artifacts.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Artifacts.toml b/Artifacts.toml index 406417ef..f96e23f7 100644 --- a/Artifacts.toml +++ b/Artifacts.toml @@ -3584,7 +3584,7 @@ os = "linux" sha256 = "5169c970367462dd820ba1d4a7b490997e46da48e1c0248718ed556f3271136f" 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" -"PlatformSupport-riscv64-linux-gnu.v2024.4.7.x86_64-linux-musl.squashfs"]] +[["PlatformSupport-riscv64-linux-gnu.v2024.4.7.x86_64-linux-musl.squashfs"]] arch = "x86_64" git-tree-sha1 = "0e6ee4055c36b0931644528bf89ebfa74da8be6b" lazy = true From 58cbd251b2450d043784822fa3e7e151808aaf52 Mon Sep 17 00:00:00 2001 From: Erik Schnetter Date: Sat, 21 Dec 2024 09:50:57 -0500 Subject: [PATCH 05/42] Bump version --- Project.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Project.toml b/Project.toml index bcf96a91..4661b4c1 100644 --- a/Project.toml +++ b/Project.toml @@ -1,7 +1,7 @@ name = "BinaryBuilderBase" uuid = "7f725544-6523-48cd-82d1-3fa08ff4056e" authors = ["Elliot Saba "] -version = "1.32.0" +version = "1.33.0" [deps] Bzip2_jll = "6e34b625-4abd-537c-b88f-471c36dfa7a0" From 8ee15f62d20850fb246f91cf828ada4bce667f3e Mon Sep 17 00:00:00 2001 From: Erik Schnetter Date: Sat, 21 Dec 2024 09:52:08 -0500 Subject: [PATCH 06/42] Overwrite more BinaryPlatform functions --- src/riscv64.jl | 92 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 92 insertions(+) diff --git a/src/riscv64.jl b/src/riscv64.jl index 16fb9074..818fbde3 100644 --- a/src/riscv64.jl +++ b/src/riscv64.jl @@ -82,3 +82,95 @@ BinaryPlatforms.arch_march_isa_mapping["riscv64"] = ["riscv64" => get_set("riscv64", "riscv64")] end +function Base.parse(::Type{Platform}, triplet::AbstractString; validate_strict::Bool = false) + # Helper function to collapse dictionary of mappings down into a regex of + # named capture groups joined by "|" operators + c(mapping) = string("(",join(["(?<$k>$v)" for (k, v) in mapping], "|"), ")") + + # We're going to build a mondo regex here to parse everything: + triplet_regex = Regex(string( + "^", + # First, the core triplet; arch/os/libc/call_abi + c(arch_mapping), + c(os_mapping), + c(libc_mapping), + c(call_abi_mapping), + # Next, optional things, like libgfortran/libstdcxx/cxxstring abi + c(libgfortran_version_mapping), + c(cxxstring_abi_mapping), + c(libstdcxx_version_mapping), + # Finally, the catch-all for extended tags + "(?(?:-[^-]+\\+[^-]+)*)?", + "\$", + )) + + m = match(triplet_regex, triplet) + 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. + get_field(m, mapping) = begin + for k in keys(mapping) + if m[k] !== nothing + # Convert our sentinel `nothing` values to actual `nothing` + if endswith(k, "_nothing") + return nothing + end + # Convert libgfortran/libstdcxx version numbers + if startswith(k, "libgfortran") + return VersionNumber(parse(Int,k[12:end])) + elseif startswith(k, "libstdcxx") + return VersionNumber(3, 4, parse(Int,m[k][11:end])) + else + return k + end + end + end + end + + # Extract the information we're interested in: + arch = get_field(m, arch_mapping) + os = get_field(m, os_mapping) + libc = get_field(m, libc_mapping) + call_abi = get_field(m, call_abi_mapping) + libgfortran_version = get_field(m, libgfortran_version_mapping) + libstdcxx_version = get_field(m, libstdcxx_version_mapping) + cxxstring_abi = get_field(m, cxxstring_abi_mapping) + function split_tags(tagstr) + tag_fields = filter(!isempty, split(tagstr, "-")) + if isempty(tag_fields) + return Pair{String,String}[] + end + return map(v -> Symbol(v[1]) => v[2], split.(tag_fields, "+")) + end + tags = split_tags(m["tags"]) + + # Special parsing of os version number, if any exists + function extract_os_version(os_name, pattern) + m_osvn = match(pattern, m[os_name]) + if m_osvn !== nothing + return VersionNumber(m_osvn.captures[1]) + end + return nothing + end + os_version = nothing + if os == "macos" + os_version = extract_os_version("macos", r".*darwin([\d\.]+)") + end + if os == "freebsd" + os_version = extract_os_version("freebsd", r".*freebsd([\d.]+)") + end + + return Platform( + arch, os; + validate_strict, + libc, + call_abi, + libgfortran_version, + cxxstring_abi, + libstdcxx_version, + os_version, + tags..., + ) + end + throw(ArgumentError("Platform `$(triplet)` is not an officially supported platform")) +end From 5ee88e7fd665120953cb8c175f9e5cbdf4f7ce61 Mon Sep 17 00:00:00 2001 From: Erik Schnetter Date: Sat, 21 Dec 2024 09:53:29 -0500 Subject: [PATCH 07/42] Overwrite more BinaryPlatform functions --- src/riscv64.jl | 1 + 1 file changed, 1 insertion(+) diff --git a/src/riscv64.jl b/src/riscv64.jl index 818fbde3..ac432c6b 100644 --- a/src/riscv64.jl +++ b/src/riscv64.jl @@ -72,6 +72,7 @@ function Base.BinaryPlatforms.validate_tags(tags::Dict) end end +using .BinaryPlatforms: arch_mapping BinaryPlatforms.arch_mapping["riscv64"] = "(rv64|riscv64)" function get_set(arch, name) From b818c10d0b2706f997b533a981246dbda9260dd4 Mon Sep 17 00:00:00 2001 From: Erik Schnetter Date: Sat, 21 Dec 2024 09:54:52 -0500 Subject: [PATCH 08/42] Overwrite more BinaryPlatform functions --- src/riscv64.jl | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/riscv64.jl b/src/riscv64.jl index ac432c6b..e55e8c23 100644 --- a/src/riscv64.jl +++ b/src/riscv64.jl @@ -72,7 +72,6 @@ function Base.BinaryPlatforms.validate_tags(tags::Dict) end end -using .BinaryPlatforms: arch_mapping BinaryPlatforms.arch_mapping["riscv64"] = "(rv64|riscv64)" function get_set(arch, name) @@ -83,6 +82,10 @@ BinaryPlatforms.arch_march_isa_mapping["riscv64"] = ["riscv64" => get_set("riscv64", "riscv64")] end + +using .BinaryPlatforms: arch_mapping, os_mapping, libc_mapping, call_abi_mapping, + libgfortran_version_mapping, cxxstring_abi_mapping, libstdcxx_version_mapping + function Base.parse(::Type{Platform}, triplet::AbstractString; validate_strict::Bool = false) # Helper function to collapse dictionary of mappings down into a regex of # named capture groups joined by "|" operators From 87150ce8b1bf33995c524b766d7bc52ce7b09bff Mon Sep 17 00:00:00 2001 From: Erik Schnetter Date: Sat, 21 Dec 2024 10:28:59 -0500 Subject: [PATCH 09/42] Overwrite more BinaryPlatform functions --- src/riscv64.jl | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/src/riscv64.jl b/src/riscv64.jl index e55e8c23..79b110e7 100644 --- a/src/riscv64.jl +++ b/src/riscv64.jl @@ -72,21 +72,22 @@ function Base.BinaryPlatforms.validate_tags(tags::Dict) end end -BinaryPlatforms.arch_mapping["riscv64"] = "(rv64|riscv64)" +using .BinaryPlatforms: arch_mapping, os_mapping, libc_mapping, call_abi_mapping, + libgfortran_version_mapping, cxxstring_abi_mapping, libstdcxx_version_mapping + +arch_mapping["riscv64"] = "(rv64|riscv64)" function get_set(arch, name) all = BinaryPlatforms.CPUID.ISAs_by_family[arch] return all[findfirst(x -> x.first == name, all)].second end -BinaryPlatforms.arch_march_isa_mapping["riscv64"] = - ["riscv64" => get_set("riscv64", "riscv64")] - -end - -using .BinaryPlatforms: arch_mapping, os_mapping, libc_mapping, call_abi_mapping, - libgfortran_version_mapping, cxxstring_abi_mapping, libstdcxx_version_mapping +BinaryPlatforms.arch_march_isa_mapping["riscv64"] = ["riscv64" => get_set("riscv64", "riscv64")] function Base.parse(::Type{Platform}, triplet::AbstractString; validate_strict::Bool = false) + # Re-insert the architecture because the global assignment above doesn't stick + arch_mapping["riscv64"] = "(rv64|riscv64)" + #TODO Base.BinaryPlatforms.arch_march_isa_mapping["riscv64"] = ["riscv64" => get_set("riscv64", "riscv64")] + # Helper function to collapse dictionary of mappings down into a regex of # named capture groups joined by "|" operators c(mapping) = string("(",join(["(?<$k>$v)" for (k, v) in mapping], "|"), ")") @@ -178,3 +179,5 @@ function Base.parse(::Type{Platform}, triplet::AbstractString; validate_strict:: end throw(ArgumentError("Platform `$(triplet)` is not an officially supported platform")) end + +end From 23b2d8f56e3fc83c2ae50a6b3c94deb53e3d6fac Mon Sep 17 00:00:00 2001 From: Erik Schnetter Date: Sat, 21 Dec 2024 11:42:09 -0500 Subject: [PATCH 10/42] More riscv64 support --- Artifacts.toml | 44 ++++++++++++++++++++++++++++++++++++++++++++ src/Rootfs.jl | 8 +++++++- src/Runner.jl | 6 ++++-- 3 files changed, 55 insertions(+), 3 deletions(-) diff --git a/Artifacts.toml b/Artifacts.toml index f96e23f7..a5b78609 100644 --- a/Artifacts.toml +++ b/Artifacts.toml @@ -4101,6 +4101,50 @@ os = "linux" sha256 = "91a599a698f8de58480c60b5b70c9be6e93a97936430b11a435f8955afae4cc4" 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" +[["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.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-x86_64-apple-darwin14.v2021.8.10.x86_64-linux-musl.unpacked"]] arch = "x86_64" git-tree-sha1 = "597f3ec099059ced3acae4427576fedbaa3fd21c" diff --git a/src/Rootfs.jl b/src/Rootfs.jl index 076b5e23..ebd5f50f 100644 --- a/src/Rootfs.jl +++ b/src/Rootfs.jl @@ -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. @@ -471,6 +472,11 @@ function gcc_version(p::AbstractPlatform,GCC_builds::Vector{GCCBuild}, GCC_builds = filter(b -> getversion(b) ≥ v"7", GCC_builds) end + # We only have GCC 13 or newer for RISC-V (this could be changed) + if arch(p) == "riscv64" + GCC_builds = filter(b -> getversion(b) ≥ v"13", 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) diff --git a/src/Runner.jl b/src/Runner.jl index f2e7340e..3c05b6c5 100644 --- a/src/Runner.jl +++ b/src/Runner.jl @@ -1286,10 +1286,12 @@ function platform_envs(platform::AbstractPlatform, src_name::AbstractString; if libc(platform) === "glibc" # This should be kept in sync with the version of glibc used in # https://github.com/JuliaPackaging/Yggdrasil/blob/master/0_RootFS/gcc_sources.jl - if arch(platform) in ("armv7l", "aarch64") + if arch(platform) in ["armv7l", "aarch64"] mapping["GNU_LIBC_VERSION"] = "glibc 2.19" - elseif arch(platform) in ("x86_64", "i686", "powerpc64le", "riscv64") + 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.28" end end From f08131b75767e2c8ffb64dc910cda67b3f7d4b7c Mon Sep 17 00:00:00 2001 From: Erik Schnetter Date: Sat, 21 Dec 2024 18:44:39 -0500 Subject: [PATCH 11/42] More riscv64 support --- Artifacts.toml | 130 ++++++++++++++++++++++++++++++++++------------- src/Platforms.jl | 6 ++- src/Rootfs.jl | 15 +++++- src/Runner.jl | 2 +- src/riscv64.jl | 4 ++ 5 files changed, 118 insertions(+), 39 deletions(-) diff --git a/Artifacts.toml b/Artifacts.toml index a5b78609..2ecf1465 100644 --- a/Artifacts.toml +++ b/Artifacts.toml @@ -1956,6 +1956,28 @@ 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-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-x86_64-apple-darwin14.v10.2.0.x86_64-linux-musl.squashfs"]] arch = "x86_64" git-tree-sha1 = "ceb591a6cf8b32224a2a62cf3d8a9572c1c83e62" @@ -3344,25 +3366,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" @@ -3584,28 +3606,6 @@ os = "linux" sha256 = "5169c970367462dd820ba1d4a7b490997e46da48e1c0248718ed556f3271136f" 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" -[["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-aarch64-linux-musl.v2021.8.10.x86_64-linux-musl.squashfs"]] arch = "x86_64" git-tree-sha1 = "c10506f4f885ab358b54b4714036be25ca003a90" @@ -4090,17 +4090,16 @@ 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-x86_64-apple-darwin14.v2021.8.10.x86_64-linux-musl.squashfs"]] +[["PlatformSupport-riscv64-linux-gnu.v2024.12.21.x86_64-linux-musl.squashfs"]] arch = "x86_64" -git-tree-sha1 = "bc7f1d08ee0ff50a8665304159d0038d4ece04eb" +git-tree-sha1 = "b176fca4332dbcd60e0f4195feafef712394be6d" lazy = true libc = "musl" os = "linux" - [["PlatformSupport-x86_64-apple-darwin14.v2021.8.10.x86_64-linux-musl.squashfs".download]] - sha256 = "91a599a698f8de58480c60b5b70c9be6e93a97936430b11a435f8955afae4cc4" - 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" - + [["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" @@ -4117,6 +4116,16 @@ 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]] @@ -4128,6 +4137,16 @@ 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]] @@ -4144,6 +4163,49 @@ 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" +lazy = true +libc = "musl" +os = "linux" + + [["PlatformSupport-x86_64-apple-darwin14.v2021.8.10.x86_64-linux-musl.squashfs".download]] + sha256 = "91a599a698f8de58480c60b5b70c9be6e93a97936430b11a435f8955afae4cc4" + 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" [["PlatformSupport-x86_64-apple-darwin14.v2021.8.10.x86_64-linux-musl.unpacked"]] arch = "x86_64" diff --git a/src/Platforms.jl b/src/Platforms.jl index e2ab18ea..b6d18468 100644 --- a/src/Platforms.jl +++ b/src/Platforms.jl @@ -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"], @@ -158,7 +158,9 @@ 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( + ), ), "gcc" => Dict( "aarch64" => OrderedDict( diff --git a/src/Rootfs.jl b/src/Rootfs.jl index ebd5f50f..c3fb1e5b 100644 --- a/src/Rootfs.jl +++ b/src/Rootfs.jl @@ -472,7 +472,8 @@ function gcc_version(p::AbstractPlatform, GCC_builds = filter(b -> getversion(b) ≥ v"7", GCC_builds) end - # We only have GCC 13 or newer for RISC-V (this could be changed) + # We only have GCC 13 or newer for RISC-V. + # (This could be changed down to GCC 7.1.) if arch(p) == "riscv64" GCC_builds = filter(b -> getversion(b) ≥ v"13", GCC_builds) end @@ -523,6 +524,12 @@ function gcc_version(p::AbstractPlatform, end function llvm_version(p::AbstractPlatform, LLVM_builds::Vector{LLVMBuild}) + # # We only have LLVM 18 or newer for RISC-V. + # # (This could be changed down to LLVM 6.0.) + # if arch(p) == "riscv64" + # LLVM_builds = filter(b -> getversion(b) ≥ v"6", LLVM_builds) + # end + if march(p) in ("armv8_2_crypto",) LLVM_builds = filter(b -> getversion(b) >= v"9.0", LLVM_builds) elseif march(p) in ("a64fx",) @@ -748,6 +755,7 @@ function supported_platforms(;exclude::Union{Vector{<:Platform},Function}=Return if experimental append!(standard_platforms, [ Platform("riscv64", "linux"), + Platform("riscv64", "linux"; libc="musl"), ]) end return exclude_platforms!(standard_platforms,exclude) @@ -780,6 +788,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" + # TODO: That might change if we build older GCC versions + libgfortran_versions = [v"5"] else libgfortran_versions = [v"3", v"4", v"5"] end @@ -817,7 +828,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 diff --git a/src/Runner.jl b/src/Runner.jl index 3c05b6c5..2fe36847 100644 --- a/src/Runner.jl +++ b/src/Runner.jl @@ -1291,7 +1291,7 @@ function platform_envs(platform::AbstractPlatform, src_name::AbstractString; 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.28" + mapping["GNU_LIBC_VERSION"] = "glibc 2.35" end end diff --git a/src/riscv64.jl b/src/riscv64.jl index 79b110e7..a902130c 100644 --- a/src/riscv64.jl +++ b/src/riscv64.jl @@ -2,6 +2,10 @@ using Base: BinaryPlatforms @static if !haskey(BinaryPlatforms.arch_mapping, "riscv64") +# We pirate a few functions and global variables from Base.BinaryPlatforms. +# These changes have been upstreamed to newer Julia versions, but we are stuck with Julia 1.7. +# This is not pretty. It seems to work. + using .BinaryPlatforms: CPUID CPUID.ISAs_by_family["riscv64"] = [ # We have no way to test riscv64 features yet, so we're only going to declare the lowest ISA: From a21f3918a1dc22e015f9ed34c340637cd0880a9a Mon Sep 17 00:00:00 2001 From: Erik Schnetter Date: Sat, 21 Dec 2024 18:48:20 -0500 Subject: [PATCH 12/42] More riscv64 support --- src/Rootfs.jl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Rootfs.jl b/src/Rootfs.jl index c3fb1e5b..8c0a5c8a 100644 --- a/src/Rootfs.jl +++ b/src/Rootfs.jl @@ -472,10 +472,10 @@ function gcc_version(p::AbstractPlatform, GCC_builds = filter(b -> getversion(b) ≥ v"7", GCC_builds) end - # We only have GCC 13 or newer for RISC-V. + # We only have GCC 12 or newer for RISC-V. # (This could be changed down to GCC 7.1.) if arch(p) == "riscv64" - GCC_builds = filter(b -> getversion(b) ≥ v"13", GCC_builds) + 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`), From 159eb6379896ec6419964cb5e4659fd8cc8a85cd Mon Sep 17 00:00:00 2001 From: Erik Schnetter Date: Sat, 21 Dec 2024 18:52:26 -0500 Subject: [PATCH 13/42] More riscv64 support --- src/Rootfs.jl | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/Rootfs.jl b/src/Rootfs.jl index 8c0a5c8a..ca9f6817 100644 --- a/src/Rootfs.jl +++ b/src/Rootfs.jl @@ -435,6 +435,7 @@ function gcc_version(p::AbstractPlatform, GCC_builds::Vector{GCCBuild}, compilers::Vector{Symbol}=[:c]; llvm_version::Union{Nothing,VersionNumber}=nothing) + @show gcc_version p GCC_builds compilers llvm_version # First, filter by libgfortran version. if libgfortran_version(p) !== nothing GCC_builds = filter(b -> getabi(b).libgfortran_version == libgfortran_version(p), GCC_builds) @@ -634,6 +635,7 @@ function choose_shards(p::AbstractPlatform; shards = CompilerShard[] if isempty(bootstrap_list) + @show choose_shards compilers, GCC_builds, LLVM_builds, preferred_gcc_version, preferred_llvm_version # Select GCC and LLVM versions given the compiler ABI and target requirements given in `p` GCC_build, LLVM_build = select_compiler_versions(p, compilers, @@ -645,14 +647,14 @@ function choose_shards(p::AbstractPlatform; # We _always_ need Rootfs and PlatformSupport for our target, at least append!(shards, [ - find_shard("Rootfs", rootfs_build, archive_type), - find_shard("PlatformSupport", ps_build, archive_type; target=p) + @show find_shard("Rootfs", rootfs_build, archive_type), + @show find_shard("PlatformSupport", ps_build, archive_type; target=p) ]) if :c in compilers append!(shards, [ - find_shard("GCCBootstrap", GCC_build, archive_type; target=p), - find_shard("LLVMBootstrap", LLVM_build, archive_type), + @show find_shard("GCCBootstrap", GCC_build, archive_type; target=p), + @show find_shard("LLVMBootstrap", LLVM_build, archive_type), ]) end @@ -673,8 +675,8 @@ function choose_shards(p::AbstractPlatform; # This is necessary for both rust and c compilers if !platforms_match(p, default_host_platform) append!(shards, [ - find_shard("PlatformSupport", ps_build, archive_type; target=default_host_platform), - find_shard("GCCBootstrap", GCC_build, archive_type; target=default_host_platform), + @show find_shard("PlatformSupport", ps_build, archive_type; target=default_host_platform), + @show find_shard("GCCBootstrap", GCC_build, archive_type; target=default_host_platform), ]) end end From beb0845c59df36231b8ad9c36f35ec437f594d79 Mon Sep 17 00:00:00 2001 From: Erik Schnetter Date: Sat, 21 Dec 2024 18:56:26 -0500 Subject: [PATCH 14/42] More riscv64 support --- src/Rootfs.jl | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/Rootfs.jl b/src/Rootfs.jl index ca9f6817..ce5d85c8 100644 --- a/src/Rootfs.jl +++ b/src/Rootfs.jl @@ -647,14 +647,14 @@ function choose_shards(p::AbstractPlatform; # We _always_ need Rootfs and PlatformSupport for our target, at least append!(shards, [ - @show find_shard("Rootfs", rootfs_build, archive_type), - @show find_shard("PlatformSupport", ps_build, archive_type; target=p) + (@show find_shard("Rootfs", rootfs_build, archive_type)), + (@show find_shard("PlatformSupport", ps_build, archive_type; target=p)) ]) if :c in compilers append!(shards, [ - @show find_shard("GCCBootstrap", GCC_build, archive_type; target=p), - @show find_shard("LLVMBootstrap", LLVM_build, archive_type), + (@show find_shard("GCCBootstrap", GCC_build, archive_type; target=p)), + (@show find_shard("LLVMBootstrap", LLVM_build, archive_type)), ]) end @@ -675,8 +675,8 @@ function choose_shards(p::AbstractPlatform; # This is necessary for both rust and c compilers if !platforms_match(p, default_host_platform) append!(shards, [ - @show find_shard("PlatformSupport", ps_build, archive_type; target=default_host_platform), - @show find_shard("GCCBootstrap", GCC_build, archive_type; target=default_host_platform), + (@show find_shard("PlatformSupport", ps_build, archive_type; target=default_host_platform)), + (@show find_shard("GCCBootstrap", GCC_build, archive_type; target=default_host_platform)), ]) end end From 06cbd65135d42b8c1db9cd34bc6dba1962d9ffb8 Mon Sep 17 00:00:00 2001 From: Erik Schnetter Date: Sat, 21 Dec 2024 19:02:06 -0500 Subject: [PATCH 15/42] More riscv64 support --- src/Rootfs.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Rootfs.jl b/src/Rootfs.jl index ce5d85c8..5c9526ba 100644 --- a/src/Rootfs.jl +++ b/src/Rootfs.jl @@ -604,7 +604,7 @@ function choose_shards(p::AbstractPlatform; for cs in all_compiler_shards() if cs.name == name && cs.version == version && - (target === nothing || platforms_match(cs.target, target)) && + (target === nothing || (@show platforms_match((@show cs.target), (@show target)))) && cs.archive_type == archive_type return cs end From eb35103b224ba556adb522023690f8f64d536975 Mon Sep 17 00:00:00 2001 From: Erik Schnetter Date: Sat, 21 Dec 2024 19:08:23 -0500 Subject: [PATCH 16/42] More riscv64 support --- src/Rootfs.jl | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/Rootfs.jl b/src/Rootfs.jl index 5c9526ba..5c901c27 100644 --- a/src/Rootfs.jl +++ b/src/Rootfs.jl @@ -602,13 +602,17 @@ function choose_shards(p::AbstractPlatform; version = v"12.1.0" end + @show find_shard + @show name version archive_type target for cs in all_compiler_shards() + @show cs.name cs.version cs.archive_type cs.target if cs.name == name && cs.version == version && - (target === nothing || (@show platforms_match((@show cs.target), (@show target)))) && + (target === nothing || platforms_match(cs.target, target)) && cs.archive_type == archive_type return cs end end + @show :notfound return nothing end From b4884fb9e53375e1a336779a7bb737e7a841f8d5 Mon Sep 17 00:00:00 2001 From: Erik Schnetter Date: Sat, 21 Dec 2024 19:16:56 -0500 Subject: [PATCH 17/42] More riscv64 support --- src/Rootfs.jl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Rootfs.jl b/src/Rootfs.jl index 5c901c27..2f1f6104 100644 --- a/src/Rootfs.jl +++ b/src/Rootfs.jl @@ -579,7 +579,8 @@ function choose_shards(p::AbstractPlatform; compilers::Vector{Symbol} = [:c], # We always just use the latest Rootfs embedded within our Artifacts.toml rootfs_build::VersionNumber=last(BinaryBuilderBase.get_available_builds("Rootfs")), - ps_build::VersionNumber=v"2024.08.10", + #TODO ps_build::VersionNumber=v"2024.08.10", + ps_build::VersionNumber=v"2024.12.21", GCC_builds::Vector{GCCBuild}=available_gcc_builds, LLVM_builds::Vector{LLVMBuild}=available_llvm_builds, Rust_build::VersionNumber=maximum(getversion.(available_rust_builds)), From 83dc17d2707c2dc59c56c628725eb0e5b469ef9b Mon Sep 17 00:00:00 2001 From: Erik Schnetter Date: Sat, 21 Dec 2024 19:20:22 -0500 Subject: [PATCH 18/42] More riscv64 support --- src/Rootfs.jl | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/Rootfs.jl b/src/Rootfs.jl index 2f1f6104..2714c92d 100644 --- a/src/Rootfs.jl +++ b/src/Rootfs.jl @@ -579,8 +579,7 @@ function choose_shards(p::AbstractPlatform; compilers::Vector{Symbol} = [:c], # We always just use the latest Rootfs embedded within our Artifacts.toml rootfs_build::VersionNumber=last(BinaryBuilderBase.get_available_builds("Rootfs")), - #TODO ps_build::VersionNumber=v"2024.08.10", - ps_build::VersionNumber=v"2024.12.21", + ps_build::VersionNumber=v"2024.08.10", GCC_builds::Vector{GCCBuild}=available_gcc_builds, LLVM_builds::Vector{LLVMBuild}=available_llvm_builds, Rust_build::VersionNumber=maximum(getversion.(available_rust_builds)), @@ -651,9 +650,11 @@ function choose_shards(p::AbstractPlatform; ) # We _always_ need Rootfs and PlatformSupport for our target, at least + ps_build_new=v"2024.12.21" append!(shards, [ (@show find_shard("Rootfs", rootfs_build, archive_type)), - (@show find_shard("PlatformSupport", ps_build, archive_type; target=p)) + (@show find_shard("PlatformSupport", ps_build_new, archive_type; target=p)) + ]) if :c in compilers From 4082a504fce6038ee6ebc26785a68d4f28507ced Mon Sep 17 00:00:00 2001 From: Erik Schnetter Date: Sat, 21 Dec 2024 19:34:37 -0500 Subject: [PATCH 19/42] More riscv64 support --- Artifacts.toml | 22 ++++++++++++++++++++++ src/Platforms.jl | 1 + 2 files changed, 23 insertions(+) diff --git a/Artifacts.toml b/Artifacts.toml index 2ecf1465..1c03741b 100644 --- a/Artifacts.toml +++ b/Artifacts.toml @@ -1978,6 +1978,28 @@ os = "linux" 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" diff --git a/src/Platforms.jl b/src/Platforms.jl index b6d18468..121239e9 100644 --- a/src/Platforms.jl +++ b/src/Platforms.jl @@ -160,6 +160,7 @@ const ARCHITECTURE_FLAGS = Dict( #"power10" => ["-mcpu=power10", "-mtune=power10"], ), "riscv64" => OrderedDict( + "riscv64" => [], # TODO ), ), "gcc" => Dict( From 50133af4c90427f91e70ad306563d7c7b87d3d19 Mon Sep 17 00:00:00 2001 From: Erik Schnetter Date: Sat, 21 Dec 2024 19:45:33 -0500 Subject: [PATCH 20/42] More riscv64 support --- src/Rootfs.jl | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/Rootfs.jl b/src/Rootfs.jl index 2714c92d..f2711a84 100644 --- a/src/Rootfs.jl +++ b/src/Rootfs.jl @@ -650,11 +650,10 @@ function choose_shards(p::AbstractPlatform; ) # We _always_ need Rootfs and PlatformSupport for our target, at least - ps_build_new=v"2024.12.21" + ps_build_new = arch(p) == "riscv64" ? v"2024.12.21" : ps_build append!(shards, [ (@show find_shard("Rootfs", rootfs_build, archive_type)), (@show find_shard("PlatformSupport", ps_build_new, archive_type; target=p)) - ]) if :c in compilers From 1dcf9d5764fc7aa9425f07484470acb0d3781c3e Mon Sep 17 00:00:00 2001 From: Erik Schnetter Date: Sat, 21 Dec 2024 20:03:14 -0500 Subject: [PATCH 21/42] More riscv64 support --- Project.toml | 2 +- src/riscv64.jl | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Project.toml b/Project.toml index 4661b4c1..6bd8d028 100644 --- a/Project.toml +++ b/Project.toml @@ -1,7 +1,7 @@ name = "BinaryBuilderBase" uuid = "7f725544-6523-48cd-82d1-3fa08ff4056e" authors = ["Elliot Saba "] -version = "1.33.0" +version = "1.34.0" [deps] Bzip2_jll = "6e34b625-4abd-537c-b88f-471c36dfa7a0" diff --git a/src/riscv64.jl b/src/riscv64.jl index a902130c..cd769c60 100644 --- a/src/riscv64.jl +++ b/src/riscv64.jl @@ -88,9 +88,9 @@ end BinaryPlatforms.arch_march_isa_mapping["riscv64"] = ["riscv64" => get_set("riscv64", "riscv64")] function Base.parse(::Type{Platform}, triplet::AbstractString; validate_strict::Bool = false) - # Re-insert the architecture because the global assignment above doesn't stick + # Re-insert the architecture because the global assignments above don't stick arch_mapping["riscv64"] = "(rv64|riscv64)" - #TODO Base.BinaryPlatforms.arch_march_isa_mapping["riscv64"] = ["riscv64" => get_set("riscv64", "riscv64")] + arch_march_isa_mapping["riscv64"] = ["riscv64" => get_set("riscv64", "riscv64")] # Helper function to collapse dictionary of mappings down into a regex of # named capture groups joined by "|" operators From 2bcd78b63faee64edeeb04264befa6201c5288a4 Mon Sep 17 00:00:00 2001 From: Erik Schnetter Date: Sat, 21 Dec 2024 20:05:35 -0500 Subject: [PATCH 22/42] More riscv64 support --- src/riscv64.jl | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/riscv64.jl b/src/riscv64.jl index cd769c60..73f78454 100644 --- a/src/riscv64.jl +++ b/src/riscv64.jl @@ -89,6 +89,10 @@ BinaryPlatforms.arch_march_isa_mapping["riscv64"] = ["riscv64" => get_set("riscv function Base.parse(::Type{Platform}, triplet::AbstractString; validate_strict::Bool = false) # Re-insert the architecture because the global assignments above don't stick + CPUID.ISAs_by_family["riscv64"] = [ + # We have no way to test riscv64 features yet, so we're only going to declare the lowest ISA: + "riscv64" => CPUID.ISA(Set{UInt32}()), + ] arch_mapping["riscv64"] = "(rv64|riscv64)" arch_march_isa_mapping["riscv64"] = ["riscv64" => get_set("riscv64", "riscv64")] From 77e8c6f90d85278b1e32a16a1be479a6d7c5dce0 Mon Sep 17 00:00:00 2001 From: Erik Schnetter Date: Sat, 21 Dec 2024 20:06:53 -0500 Subject: [PATCH 23/42] More riscv64 support --- src/riscv64.jl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/riscv64.jl b/src/riscv64.jl index 73f78454..a2270078 100644 --- a/src/riscv64.jl +++ b/src/riscv64.jl @@ -93,8 +93,8 @@ function Base.parse(::Type{Platform}, triplet::AbstractString; validate_strict:: # We have no way to test riscv64 features yet, so we're only going to declare the lowest ISA: "riscv64" => CPUID.ISA(Set{UInt32}()), ] - arch_mapping["riscv64"] = "(rv64|riscv64)" - arch_march_isa_mapping["riscv64"] = ["riscv64" => get_set("riscv64", "riscv64")] + BinaryPlatforms.arch_mapping["riscv64"] = "(rv64|riscv64)" + BinaryPlatforms.arch_march_isa_mapping["riscv64"] = ["riscv64" => get_set("riscv64", "riscv64")] # Helper function to collapse dictionary of mappings down into a regex of # named capture groups joined by "|" operators From 99731595a43b2d37964287001294ccab2937088e Mon Sep 17 00:00:00 2001 From: Erik Schnetter Date: Sat, 21 Dec 2024 20:09:37 -0500 Subject: [PATCH 24/42] More riscv64 support --- src/riscv64.jl | 233 +++++++++++++++++++++++++------------------------ 1 file changed, 117 insertions(+), 116 deletions(-) diff --git a/src/riscv64.jl b/src/riscv64.jl index a2270078..78d8682d 100644 --- a/src/riscv64.jl +++ b/src/riscv64.jl @@ -6,11 +6,20 @@ using Base: BinaryPlatforms # These changes have been upstreamed to newer Julia versions, but we are stuck with Julia 1.7. # This is not pretty. It seems to work. -using .BinaryPlatforms: CPUID -CPUID.ISAs_by_family["riscv64"] = [ - # We have no way to test riscv64 features yet, so we're only going to declare the lowest ISA: - "riscv64" => CPUID.ISA(Set{UInt32}()), -] +function __init__() + CPUID.ISAs_by_family["riscv64"] = [ + # We have no way to test riscv64 features yet, so we're only going to declare the lowest ISA: + "riscv64" => CPUID.ISA(Set{UInt32}()), + ] + + BinaryPlatforms.arch_mapping["riscv64"] = "(rv64|riscv64)" + + function get_set(arch, name) + all = BinaryPlatforms.CPUID.ISAs_by_family[arch] + return all[findfirst(x -> x.first == name, all)].second + end + BinaryPlatforms.arch_march_isa_mapping["riscv64"] = ["riscv64" => get_set("riscv64", "riscv64")] +end function Base.BinaryPlatforms.validate_tags(tags::Dict) throw_invalid_key(k) = throw(ArgumentError("Key \"$(k)\" cannot have value \"$(tags[k])\"")) @@ -76,116 +85,108 @@ function Base.BinaryPlatforms.validate_tags(tags::Dict) end end -using .BinaryPlatforms: arch_mapping, os_mapping, libc_mapping, call_abi_mapping, - libgfortran_version_mapping, cxxstring_abi_mapping, libstdcxx_version_mapping - -arch_mapping["riscv64"] = "(rv64|riscv64)" - -function get_set(arch, name) - all = BinaryPlatforms.CPUID.ISAs_by_family[arch] - return all[findfirst(x -> x.first == name, all)].second -end -BinaryPlatforms.arch_march_isa_mapping["riscv64"] = ["riscv64" => get_set("riscv64", "riscv64")] - -function Base.parse(::Type{Platform}, triplet::AbstractString; validate_strict::Bool = false) - # Re-insert the architecture because the global assignments above don't stick - CPUID.ISAs_by_family["riscv64"] = [ - # We have no way to test riscv64 features yet, so we're only going to declare the lowest ISA: - "riscv64" => CPUID.ISA(Set{UInt32}()), - ] - BinaryPlatforms.arch_mapping["riscv64"] = "(rv64|riscv64)" - BinaryPlatforms.arch_march_isa_mapping["riscv64"] = ["riscv64" => get_set("riscv64", "riscv64")] - - # Helper function to collapse dictionary of mappings down into a regex of - # named capture groups joined by "|" operators - c(mapping) = string("(",join(["(?<$k>$v)" for (k, v) in mapping], "|"), ")") - - # We're going to build a mondo regex here to parse everything: - triplet_regex = Regex(string( - "^", - # First, the core triplet; arch/os/libc/call_abi - c(arch_mapping), - c(os_mapping), - c(libc_mapping), - c(call_abi_mapping), - # Next, optional things, like libgfortran/libstdcxx/cxxstring abi - c(libgfortran_version_mapping), - c(cxxstring_abi_mapping), - c(libstdcxx_version_mapping), - # Finally, the catch-all for extended tags - "(?(?:-[^-]+\\+[^-]+)*)?", - "\$", - )) - - m = match(triplet_regex, triplet) - 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. - get_field(m, mapping) = begin - for k in keys(mapping) - if m[k] !== nothing - # Convert our sentinel `nothing` values to actual `nothing` - if endswith(k, "_nothing") - return nothing - end - # Convert libgfortran/libstdcxx version numbers - if startswith(k, "libgfortran") - return VersionNumber(parse(Int,k[12:end])) - elseif startswith(k, "libstdcxx") - return VersionNumber(3, 4, parse(Int,m[k][11:end])) - else - return k - end - end - end - end - - # Extract the information we're interested in: - arch = get_field(m, arch_mapping) - os = get_field(m, os_mapping) - libc = get_field(m, libc_mapping) - call_abi = get_field(m, call_abi_mapping) - libgfortran_version = get_field(m, libgfortran_version_mapping) - libstdcxx_version = get_field(m, libstdcxx_version_mapping) - cxxstring_abi = get_field(m, cxxstring_abi_mapping) - function split_tags(tagstr) - tag_fields = filter(!isempty, split(tagstr, "-")) - if isempty(tag_fields) - return Pair{String,String}[] - end - return map(v -> Symbol(v[1]) => v[2], split.(tag_fields, "+")) - end - tags = split_tags(m["tags"]) - - # Special parsing of os version number, if any exists - function extract_os_version(os_name, pattern) - m_osvn = match(pattern, m[os_name]) - if m_osvn !== nothing - return VersionNumber(m_osvn.captures[1]) - end - return nothing - end - os_version = nothing - if os == "macos" - os_version = extract_os_version("macos", r".*darwin([\d\.]+)") - end - if os == "freebsd" - os_version = extract_os_version("freebsd", r".*freebsd([\d.]+)") - end - - return Platform( - arch, os; - validate_strict, - libc, - call_abi, - libgfortran_version, - cxxstring_abi, - libstdcxx_version, - os_version, - tags..., - ) - end - throw(ArgumentError("Platform `$(triplet)` is not an officially supported platform")) -end +#TODO using .BinaryPlatforms: arch_mapping, os_mapping, libc_mapping, call_abi_mapping, +#TODO libgfortran_version_mapping, cxxstring_abi_mapping, libstdcxx_version_mapping +#TODO +#TODO function Base.parse(::Type{Platform}, triplet::AbstractString; validate_strict::Bool = false) +#TODO # Re-insert the architecture because the global assignments above don't stick +#TODO CPUID.ISAs_by_family["riscv64"] = [ +#TODO # We have no way to test riscv64 features yet, so we're only going to declare the lowest ISA: +#TODO "riscv64" => CPUID.ISA(Set{UInt32}()), +#TODO ] +#TODO BinaryPlatforms.arch_mapping["riscv64"] = "(rv64|riscv64)" +#TODO BinaryPlatforms.arch_march_isa_mapping["riscv64"] = ["riscv64" => get_set("riscv64", "riscv64")] +#TODO +#TODO # Helper function to collapse dictionary of mappings down into a regex of +#TODO # named capture groups joined by "|" operators +#TODO c(mapping) = string("(",join(["(?<$k>$v)" for (k, v) in mapping], "|"), ")") +#TODO +#TODO # We're going to build a mondo regex here to parse everything: +#TODO triplet_regex = Regex(string( +#TODO "^", +#TODO # First, the core triplet; arch/os/libc/call_abi +#TODO c(arch_mapping), +#TODO c(os_mapping), +#TODO c(libc_mapping), +#TODO c(call_abi_mapping), +#TODO # Next, optional things, like libgfortran/libstdcxx/cxxstring abi +#TODO c(libgfortran_version_mapping), +#TODO c(cxxstring_abi_mapping), +#TODO c(libstdcxx_version_mapping), +#TODO # Finally, the catch-all for extended tags +#TODO "(?(?:-[^-]+\\+[^-]+)*)?", +#TODO "\$", +#TODO )) +#TODO +#TODO m = match(triplet_regex, triplet) +#TODO if m !== nothing +#TODO # Helper function to find the single named field within the giant regex +#TODO # that is not `nothing` for each mapping we give it. +#TODO get_field(m, mapping) = begin +#TODO for k in keys(mapping) +#TODO if m[k] !== nothing +#TODO # Convert our sentinel `nothing` values to actual `nothing` +#TODO if endswith(k, "_nothing") +#TODO return nothing +#TODO end +#TODO # Convert libgfortran/libstdcxx version numbers +#TODO if startswith(k, "libgfortran") +#TODO return VersionNumber(parse(Int,k[12:end])) +#TODO elseif startswith(k, "libstdcxx") +#TODO return VersionNumber(3, 4, parse(Int,m[k][11:end])) +#TODO else +#TODO return k +#TODO end +#TODO end +#TODO end +#TODO end +#TODO +#TODO # Extract the information we're interested in: +#TODO arch = get_field(m, arch_mapping) +#TODO os = get_field(m, os_mapping) +#TODO libc = get_field(m, libc_mapping) +#TODO call_abi = get_field(m, call_abi_mapping) +#TODO libgfortran_version = get_field(m, libgfortran_version_mapping) +#TODO libstdcxx_version = get_field(m, libstdcxx_version_mapping) +#TODO cxxstring_abi = get_field(m, cxxstring_abi_mapping) +#TODO function split_tags(tagstr) +#TODO tag_fields = filter(!isempty, split(tagstr, "-")) +#TODO if isempty(tag_fields) +#TODO return Pair{String,String}[] +#TODO end +#TODO return map(v -> Symbol(v[1]) => v[2], split.(tag_fields, "+")) +#TODO end +#TODO tags = split_tags(m["tags"]) +#TODO +#TODO # Special parsing of os version number, if any exists +#TODO function extract_os_version(os_name, pattern) +#TODO m_osvn = match(pattern, m[os_name]) +#TODO if m_osvn !== nothing +#TODO return VersionNumber(m_osvn.captures[1]) +#TODO end +#TODO return nothing +#TODO end +#TODO os_version = nothing +#TODO if os == "macos" +#TODO os_version = extract_os_version("macos", r".*darwin([\d\.]+)") +#TODO end +#TODO if os == "freebsd" +#TODO os_version = extract_os_version("freebsd", r".*freebsd([\d.]+)") +#TODO end +#TODO +#TODO return Platform( +#TODO arch, os; +#TODO validate_strict, +#TODO libc, +#TODO call_abi, +#TODO libgfortran_version, +#TODO cxxstring_abi, +#TODO libstdcxx_version, +#TODO os_version, +#TODO tags..., +#TODO ) +#TODO end +#TODO throw(ArgumentError("Platform `$(triplet)` is not an officially supported platform")) +#TODO end end From bba0066e9a1e5685d56eef7cee5d32e75a8b825b Mon Sep 17 00:00:00 2001 From: Erik Schnetter Date: Sat, 21 Dec 2024 20:11:08 -0500 Subject: [PATCH 25/42] More riscv64 support --- src/Rootfs.jl | 19 ++++----- src/riscv64.jl | 104 ------------------------------------------------- 2 files changed, 7 insertions(+), 116 deletions(-) diff --git a/src/Rootfs.jl b/src/Rootfs.jl index f2711a84..697a8831 100644 --- a/src/Rootfs.jl +++ b/src/Rootfs.jl @@ -435,7 +435,6 @@ function gcc_version(p::AbstractPlatform, GCC_builds::Vector{GCCBuild}, compilers::Vector{Symbol}=[:c]; llvm_version::Union{Nothing,VersionNumber}=nothing) - @show gcc_version p GCC_builds compilers llvm_version # First, filter by libgfortran version. if libgfortran_version(p) !== nothing GCC_builds = filter(b -> getabi(b).libgfortran_version == libgfortran_version(p), GCC_builds) @@ -602,17 +601,13 @@ function choose_shards(p::AbstractPlatform; version = v"12.1.0" end - @show find_shard - @show name version archive_type target for cs in all_compiler_shards() - @show cs.name cs.version cs.archive_type cs.target if cs.name == name && cs.version == version && (target === nothing || platforms_match(cs.target, target)) && cs.archive_type == archive_type return cs end end - @show :notfound return nothing end @@ -639,7 +634,6 @@ function choose_shards(p::AbstractPlatform; shards = CompilerShard[] if isempty(bootstrap_list) - @show choose_shards compilers, GCC_builds, LLVM_builds, preferred_gcc_version, preferred_llvm_version # Select GCC and LLVM versions given the compiler ABI and target requirements given in `p` GCC_build, LLVM_build = select_compiler_versions(p, compilers, @@ -650,16 +644,17 @@ function choose_shards(p::AbstractPlatform; ) # We _always_ need Rootfs and PlatformSupport for our target, at least + # TODO: Remove this again ps_build_new = arch(p) == "riscv64" ? v"2024.12.21" : ps_build append!(shards, [ - (@show find_shard("Rootfs", rootfs_build, archive_type)), - (@show find_shard("PlatformSupport", ps_build_new, archive_type; target=p)) + find_shard("Rootfs", rootfs_build, archive_type), + find_shard("PlatformSupport", ps_build_new, archive_type; target=p) ]) if :c in compilers append!(shards, [ - (@show find_shard("GCCBootstrap", GCC_build, archive_type; target=p)), - (@show find_shard("LLVMBootstrap", LLVM_build, archive_type)), + find_shard("GCCBootstrap", GCC_build, archive_type; target=p), + find_shard("LLVMBootstrap", LLVM_build, archive_type), ]) end @@ -680,8 +675,8 @@ function choose_shards(p::AbstractPlatform; # This is necessary for both rust and c compilers if !platforms_match(p, default_host_platform) append!(shards, [ - (@show find_shard("PlatformSupport", ps_build, archive_type; target=default_host_platform)), - (@show find_shard("GCCBootstrap", GCC_build, archive_type; target=default_host_platform)), + find_shard("PlatformSupport", ps_build, archive_type; target=default_host_platform), + find_shard("GCCBootstrap", GCC_build, archive_type; target=default_host_platform), ]) end end diff --git a/src/riscv64.jl b/src/riscv64.jl index 78d8682d..acaf0068 100644 --- a/src/riscv64.jl +++ b/src/riscv64.jl @@ -85,108 +85,4 @@ function Base.BinaryPlatforms.validate_tags(tags::Dict) end end -#TODO using .BinaryPlatforms: arch_mapping, os_mapping, libc_mapping, call_abi_mapping, -#TODO libgfortran_version_mapping, cxxstring_abi_mapping, libstdcxx_version_mapping -#TODO -#TODO function Base.parse(::Type{Platform}, triplet::AbstractString; validate_strict::Bool = false) -#TODO # Re-insert the architecture because the global assignments above don't stick -#TODO CPUID.ISAs_by_family["riscv64"] = [ -#TODO # We have no way to test riscv64 features yet, so we're only going to declare the lowest ISA: -#TODO "riscv64" => CPUID.ISA(Set{UInt32}()), -#TODO ] -#TODO BinaryPlatforms.arch_mapping["riscv64"] = "(rv64|riscv64)" -#TODO BinaryPlatforms.arch_march_isa_mapping["riscv64"] = ["riscv64" => get_set("riscv64", "riscv64")] -#TODO -#TODO # Helper function to collapse dictionary of mappings down into a regex of -#TODO # named capture groups joined by "|" operators -#TODO c(mapping) = string("(",join(["(?<$k>$v)" for (k, v) in mapping], "|"), ")") -#TODO -#TODO # We're going to build a mondo regex here to parse everything: -#TODO triplet_regex = Regex(string( -#TODO "^", -#TODO # First, the core triplet; arch/os/libc/call_abi -#TODO c(arch_mapping), -#TODO c(os_mapping), -#TODO c(libc_mapping), -#TODO c(call_abi_mapping), -#TODO # Next, optional things, like libgfortran/libstdcxx/cxxstring abi -#TODO c(libgfortran_version_mapping), -#TODO c(cxxstring_abi_mapping), -#TODO c(libstdcxx_version_mapping), -#TODO # Finally, the catch-all for extended tags -#TODO "(?(?:-[^-]+\\+[^-]+)*)?", -#TODO "\$", -#TODO )) -#TODO -#TODO m = match(triplet_regex, triplet) -#TODO if m !== nothing -#TODO # Helper function to find the single named field within the giant regex -#TODO # that is not `nothing` for each mapping we give it. -#TODO get_field(m, mapping) = begin -#TODO for k in keys(mapping) -#TODO if m[k] !== nothing -#TODO # Convert our sentinel `nothing` values to actual `nothing` -#TODO if endswith(k, "_nothing") -#TODO return nothing -#TODO end -#TODO # Convert libgfortran/libstdcxx version numbers -#TODO if startswith(k, "libgfortran") -#TODO return VersionNumber(parse(Int,k[12:end])) -#TODO elseif startswith(k, "libstdcxx") -#TODO return VersionNumber(3, 4, parse(Int,m[k][11:end])) -#TODO else -#TODO return k -#TODO end -#TODO end -#TODO end -#TODO end -#TODO -#TODO # Extract the information we're interested in: -#TODO arch = get_field(m, arch_mapping) -#TODO os = get_field(m, os_mapping) -#TODO libc = get_field(m, libc_mapping) -#TODO call_abi = get_field(m, call_abi_mapping) -#TODO libgfortran_version = get_field(m, libgfortran_version_mapping) -#TODO libstdcxx_version = get_field(m, libstdcxx_version_mapping) -#TODO cxxstring_abi = get_field(m, cxxstring_abi_mapping) -#TODO function split_tags(tagstr) -#TODO tag_fields = filter(!isempty, split(tagstr, "-")) -#TODO if isempty(tag_fields) -#TODO return Pair{String,String}[] -#TODO end -#TODO return map(v -> Symbol(v[1]) => v[2], split.(tag_fields, "+")) -#TODO end -#TODO tags = split_tags(m["tags"]) -#TODO -#TODO # Special parsing of os version number, if any exists -#TODO function extract_os_version(os_name, pattern) -#TODO m_osvn = match(pattern, m[os_name]) -#TODO if m_osvn !== nothing -#TODO return VersionNumber(m_osvn.captures[1]) -#TODO end -#TODO return nothing -#TODO end -#TODO os_version = nothing -#TODO if os == "macos" -#TODO os_version = extract_os_version("macos", r".*darwin([\d\.]+)") -#TODO end -#TODO if os == "freebsd" -#TODO os_version = extract_os_version("freebsd", r".*freebsd([\d.]+)") -#TODO end -#TODO -#TODO return Platform( -#TODO arch, os; -#TODO validate_strict, -#TODO libc, -#TODO call_abi, -#TODO libgfortran_version, -#TODO cxxstring_abi, -#TODO libstdcxx_version, -#TODO os_version, -#TODO tags..., -#TODO ) -#TODO end -#TODO throw(ArgumentError("Platform `$(triplet)` is not an officially supported platform")) -#TODO end - end From 486c2ea2c173d9d23d9458cc7050ea63bf2e55d3 Mon Sep 17 00:00:00 2001 From: Erik Schnetter Date: Sat, 21 Dec 2024 20:15:57 -0500 Subject: [PATCH 26/42] More riscv64 support --- src/riscv64.jl | 104 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 104 insertions(+) diff --git a/src/riscv64.jl b/src/riscv64.jl index acaf0068..3e467001 100644 --- a/src/riscv64.jl +++ b/src/riscv64.jl @@ -85,4 +85,108 @@ function Base.BinaryPlatforms.validate_tags(tags::Dict) end end +using .BinaryPlatforms: arch_mapping, os_mapping, libc_mapping, call_abi_mapping, + libgfortran_version_mapping, cxxstring_abi_mapping, libstdcxx_version_mapping + +function Base.parse(::Type{Platform}, triplet::AbstractString; validate_strict::Bool = false) + # # Re-insert the architecture because the global assignments above don't stick + # CPUID.ISAs_by_family["riscv64"] = [ + # # We have no way to test riscv64 features yet, so we're only going to declare the lowest ISA: + # "riscv64" => CPUID.ISA(Set{UInt32}()), + # ] + # BinaryPlatforms.arch_mapping["riscv64"] = "(rv64|riscv64)" + # BinaryPlatforms.arch_march_isa_mapping["riscv64"] = ["riscv64" => get_set("riscv64", "riscv64")] + + # Helper function to collapse dictionary of mappings down into a regex of + # named capture groups joined by "|" operators + c(mapping) = string("(",join(["(?<$k>$v)" for (k, v) in mapping], "|"), ")") + + # We're going to build a mondo regex here to parse everything: + triplet_regex = Regex(string( + "^", + # First, the core triplet; arch/os/libc/call_abi + c(arch_mapping), + c(os_mapping), + c(libc_mapping), + c(call_abi_mapping), + # Next, optional things, like libgfortran/libstdcxx/cxxstring abi + c(libgfortran_version_mapping), + c(cxxstring_abi_mapping), + c(libstdcxx_version_mapping), + # Finally, the catch-all for extended tags + "(?(?:-[^-]+\\+[^-]+)*)?", + "\$", + )) + + m = match(triplet_regex, triplet) + 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. + get_field(m, mapping) = begin + for k in keys(mapping) + if m[k] !== nothing + # Convert our sentinel `nothing` values to actual `nothing` + if endswith(k, "_nothing") + return nothing + end + # Convert libgfortran/libstdcxx version numbers + if startswith(k, "libgfortran") + return VersionNumber(parse(Int,k[12:end])) + elseif startswith(k, "libstdcxx") + return VersionNumber(3, 4, parse(Int,m[k][11:end])) + else + return k + end + end + end + end + + # Extract the information we're interested in: + arch = get_field(m, arch_mapping) + os = get_field(m, os_mapping) + libc = get_field(m, libc_mapping) + call_abi = get_field(m, call_abi_mapping) + libgfortran_version = get_field(m, libgfortran_version_mapping) + libstdcxx_version = get_field(m, libstdcxx_version_mapping) + cxxstring_abi = get_field(m, cxxstring_abi_mapping) + function split_tags(tagstr) + tag_fields = filter(!isempty, split(tagstr, "-")) + if isempty(tag_fields) + return Pair{String,String}[] + end + return map(v -> Symbol(v[1]) => v[2], split.(tag_fields, "+")) + end + tags = split_tags(m["tags"]) + + # Special parsing of os version number, if any exists + function extract_os_version(os_name, pattern) + m_osvn = match(pattern, m[os_name]) + if m_osvn !== nothing + return VersionNumber(m_osvn.captures[1]) + end + return nothing + end + os_version = nothing + if os == "macos" + os_version = extract_os_version("macos", r".*darwin([\d\.]+)") + end + if os == "freebsd" + os_version = extract_os_version("freebsd", r".*freebsd([\d.]+)") + end + + return Platform( + arch, os; + validate_strict, + libc, + call_abi, + libgfortran_version, + cxxstring_abi, + libstdcxx_version, + os_version, + tags..., + ) + end + throw(ArgumentError("Platform `$(triplet)` is not an officially supported platform")) +end + end From d5a16e3dd35bbd8c46c6a2b4f9aa4c6deb2ba5ad Mon Sep 17 00:00:00 2001 From: Erik Schnetter Date: Sat, 21 Dec 2024 20:17:04 -0500 Subject: [PATCH 27/42] More riscv64 support --- src/riscv64.jl | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/src/riscv64.jl b/src/riscv64.jl index 3e467001..8df43a95 100644 --- a/src/riscv64.jl +++ b/src/riscv64.jl @@ -6,7 +6,7 @@ using Base: BinaryPlatforms # These changes have been upstreamed to newer Julia versions, but we are stuck with Julia 1.7. # This is not pretty. It seems to work. -function __init__() +function setup_riscv64() CPUID.ISAs_by_family["riscv64"] = [ # We have no way to test riscv64 features yet, so we're only going to declare the lowest ISA: "riscv64" => CPUID.ISA(Set{UInt32}()), @@ -21,6 +21,8 @@ function __init__() BinaryPlatforms.arch_march_isa_mapping["riscv64"] = ["riscv64" => get_set("riscv64", "riscv64")] end +__init__() = setup_riscv64() + function Base.BinaryPlatforms.validate_tags(tags::Dict) throw_invalid_key(k) = throw(ArgumentError("Key \"$(k)\" cannot have value \"$(tags[k])\"")) # Validate `arch` @@ -89,13 +91,7 @@ using .BinaryPlatforms: arch_mapping, os_mapping, libc_mapping, call_abi_mapping libgfortran_version_mapping, cxxstring_abi_mapping, libstdcxx_version_mapping function Base.parse(::Type{Platform}, triplet::AbstractString; validate_strict::Bool = false) - # # Re-insert the architecture because the global assignments above don't stick - # CPUID.ISAs_by_family["riscv64"] = [ - # # We have no way to test riscv64 features yet, so we're only going to declare the lowest ISA: - # "riscv64" => CPUID.ISA(Set{UInt32}()), - # ] - # BinaryPlatforms.arch_mapping["riscv64"] = "(rv64|riscv64)" - # BinaryPlatforms.arch_march_isa_mapping["riscv64"] = ["riscv64" => get_set("riscv64", "riscv64")] + setup_riscv64() # Helper function to collapse dictionary of mappings down into a regex of # named capture groups joined by "|" operators From a08a9418e888d71b0f08176c34f38689dcff9f56 Mon Sep 17 00:00:00 2001 From: Erik Schnetter Date: Sat, 21 Dec 2024 20:19:01 -0500 Subject: [PATCH 28/42] More riscv64 support --- src/riscv64.jl | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/src/riscv64.jl b/src/riscv64.jl index 8df43a95..da433c76 100644 --- a/src/riscv64.jl +++ b/src/riscv64.jl @@ -23,6 +23,8 @@ end __init__() = setup_riscv64() + + function Base.BinaryPlatforms.validate_tags(tags::Dict) throw_invalid_key(k) = throw(ArgumentError("Key \"$(k)\" cannot have value \"$(tags[k])\"")) # Validate `arch` @@ -87,11 +89,16 @@ function Base.BinaryPlatforms.validate_tags(tags::Dict) end end -using .BinaryPlatforms: arch_mapping, os_mapping, libc_mapping, call_abi_mapping, - libgfortran_version_mapping, cxxstring_abi_mapping, libstdcxx_version_mapping - function Base.parse(::Type{Platform}, triplet::AbstractString; validate_strict::Bool = false) - setup_riscv64() + # setup_riscv64() + + arch_mapping = BinaryPlatforms.arch_mapping + os_mapping = BinaryPlatforms.os_mapping + libc_mapping = BinaryPlatforms.libc_mapping + call_abi_mapping = BinaryPlatforms.call_abi_mapping + libgfortran_version_mapping = BinaryPlatforms.libgfortran_version_mapping + cxxstring_abi_mapping = BinaryPlatforms.cxxstring_abi_mapping + libstdcxx_version_mapping = BinaryPlatforms.libstdcxx_version_mapping # Helper function to collapse dictionary of mappings down into a regex of # named capture groups joined by "|" operators From c24a05a7228efd48faaf1c9d7244bbe072b31602 Mon Sep 17 00:00:00 2001 From: Erik Schnetter Date: Sat, 21 Dec 2024 20:20:13 -0500 Subject: [PATCH 29/42] More riscv64 support --- src/riscv64.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/riscv64.jl b/src/riscv64.jl index da433c76..17b645f9 100644 --- a/src/riscv64.jl +++ b/src/riscv64.jl @@ -90,7 +90,7 @@ function Base.BinaryPlatforms.validate_tags(tags::Dict) end function Base.parse(::Type{Platform}, triplet::AbstractString; validate_strict::Bool = false) - # setup_riscv64() + setup_riscv64() arch_mapping = BinaryPlatforms.arch_mapping os_mapping = BinaryPlatforms.os_mapping From fdff0c592a5f3387ee56c964348a755df7791ce2 Mon Sep 17 00:00:00 2001 From: Erik Schnetter Date: Sat, 21 Dec 2024 20:21:24 -0500 Subject: [PATCH 30/42] More riscv64 support --- src/riscv64.jl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/riscv64.jl b/src/riscv64.jl index 17b645f9..7f9ca93f 100644 --- a/src/riscv64.jl +++ b/src/riscv64.jl @@ -7,9 +7,9 @@ using Base: BinaryPlatforms # This is not pretty. It seems to work. function setup_riscv64() - CPUID.ISAs_by_family["riscv64"] = [ + BinaryPlatforms.CPUID.ISAs_by_family["riscv64"] = [ # We have no way to test riscv64 features yet, so we're only going to declare the lowest ISA: - "riscv64" => CPUID.ISA(Set{UInt32}()), + "riscv64" => BinaryPlatforms.CPUID.ISA(Set{UInt32}()), ] BinaryPlatforms.arch_mapping["riscv64"] = "(rv64|riscv64)" From 756417002c1491289c63eea6f3f7f5e50c7c7590 Mon Sep 17 00:00:00 2001 From: Erik Schnetter Date: Sat, 21 Dec 2024 22:14:41 -0500 Subject: [PATCH 31/42] Update tests for riscv64 --- test/platforms.jl | 8 +++++--- test/rootfs.jl | 1 + test/runners.jl | 4 ++++ 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/test/platforms.jl b/test/platforms.jl index 19837b7d..1412acf2 100644 --- a/test/platforms.jl +++ b/test/platforms.jl @@ -65,7 +65,7 @@ end end for p in [Platform("x86_64", "linux"), Platform("x86_64", "windows"), Platform("aarch64", "linux"), - Platform("powerpc64le", "linux"), Platform("x86_64", "macos")] + Platform("powerpc64le", "linux"), Platform("riscv64", "linux"), Platform("x86_64", "macos")] @test nbits(p) == 64 end @@ -76,8 +76,10 @@ end @test proc_family(p) == "arm" end @test proc_family(Platform("powerpc64le", "linux")) == "power" + @test proc_family(Platform("riscv64", "linux")) == "riscv" - for p in [Platform("x86_64", "linux"), Platform("x86_64", "freebsd"), Platform("powerpc64le", "linux"), Platform("x86_64", "macos")] + for p in [Platform("x86_64", "linux"), Platform("x86_64", "freebsd"), Platform("powerpc64le", "linux"), + Platform("riscv64", "linux"), Platform("x86_64", "macos")] @test platform_exeext(p) == "" end @test platform_exeext(Platform("x86_64", "windows")) == ".exe" @@ -107,7 +109,7 @@ using BinaryBuilderBase: get_march_flags, get_all_arch_names, get_all_march_name end # Get all architectures and all microarchitectures for the different architectures - @test sort(get_all_arch_names()) == ["aarch64", "armv6l", "armv7l", "i686", "powerpc64le", "x86_64"] + @test sort(get_all_arch_names()) == ["aarch64", "armv6l", "armv7l", "i686", "powerpc64le", "riscv64", "x86_64"] @test sort(get_all_march_names("x86_64")) == ["avx", "avx2", "avx512", "x86_64"] @test sort(get_all_march_names("armv7l")) == ["armv7l", "neonvfpv4"] end diff --git a/test/rootfs.jl b/test/rootfs.jl index 9007559f..77f5f065 100644 --- a/test/rootfs.jl +++ b/test/rootfs.jl @@ -86,6 +86,7 @@ using BinaryBuilderBase Platform("i686", "linux"; libc="glibc", march="pentium4"), Platform("i686", "linux"; libc="glibc", march="prescott"), Platform("powerpc64le", "linux"; libc="glibc", march="power8"), + Platform("riscv64", "linux"; libc="glibc", march="riscv64"), Platform("x86_64", "linux"; libc="glibc", march="avx"), Platform("x86_64", "linux"; libc="glibc", march="avx2"), Platform("x86_64", "linux"; libc="glibc", march="avx512"), diff --git a/test/runners.jl b/test/runners.jl index 75b9c075..95698207 100644 --- a/test/runners.jl +++ b/test/runners.jl @@ -9,6 +9,7 @@ using Pkg @test nbits(Platform("armv7l", "linux")) == 32 @test nbits(Platform("aarch64", "linux"; cuda="10.1")) == 64 @test nbits(Platform("powerpc64le", "linux")) == 64 + @test nbits(Platform("riscv64", "linux")) == 64 @test nbits(AnyPlatform()) == 64 @test proc_family(Platform("i686", "linux")) == "intel" @@ -16,6 +17,7 @@ using Pkg @test proc_family(Platform("armv7l", "linux")) == "arm" @test proc_family(Platform("aarch64", "linux"; cuda="10.1")) == "arm" @test proc_family(Platform("powerpc64le", "linux")) == "power" + @test proc_family(Platform("riscv64", "linux")) == "riscv" @test proc_family(AnyPlatform()) == "any" @test platform_exeext(Platform("i686", "linux")) == "" @@ -28,6 +30,8 @@ using Pkg @test prefer_clang(Platform("x86_64", "freebsd")) @test prefer_clang(Platform("aarch64", "macos")) + @test !prefer_clang(Platform("powerpc64le", "linux")) + @test !prefer_clang(Platform("riscv64", "linux")) @test !prefer_clang(Platform("x86_64", "linux")) @test prefer_clang(Platform("x86_64", "linux"; sanitize="memory")) @test !prefer_clang(Platform("x86_64", "linux"; sanitize="thread")) From 76c9967313f2055118077c6a3c7b28afba912cf0 Mon Sep 17 00:00:00 2001 From: Erik Schnetter Date: Sat, 21 Dec 2024 22:23:38 -0500 Subject: [PATCH 32/42] Update tests for riscv64 --- test/rootfs.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/rootfs.jl b/test/rootfs.jl index 77f5f065..34938ce1 100644 --- a/test/rootfs.jl +++ b/test/rootfs.jl @@ -86,7 +86,7 @@ using BinaryBuilderBase Platform("i686", "linux"; libc="glibc", march="pentium4"), Platform("i686", "linux"; libc="glibc", march="prescott"), Platform("powerpc64le", "linux"; libc="glibc", march="power8"), - Platform("riscv64", "linux"; libc="glibc", march="riscv64"), + #experimental Platform("riscv64", "linux"; libc="glibc", march="riscv64"), Platform("x86_64", "linux"; libc="glibc", march="avx"), Platform("x86_64", "linux"; libc="glibc", march="avx2"), Platform("x86_64", "linux"; libc="glibc", march="avx512"), From 6f037adef8870b6159898ad68f4122fb23ed3089 Mon Sep 17 00:00:00 2001 From: Erik Schnetter Date: Sun, 22 Dec 2024 10:38:01 -0500 Subject: [PATCH 33/42] Make changes requested in code review --- Artifacts.toml | 44 ++++++++++++++++++++++++++++++++++++++++++++ Project.toml | 2 +- src/Rootfs.jl | 14 +++++--------- src/Runner.jl | 6 +++--- 4 files changed, 53 insertions(+), 13 deletions(-) diff --git a/Artifacts.toml b/Artifacts.toml index 1c03741b..1c47c761 100644 --- a/Artifacts.toml +++ b/Artifacts.toml @@ -1956,6 +1956,50 @@ 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" diff --git a/Project.toml b/Project.toml index 6bd8d028..4661b4c1 100644 --- a/Project.toml +++ b/Project.toml @@ -1,7 +1,7 @@ name = "BinaryBuilderBase" uuid = "7f725544-6523-48cd-82d1-3fa08ff4056e" authors = ["Elliot Saba "] -version = "1.34.0" +version = "1.33.0" [deps] Bzip2_jll = "6e34b625-4abd-537c-b88f-471c36dfa7a0" diff --git a/src/Rootfs.jl b/src/Rootfs.jl index 697a8831..4d387ef5 100644 --- a/src/Rootfs.jl +++ b/src/Rootfs.jl @@ -524,12 +524,6 @@ function gcc_version(p::AbstractPlatform, end function llvm_version(p::AbstractPlatform, LLVM_builds::Vector{LLVMBuild}) - # # We only have LLVM 18 or newer for RISC-V. - # # (This could be changed down to LLVM 6.0.) - # if arch(p) == "riscv64" - # LLVM_builds = filter(b -> getversion(b) ≥ v"6", LLVM_builds) - # end - if march(p) in ("armv8_2_crypto",) LLVM_builds = filter(b -> getversion(b) >= v"9.0", LLVM_builds) elseif march(p) in ("a64fx",) @@ -538,6 +532,8 @@ 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 + + end return getversion.(LLVM_builds) end @@ -644,8 +640,8 @@ function choose_shards(p::AbstractPlatform; ) # We _always_ need Rootfs and PlatformSupport for our target, at least - # TODO: Remove this again - ps_build_new = arch(p) == "riscv64" ? v"2024.12.21" : ps_build + # We don't have old platform support for riscv64. Remove this once all platfor support is aligned in time. + 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_new, archive_type; target=p) @@ -791,7 +787,7 @@ function expand_gfortran_versions(platform::AbstractPlatform) elseif Sys.isfreebsd(platform) && arch(platform) == "aarch64" libgfortran_versions = [v"4", v"5"] elseif arch(platform) == "riscv64" - # TODO: That might change if we build older GCC versions + # We don't have older GCC versions libgfortran_versions = [v"5"] else libgfortran_versions = [v"3", v"4", v"5"] diff --git a/src/Runner.jl b/src/Runner.jl index 2fe36847..0cde3a22 100644 --- a/src/Runner.jl +++ b/src/Runner.jl @@ -1286,11 +1286,11 @@ function platform_envs(platform::AbstractPlatform, src_name::AbstractString; if libc(platform) === "glibc" # This should be kept in sync with the version of glibc used in # https://github.com/JuliaPackaging/Yggdrasil/blob/master/0_RootFS/gcc_sources.jl - if arch(platform) in ["armv7l", "aarch64"] + if arch(platform) in ("armv7l", "aarch64") mapping["GNU_LIBC_VERSION"] = "glibc 2.19" - elseif arch(platform) in ["x86_64", "i686", "powerpc64le"] + elseif arch(platform) in ("x86_64", "i686", "powerpc64le") mapping["GNU_LIBC_VERSION"] = "glibc 2.17" - elseif arch(platform) in ["riscv64"] + elseif arch(platform) in ("riscv64",) mapping["GNU_LIBC_VERSION"] = "glibc 2.35" end end From b409474afd0bff002af88ac0109bb4a03629e348 Mon Sep 17 00:00:00 2001 From: Erik Schnetter Date: Sun, 22 Dec 2024 10:39:26 -0500 Subject: [PATCH 34/42] Make changes requested in code review --- src/Rootfs.jl | 1 - 1 file changed, 1 deletion(-) diff --git a/src/Rootfs.jl b/src/Rootfs.jl index 4d387ef5..375ac4cc 100644 --- a/src/Rootfs.jl +++ b/src/Rootfs.jl @@ -533,7 +533,6 @@ function llvm_version(p::AbstractPlatform, LLVM_builds::Vector{LLVMBuild}) LLVM_builds = filter(b -> getversion(b) >= v"13.0", LLVM_builds) end - end return getversion.(LLVM_builds) end From 52e5caa81b27d169d1043f01deff40c4503140fc Mon Sep 17 00:00:00 2001 From: Erik Schnetter Date: Sun, 22 Dec 2024 11:10:38 -0500 Subject: [PATCH 35/42] Support riscv64 for Go --- src/BuildToolchains.jl | 2 ++ src/Platforms.jl | 2 +- src/Runner.jl | 1 + 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/BuildToolchains.jl b/src/BuildToolchains.jl index c655a40f..bef4ddba 100644 --- a/src/BuildToolchains.jl +++ b/src/BuildToolchains.jl @@ -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 diff --git a/src/Platforms.jl b/src/Platforms.jl index 121239e9..6063ce20 100644 --- a/src/Platforms.jl +++ b/src/Platforms.jl @@ -160,7 +160,7 @@ const ARCHITECTURE_FLAGS = Dict( #"power10" => ["-mcpu=power10", "-mtune=power10"], ), "riscv64" => OrderedDict( - "riscv64" => [], # TODO + "riscv64" => [], ), ), "gcc" => Dict( diff --git a/src/Runner.jl b/src/Runner.jl index 0cde3a22..54a1a18a 100644 --- a/src/Runner.jl +++ b/src/Runner.jl @@ -664,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 From edd790736a3d15ab65140e472e35beeb71f3a519 Mon Sep 17 00:00:00 2001 From: Erik Schnetter Date: Sun, 22 Dec 2024 12:57:58 -0500 Subject: [PATCH 36/42] Specify riscv64 ABI --- src/Platforms.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Platforms.jl b/src/Platforms.jl index 6063ce20..c36cb87b 100644 --- a/src/Platforms.jl +++ b/src/Platforms.jl @@ -160,7 +160,7 @@ const ARCHITECTURE_FLAGS = Dict( #"power10" => ["-mcpu=power10", "-mtune=power10"], ), "riscv64" => OrderedDict( - "riscv64" => [], + "riscv64" => ["-march=rv64g", "-mabi=lp64d"], ), ), "gcc" => Dict( From aa9cd98b7ae4c9fc96ab0b3a95d33bd035661dbf Mon Sep 17 00:00:00 2001 From: Erik Schnetter Date: Sun, 22 Dec 2024 12:58:10 -0500 Subject: [PATCH 37/42] Don't use experimental platforms --- src/Rootfs.jl | 3 +-- test/rootfs.jl | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/Rootfs.jl b/src/Rootfs.jl index 375ac4cc..b82acce6 100644 --- a/src/Rootfs.jl +++ b/src/Rootfs.jl @@ -729,6 +729,7 @@ function supported_platforms(;exclude::Union{Vector{<:Platform},Function}=Return Platform("armv6l", "linux"), Platform("armv7l", "linux"), Platform("powerpc64le", "linux"), + Platform("riscv64", "linux"), # musl Linuces Platform("i686", "linux"; libc="musl"), @@ -751,8 +752,6 @@ 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) diff --git a/test/rootfs.jl b/test/rootfs.jl index 34938ce1..77f5f065 100644 --- a/test/rootfs.jl +++ b/test/rootfs.jl @@ -86,7 +86,7 @@ using BinaryBuilderBase Platform("i686", "linux"; libc="glibc", march="pentium4"), Platform("i686", "linux"; libc="glibc", march="prescott"), Platform("powerpc64le", "linux"; libc="glibc", march="power8"), - #experimental Platform("riscv64", "linux"; libc="glibc", march="riscv64"), + Platform("riscv64", "linux"; libc="glibc", march="riscv64"), Platform("x86_64", "linux"; libc="glibc", march="avx"), Platform("x86_64", "linux"; libc="glibc", march="avx2"), Platform("x86_64", "linux"; libc="glibc", march="avx512"), From 83445ab09f87d03a9fc7f1fd32389cb0a29174a4 Mon Sep 17 00:00:00 2001 From: Erik Schnetter Date: Sun, 22 Dec 2024 13:06:33 -0500 Subject: [PATCH 38/42] Correct doctests --- src/Rootfs.jl | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/Rootfs.jl b/src/Rootfs.jl index b82acce6..58a4e561 100644 --- a/src/Rootfs.jl +++ b/src/Rootfs.jl @@ -942,6 +942,7 @@ julia> expand_microarchitectures(filter!(p -> Sys.islinux(p) && libc(p) == "glib Linux armv7l {call_abi=eabihf, libc=glibc, march=armv7l} Linux armv7l {call_abi=eabihf, libc=glibc, march=neonvfpv4} Linux powerpc64le {libc=glibc, march=power8} + Linux riscv64 {libc=glibc, march=riscv64} julia> expand_microarchitectures(filter!(p -> Sys.islinux(p) && libc(p) == "glibc", supported_platforms()), ["x86_64", "avx2"]) 7-element Vector{Platform}: @@ -952,6 +953,7 @@ julia> expand_microarchitectures(filter!(p -> Sys.islinux(p) && libc(p) == "glib Linux armv6l {call_abi=eabihf, libc=glibc} Linux armv7l {call_abi=eabihf, libc=glibc} Linux powerpc64le {libc=glibc} + Linux riscv64 {libc=glibc} julia> expand_microarchitectures(filter!(p -> Sys.islinux(p) && libc(p) == "glibc", supported_platforms()); filter=p->arch(p)=="x86_64") 9-element Vector{Platform}: @@ -964,6 +966,7 @@ julia> expand_microarchitectures(filter!(p -> Sys.islinux(p) && libc(p) == "glib Linux armv6l {call_abi=eabihf, libc=glibc} Linux armv7l {call_abi=eabihf, libc=glibc} Linux powerpc64le {libc=glibc} + Linux riscv64 {libc=glibc} ``` """ function expand_microarchitectures(ps::Vector{<:AbstractPlatform}, From 3d13f999410909118dbe051642d3785b092e32cd Mon Sep 17 00:00:00 2001 From: Erik Schnetter Date: Sun, 22 Dec 2024 13:10:13 -0500 Subject: [PATCH 39/42] Correct doctests --- src/Rootfs.jl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Rootfs.jl b/src/Rootfs.jl index 58a4e561..ec6b6f44 100644 --- a/src/Rootfs.jl +++ b/src/Rootfs.jl @@ -927,7 +927,7 @@ argument. julia> using BinaryBuilderBase julia> expand_microarchitectures(filter!(p -> Sys.islinux(p) && libc(p) == "glibc", supported_platforms())) -14-element Vector{Platform}: +15-element Vector{Platform}: Linux i686 {libc=glibc, march=pentium4} Linux i686 {libc=glibc, march=prescott} Linux x86_64 {libc=glibc, march=x86_64} @@ -945,7 +945,7 @@ julia> expand_microarchitectures(filter!(p -> Sys.islinux(p) && libc(p) == "glib Linux riscv64 {libc=glibc, march=riscv64} julia> expand_microarchitectures(filter!(p -> Sys.islinux(p) && libc(p) == "glibc", supported_platforms()), ["x86_64", "avx2"]) -7-element Vector{Platform}: +8-element Vector{Platform}: Linux i686 {libc=glibc} Linux x86_64 {libc=glibc, march=x86_64} Linux x86_64 {libc=glibc, march=avx2} @@ -956,7 +956,7 @@ julia> expand_microarchitectures(filter!(p -> Sys.islinux(p) && libc(p) == "glib Linux riscv64 {libc=glibc} julia> expand_microarchitectures(filter!(p -> Sys.islinux(p) && libc(p) == "glibc", supported_platforms()); filter=p->arch(p)=="x86_64") -9-element Vector{Platform}: +10-element Vector{Platform}: Linux i686 {libc=glibc} Linux x86_64 {libc=glibc, march=x86_64} Linux x86_64 {libc=glibc, march=avx} From 28c7be3aeb516d3f94425340d3b3c0a34f550d32 Mon Sep 17 00:00:00 2001 From: Erik Schnetter Date: Sun, 22 Dec 2024 13:33:22 -0500 Subject: [PATCH 40/42] Update default riscv64 ABI --- src/Platforms.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Platforms.jl b/src/Platforms.jl index c36cb87b..f822b67c 100644 --- a/src/Platforms.jl +++ b/src/Platforms.jl @@ -160,7 +160,7 @@ const ARCHITECTURE_FLAGS = Dict( #"power10" => ["-mcpu=power10", "-mtune=power10"], ), "riscv64" => OrderedDict( - "riscv64" => ["-march=rv64g", "-mabi=lp64d"], + "riscv64" => ["-march=rv64gc", "-mabi=lp64d"], ), ), "gcc" => Dict( From dafa99380c04a0de80e1b478a3517839bc494dc1 Mon Sep 17 00:00:00 2001 From: Erik Schnetter Date: Sun, 22 Dec 2024 18:31:13 -0500 Subject: [PATCH 41/42] Remove outdated and unnecessary artifacts --- Artifacts.toml | 74 ++++---------------------------------------------- 1 file changed, 6 insertions(+), 68 deletions(-) diff --git a/Artifacts.toml b/Artifacts.toml index 1c47c761..88040fa2 100644 --- a/Artifacts.toml +++ b/Artifacts.toml @@ -3432,25 +3432,25 @@ os = "linux" [["LLVMBootstrap.v18.1.7.x86_64-linux-musl.squashfs"]] arch = "x86_64" -git-tree-sha1 = "b639d2a33c52a6e5c9c6ba4b837478610801983e" +git-tree-sha1 = "56e29a15fa1dc3da79b6da7476b826c6a989eda3" lazy = true libc = "musl" os = "linux" [["LLVMBootstrap.v18.1.7.x86_64-linux-musl.squashfs".download]] - 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" + 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" [["LLVMBootstrap.v18.1.7.x86_64-linux-musl.unpacked"]] arch = "x86_64" -git-tree-sha1 = "1943b45494f48fde6fbbef3f80ea06b1b35d0d86" +git-tree-sha1 = "ba75276dcd66d7dbc627c61fc86e6d6ea2d4cd31" lazy = true libc = "musl" os = "linux" [["LLVMBootstrap.v18.1.7.x86_64-linux-musl.unpacked".download]] - 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" + 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" [["LLVMBootstrap.v6.0.1.x86_64-linux-musl.squashfs"]] arch = "x86_64" @@ -4161,16 +4161,6 @@ 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]] @@ -4187,58 +4177,6 @@ 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" From fc2baa2735a470a5e033e31743af1f8fc676c385 Mon Sep 17 00:00:00 2001 From: Erik Schnetter Date: Mon, 23 Dec 2024 09:38:09 -0500 Subject: [PATCH 42/42] Correct typo in comment --- src/Rootfs.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Rootfs.jl b/src/Rootfs.jl index ec6b6f44..8a891856 100644 --- a/src/Rootfs.jl +++ b/src/Rootfs.jl @@ -639,7 +639,7 @@ 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. + # We don't have old platform support for riscv64. Remove this once all platform support is aligned in time. ps_build_new = arch(p) == "riscv64" ? max(ps_build, v"2024.12.21") : ps_build append!(shards, [ find_shard("Rootfs", rootfs_build, archive_type),