Skip to content

Commit

Permalink
Introduce SPARC64 support
Browse files Browse the repository at this point in the history
Closes: #1512
Signed-off-by: Richard Rogalski <[email protected]>
  • Loading branch information
Richard-Rogalski committed May 23, 2024
1 parent 8238c00 commit 4063289
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 0 deletions.
2 changes: 2 additions & 0 deletions include/ring-core/target.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@
#define OPENSSL_32_BIT
#elif defined(__s390x__)
#define OPENSSL_64_BIT
#elif defined(__sparc_v9__) && defined(__LP64__)
#define OPENSSL_64_BIT
#else
#error "Unknown target CPU"
#endif
Expand Down
6 changes: 6 additions & 0 deletions mk/cargo.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ qemu_powerpc64="qemu-ppc64 -L /usr/powerpc64-linux-gnu"
qemu_powerpc64le="qemu-ppc64le -L /usr/powerpc64le-linux-gnu"
qemu_riscv64="qemu-riscv64 -L /usr/riscv64-linux-gnu"
qemu_s390x="qemu-s390x -L /usr/s390x-linux-gnu"
qemu_sparc64="qemu-sparc64 -L /usr/sparc64-linux-gnu"

# Avoid putting the Android tools in `$PATH` because there are tools in this
# directory like `clang` that would conflict with the same-named tools that may
Expand Down Expand Up @@ -170,6 +171,11 @@ case $target in
export CARGO_TARGET_S390X_UNKNOWN_LINUX_GNU_LINKER=s390x-linux-gnu-gcc
export CARGO_TARGET_S390X_UNKNOWN_LINUX_GNU_RUNNER="$qemu_s390x"
;;
sparc64-unknown-linux-gnu)
export CFLAGS_sparc64_unknown_linux_gnu="--sysroot=/usr/sparc64-linux-gnu"
export CARGO_TARGET_SPARC64_UNKNOWN_LINUX_GNU_LINKER=sparc64-linux-gnu-gcc
export CARGO_TARGET_SPARC64_UNKNOWN_LINUX_GNU_RUNNER="$qemu_sparc64"
;;
x86_64-unknown-linux-musl)
use_clang=1
# XXX: Work around https://github.com/rust-lang/rust/issues/79555.
Expand Down
6 changes: 6 additions & 0 deletions mk/install-build-tools.sh
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,12 @@ s390x-unknown-linux-gnu)
gcc-s390x-linux-gnu \
libc6-dev-s390x-cross
;;
sparc64-unknown-linux-gnu)
install_packages \
qemu-user \
gcc-sparc64-linux-gnu \
libc6-dev-sparc64-cross
;;
wasm32-unknown-unknown)
cargo install wasm-bindgen-cli --bin wasm-bindgen-test-runner
use_clang=1
Expand Down

0 comments on commit 4063289

Please sign in to comment.