From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from ma1-aaemail-dr-lapp03.apple.com (ma1-aaemail-dr-lapp03.apple.com [17.171.2.72]) by mx.groups.io with SMTP id smtpd.web11.25309.1590374311280830977 for ; Sun, 24 May 2020 19:38:31 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@apple.com header.s=20180706 header.b=RmWK+jl3; spf=pass (domain: apple.com, ip: 17.171.2.72, mailfrom: afish@apple.com) Received: from pps.filterd (ma1-aaemail-dr-lapp03.apple.com [127.0.0.1]) by ma1-aaemail-dr-lapp03.apple.com (8.16.0.42/8.16.0.42) with SMTP id 04P2b9jk025621; Sun, 24 May 2020 19:38:29 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=apple.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding; s=20180706; bh=a8/2bWEMa/2WbGdkKUg7my6chO4MMOiHF6phZwatkTg=; b=RmWK+jl3nxWzuRrPjtcb8S1xyeBNJyR04Fgdhlbgc4jlnUg8mE/gOgR6UloOaxRd9LnK EtoBXlEPsE7AU/4Aj64liGFSWMs8QOr/8m6vQJqdAVn17kCmnU6HQcixQTisGCQZMb7V rMEe5/jdR07q7fXuDBG5Sv6ioqoYIgO9S3QHpzQtdoMAAMZed7Km33CorkW1iijc6HWy 5zzzTPMgz5tXg+N0SxqNfjVNIQFagBY+PQuDoz5/or/+rRGV7EI1xsKLOBUEOECL3XZf fepB6RzC1RJinUCLqxaJPwuVp94BzvaEuHKSq7jvsv2SbVpo6Yaicptu3SgKtOEuaTXQ CQ== Received: from rn-mailsvcp-mta-lapp03.rno.apple.com (rn-mailsvcp-mta-lapp03.rno.apple.com [10.225.203.151]) by ma1-aaemail-dr-lapp03.apple.com with ESMTP id 3172tuf5ke-28 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NO); Sun, 24 May 2020 19:38:29 -0700 Received: from rn-mailsvcp-relay-lapp03.rno.apple.com (rn-mailsvcp-relay-lapp03.rno.apple.com [17.179.253.12]) by rn-mailsvcp-mta-lapp03.rno.apple.com (Oracle Communications Messaging Server 8.1.0.5.20200312 64bit (built Mar 12 2020)) with ESMTPS id <0QAV006F28O3SE60@rn-mailsvcp-mta-lapp03.rno.apple.com>; Sun, 24 May 2020 19:38:27 -0700 (PDT) Received: from process_milters-daemon.rn-mailsvcp-relay-lapp03.rno.apple.com by rn-mailsvcp-relay-lapp03.rno.apple.com (Oracle Communications Messaging Server 8.1.0.5.20200312 64bit (built Mar 12 2020)) id <0QAV009008NFB400@rn-mailsvcp-relay-lapp03.rno.apple.com>; Sun, 24 May 2020 19:38:27 -0700 (PDT) X-Va-A: X-Va-T-CD: 678bf7de5df0d9ff994f556fd1b44182 X-Va-E-CD: e626ab0a9fecf2f98f0b56a49de24088 X-Va-R-CD: 710eefb4a9efdb2f993008c5e6fa6c05 X-Va-CD: 0 X-Va-ID: 7e34e839-1111-4980-abc6-b9d73d52b424 X-V-A: X-V-T-CD: 678bf7de5df0d9ff994f556fd1b44182 X-V-E-CD: e626ab0a9fecf2f98f0b56a49de24088 X-V-R-CD: 710eefb4a9efdb2f993008c5e6fa6c05 X-V-CD: 0 X-V-ID: 722d1d21-545d-4859-ab7e-de7722d00d23 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.216,18.0.676 definitions=2020-05-24_11:2020-05-22,2020-05-24 signatures=0 Received: from rn-mailsvcp-relay-lapp04.rno.apple.com (unknown [17.235.51.71]) by rn-mailsvcp-relay-lapp03.rno.apple.com (Oracle Communications Messaging Server 8.1.0.5.20200312 64bit (built Mar 12 2020)) with ESMTP id <0QAV00D9V8O31970@rn-mailsvcp-relay-lapp03.rno.apple.com>; Sun, 24 May 2020 19:38:27 -0700 (PDT) From: "Andrew Fish" To: devel@edk2.groups.io Cc: Andrew Fish , Liming Gao , Zhiguang Liu Subject: [PATCH 1/1] BaseTools: Turn on Link Time Optimization (LTO) for XCOODE Date: Sun, 24 May 2020 19:38:18 -0700 Message-id: X-Mailer: git-send-email 2.24.1 (Apple Git-126) In-reply-to: References: MIME-version: 1.0 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.216,18.0.676 definitions=2020-05-24_11:2020-05-22,2020-05-24 signatures=0 Content-transfer-encoding: quoted-printable BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=3D1202 Turn on LTO for XCODE. We need to pass -object_path_lto to the linker to keep source level debugging working. OVMF X64 before: SECFV [14%Full] 212992 total, 30224 used, 182768 free PEIFV [29%Full] 917504 total, 273256 used, 644248 free DXEFV [40%Full] 12582912 total, 5096904 used, 7486008 free FVMAIN_COMPACT [37%Full] 3440640 total, 1290240 used, 2150400 free After: SECFV [10%Full] 212992 total, 23064 used, 189928 free PEIFV [20%Full] 917504 total, 192328 used, 725176 free DXEFV [33%Full] 12582912 total, 4193632 used, 8389280 free FVMAIN_COMPACT [33%Full] 3440640 total, 1165352 used, 2275288 free Signed-off-by: Andrew Fish Cc: Liming Gao Cc: Zhiguang Liu --- BaseTools/Conf/tools_def.template | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/BaseTools/Conf/tools_def.template b/BaseTools/Conf/tools_def.t= emplate index 923517b5c296..efe8e47af851 100755 --- a/BaseTools/Conf/tools_def.template +++ b/BaseTools/Conf/tools_def.template @@ -2927,9 +2927,9 @@ RELEASE_XCODE5_*_MTOC_FLAGS =3D -align 0x20 ####################=0D # IA-32 definitions=0D ####################=0D - DEBUG_XCODE5_IA32_DLINK_FLAGS =3D -arch i386 -u _$(IMAGE_ENTRY_POIN= T) -e _$(IMAGE_ENTRY_POINT) -preload -segalign 0x20 -pie -all_load -dead_s= trip -seg1addr 0x240 -read_only_relocs suppress -map $(DEST_DIR_DEBUG)/$(BA= SE_NAME).map=0D + DEBUG_XCODE5_IA32_DLINK_FLAGS =3D -arch i386 -u _$(IMAGE_ENTRY_POIN= T) -e _$(IMAGE_ENTRY_POINT) -preload -segalign 0x20 -pie -all_load -dead_s= trip -seg1addr 0x240 -read_only_relocs suppress -map $(DEST_DIR_DEBUG)/$(BA= SE_NAME).map -object_path_lto $(DEST_DIR_DEBUG)/$(BASE_NAME).lto=0D NOOPT_XCODE5_IA32_DLINK_FLAGS =3D -arch i386 -u _$(IMAGE_ENTRY_POIN= T) -e _$(IMAGE_ENTRY_POINT) -preload -segalign 0x20 -pie -all_load -dead_s= trip -seg1addr 0x240 -read_only_relocs suppress -map $(DEST_DIR_DEBUG)/$(BA= SE_NAME).map=0D -RELEASE_XCODE5_IA32_DLINK_FLAGS =3D -arch i386 -u _$(IMAGE_ENTRY_POIN= T) -e _$(IMAGE_ENTRY_POINT) -preload -segalign 0x20 -pie -all_load -dead_s= trip -seg1addr 0x240 -read_only_relocs suppress -map $(DEST_DIR_DEBUG)/$(BA= SE_NAME).map=0D +RELEASE_XCODE5_IA32_DLINK_FLAGS =3D -arch i386 -u _$(IMAGE_ENTRY_POIN= T) -e _$(IMAGE_ENTRY_POINT) -preload -segalign 0x20 -pie -all_load -dead_s= trip -seg1addr 0x240 -read_only_relocs suppress -map $(DEST_DIR_DEBUG)/$(BA= SE_NAME).map -object_path_lto $(DEST_DIR_DEBUG)/$(BASE_NAME).lto=0D =0D *_XCODE5_IA32_SLINK_FLAGS =3D -static -o=0D DEBUG_XCODE5_IA32_ASM_FLAGS =3D -arch i386 -g=0D @@ -2938,16 +2938,16 @@ RELEASE_XCODE5_IA32_ASM_FLAGS =3D -arch i386 *_XCODE5_IA32_NASM_FLAGS =3D -f macho32=0D =0D =0D - DEBUG_XCODE5_IA32_CC_FLAGS =3D -arch i386 -c -g -Os -Wall -Werro= r -include AutoGen.h -funsigned-char -fno-stack-protector -fno-builtin -fsh= ort-wchar -fasm-blocks -mdynamic-no-pic -mno-implicit-float -mms-bitfields = -msoft-float -Wno-unused-parameter -Wno-missing-braces -Wno-missing-field-i= nitializers -Wno-tautological-compare -Wno-sign-compare -Wno-varargs -ftrap= -function=3Dundefined_behavior_has_been_optimized_away_by_clang $(PLATFORM_= FLAGS)=0D -RELEASE_XCODE5_IA32_CC_FLAGS =3D -arch i386 -c -Os -Wall -Werro= r -include AutoGen.h -funsigned-char -fno-stack-protector -fno-builtin -fsh= ort-wchar -fasm-blocks -mdynamic-no-pic -mno-implicit-float -mms-bitfields = -msoft-float -Wno-unused-parameter -Wno-missing-braces -Wno-missing-field-i= nitializers -Wno-tautological-compare -Wno-sign-compare -Wno-varargs -Wno-u= nused-const-variable -ftrap-function=3Dundefined_behavior_has_been_optimize= d_away_by_clang $(PLATFORM_FLAGS)=0D + DEBUG_XCODE5_IA32_CC_FLAGS =3D -arch i386 -c -g -Os -flto -Wall -Werro= r -include AutoGen.h -funsigned-char -fno-stack-protector -fno-builtin -fsh= ort-wchar -fasm-blocks -mdynamic-no-pic -mno-implicit-float -mms-bitfields = -msoft-float -Wno-unused-parameter -Wno-missing-braces -Wno-missing-field-i= nitializers -Wno-tautological-compare -Wno-sign-compare -Wno-varargs -ftrap= -function=3Dundefined_behavior_has_been_optimized_away_by_clang $(PLATFORM_= FLAGS)=0D +RELEASE_XCODE5_IA32_CC_FLAGS =3D -arch i386 -c -Os -flto -Wall -Werro= r -include AutoGen.h -funsigned-char -fno-stack-protector -fno-builtin -fsh= ort-wchar -fasm-blocks -mdynamic-no-pic -mno-implicit-float -mms-bitfields = -msoft-float -Wno-unused-parameter -Wno-missing-braces -Wno-missing-field-i= nitializers -Wno-tautological-compare -Wno-sign-compare -Wno-varargs -Wno-u= nused-const-variable -ftrap-function=3Dundefined_behavior_has_been_optimize= d_away_by_clang $(PLATFORM_FLAGS)=0D NOOPT_XCODE5_IA32_CC_FLAGS =3D -arch i386 -c -g -O0 -Wall -Werro= r -include AutoGen.h -funsigned-char -fno-stack-protector -fno-builtin -fsh= ort-wchar -fasm-blocks -mdynamic-no-pic -mno-implicit-float -mms-bitfields = -msoft-float -Wno-unused-parameter -Wno-missing-braces -Wno-missing-field-i= nitializers -Wno-tautological-compare -Wno-sign-compare -Wno-varargs -ftrap= -function=3Dundefined_behavior_has_been_optimized_away_by_clang $(PLATFORM_= FLAGS)=0D =0D ##################=0D # X64 definitions=0D ##################=0D - DEBUG_XCODE5_X64_DLINK_FLAGS =3D -arch x86_64 -u _$(IMAGE_ENTRY_POI= NT) -e _$(IMAGE_ENTRY_POINT) -preload -segalign 0x20 -pie -all_load -dead_= strip -seg1addr 0x240 -map $(DEST_DIR_DEBUG)/$(BASE_NAME).map=0D + DEBUG_XCODE5_X64_DLINK_FLAGS =3D -arch x86_64 -u _$(IMAGE_ENTRY_POI= NT) -e _$(IMAGE_ENTRY_POINT) -preload -segalign 0x20 -pie -all_load -dead_= strip -seg1addr 0x240 -map $(DEST_DIR_DEBUG)/$(BASE_NAME).map -object_path_= lto $(DEST_DIR_DEBUG)/$(BASE_NAME).lto=0D NOOPT_XCODE5_X64_DLINK_FLAGS =3D -arch x86_64 -u _$(IMAGE_ENTRY_POI= NT) -e _$(IMAGE_ENTRY_POINT) -preload -segalign 0x20 -pie -all_load -dead_= strip -seg1addr 0x240 -map $(DEST_DIR_DEBUG)/$(BASE_NAME).map=0D -RELEASE_XCODE5_X64_DLINK_FLAGS =3D -arch x86_64 -u _$(IMAGE_ENTRY_POI= NT) -e _$(IMAGE_ENTRY_POINT) -preload -segalign 0x20 -pie -all_load -dead_= strip -seg1addr 0x240 -map $(DEST_DIR_DEBUG)/$(BASE_NAME).map=0D +RELEASE_XCODE5_X64_DLINK_FLAGS =3D -arch x86_64 -u _$(IMAGE_ENTRY_POI= NT) -e _$(IMAGE_ENTRY_POINT) -preload -segalign 0x20 -pie -all_load -dead_= strip -seg1addr 0x240 -map $(DEST_DIR_DEBUG)/$(BASE_NAME).map -object_path_= lto $(DEST_DIR_DEBUG)/$(BASE_NAME).lto=0D =0D *_XCODE5_X64_SLINK_FLAGS =3D -static -o=0D DEBUG_XCODE5_X64_ASM_FLAGS =3D -arch x86_64 -g=0D @@ -2957,9 +2957,9 @@ RELEASE_XCODE5_X64_ASM_FLAGS =3D -arch x86_64 *_XCODE5_*_PP_FLAGS =3D -E -x assembler-with-cpp -include AutoGen.= h=0D *_XCODE5_*_VFRPP_FLAGS =3D -x c -E -P -DVFRCOMPILE -include $(MODULE_= NAME)StrDefs.h=0D =0D - DEBUG_XCODE5_X64_CC_FLAGS =3D -target x86_64-pc-win32-macho -c -g -gdw= arf -Os -Wall -Werror -Wextra -include AutoGen.h -funsigned-char -fno= -ms-extensions -fno-stack-protector -fno-builtin -fshort-wchar -mno-implici= t-float -mms-bitfields -Wno-unused-parameter -Wno-missing-braces -Wno-missi= ng-field-initializers -Wno-tautological-compare -Wno-sign-compare -Wno-vara= rgs -ftrap-function=3Dundefined_behavior_has_been_optimized_away_by_clang -= D NO_MSABI_VA_FUNCS $(PLATFORM_FLAGS)=0D + DEBUG_XCODE5_X64_CC_FLAGS =3D -target x86_64-pc-win32-macho -c -g -gdw= arf -Os -flto -Wall -Werror -Wextra -include AutoGen.h -funsigned-char -fno= -ms-extensions -fno-stack-protector -fno-builtin -fshort-wchar -mno-implici= t-float -mms-bitfields -Wno-unused-parameter -Wno-missing-braces -Wno-missi= ng-field-initializers -Wno-tautological-compare -Wno-sign-compare -Wno-vara= rgs -ftrap-function=3Dundefined_behavior_has_been_optimized_away_by_clang -= D NO_MSABI_VA_FUNCS $(PLATFORM_FLAGS)=0D NOOPT_XCODE5_X64_CC_FLAGS =3D -target x86_64-pc-win32-macho -c -g -gdw= arf -O0 -Wall -Werror -Wextra -include AutoGen.h -funsigned-char -fno= -ms-extensions -fno-stack-protector -fno-builtin -fshort-wchar -mno-implici= t-float -mms-bitfields -Wno-unused-parameter -Wno-missing-braces -Wno-missi= ng-field-initializers -Wno-tautological-compare -Wno-sign-compare -Wno-vara= rgs -ftrap-function=3Dundefined_behavior_has_been_optimized_away_by_clang -= D NO_MSABI_VA_FUNCS $(PLATFORM_FLAGS)=0D -RELEASE_XCODE5_X64_CC_FLAGS =3D -target x86_64-pc-win32-macho -c -Os = -Wall -Werror -Wextra -include AutoGen.h -funsigned-char -fno-ms-exte= nsions -fno-stack-protector -fno-builtin -fshort-wchar -mno-implicit-float = -mms-bitfields -Wno-unused-parameter -Wno-missing-braces -Wno-missing-field= -initializers -Wno-tautological-compare -Wno-sign-compare -Wno-varargs -Wno= -unused-const-variable -ftrap-function=3Dundefined_behavior_has_been_optimi= zed_away_by_clang -D NO_MSABI_VA_FUNCS $(PLATFORM_FLAGS)=0D +RELEASE_XCODE5_X64_CC_FLAGS =3D -target x86_64-pc-win32-macho -c = -Os -flto -Wall -Werror -Wextra -include AutoGen.h -funsigned-char -fno= -ms-extensions -fno-stack-protector -fno-builtin -fshort-wchar -mno-implici= t-float -mms-bitfields -Wno-unused-parameter -Wno-missing-braces -Wno-missi= ng-field-initializers -Wno-tautological-compare -Wno-sign-compare -Wno-vara= rgs -Wno-unused-const-variable -ftrap-function=3Dundefined_behavior_has_bee= n_optimized_away_by_clang -D NO_MSABI_VA_FUNCS $(PLATFORM_FLAGS)=0D =0D ##########################################################################= ##########=0D #=0D --=20 2.24.1 (Apple Git-126)