]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
Fixes for build failures on OS X 10.4 Tiger
authorGAlvare <40766690+GAlvare@users.noreply.github.com>
Fri, 2 May 2025 16:57:22 +0000 (11:57 -0500)
committerTomas Mraz <tomas@openssl.org>
Fri, 8 Aug 2025 11:56:02 +0000 (13:56 +0200)
Also added darwin8-ppc-cc and darwin8-ppc64-cc build configurations for
handling OS X 10.4 PowerPC specific configuration options, specifically
disabling async by default.

Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Bernd Edlinger <bernd.edlinger@hotmail.de>
Reviewed-by: Paul Dale <ppzgs1@gmail.com>
(Merged from https://github.com/openssl/openssl/pull/27578)

Configurations/10-main.conf
include/crypto/rand.h
include/internal/numbers.h
test/testutil/helper.c
util/perl/OpenSSL/config.pm

index 01526cd3efd33caa70f1533715a68f2f22beff12..7e9396868afd62d2b2c8444a05b60337174fe67c 100644 (file)
@@ -1862,6 +1862,10 @@ my %targets = (
     # Option "freeze" such as -std=gnu9x can't negatively interfere
     # with future defaults for below two targets, because MacOS X
     # for PPC has no future, it was discontinued by vendor in 2009.
+    "darwin8-ppc-cc" => {
+        inherit_from => [ "darwin-ppc" ],
+        disable => [ "async" ]
+    },
     "darwin-ppc-cc" => { inherit_from => [ "darwin-ppc" ] }, # Historic alias
     "darwin-ppc" => {
         inherit_from     => [ "darwin-common" ],
@@ -1871,6 +1875,10 @@ my %targets = (
         asm_arch         => 'ppc32',
         perlasm_scheme   => "osx32",
     },
+    "darwin8-ppc64-cc" => {
+        inherit_from => [ "darwin64-ppc" ],
+        disable => [ "async" ]
+    },
     "darwin64-ppc-cc" => { inherit_from => [ "darwin64-ppc" ] }, # Historic alias
     "darwin64-ppc" => {
         inherit_from     => [ "darwin-common" ],
index f7c1a165b45b94b78affb6ad5c098ba6166bc1c9..5f65e399d55f93a61042bb64d3ef5de246242c8d 100644 (file)
 # include "crypto/rand_pool.h"
 
 # if defined(__APPLE__) && !defined(OPENSSL_NO_APPLE_CRYPTO_RANDOM)
-#  include <Availability.h>
+#  if defined(__MAC_OS_X_VERSION_MIN_REQUIRED) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 1050
+#   include <Availability.h>
+#  else
+#   include <TargetConditionals.h>
+#   include <AvailabilityMacros.h>
+#  endif
 #  if (defined(__MAC_OS_X_VERSION_MIN_REQUIRED) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101200) || \
      (defined(__IPHONE_OS_VERSION_MIN_REQUIRED) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 80000)
 #   define OPENSSL_APPLE_CRYPTO_RANDOM 1
index 4a93a247563753d95af96cff0619195527393be1..949bd56258e9f0def886799fd31ae5bb747c88d8 100644 (file)
@@ -106,5 +106,13 @@ typedef __uint128_t uint128_t;
 #  define OSSL_UINTMAX_MAX __MAXUINT__(ossl_uintmax_t)
 # endif
 
+/* Fix for cross compiling 64-bit PowerPC on OS X 10.4 */
+# if defined(__APPLE__) && defined(_ARCH_PPC64)
+#  ifdef SIZE_MAX
+#   undef SIZE_MAX
+#  endif
+#  define SIZE_MAX __MAXUINT__(uint64_t)
+# endif
+
 #endif
 
index 9c985e25a8beae9b8d4194a5d6d142f035c534f7..6a1da5c9bac5f6d95af4aa892680a4552093fb40 100644 (file)
@@ -19,7 +19,9 @@
 # define timezone _timezone
 #endif
 
-#if defined(__FreeBSD__) || defined(__wasi__)
+#if defined(__FreeBSD__) || defined(__wasi__) || \
+    (defined(__APPLE__) && !defined(OPENSSL_NO_APPLE_CRYPTO_RANDOM) && \
+     !(defined(__MAC_OS_X_VERSION_MIN_REQUIRED) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 1050))
 # define USE_TIMEGM
 #endif
 
index 24d0dfb0606d66e0395ab6a95f01eaab5f399d2c..4af388fa108feab1b0077a95620c4a9831bf3e3e 100755 (executable)
@@ -146,6 +146,7 @@ my $guess_patterns = [
     ],
     [ 'Paragon.*?:.*',              'i860-intel-osf1' ],
     [ 'Rhapsody:.*',                'ppc-apple-rhapsody' ],
+    [ 'Darwin:8.*?:.*?:Power.*',    'ppc-apple-darwin8' ],
     [ 'Darwin:.*?:.*?:Power.*',     'ppc-apple-darwin' ],
     [ 'Darwin:.*',                  '${MACHINE}-apple-darwin' ],
     [ 'SunOS:5\..*',                '${MACHINE}-whatever-solaris2' ],
@@ -491,6 +492,22 @@ EOF
         }
       ],
       [ 'ppc-apple-rhapsody',     { target => "rhapsody-ppc" } ],
+      [ 'ppc-apple-darwin8.*', 
+        sub {
+            my $KERNEL_BITS = $ENV{KERNEL_BITS} // '';
+            my $ISA64 = `sysctl -n hw.optional.64bitops 2>/dev/null`;
+            if ( $ISA64 == 1 && $KERNEL_BITS eq '' ) {
+                print <<EOF;
+WARNING! To build 64-bit package, do this:
+         $WHERE/Configure darwin8-ppc64-cc
+EOF
+                maybe_abort();
+            }
+            return { target => "darwin8-ppc64-cc" }
+                if $ISA64 == 1 && $KERNEL_BITS eq '64';
+            return { target => "darwin8-ppc-cc" };
+        }
+      ],
       [ 'ppc-apple-darwin.*',
         sub {
             my $KERNEL_BITS = $ENV{KERNEL_BITS} // '';