Skip to content

Commit

Permalink
build: Make it build on riscv64
Browse files Browse the repository at this point in the history
Go 1.14 added experimental support for 64-bit RISC-V on Linux
(GOOS=linux, GOARCH=riscv64) [1], and the path of the dynamic linker
(ie., PT_INTERP) was taken from the ABI specification [2].

Tested in Arch Linux rv64gc qemu user image.

[1] https://tip.golang.org/doc/go1.14#riscv

[2] https://sourceware.org/glibc/wiki/ABIList

containers#1159
containers#1316

Signed-off-by: Avimitin <[email protected]>
  • Loading branch information
Avimitin authored and debarshiray committed Jun 13, 2023
1 parent 0a14177 commit e238c49
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/containers/toolbox

go 1.13
go 1.14

require (
github.com/HarryMichal/go-version v1.0.1
Expand Down
2 changes: 2 additions & 0 deletions src/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ elif cpu_family == 'x86' and endian == 'little'
dynamic_linker = '/lib/ld-linux.so.2'
elif cpu_family == 'x86_64' and endian == 'little'
dynamic_linker = '/lib64/ld-linux-x86-64.so.2'
elif cpu_family == 'riscv64' and endian == 'little'
dynamic_linker = '/lib/ld-linux-riscv64-lp64d.so.1'
else
host_machine_description = cpu_family + ' (' + endian + ' endian)'
error('Please specify dynamic linker for:', host_machine_description)
Expand Down

0 comments on commit e238c49

Please sign in to comment.