]> git.proxmox.com Git - mirror_edk2.git/commit
BaseTools: Use SEH exceptions in CLANGPDB for IA32
authorVitaly Cheptsov <vit9696@protonmail.com>
Fri, 27 Mar 2020 10:45:59 +0000 (18:45 +0800)
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Wed, 8 Apr 2020 14:24:09 +0000 (14:24 +0000)
commitd4bc5378e003e53a1c76d106997cec4af46a133a
tree2018e5cee22bee1d92716ae8c89b4538e935342a
parent7cfc48fe4f972ae7ddeb9ab2042156d07e1e992a
BaseTools: Use SEH exceptions in CLANGPDB for IA32

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

This patch reduces the size of IA32 binaries by ensuring that
no .debug_frame / .eh_frame sections are generated through forcing
SEH exception model, which is already the default in clang for X64.

EDK II does not support exceptions, and in future we should disable
them instead of switching to some other variant. Currently this
is not possible due to the following LLVM bugs:

https://bugs.llvm.org/show_bug.cgi?id=45324
https://bugs.llvm.org/show_bug.cgi?id=45325

Upon applying this patch OvmfPkgIA32.dsc compilation in DEBUG mode
gets the following size decrease with clang 9.0.1.

Before: FV Space Information
SECFV [11%Full] 212992 total, 24512 used, 188480 free
PEIFV [22%Full] 917504 total, 203048 used, 714456 free
DXEFV [36%Full] 11534336 total, 4215672 used, 7318664 free
FVMAIN_COMPACT [37%Full] 3440640 total, 1287776 used, 2152864 free

After: FV Space Information
SECFV [10%Full] 212992 total, 22112 used, 190880 free
PEIFV [19%Full] 917504 total, 176392 used, 741112 free
DXEFV [31%Full] 11534336 total, 3657112 used, 7877224 free
FVMAIN_COMPACT [33%Full] 3440640 total, 1153896 used, 2286744 free

Cc: Liming Gao <liming.gao@intel.com>
Cc: Marvin H?user <mhaeuser@outlook.de>
Cc: Zhiguang Liu <zhiguang.liu@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
Reviewed-by: Zhiguang Liu <zhiguang.liu@intel.com>
Signed-off-by: Vitaly Cheptsov <vit9696@protonmail.com>
BaseTools/Conf/tools_def.template