]> git.proxmox.com Git - mirror_edk2.git/commitdiff
CryptoPkg/OpensslLib: Prepare for upgrading OpenSSL
authorXiaoyuX Lu <xiaoyux.lu@intel.com>
Wed, 29 May 2019 18:40:33 +0000 (18:40 +0000)
committerJian J Wang <jian.j.wang@intel.com>
Mon, 3 Jun 2019 00:28:01 +0000 (08:28 +0800)
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1089

Disable warning for building OpenSSL_1_1_1b

add /wd4132 /wd4700 /wd4310 for Visual Studio in OpensslLib[Crypto].inf

add -Wno-error=unused-but-set-variable for GCC in OpensslLib[Crypto].inf
Although this option is set in some build environments by default.
But this is only for OpenSSL compilation, no matter how the
default options change.

Cc: Jian J Wang <jian.j.wang@intel.com>
Cc: Ting Ye <ting.ye@intel.com>
Signed-off-by: Xiaoyu Lu <xiaoyux.lu@intel.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Tested-by: Gary Lin <glin@suse.com>
Reviewed-by: Jian J Wang <jian.j.wang@intel.com>
CryptoPkg/Library/OpensslLib/OpensslLib.inf
CryptoPkg/Library/OpensslLib/OpensslLibCrypto.inf

index 530ac5f1109625825642a1459f4800d62f479262..f4d7772c068c5503b5e1745356c8b5f0c0720781 100644 (file)
   # Disables the following Visual Studio compiler warnings brought by openssl source,\r
   # so we do not break the build with /WX option:\r
   #   C4090: 'function' : different 'const' qualifiers\r
+  #   C4132: 'object' : const object should be initialized (tls13_enc.c)\r
   #   C4244: conversion from type1 to type2, possible loss of data\r
   #   C4245: conversion from type1 to type2, signed/unsigned mismatch\r
   #   C4267: conversion from size_t to type, possible loss of data\r
   #   C4306: 'identifier' : conversion from 'type1' to 'type2' of greater size\r
+  #   C4310: cast truncates constant value\r
   #   C4389: 'operator' : signed/unsigned mismatch (xxxx)\r
+  #   C4700: uninitialized local variable 'name' used. (conf_sap.c(71))\r
   #   C4702: unreachable code\r
   #   C4706: assignment within conditional expression\r
   #   C4819: The file contains a character that cannot be represented in the current code page\r
   #\r
-  MSFT:*_*_IA32_CC_FLAGS   = -U_WIN32 -U_WIN64 -U_MSC_VER $(OPENSSL_FLAGS) /wd4090 /wd4244 /wd4245 /wd4267 /wd4389 /wd4702 /wd4706 /wd4819\r
-  MSFT:*_*_X64_CC_FLAGS    = -U_WIN32 -U_WIN64 -U_MSC_VER $(OPENSSL_FLAGS) /wd4090 /wd4244 /wd4245 /wd4267 /wd4306 /wd4389 /wd4702 /wd4706 /wd4819\r
+  MSFT:*_*_IA32_CC_FLAGS   = -U_WIN32 -U_WIN64 -U_MSC_VER $(OPENSSL_FLAGS) /wd4090 /wd4132 /wd4244 /wd4245 /wd4267 /wd4310 /wd4389 /wd4700 /wd4702 /wd4706 /wd4819\r
+  MSFT:*_*_X64_CC_FLAGS    = -U_WIN32 -U_WIN64 -U_MSC_VER $(OPENSSL_FLAGS) /wd4090 /wd4132 /wd4244 /wd4245 /wd4267 /wd4306 /wd4310 /wd4700 /wd4389 /wd4702 /wd4706 /wd4819\r
 \r
   INTEL:*_*_IA32_CC_FLAGS  = -U_WIN32 -U_WIN64 -U_MSC_VER -U__ICC $(OPENSSL_FLAGS) /w\r
   INTEL:*_*_X64_CC_FLAGS   = -U_WIN32 -U_WIN64 -U_MSC_VER -U__ICC $(OPENSSL_FLAGS) /w\r
   #   -Werror=maybe-uninitialized: there exist some other paths for which the variable is not initialized.\r
   #   -Werror=format: Check calls to printf and scanf, etc., to make sure that the arguments supplied have\r
   #                   types appropriate to the format string specified.\r
+  #   -Werror=unused-but-set-variable: Warn whenever a local variable is assigned to, but otherwise unused (aside from its declaration).\r
   #\r
-  GCC:*_*_IA32_CC_FLAGS    = -U_WIN32 -U_WIN64 $(OPENSSL_FLAGS) -Wno-error=maybe-uninitialized\r
-  GCC:*_*_X64_CC_FLAGS     = -U_WIN32 -U_WIN64 $(OPENSSL_FLAGS) -Wno-error=maybe-uninitialized -Wno-error=format -Wno-format -DNO_MSABI_VA_FUNCS\r
-  GCC:*_*_ARM_CC_FLAGS     = $(OPENSSL_FLAGS) -Wno-error=maybe-uninitialized\r
-  GCC:*_*_AARCH64_CC_FLAGS = $(OPENSSL_FLAGS) -Wno-error=maybe-uninitialized -Wno-format\r
+  GCC:*_*_IA32_CC_FLAGS    = -U_WIN32 -U_WIN64 $(OPENSSL_FLAGS) -Wno-error=maybe-uninitialized -Wno-error=unused-but-set-variable\r
+  GCC:*_*_X64_CC_FLAGS     = -U_WIN32 -U_WIN64 $(OPENSSL_FLAGS) -Wno-error=maybe-uninitialized -Wno-error=format -Wno-format -Wno-error=unused-but-set-variable -DNO_MSABI_VA_FUNCS\r
+  GCC:*_*_ARM_CC_FLAGS     = $(OPENSSL_FLAGS) -Wno-error=maybe-uninitialized -Wno-error=unused-but-set-variable\r
+  GCC:*_*_AARCH64_CC_FLAGS = $(OPENSSL_FLAGS) -Wno-error=maybe-uninitialized -Wno-format -Wno-error=unused-but-set-variable\r
 \r
   # suppress the following warnings in openssl so we don't break the build with warnings-as-errors:\r
   # 1295: Deprecated declaration <entity> - give arg types\r
