Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Support riscv64 #1355

Merged
merged 5 commits into from
Dec 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "BinaryBuilder"
uuid = "12aac903-9f7c-5d81-afc2-d9565ea332ae"
authors = ["Elliot Saba <[email protected]>"]
version = "0.6.0"
version = "0.6.1"

[deps]
ArgParse = "c7e460c6-2fb9-53a9-8c5b-16f535851c63"
Expand Down Expand Up @@ -33,23 +33,23 @@ ghr_jll = "07c12ed4-43bc-5495-8a2a-d5838ef8d533"

[compat]
ArgParse = "1.1"
BinaryBuilderBase = "1.31"
BinaryBuilderBase = "1.33"
Downloads = "1"
GitHub = "5.1"
HTTP = "0.8, 0.9, 1"
JLD2 = "0.1.6, 0.2, 0.3, 0.4, 0.5"
JLLWrappers = "1.2.0"
JSON = "0.21"
LoggingExtras = "0.4, 1"
ObjectFile = "0.4"
ObjectFile = "0.4.3"
OutputCollectors = "0.1"
PkgLicenses = "0.2"
Registrator = "1.1"
RegistryTools = "2.1"
SHA = "0.7, 1"
Scratch = "1.0"
TOML = "1"
ghr_jll = "0.13, 0.14"
ghr_jll = "0.13, 0.14, 0.17"
julia = "1.7"

[extras]
Expand Down
5 changes: 5 additions & 0 deletions src/auditor/dynamic_linkage.jl
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
ELF.EM_X86_64 => "x86_64",
ELF.EM_AARCH64 => "aarch64",
ELF.EM_PPC64 => "powerpc64le",
ELF.EM_RISCV => "riscv64", # Could also be riscv32; should check ELF_CLASS
ELF.EM_ARM => "arm",
)
mach = oh.header.e_machine
Expand Down Expand Up @@ -120,6 +121,9 @@
return m == ELF.EM_AARCH64
elseif arch(platform) == "powerpc64le"
return m == ELF.EM_PPC64
elseif arch(platform) == "riscv64"
# Could also be riscv32; should check ELF_CLASS
return m == ELF.EM_RISCV

Check warning on line 126 in src/auditor/dynamic_linkage.jl

View check run for this annotation

Codecov / codecov/patch

src/auditor/dynamic_linkage.jl#L126

Added line #L126 was not covered by tests
elseif arch(platform) ∈ ("armv7l", "armv6l")
return m == ELF.EM_ARM
else
Expand Down Expand Up @@ -326,6 +330,7 @@
flags = []

# ppc64le and aarch64 have 64KB page sizes, don't muck up the ELF section load alignment
# TODO: What is the riscv64 page size?
eschnett marked this conversation as resolved.
Show resolved Hide resolved
if arch(p) in ("powerpc64le", "aarch64")
append!(flags, ["--page-size", "65536"])
end
Expand Down
2 changes: 2 additions & 0 deletions src/auditor/instruction_set.jl
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,8 @@
# TODO: Detect NEON and vfpv4 instructions
elseif arch(p) == "powerpc64le"
# TODO Detect POWER9/10 instructions
elseif arch(p) == "riscv64"

Check warning on line 124 in src/auditor/instruction_set.jl

View check run for this annotation

Codecov / codecov/patch

src/auditor/instruction_set.jl#L124

Added line #L124 was not covered by tests
# TODO
end
return generic_march(p)
end
Expand Down
4 changes: 2 additions & 2 deletions src/wizard/interactive_build.jl
Original file line number Diff line number Diff line change
Expand Up @@ -467,7 +467,7 @@
that's generally the host platform, so it's usually easiest. After that we
go by the following preferences:
* OS (in order): Linux, Windows, OSX
* Architecture: x86_64, i686, aarch64, powerpc64le, armv7l
* Architecture: x86_64, i686, aarch64, powerpc64le, armv7l, riscv64
* The first remaining after this selection
"""
function pick_preferred_platform(platforms)
Expand All @@ -480,7 +480,7 @@
platforms = plats
end
end
for a in ("x86_64", "i686", "aarch64", "powerpc64le", "armv7l")
for a in ("x86_64", "i686", "aarch64", "powerpc64le", "armv7l", "riscv64")

Check warning on line 483 in src/wizard/interactive_build.jl

View check run for this annotation

Codecov / codecov/patch

src/wizard/interactive_build.jl#L483

Added line #L483 was not covered by tests
plats = filter(p->arch(p) == a, platforms)
if !isempty(plats)
platforms = plats
Expand Down
Loading