Add hurd-x86_64 support
authorSamuel Thibault <samuel.thibault@ens-lyon.org>
Sat, 6 May 2023 14:46:56 +0000 (16:46 +0200)
committerTodd Short <todd.short@me.com>
Fri, 4 Aug 2023 17:34:21 +0000 (13:34 -0400)
This also upgrades flags similarly to the Linux configuration.

Reviewed-by: Richard Levitte <levitte@openssl.org>
Reviewed-by: Matthias St. Pierre <Matthias.St.Pierre@ncp-e.com>
Reviewed-by: Todd Short <todd.short@me.com>
(Merged from https://github.com/openssl/openssl/pull/20896)

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

index bcf54a2a53f5b4fee6d9b6d11287f61a9ff9e1e5..b1e8ce118522aa2f522a432533e73be9bb3e8b02 100644 (file)
@@ -1835,20 +1835,53 @@ my %targets = (
     },
 
 ##### GNU Hurd
-    "hurd-x86" => {
+    "hurd-generic32" => {
         inherit_from     => [ "BASE_unix" ],
         CC               => "gcc",
-        CFLAGS           => "-O3 -fomit-frame-pointer -Wall",
+        CXX              => "g++",
+        CFLAGS           => picker(default => "-Wall",
+                                   debug   => "-O0 -g",
+                                   release => "-O3"),
+        CXXFLAGS         => picker(default => "-Wall",
+                                   debug   => "-O0 -g",
+                                   release => "-O3"),
         cflags           => threads("-pthread"),
-        lib_cppflags     => "-DL_ENDIAN",
+        cxxflags         => combine("-std=c++11", threads("-pthread")),
         ex_libs          => add("-ldl", threads("-pthread")),
-        bn_ops           => "BN_LLONG",
-        asm_arch         => 'x86',
-        perlasm_scheme   => 'elf',
+        bn_ops           => "BN_LLONG RC4_CHAR",
         thread_scheme    => "pthreads",
         dso_scheme       => "dlfcn",
         shared_target    => "linux-shared",
         shared_cflag     => "-fPIC",
+        shared_ldflag    => sub { $disabled{pinshared} ? () : "-Wl,-znodelete" },
+    },
+
+    "hurd-generic64" => {
+        inherit_from     => [ "hurd-generic32" ],
+        bn_ops           => "SIXTY_FOUR_BIT_LONG RC4_CHAR",
+    },
+
+    #### X86 / X86_64 targets
+    "hurd-x86" => {
+        inherit_from     => [ "hurd-generic32" ],
+        CFLAGS           => add(picker(release => "-fomit-frame-pointer")),
+        cflags           => add("-m32"),
+        cxxflags         => add("-m32"),
+        lib_cppflags     => add("-DL_ENDIAN"),
+        bn_ops           => "BN_LLONG",
+        asm_arch         => 'x86',
+        perlasm_scheme   => 'elf',
+    },
+
+    "hurd-x86_64" => {
+        inherit_from     => [ "hurd-generic64" ],
+        cflags           => add("-m64"),
+        cxxflags         => add("-m64"),
+        lib_cppflags     => add("-DL_ENDIAN"),
+        bn_ops           => "SIXTY_FOUR_BIT_LONG",
+        asm_arch         => 'x86_64',
+        perlasm_scheme   => 'elf',
+        multilib         => "64",
     },
 
 ##### VxWorks for various targets
index fef32c93237f8a5a0197471288780cc8b1ce3316..6b2cd9b9fb438f99113ad1eda29ea2efac43ebaa 100755 (executable)
@@ -92,7 +92,8 @@ my $guess_patterns = [
     [ 'IRIX64:.*',                  'mips4-sgi-irix64' ],
     [ 'Linux:[2-9]\..*',            '${MACHINE}-whatever-linux2' ],
     [ 'Linux:1\..*',                '${MACHINE}-whatever-linux1' ],
-    [ 'GNU.*',                      'hurd-x86' ],
+    [ 'GNU:.*86-AT386',             'hurd-x86' ],
+    [ 'GNU:.*86_64-AT386',          'hurd-x86_64' ],
     [ 'LynxOS:.*',                  '${MACHINE}-lynx-lynxos' ],
     # BSD/OS always says 386
     [ 'BSD\/OS:4\..*',              'i486-whatever-bsdi4' ],