]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
crypto/bio: fix build on UEFI
authorGerd Hoffmann <kraxel@redhat.com>
Fri, 7 Jan 2022 11:58:27 +0000 (12:58 +0100)
committerPauli <ppzgs1@gmail.com>
Sun, 9 Jan 2022 11:17:14 +0000 (22:17 +1100)
When compiling openssl for tianocore compiling abs_val() and pow_10()
fails with the following error because SSE support is disabled:

   crypto/bio/bio_print.c:587:46: error: SSE register return with SSE disabled

Fix that by using EFIAPI calling convention when compiling for UEFI.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/17442)

crypto/bio/bio_print.c

index 1ea9a1a3c6923db348b0933c40431e0aeb3b1da0..60b28c61ff0bddb97b450bbb0a00f2fdff0d54ca 100644 (file)
@@ -13,6 +13,7 @@
 #include "crypto/ctype.h"
 #include "internal/numbers.h"
 #include <openssl/bio.h>
+#include <openssl/configuration.h>
 
 /*
  * Copyright Patrick Powell 1995
@@ -512,7 +513,11 @@ fmtint(char **sbuffer,
     return 1;
 }
 
+#ifdef OPENSSL_SYS_UEFI
+static LDOUBLE EFIAPI abs_val(LDOUBLE value)
+#else
 static LDOUBLE abs_val(LDOUBLE value)
+#endif
 {
     LDOUBLE result = value;
     if (value < 0)
@@ -520,7 +525,11 @@ static LDOUBLE abs_val(LDOUBLE value)
     return result;
 }
 
+#ifdef OPENSSL_SYS_UEFI
+static LDOUBLE EFIAPI pow_10(int in_exp)
+#else
 static LDOUBLE pow_10(int in_exp)
+#endif
 {
     LDOUBLE result = 1;
     while (in_exp) {