From 597573268bbaa7ce70fa1fa8894df01b08bce0fc Mon Sep 17 00:00:00 2001 From: Eric Richter Date: Sat, 30 Sep 2023 09:23:07 -0500 Subject: [PATCH 1/3] Add Little-endian PPC64LE definition to ring-core/target.h Signed-off-by: Eric Richter --- include/ring-core/target.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/include/ring-core/target.h b/include/ring-core/target.h index 9c9543a294..7ea6efabb8 100644 --- a/include/ring-core/target.h +++ b/include/ring-core/target.h @@ -40,6 +40,9 @@ #elif defined(__MIPSEL__) && defined(__LP64__) #define OPENSSL_64_BIT #define OPENSSL_MIPS64 +#elif (defined(__PPC64__) || defined(__powerpc64__)) && defined(_LITTLE_ENDIAN) +#define OPENSSL_64_BIT +#define OPENSSL_PPC64LE #elif defined(__riscv) && __SIZEOF_POINTER__ == 8 #define OPENSSL_64_BIT #define OPENSSL_RISCV64 From 15faeb78ebf0a57f9f015b0858f8a803acc6395f Mon Sep 17 00:00:00 2001 From: Eric Richter Date: Fri, 29 Apr 2022 10:05:57 -0500 Subject: [PATCH 2/3] cpu/arm: allow dead code in cpu/arm mod when building on non-arm Other architectures may not need to do feature checks, and therefore Feature::available, Feature::mask, etc are never used/read. This snippet mirrors the similar bit at the top of cpu/intel. Signed-off-by: Eric Richter --- src/cpu/arm.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/cpu/arm.rs b/src/cpu/arm.rs index 6f6ee2a90e..50e2e499b2 100644 --- a/src/cpu/arm.rs +++ b/src/cpu/arm.rs @@ -12,6 +12,11 @@ // OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN // CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +#![cfg_attr( + not(any(target_arch = "aarch64", target_arch = "arm")), + allow(dead_code) +)] + #[cfg(all( any(target_os = "android", target_os = "linux"), any(target_arch = "aarch64", target_arch = "arm") From 5c496c53bdd73fe7f99b20fc3b7cfff00ad4df68 Mon Sep 17 00:00:00 2001 From: Eric Richter Date: Tue, 26 Sep 2023 11:56:40 -0500 Subject: [PATCH 3/3] CI: add powerpc64le-unknown-linux-gnu as a target Signed-off-by: Eric Richter --- .github/workflows/ci.yml | 12 ++++++++++++ mk/cargo.sh | 8 ++++++++ mk/install-build-tools.sh | 7 +++++++ 3 files changed, 27 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b840ea5b75..1601941220 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -180,6 +180,7 @@ jobs: - i686-pc-windows-msvc - i686-unknown-linux-gnu - i686-unknown-linux-musl + - powerpc64le-unknown-linux-gnu - riscv64gc-unknown-linux-gnu - x86_64-pc-windows-gnu - x86_64-pc-windows-msvc @@ -248,6 +249,9 @@ jobs: - target: i686-unknown-linux-musl host_os: ubuntu-22.04 + - target: powerpc64le-unknown-linux-gnu + host_os: ubuntu-22.04 + - target: riscv64gc-unknown-linux-gnu host_os: ubuntu-22.04 @@ -337,6 +341,7 @@ jobs: target: - aarch64-unknown-linux-musl - i686-pc-windows-msvc + - powerpc64le-unknown-linux-gnu - x86_64-unknown-linux-gnu mode: @@ -354,6 +359,9 @@ jobs: - target: i686-pc-windows-msvc host_os: windows-latest + - target: powerpc64le-unknown-linux-gnu + host_os: ubuntu-22.04 + - target: x86_64-unknown-linux-gnu host_os: ubuntu-22.04 @@ -487,6 +495,7 @@ jobs: target: - aarch64-unknown-linux-gnu - i686-unknown-linux-gnu + - powerpc64le-unknown-linux-gnu - riscv64gc-unknown-linux-gnu - x86_64-unknown-linux-musl @@ -511,6 +520,9 @@ jobs: - target: i686-unknown-linux-gnu host_os: ubuntu-22.04 + - target: powerpc64le-unknown-linux-gnu + host_os: ubuntu-22.04 + - target: riscv64gc-unknown-linux-gnu host_os: ubuntu-22.04 diff --git a/mk/cargo.sh b/mk/cargo.sh index 7964be701b..eae727a0a0 100755 --- a/mk/cargo.sh +++ b/mk/cargo.sh @@ -21,6 +21,7 @@ rustflags_self_contained="-Clink-self-contained=yes -Clinker=rust-lld" qemu_aarch64="qemu-aarch64 -L /usr/aarch64-linux-gnu" qemu_arm="qemu-arm -L /usr/arm-linux-gnueabihf" qemu_mipsel="qemu-mipsel -L /usr/mipsel-linux-gnu" +qemu_powerpc64le="qemu-ppc64le -L /usr/powerpc64le-linux-gnu" qemu_riscv64="qemu-riscv64 -L /usr/riscv64-linux-gnu" # Avoid putting the Android tools in `$PATH` because there are tools in this @@ -100,6 +101,13 @@ case $target in export CARGO_TARGET_MIPSEL_UNKNOWN_LINUX_GNU_LINKER=mipsel-linux-gnu-gcc export CARGO_TARGET_MIPSEL_UNKNOWN_LINUX_GNU_RUNNER="$qemu_mipsel" ;; + powerpc64le-unknown-linux-gnu) + export CC_powerpc64le_unknown_linux_gnu=clang-$llvm_version + export AR_powerpc64le_unknown_linux_gnu=llvm-ar-$llvm_version + export CFLAGS_powerpc64le_unknown_linux_gnu="--sysroot=/usr/powerpc64le-linux-gnu" + export CARGO_TARGET_POWERPC64LE_UNKNOWN_LINUX_GNU_LINKER=powerpc64le-linux-gnu-gcc + export CARGO_TARGET_POWERPC64LE_UNKNOWN_LINUX_GNU_RUNNER="$qemu_powerpc64le" + ;; riscv64gc-unknown-linux-gnu) export CC_riscv64gc_unknown_linux_gnu=clang-$llvm_version export AR_riscv64gc_unknown_linux_gnu=llvm-ar-$llvm_version diff --git a/mk/install-build-tools.sh b/mk/install-build-tools.sh index 75b3a9fbd4..cb5b615f1c 100755 --- a/mk/install-build-tools.sh +++ b/mk/install-build-tools.sh @@ -91,6 +91,13 @@ case $target in libc6-dev-mipsel-cross \ qemu-user ;; +--target=powerpc64le-unknown-linux-gnu) + use_clang=1 + install_packages \ + gcc-powerpc64le-linux-gnu \ + libc6-dev-ppc64el-cross \ + qemu-user + ;; --target=riscv64gc-unknown-linux-gnu) use_clang=1 install_packages \