public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [PATCH 1/2] BaseTools: Change CLANGPDB target to reduce image size
@ 2020-03-24  6:20 Zhiguang Liu
  2020-03-24  6:20 ` [PATCH 2/2] MdePkg: Use __clang__ to decide if using clang or not Zhiguang Liu
  2020-03-24  6:24 ` [PATCH 1/2] BaseTools: Change CLANGPDB target to reduce image size Vitaly Cheptsov
  0 siblings, 2 replies; 3+ messages in thread
From: Zhiguang Liu @ 2020-03-24  6:20 UTC (permalink / raw)
  To: devel; +Cc: Vitaly Cheptsov, Liming Gao, Bob Feng

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2628

Using target i686-unknown-windows will generate smaller IA32 FV.

CC: Vitaly Cheptsov <vit9696@protonmail.com>
CC: Liming Gao <liming.gao@intel.com>
CC: Bob Feng <bob.c.feng@intel.com>
Signed-off-by: Zhiguang Liu <zhiguang.liu@intel.com>
---
 BaseTools/Conf/tools_def.template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/BaseTools/Conf/tools_def.template b/BaseTools/Conf/tools_def.template
index 2b17d3b297..3d6f6b4b4c 100755
--- a/BaseTools/Conf/tools_def.template
+++ b/BaseTools/Conf/tools_def.template
@@ -2755,7 +2755,7 @@ RELEASE_CLANG38_AARCH64_DLINK_FLAGS = DEF(CLANG38_AARCH64_DLINK_FLAGS) -flto -Wl
 DEFINE CLANGPDB_IA32_PREFIX          = ENV(CLANG_BIN)
 DEFINE CLANGPDB_X64_PREFIX           = ENV(CLANG_BIN)
 
-DEFINE CLANGPDB_IA32_TARGET          = -target i686-unknown-windows-gnu
+DEFINE CLANGPDB_IA32_TARGET          = -target i686-unknown-windows
 DEFINE CLANGPDB_X64_TARGET           = -target x86_64-unknown-windows-gnu
 
 DEFINE CLANGPDB_WARNING_OVERRIDES    = -Wno-parentheses-equality -Wno-tautological-compare -Wno-tautological-constant-out-of-range-compare -Wno-empty-body -Wno-unused-const-variable -Wno-varargs -Wno-unknown-warning-option -Wno-microsoft-enum-forward-reference
-- 
2.25.1.windows.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [PATCH 2/2] MdePkg: Use __clang__ to decide if using clang or not
  2020-03-24  6:20 [PATCH 1/2] BaseTools: Change CLANGPDB target to reduce image size Zhiguang Liu
@ 2020-03-24  6:20 ` Zhiguang Liu
  2020-03-24  6:24 ` [PATCH 1/2] BaseTools: Change CLANGPDB target to reduce image size Vitaly Cheptsov
  1 sibling, 0 replies; 3+ messages in thread
From: Zhiguang Liu @ 2020-03-24  6:20 UTC (permalink / raw)
  To: devel; +Cc: Vitaly Cheptsov, Liming Gao, Michael D Kinney

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2628

After switching CLANGPDB's IA32 target to i686-unknown-windows, clang will
define _MSC_EXTENSIONS and _MSC_VER. Use __clang__ to decide if using clang.

CC: Vitaly Cheptsov <vit9696@protonmail.com>
CC: Liming Gao <liming.gao@intel.com>
CC: Michael D Kinney <michael.d.kinney@intel.com>
Signed-off-by: Zhiguang Liu <zhiguang.liu@intel.com>
---
 MdePkg/Include/Base.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/MdePkg/Include/Base.h b/MdePkg/Include/Base.h
index 85a091b9d5..c6da816aa9 100644
--- a/MdePkg/Include/Base.h
+++ b/MdePkg/Include/Base.h
@@ -799,7 +799,7 @@ typedef UINTN  *BASE_LIST;
 **/
 #ifdef MDE_CPU_EBC
   #define STATIC_ASSERT(Expression, Message)
-#elif defined(_MSC_EXTENSIONS)
+#elif defined(_MSC_EXTENSIONS) && !defined(__clang__)
   #define STATIC_ASSERT static_assert
 #else
   #define STATIC_ASSERT _Static_assert
-- 
2.25.1.windows.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH 1/2] BaseTools: Change CLANGPDB target to reduce image size
  2020-03-24  6:20 [PATCH 1/2] BaseTools: Change CLANGPDB target to reduce image size Zhiguang Liu
  2020-03-24  6:20 ` [PATCH 2/2] MdePkg: Use __clang__ to decide if using clang or not Zhiguang Liu
@ 2020-03-24  6:24 ` Vitaly Cheptsov
  1 sibling, 0 replies; 3+ messages in thread
From: Vitaly Cheptsov @ 2020-03-24  6:24 UTC (permalink / raw)
  To: Zhiguang Liu; +Cc: devel, Liming Gao, Bob Feng

[-- Attachment #1: Type: text/plain, Size: 1723 bytes --]

Hello,

While I can imagine this landing as an absolutely last effort resort, at the moment the problem is unclear and unjustified. Do not rush with this patch please and proceed with the discussion in BZ.

Best wishes,
Vitaly 

> 24 марта 2020 г., в 09:20, Zhiguang Liu <zhiguang.liu@intel.com> написал(а):
> 
> 
> REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2628
> 
> Using target i686-unknown-windows will generate smaller IA32 FV.
> 
> CC: Vitaly Cheptsov <vit9696@protonmail.com>
> CC: Liming Gao <liming.gao@intel.com>
> CC: Bob Feng <bob.c.feng@intel.com>
> Signed-off-by: Zhiguang Liu <zhiguang.liu@intel.com>
> ---
> BaseTools/Conf/tools_def.template | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/BaseTools/Conf/tools_def.template b/BaseTools/Conf/tools_def.template
> index 2b17d3b297..3d6f6b4b4c 100755
> --- a/BaseTools/Conf/tools_def.template
> +++ b/BaseTools/Conf/tools_def.template
> @@ -2755,7 +2755,7 @@ RELEASE_CLANG38_AARCH64_DLINK_FLAGS = DEF(CLANG38_AARCH64_DLINK_FLAGS) -flto -Wl
> DEFINE CLANGPDB_IA32_PREFIX          = ENV(CLANG_BIN)
> DEFINE CLANGPDB_X64_PREFIX           = ENV(CLANG_BIN)
> 
> -DEFINE CLANGPDB_IA32_TARGET          = -target i686-unknown-windows-gnu
> +DEFINE CLANGPDB_IA32_TARGET          = -target i686-unknown-windows
> DEFINE CLANGPDB_X64_TARGET           = -target x86_64-unknown-windows-gnu
> 
> DEFINE CLANGPDB_WARNING_OVERRIDES    = -Wno-parentheses-equality -Wno-tautological-compare -Wno-tautological-constant-out-of-range-compare -Wno-empty-body -Wno-unused-const-variable -Wno-varargs -Wno-unknown-warning-option -Wno-microsoft-enum-forward-reference
> --
> 2.25.1.windows.1
> 


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 489 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-03-24  6:32 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-03-24  6:20 [PATCH 1/2] BaseTools: Change CLANGPDB target to reduce image size Zhiguang Liu
2020-03-24  6:20 ` [PATCH 2/2] MdePkg: Use __clang__ to decide if using clang or not Zhiguang Liu
2020-03-24  6:24 ` [PATCH 1/2] BaseTools: Change CLANGPDB target to reduce image size Vitaly Cheptsov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox