Revision: 18705
          http://sourceforge.net/p/edk2/code/18705
Author:   qlong
Date:     2015-10-29 14:17:02 +0000 (Thu, 29 Oct 2015)
Log Message:
-----------
CryptoPkg/OpensslLib: Undefine NO_BUILTIN_VA_FUNCS to fix varargs breakage

Instead of patching OpenSSL to add EFIAPI to the one varargs function we
actually *noticed* breakage in, let's fix the problem in a more coherent
way by undefining NO_BUILTIN_VA_FUNCS.

That way, the VA_START and similar macros will actually do the right
thing for non-EFIAPI functions, which is to use the GCC builtins.

It's still fairly broken elsewhere in the tree, with the VA_START macro
being used from both EFIAPI and non-EFIAPI functions ?\226?\128?\148 and being 
broken
in the latter case. We probably ought to make EFIAPI a no-op everywhere
and add -mabi=ms to the GCC builds. But that's a project for another day.
For now, just fix the OpenSSL build in a cleaner fashion.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: David Woodhouse <[email protected]>
Tested-by: Laszlo Ersek <[email protected]>
Reviewed-by: Laszlo Ersek <[email protected]>
Reviewed-by: Qin Long <[email protected]>

Modified Paths:
--------------
    trunk/edk2/CryptoPkg/Library/OpensslLib/EDKII_openssl-1.0.2d.patch
    trunk/edk2/CryptoPkg/Library/OpensslLib/OpensslLib.inf

Modified: trunk/edk2/CryptoPkg/Library/OpensslLib/EDKII_openssl-1.0.2d.patch
===================================================================
--- trunk/edk2/CryptoPkg/Library/OpensslLib/EDKII_openssl-1.0.2d.patch  
2015-10-29 14:16:54 UTC (rev 18704)
+++ trunk/edk2/CryptoPkg/Library/OpensslLib/EDKII_openssl-1.0.2d.patch  
2015-10-29 14:17:02 UTC (rev 18705)
@@ -355,37 +355,3 @@
  #endif
  
  #if defined(HEADER_RC4_LOCL_H) && !defined(CONFIG_HEADER_RC4_LOCL_H)
-diff U3 crypto/err/err.c crypto/err/err.c
---- crypto/err/err.c
-+++ crypto/err/err.c
-@@ -1072,7 +1072,12 @@ void ERR_set_error_data(char *data, int flags)
-     es->err_data_flags[i] = flags;
- }
- 
-+/* Add EFIAPI for UEFI version. */
-+#if defined(OPENSSL_SYS_UEFI)
-+void EFIAPI ERR_add_error_data(int num, ...)
-+#else
- void ERR_add_error_data(int num, ...)
-+#endif
- {
-     va_list args;
-     va_start(args, num);
-diff U3 crypto/err/err.h crypto/err/err.h
---- crypto/err/err.h
-+++ crypto/err/err.h
-@@ -344,7 +344,14 @@ void ERR_print_errors_fp(FILE *fp);
- # ifndef OPENSSL_NO_BIO
- void ERR_print_errors(BIO *bp);
- # endif
-+
-+/* Add EFIAPI for UEFI version. */
-+#if defined(OPENSSL_SYS_UEFI)
-+void EFIAPI ERR_add_error_data(int num, ...);
-+#else
- void ERR_add_error_data(int num, ...);
-+#endif
-+
- void ERR_add_error_vdata(int num, va_list args);
- void ERR_load_strings(int lib, ERR_STRING_DATA str[]);
- void ERR_unload_strings(int lib, ERR_STRING_DATA str[]);

Modified: trunk/edk2/CryptoPkg/Library/OpensslLib/OpensslLib.inf
===================================================================
--- trunk/edk2/CryptoPkg/Library/OpensslLib/OpensslLib.inf      2015-10-29 
14:16:54 UTC (rev 18704)
+++ trunk/edk2/CryptoPkg/Library/OpensslLib/OpensslLib.inf      2015-10-29 
14:17:02 UTC (rev 18705)
@@ -901,7 +901,7 @@
   INTEL:*_*_IPF_CC_FLAGS    = -U_WIN32 -U_WIN64 -U_MSC_VER -U__ICC 
$(OPENSSL_FLAGS) $(OPENSSL_EXFLAGS) /w -DSIXTY_FOUR_BIT
 
   GCC:*_*_IA32_CC_FLAGS     = -U_WIN32 -U_WIN64 $(OPENSSL_FLAGS) 
$(OPENSSL_EXFLAGS) -w -DTHIRTY_TWO_BIT
-  GCC:*_*_X64_CC_FLAGS      = -U_WIN32 -U_WIN64 $(OPENSSL_FLAGS) 
$(OPENSSL_EXFLAGS) -w -DSIXTY_FOUR_BIT_LONG
+  GCC:*_*_X64_CC_FLAGS      = -U_WIN32 -U_WIN64 $(OPENSSL_FLAGS) 
$(OPENSSL_EXFLAGS) -w -DSIXTY_FOUR_BIT_LONG -UNO_BUILTIN_VA_FUNCS
   GCC:*_*_IPF_CC_FLAGS      = -U_WIN32 -U_WIN64 $(OPENSSL_FLAGS) 
$(OPENSSL_EXFLAGS) -w -DSIXTY_FOUR_BIT_LONG
   GCC:*_*_ARM_CC_FLAGS      = $(OPENSSL_FLAGS) $(OPENSSL_EXFLAGS) -w 
-DTHIRTY_TWO_BIT
   GCC:*_*_AARCH64_CC_FLAGS  = $(OPENSSL_FLAGS) $(OPENSSL_EXFLAGS) -w 
-DSIXTY_FOUR_BIT_LONG


------------------------------------------------------------------------------
_______________________________________________
edk2-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/edk2-commits

Reply via email to