index 231010098851851dc702144bb3146809d5bbfe59..fd12d112edb2af8999cde370b62ba26a7dd7cbc2 100644 (file)
   # Disables the following Visual Studio compiler warnings brought by openssl source,\r
   # so we do not break the build with /WX option:\r
   #   C4090: 'function' : different 'const' qualifiers\r
+  #   C4132: 'object' : const object should be initialized (tls13_enc.c)\r
   #   C4244: conversion from type1 to type2, possible loss of data\r
   #   C4245: conversion from type1 to type2, signed/unsigned mismatch\r
   #   C4267: conversion from size_t to type, possible loss of data\r
   #   C4306: 'identifier' : conversion from 'type1' to 'type2' of greater size\r
+  #   C4310: cast truncates constant value\r
   #   C4389: 'operator' : signed/unsigned mismatch (xxxx)\r
+  #   C4700: uninitialized local variable 'name' used. (conf_sap.c(71))\r
   #   C4702: unreachable code\r
   #   C4706: assignment within conditional expression\r
   #   C4819: The file contains a character that cannot be represented in the current code page\r
   #\r
-  MSFT:*_*_IA32_CC_FLAGS   = -U_WIN32 -U_WIN64 -U_MSC_VER $(OPENSSL_FLAGS) /wd4090 /wd4244 /wd4245 /wd4267 /wd4389 /wd4702 /wd4706 /wd4819\r
-  MSFT:*_*_X64_CC_FLAGS    = -U_WIN32 -U_WIN64 -U_MSC_VER $(OPENSSL_FLAGS) /wd4090 /wd4244 /wd4245 /wd4267 /wd4306 /wd4389 /wd4702 /wd4706 /wd4819\r
+  MSFT:*_*_IA32_CC_FLAGS   = -U_WIN32 -U_WIN64 -U_MSC_VER $(OPENSSL_FLAGS) /wd4090 /wd4132 /wd4244 /wd4245 /wd4267 /wd4310 /wd4389 /wd4700 /wd4702 /wd4706 /wd4819\r
+  MSFT:*_*_X64_CC_FLAGS    = -U_WIN32 -U_WIN64 -U_MSC_VER $(OPENSSL_FLAGS) /wd4090 /wd4132 /wd4244 /wd4245 /wd4267 /wd4306 /wd4310 /wd4700 /wd4389 /wd4702 /wd4706 /wd4819\r
 \r
   INTEL:*_*_IA32_CC_FLAGS  = -U_WIN32 -U_WIN64 -U_MSC_VER -U__ICC $(OPENSSL_FLAGS) /w\r
   INTEL:*_*_X64_CC_FLAGS   = -U_WIN32 -U_WIN64 -U_MSC_VER -U__ICC $(OPENSSL_FLAGS) /w\r
   #   -Werror=maybe-uninitialized: there exist some other paths for which the variable is not initialized.\r
   #   -Werror=format: Check calls to printf and scanf, etc., to make sure that the arguments supplied have\r
   #                   types appropriate to the format string specified.\r
+  #   -Werror=unused-but-set-variable: Warn whenever a local variable is assigned to, but otherwise unused (aside from its declaration).\r
   #\r
-  GCC:*_*_IA32_CC_FLAGS    = -U_WIN32 -U_WIN64 $(OPENSSL_FLAGS) -Wno-error=maybe-uninitialized\r
-  GCC:*_*_X64_CC_FLAGS     = -U_WIN32 -U_WIN64 $(OPENSSL_FLAGS) -Wno-error=maybe-uninitialized -Wno-error=format -Wno-format -DNO_MSABI_VA_FUNCS\r
-  GCC:*_*_ARM_CC_FLAGS     = $(OPENSSL_FLAGS) -Wno-error=maybe-uninitialized\r
-  GCC:*_*_AARCH64_CC_FLAGS = $(OPENSSL_FLAGS) -Wno-error=maybe-uninitialized -Wno-format\r
+  GCC:*_*_IA32_CC_FLAGS    = -U_WIN32 -U_WIN64 $(OPENSSL_FLAGS) -Wno-error=maybe-uninitialized -Wno-error=unused-but-set-variable\r
+  GCC:*_*_X64_CC_FLAGS     = -U_WIN32 -U_WIN64 $(OPENSSL_FLAGS) -Wno-error=maybe-uninitialized -Wno-error=format -Wno-format -Wno-error=unused-but-set-variable -DNO_MSABI_VA_FUNCS\r
+  GCC:*_*_ARM_CC_FLAGS     = $(OPENSSL_FLAGS) -Wno-error=maybe-uninitialized -Wno-error=unused-but-set-variable\r
+  GCC:*_*_AARCH64_CC_FLAGS = $(OPENSSL_FLAGS) -Wno-error=maybe-uninitialized -Wno-format -Wno-error=unused-but-set-variable\r
 \r
   # suppress the following warnings in openssl so we don't break the build with warnings-as-errors:\r
   # 1295: Deprecated declaration <entity> - give arg types\r