From 0a44a61f39281de0942ebdf7e4b2dc22b46a51b9 Mon Sep 17 00:00:00 2001 From: Lisa Ugray Date: Tue, 10 Aug 2021 15:11:08 -0400 Subject: [PATCH] openssl-1.0.2u: Add patch for darwin64-arm64 openssl-1.0.2u doesn't have build flags for Apple's new arm chips --- .../libraries/openssl/1.0.2/darwin64-arm64.patch | 12 ++++++++++++ pkgs/development/libraries/openssl/default.nix | 2 ++ 2 files changed, 14 insertions(+) create mode 100644 pkgs/development/libraries/openssl/1.0.2/darwin64-arm64.patch diff --git a/pkgs/development/libraries/openssl/1.0.2/darwin64-arm64.patch b/pkgs/development/libraries/openssl/1.0.2/darwin64-arm64.patch new file mode 100644 index 000000000000..5ecfb4175569 --- /dev/null +++ b/pkgs/development/libraries/openssl/1.0.2/darwin64-arm64.patch @@ -0,0 +1,12 @@ +diff --git a/Configure b/Configure +index 494e0b3..0b448aa 100755 +--- a/Configure ++++ b/Configure +@@ -652,6 +652,8 @@ my %table=( + "darwin64-x86_64-cc","cc:-arch x86_64 -O3 -DL_ENDIAN -Wall::-D_REENTRANT:MACOSX:-Wl,-search_paths_first%:SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_INT DES_UNROLL:".eval{my $asm=$x86_64_asm;$asm=~s/rc4\-[^:]+//;$asm}.":macosx:dlfcn:darwin-shared:-fPIC -fno-common:-arch x86_64 -dynamiclib:.\$(SHLIB_MAJOR).\$(SHLIB_MINOR).dylib", + "debug-darwin64-x86_64-cc","cc:-arch x86_64 -ggdb -g2 -O0 -DL_ENDIAN -Wall::-D_REENTRANT:MACOSX:-Wl,-search_paths_first%:SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_INT DES_UNROLL:".eval{my $asm=$x86_64_asm;$asm=~s/rc4\-[^:]+//;$asm}.":macosx:dlfcn:darwin-shared:-fPIC -fno-common:-arch x86_64 -dynamiclib:.\$(SHLIB_MAJOR).\$(SHLIB_MINOR).dylib", + "debug-darwin-ppc-cc","cc:-DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DCRYPTO_MDEBUG -DB_ENDIAN -g -Wall -O::-D_REENTRANT:MACOSX::BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR:${ppc32_asm}:osx32:dlfcn:darwin-shared:-fPIC:-dynamiclib:.\$(SHLIB_MAJOR).\$(SHLIB_MINOR).dylib", ++"darwin64-arm64-cc","cc:-arch arm64 -O3 -DL_ENDIAN -Wall::-D_REENTRANT:MACOSX:-Wl,-search_paths_first%:SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_INT DES_UNROLL:${no_asm}:dlfcn:darwin-shared:-fPIC -fno-common:-arch arm64 -dynamiclib:.\$(SHLIB_MAJOR).\$(SHLIB_MINOR).dylib", ++"debug-darwin64-arm64-cc","cc:-arch arm64 -ggdb -g2 -O0 -DL_ENDIAN -Wall::-D_REENTRANT:MACOSX:-Wl,-search_paths_first%:SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_INT DES_UNROLL:${no_asm}:dlfcn:darwin-shared:-fPIC -fno-common:-arch arm64 -dynamiclib:.\$(SHLIB_MAJOR).\$(SHLIB_MINOR).dylib", + # iPhoneOS/iOS + "iphoneos-cross","llvm-gcc:-O3 -isysroot \$(CROSS_TOP)/SDKs/\$(CROSS_SDK) -fomit-frame-pointer -fno-common::-D_REENTRANT:iOS:-Wl,-search_paths_first%:BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR:${no_asm}:dlfcn:darwin-shared:-fPIC -fno-common:-dynamiclib:.\$(SHLIB_MAJOR).\$(SHLIB_MINOR).dylib", diff --git a/pkgs/development/libraries/openssl/default.nix b/pkgs/development/libraries/openssl/default.nix index d4be8cc2428e..fc2c2fad1959 100644 --- a/pkgs/development/libraries/openssl/default.nix +++ b/pkgs/development/libraries/openssl/default.nix @@ -185,6 +185,8 @@ in { (if stdenv.hostPlatform.isDarwin then ./1.0.2/use-etc-ssl-certs-darwin.patch else ./1.0.2/use-etc-ssl-certs.patch) + ] ++ lib.optionals (stdenv.hostPlatform.system == "aarch64-darwin") [ + ./1.0.2/darwin64-arm64.patch ]; extraMeta.knownVulnerabilities = [ "Support for OpenSSL 1.0.2 ended with 2019." ]; };