From a59f11bf43d111d9979ed7b2a734a3a9217cc4bb Mon Sep 17 00:00:00 2001 From: nullun Date: Tue, 25 Mar 2025 09:48:36 +0000 Subject: [PATCH 1/2] feat: add riscv64 support for crypto libraries This commit adds support for the riscv64 architecture to the crypto libraries. It includes the necessary CFLAGS and LDFLAGS for compiling with the libsodium library on riscv64 Linux systems. Additionally, it updates the archtype.sh script to correctly identify the riscv64 architecture. --- crypto/batchverifier.go | 1 + crypto/curve25519.go | 2 ++ crypto/vrf.go | 1 + scripts/archtype.sh | 2 ++ 4 files changed, 6 insertions(+) diff --git a/crypto/batchverifier.go b/crypto/batchverifier.go index 4d68037b95..65b2febeaa 100644 --- a/crypto/batchverifier.go +++ b/crypto/batchverifier.go @@ -22,6 +22,7 @@ package crypto // #cgo linux,amd64 CFLAGS: -I${SRCDIR}/libs/linux/amd64/include // #cgo linux,arm64 CFLAGS: -I${SRCDIR}/libs/linux/arm64/include // #cgo linux,arm CFLAGS: -I${SRCDIR}/libs/linux/arm/include +// #cgo linux,riscv64 CFLAGS: -I${SRCDIR}/libs/linux/riscv64/include // #cgo windows,amd64 CFLAGS: -I${SRCDIR}/libs/windows/amd64/include // #include // enum { diff --git a/crypto/curve25519.go b/crypto/curve25519.go index 9a7e92ad2a..1f6dfcbd16 100644 --- a/crypto/curve25519.go +++ b/crypto/curve25519.go @@ -27,6 +27,8 @@ package crypto // #cgo linux,arm64 LDFLAGS: ${SRCDIR}/libs/linux/arm64/lib/libsodium.a // #cgo linux,arm CFLAGS: -I${SRCDIR}/libs/linux/arm/include // #cgo linux,arm LDFLAGS: ${SRCDIR}/libs/linux/arm/lib/libsodium.a +// #cgo linux,riscv64 CFLAGS: -I${SRCDIR}/libs/linux/riscv64/include +// #cgo linux,riscv64 LDFLAGS: ${SRCDIR}/libs/linux/riscv64/lib/libsodium.a // #cgo windows,amd64 CFLAGS: -I${SRCDIR}/libs/windows/amd64/include // #cgo windows,amd64 LDFLAGS: ${SRCDIR}/libs/windows/amd64/lib/libsodium.a // #include diff --git a/crypto/vrf.go b/crypto/vrf.go index 4f242842be..5b89500d70 100644 --- a/crypto/vrf.go +++ b/crypto/vrf.go @@ -21,6 +21,7 @@ package crypto // #cgo linux,amd64 CFLAGS: -I${SRCDIR}/libs/linux/amd64/include // #cgo linux,arm64 CFLAGS: -I${SRCDIR}/libs/linux/arm64/include // #cgo linux,arm CFLAGS: -I${SRCDIR}/libs/linux/arm/include +// #cgo linux,riscv64 CFLAGS: -I${SRCDIR}/libs/linux/riscv64/include // #cgo windows,amd64 CFLAGS: -I${SRCDIR}/libs/windows/amd64/include // #include // #include "sodium.h" diff --git a/scripts/archtype.sh b/scripts/archtype.sh index cc241c82f7..fb4429839d 100755 --- a/scripts/archtype.sh +++ b/scripts/archtype.sh @@ -15,6 +15,8 @@ elif [[ "${ARCH}" = "armv7l" ]]; then echo "arm" elif [[ "${ARCH}" = "aarch64" ]] || [[ "${ARCH}" = "arm64" ]]; then echo "arm64" +elif [[ "${ARCH}" = "riscv64" ]]; then + echo "riscv64" else # Anything else needs to be specifically added... echo "unsupported" From 60d76199973c56879e64ce51dbd31cfafc8c39f9 Mon Sep 17 00:00:00 2001 From: nullun Date: Tue, 25 Mar 2025 11:27:53 +0000 Subject: [PATCH 2/2] Created dummy node_exporter archive --- .../node_exporter-stable-linux-riscv64.tar.gz | Bin 0 -> 137 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 installer/external/node_exporter-stable-linux-riscv64.tar.gz diff --git a/installer/external/node_exporter-stable-linux-riscv64.tar.gz b/installer/external/node_exporter-stable-linux-riscv64.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..56d41a144d9e6f7471c3f870c43d82b4c459908e GIT binary patch literal 137 zcmb2|=3vOYUKGQ?{Pw&pU$X&ETVmfN;ed9F0>*cZ6F7pV2Q6)|u&dW~X5W_cesj&H zKfGoCDtKcv4t