Add BSD-armv4 target based on linux-armv4
authorPiotr Kubaj <pkubaj@FreeBSD.org>
Fri, 29 Jul 2022 10:47:29 +0000 (12:47 +0200)
committerTomas Mraz <tomas@openssl.org>
Mon, 22 Aug 2022 06:09:25 +0000 (08:09 +0200)
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Hugo Landau <hlandau@openssl.org>
Reviewed-by: Todd Short <todd.short@me.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/18910)

Configurations/10-main.conf
util/perl/OpenSSL/config.pm

index 2c53f56bfff43195137c0525de6d949d82ffe42b..036f0bbbc97474934a764369de1a3d09c193359e 100644 (file)
@@ -1111,6 +1111,43 @@ my %targets = (
         asm_arch         => 'riscv64',
     },
 
+    "BSD-armv4" => {
+        ################################################################
+        # Note that -march is not among compiler options in linux-armv4
+        # target description. Not specifying one is intentional to give
+        # you choice to:
+        #
+        # a) rely on your compiler default by not specifying one;
+        # b) specify your target platform explicitly for optimal
+        # performance, e.g. -march=armv6 or -march=armv7-a;
+        # c) build "universal" binary that targets *range* of platforms
+        # by specifying minimum and maximum supported architecture;
+        #
+        # As for c) option. It actually makes no sense to specify
+        # maximum to be less than ARMv7, because it's the least
+        # requirement for run-time switch between platform-specific
+        # code paths. And without run-time switch performance would be
+        # equivalent to one for minimum. Secondly, there are some
+        # natural limitations that you'd have to accept and respect.
+        # Most notably you can *not* build "universal" binary for
+        # big-endian platform. This is because ARMv7 processor always
+        # picks instructions in little-endian order. Another similar
+        # limitation is that -mthumb can't "cross" -march=armv6t2
+        # boundary, because that's where it became Thumb-2. Well, this
+        # limitation is a bit artificial, because it's not really
+        # impossible, but it's deemed too tricky to support. And of
+        # course you have to be sure that your binutils are actually
+        # up to the task of handling maximum target platform. With all
+        # this in mind here is an example of how to configure
+        # "universal" build:
+        #
+        # ./Configure BSD-armv4 -march=armv6 -D__ARM_MAX_ARCH__=8
+        #
+        inherit_from     => [ "BSD-generic32" ],
+        asm_arch         => 'armv4',
+        perlasm_scheme   => "linux32",
+    },
+
     "bsdi-elf-gcc" => {
         inherit_from     => [ "BASE_unix" ],
         CC               => "gcc",
index 380696d818c9d14adb0eecf871fc18fd8b8d327f..874e6e6a52fcb3de7a372748447ec2a0c4f80518 100755 (executable)
@@ -756,6 +756,8 @@ EOF
       [ 'x86_64-.*-dragonfly.*',  { target => "BSD-x86_64" } ],
       [ 'amd64-.*-.*bsd.*',       { target => "BSD-x86_64" } ],
       [ 'arm64-.*-.*bsd.*',       { target => "BSD-aarch64" } ],
+      [ 'armv6-.*-.*bsd.*',       { target => "BSD-armv4" } ],
+      [ 'armv7-.*-.*bsd.*',       { target => "BSD-armv4" } ],
       [ '.*86.*-.*-.*bsd.*',
         sub {
             # mimic ld behaviour when it's looking for libc...