Add support in configuration for android-riscv64
authorPrashanth Swaminathan <prashanthsw@google.com>
Mon, 29 Jan 2024 21:20:54 +0000 (13:20 -0800)
committerTomas Mraz <tomas@openssl.org>
Mon, 5 Feb 2024 09:08:23 +0000 (10:08 +0100)
Android is enabling support for the riscv64 ISA. Add a configuration
option to support building for it, aligned with the existing
linux-riscv64 configuration.

Reviewed-by: Hugo Landau <hlandau@openssl.org>
Reviewed-by: Todd Short <todd.short@me.com>
(Merged from https://github.com/openssl/openssl/pull/23427)

Configurations/15-android.conf
NOTES-ANDROID.md
util/perl/OpenSSL/config.pm

index 41ad9223e0945d65ecffc82e0e5c31fd130fd0fe..1de6b7a91571d7ec22f8549effc5867819663164 100644 (file)
@@ -12,6 +12,7 @@
         arm64  => "aarch64-linux-android",
         mips   => "mipsel-linux-android",
         mips64 => "mips64el-linux-android",
+        riscv64 => "riscv64-linux-android",
         x86    => "i686-linux-android",
         x86_64 => "x86_64-linux-android",
     );
@@ -270,6 +271,12 @@ my %targets = (
         perlasm_scheme   => "elf",
     },
 
+    "android-riscv64" => {
+        inherit_from     => [ "android" ],
+        asm_arch         => 'riscv64',
+        perlasm_scheme   => "linux64",
+    },
+
     ####################################################################
     # Backward compatible targets, (might) require $CROSS_SYSROOT
     #
index c79b2212d4584aed9e69524ef65cbeb01dd723b4..b71365fe731e650e27bce84f64ae11ab25af33dd 100644 (file)
@@ -17,8 +17,8 @@ Notes for Android platforms
  Android is a cross-compiled target and you can't rely on `./Configure`
  to find out the configuration target for you.  You have to name your
  target explicitly; there are `android-arm`, `android-arm64`, `android-mips`,
- `android-mip64`, `android-x86` and `android-x86_64` (`*MIPS` targets are no
- longer supported with NDK R20+).
+ `android-mip64`, `android-x86`, `android-x86_64` and `android-riscv64`
(`*MIPS` targets are no longer supported with NDK R20+).
 
  Do not pass --cross-compile-prefix (as you might be tempted), as it
  will be "calculated" automatically based on chosen platform. However,
index 970e65dc97e4347f85d282998b43c820d1dcb8c9..78e1e3774b4781b55b042d1bafbea0f874be2c35 100755 (executable)
@@ -859,6 +859,7 @@ EOF
                                     cflags => [ '-march=armv7-a' ],
                                     cxxflags => [ '-march=armv7-a' ] } ],
       [ 'arm.*-.*-android',       { target => "android-armeabi" } ],
+      [ 'riscv64-.*-android',     { target => "android-riscv64" } ],
       [ '.*-hpux1.*',
         sub {
             my $KERNEL_BITS = $ENV{KERNEL_BITS};