* [Patch 0/2] BaseTools: Fix XCODE5 build breaks for varargs
@ 2017-05-19 6:52 Michael Kinney
2017-05-19 6:52 ` [Patch 1/2] BaseTools: Add -D NO_MSABI_VARGS to X64 XCODE5 CC_FLAGS Michael Kinney
` (3 more replies)
0 siblings, 4 replies; 8+ messages in thread
From: Michael Kinney @ 2017-05-19 6:52 UTC (permalink / raw)
To: edk2-devel; +Cc: Andrew Fish, Liming Gao, Michael D Kinney
* Add -D NO_MSABI_VAARGS to X64 XCODE CC_FLAGS
* Clean up XCODE5 tool chain statements
Cc: Andrew Fish <afish@apple.com>
Cc: Liming Gao <liming.gao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
Michael Kinney (2):
BaseTools: Add -D NO_MSABI_VARGS to X64 XCODE5 CC_FLAGS
BaseTools: Clean up tools_def.template for XCODE5
BaseTools/Conf/tools_def.template | 60 ++++++++++++++++++++-------------------
1 file changed, 31 insertions(+), 29 deletions(-)
--
2.6.3.windows.1
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Patch 1/2] BaseTools: Add -D NO_MSABI_VARGS to X64 XCODE5 CC_FLAGS
2017-05-19 6:52 [Patch 0/2] BaseTools: Fix XCODE5 build breaks for varargs Michael Kinney
@ 2017-05-19 6:52 ` Michael Kinney
2017-05-19 12:49 ` Ard Biesheuvel
2017-05-19 6:52 ` [Patch 2/2] BaseTools: Clean up tools_def.template for XCODE5 Michael Kinney
` (2 subsequent siblings)
3 siblings, 1 reply; 8+ messages in thread
From: Michael Kinney @ 2017-05-19 6:52 UTC (permalink / raw)
To: edk2-devel; +Cc: Andrew Fish, Liming Gao, Michael D Kinney
https://bugzilla.tianocore.org/show_bug.cgi?id=561
Update BaseTools/Conf/tools_def.template to add the define
-D NO_MSABI_VAARGS
To CC_FLAGS for X64 XCODE5 builds.
The llvm/clang compiler used in XCODE5 builds supports the
_ms_ versions of the vararg builtins, but the compiler
generates build errors.
The recommendation from the XCODE5 experts is to never use
the _ms_ version of the vararg builtins. The define
NO_MSABI_VARARGS is already supported in MdePkg/Include/Base.h
and forces the use the standard vararg builtins.
Cc: Andrew Fish <afish@apple.com>
Cc: Liming Gao <liming.gao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
---
BaseTools/Conf/tools_def.template | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/BaseTools/Conf/tools_def.template b/BaseTools/Conf/tools_def.template
index 427ef1b..ed9e834 100755
--- a/BaseTools/Conf/tools_def.template
+++ b/BaseTools/Conf/tools_def.template
@@ -7494,9 +7494,9 @@ RELEASE_XCODE5_X64_ASM_FLAGS = -arch x86_64
*_XCODE5_*_VFRPP_FLAGS = -x c -E -P -DVFRCOMPILE -include $(DEST_DIR_DEBUG)/$(MODULE_NAME)StrDefs.h
- DEBUG_XCODE5_X64_CC_FLAGS = -target x86_64-pc-win32-macho -c -g -Os -Wall -Werror -Wextra -include AutoGen.h -funsigned-char -fno-ms-extensions -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 -ftrap-function=undefined_behavior_has_been_optimized_away_by_clang $(PLATFORM_FLAGS)
- NOOPT_XCODE5_X64_CC_FLAGS = -target x86_64-pc-win32-macho -c -g -O0 -Wall -Werror -Wextra -include AutoGen.h -funsigned-char -fno-ms-extensions -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 -ftrap-function=undefined_behavior_has_been_optimized_away_by_clang $(PLATFORM_FLAGS)
-RELEASE_XCODE5_X64_CC_FLAGS = -target x86_64-pc-win32-macho -c -Os -Wall -Werror -Wextra -include AutoGen.h -funsigned-char -fno-ms-extensions -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 -ftrap-function=undefined_behavior_has_been_optimized_away_by_clang $(PLATFORM_FLAGS)
+ DEBUG_XCODE5_X64_CC_FLAGS = -target x86_64-pc-win32-macho -c -g -Os -Wall -Werror -Wextra -include AutoGen.h -funsigned-char -fno-ms-extensions -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 -ftrap-function=undefined_behavior_has_been_optimized_away_by_clang -D NO_MSABI_VA_FUNCS $(PLATFORM_FLAGS)
+ NOOPT_XCODE5_X64_CC_FLAGS = -target x86_64-pc-win32-macho -c -g -O0 -Wall -Werror -Wextra -include AutoGen.h -funsigned-char -fno-ms-extensions -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 -ftrap-function=undefined_behavior_has_been_optimized_away_by_clang -D NO_MSABI_VA_FUNCS $(PLATFORM_FLAGS)
+RELEASE_XCODE5_X64_CC_FLAGS = -target x86_64-pc-win32-macho -c -Os -Wall -Werror -Wextra -include AutoGen.h -funsigned-char -fno-ms-extensions -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 -ftrap-function=undefined_behavior_has_been_optimized_away_by_clang -D NO_MSABI_VA_FUNCS $(PLATFORM_FLAGS)
*_XCODE5_*_ASLCC_FLAGS = -x c -save-temps -g -O0 -fshort-wchar -fno-strict-aliasing -Wall -Werror -Wno-missing-braces -c -include AutoGen.h
*_XCODE5_*_ASLDLINK_FLAGS = -e _ReferenceAcpiTable -preload -segalign 0x20 -pie -seg1addr 0x240 -read_only_relocs suppress -map $(DEST_DIR_DEBUG)/$(BASE_NAME).map
--
2.6.3.windows.1
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [Patch 2/2] BaseTools: Clean up tools_def.template for XCODE5
2017-05-19 6:52 [Patch 0/2] BaseTools: Fix XCODE5 build breaks for varargs Michael Kinney
2017-05-19 6:52 ` [Patch 1/2] BaseTools: Add -D NO_MSABI_VARGS to X64 XCODE5 CC_FLAGS Michael Kinney
@ 2017-05-19 6:52 ` Michael Kinney
2017-05-19 21:36 ` [Patch 0/2] BaseTools: Fix XCODE5 build breaks for varargs Andrew Fish
2017-05-22 4:13 ` Gao, Liming
3 siblings, 0 replies; 8+ messages in thread
From: Michael Kinney @ 2017-05-19 6:52 UTC (permalink / raw)
To: edk2-devel; +Cc: Andrew Fish, Liming Gao, Michael D Kinney
Reorganize the statements for XCODE5 to match other tool
chains and remove dependency on XCLANG and XCODE32
Cc: Andrew Fish <afish@apple.com>
Cc: Liming Gao <liming.gao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
---
BaseTools/Conf/tools_def.template | 54 ++++++++++++++++++++-------------------
1 file changed, 28 insertions(+), 26 deletions(-)
diff --git a/BaseTools/Conf/tools_def.template b/BaseTools/Conf/tools_def.template
index ed9e834..4b1b7b5 100755
--- a/BaseTools/Conf/tools_def.template
+++ b/BaseTools/Conf/tools_def.template
@@ -7435,29 +7435,40 @@ RELEASE_XCLANG_X64_CC_FLAGS = -ccc-host-triple x86_64-pc-win32-macho -c -Os
*_XCODE5_*_*_BUILDRULEFAMILY = XCODE
*_XCODE5_*_*_BUILDRULEORDER = S s nasm
-*_XCODE5_*_ASL_PATH = /usr/bin/iasl
+#
+# use xcode-select to change Xcode version of command line tools
+#
+*_XCODE5_*_MAKE_PATH = make
+*_XCODE5_*_CC_PATH = clang
+*_XCODE5_*_SLINK_PATH = libtool
+*_XCODE5_*_DLINK_PATH = ld
+*_XCODE5_*_ASM_PATH = as
+*_XCODE5_*_PP_PATH = clang
+*_XCODE5_*_VFRPP_PATH = clang
+*_XCODE5_*_ASL_PATH = iasl
+*_XCODE5_*_ASLCC_PATH = clang
+*_XCODE5_*_ASLPP_PATH = clang
+*_XCODE5_*_ASLDLINK_PATH = ld
+*_XCODE5_*_DSYMUTIL_PATH = /usr/bin/dsymutil
+*_XCODE5_*_MTOC_PATH = /usr/local/bin/mtoc
-*_XCODE5_*_MAKE_PATH = make
-*_XCODE5_*_DSYMUTIL_PATH = /usr/bin/dsymutil
+##################
+# ASL definitions
+##################
+*_XCODE5_*_ASLCC_FLAGS = -x c -save-temps -g -O0 -fshort-wchar -fno-strict-aliasing -Wall -Werror -Wno-missing-braces -c -include AutoGen.h
+*_XCODE5_*_ASLDLINK_FLAGS = -e _ReferenceAcpiTable -preload -segalign 0x20 -pie -seg1addr 0x240 -read_only_relocs suppress -map $(DEST_DIR_DEBUG)/$(BASE_NAME).map
+*_XCODE5_*_ASLPP_FLAGS = -x c -E -include AutoGen.h
+*_XCODE5_*_ASL_FLAGS =
+*_XCODE5_*_ASL_OUTFLAGS = DEF(IASL_OUTFLAGS)
+
+##################
+# MTOC definitions
+##################
DEBUG_XCODE5_*_MTOC_FLAGS = -align 0x20 -d $(DEBUG_DIR)/$(MODULE_NAME).dll
NOOPT_XCODE5_*_MTOC_FLAGS = -align 0x20 -d $(DEBUG_DIR)/$(MODULE_NAME).dll
RELEASE_XCODE5_*_MTOC_FLAGS = -align 0x20
-#
-# use xcode-select to change Xcode version of command line tools
-#
-*_XCODE5_*_CC_PATH = clang
-*_XCODE5_*_SLINK_PATH = libtool
-*_XCODE5_*_DLINK_PATH = ld
-*_XCODE5_*_ASM_PATH = as
-*_XCODE5_*_PP_PATH = clang
-*_XCODE5_*_VFRPP_PATH = clang
-*_XCODE5_*_ASL_PATH = iasl
-*_XCODE5_*_ASLCC_PATH = clang
-*_XCODE5_*_ASLPP_PATH = clang
-*_XCODE5_*_ASLDLINK_PATH = ld
-
####################
# IA-32 definitions
####################
@@ -7476,8 +7487,6 @@ RELEASE_XCODE5_IA32_ASM_FLAGS = -arch i386
RELEASE_XCODE5_IA32_CC_FLAGS = -arch i386 -c -Os -Wall -Werror -include AutoGen.h -funsigned-char -fno-stack-protector -fno-builtin -fshort-wchar -fasm-blocks -mdynamic-no-pic -mno-implicit-float -mms-bitfields -msoft-float -Wno-unused-parameter -Wno-missing-braces -Wno-missing-field-initializers -Wno-tautological-compare -Wno-sign-compare -ftrap-function=undefined_behavior_has_been_optimized_away_by_clang $(PLATFORM_FLAGS)
NOOPT_XCODE5_IA32_CC_FLAGS = -arch i386 -c -g -O0 -Wall -Werror -include AutoGen.h -funsigned-char -fno-stack-protector -fno-builtin -fshort-wchar -fasm-blocks -mdynamic-no-pic -mno-implicit-float -mms-bitfields -msoft-float -Wno-unused-parameter -Wno-missing-braces -Wno-missing-field-initializers -Wno-tautological-compare -Wno-sign-compare -ftrap-function=undefined_behavior_has_been_optimized_away_by_clang $(PLATFORM_FLAGS)
-
-
##################
# X64 definitions
##################
@@ -7493,17 +7502,10 @@ RELEASE_XCODE5_X64_ASM_FLAGS = -arch x86_64
*_XCODE5_*_PP_FLAGS = -E -x assembler-with-cpp -include $(DEST_DIR_DEBUG)/AutoGen.h
*_XCODE5_*_VFRPP_FLAGS = -x c -E -P -DVFRCOMPILE -include $(DEST_DIR_DEBUG)/$(MODULE_NAME)StrDefs.h
-
DEBUG_XCODE5_X64_CC_FLAGS = -target x86_64-pc-win32-macho -c -g -Os -Wall -Werror -Wextra -include AutoGen.h -funsigned-char -fno-ms-extensions -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 -ftrap-function=undefined_behavior_has_been_optimized_away_by_clang -D NO_MSABI_VA_FUNCS $(PLATFORM_FLAGS)
NOOPT_XCODE5_X64_CC_FLAGS = -target x86_64-pc-win32-macho -c -g -O0 -Wall -Werror -Wextra -include AutoGen.h -funsigned-char -fno-ms-extensions -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 -ftrap-function=undefined_behavior_has_been_optimized_away_by_clang -D NO_MSABI_VA_FUNCS $(PLATFORM_FLAGS)
RELEASE_XCODE5_X64_CC_FLAGS = -target x86_64-pc-win32-macho -c -Os -Wall -Werror -Wextra -include AutoGen.h -funsigned-char -fno-ms-extensions -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 -ftrap-function=undefined_behavior_has_been_optimized_away_by_clang -D NO_MSABI_VA_FUNCS $(PLATFORM_FLAGS)
-*_XCODE5_*_ASLCC_FLAGS = -x c -save-temps -g -O0 -fshort-wchar -fno-strict-aliasing -Wall -Werror -Wno-missing-braces -c -include AutoGen.h
-*_XCODE5_*_ASLDLINK_FLAGS = -e _ReferenceAcpiTable -preload -segalign 0x20 -pie -seg1addr 0x240 -read_only_relocs suppress -map $(DEST_DIR_DEBUG)/$(BASE_NAME).map
-*_XCODE5_*_ASLPP_FLAGS = -x c -E -include AutoGen.h
-*_XCODE5_*_ASL_FLAGS =
-*_XCODE5_*_ASL_OUTFLAGS = DEF(IASL_OUTFLAGS)
-
####################################################################################
#
# RVCT Common
--
2.6.3.windows.1
^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [Patch 1/2] BaseTools: Add -D NO_MSABI_VARGS to X64 XCODE5 CC_FLAGS
2017-05-19 6:52 ` [Patch 1/2] BaseTools: Add -D NO_MSABI_VARGS to X64 XCODE5 CC_FLAGS Michael Kinney
@ 2017-05-19 12:49 ` Ard Biesheuvel
2017-05-19 16:46 ` Andrew Fish
0 siblings, 1 reply; 8+ messages in thread
From: Ard Biesheuvel @ 2017-05-19 12:49 UTC (permalink / raw)
To: Michael Kinney; +Cc: edk2-devel@lists.01.org, Andrew Fish, Liming Gao
On 19 May 2017 at 07:52, Michael Kinney <michael.d.kinney@intel.com> wrote:
> https://bugzilla.tianocore.org/show_bug.cgi?id=561
>
> Update BaseTools/Conf/tools_def.template to add the define
>
> -D NO_MSABI_VAARGS
>
> To CC_FLAGS for X64 XCODE5 builds.
>
> The llvm/clang compiler used in XCODE5 builds supports the
> _ms_ versions of the vararg builtins, but the compiler
> generates build errors.
>
> The recommendation from the XCODE5 experts is to never use
> the _ms_ version of the vararg builtins. The define
> NO_MSABI_VARARGS is already supported in MdePkg/Include/Base.h
> and forces the use the standard vararg builtins.
>
Are such builds compliant with the UEFI spec?
> Cc: Andrew Fish <afish@apple.com>
> Cc: Liming Gao <liming.gao@intel.com>
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
> ---
> BaseTools/Conf/tools_def.template | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/BaseTools/Conf/tools_def.template b/BaseTools/Conf/tools_def.template
> index 427ef1b..ed9e834 100755
> --- a/BaseTools/Conf/tools_def.template
> +++ b/BaseTools/Conf/tools_def.template
> @@ -7494,9 +7494,9 @@ RELEASE_XCODE5_X64_ASM_FLAGS = -arch x86_64
> *_XCODE5_*_VFRPP_FLAGS = -x c -E -P -DVFRCOMPILE -include $(DEST_DIR_DEBUG)/$(MODULE_NAME)StrDefs.h
>
>
> - DEBUG_XCODE5_X64_CC_FLAGS = -target x86_64-pc-win32-macho -c -g -Os -Wall -Werror -Wextra -include AutoGen.h -funsigned-char -fno-ms-extensions -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 -ftrap-function=undefined_behavior_has_been_optimized_away_by_clang $(PLATFORM_FLAGS)
> - NOOPT_XCODE5_X64_CC_FLAGS = -target x86_64-pc-win32-macho -c -g -O0 -Wall -Werror -Wextra -include AutoGen.h -funsigned-char -fno-ms-extensions -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 -ftrap-function=undefined_behavior_has_been_optimized_away_by_clang $(PLATFORM_FLAGS)
> -RELEASE_XCODE5_X64_CC_FLAGS = -target x86_64-pc-win32-macho -c -Os -Wall -Werror -Wextra -include AutoGen.h -funsigned-char -fno-ms-extensions -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 -ftrap-function=undefined_behavior_has_been_optimized_away_by_clang $(PLATFORM_FLAGS)
> + DEBUG_XCODE5_X64_CC_FLAGS = -target x86_64-pc-win32-macho -c -g -Os -Wall -Werror -Wextra -include AutoGen.h -funsigned-char -fno-ms-extensions -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 -ftrap-function=undefined_behavior_has_been_optimized_away_by_clang -D NO_MSABI_VA_FUNCS $(PLATFORM_FLAGS)
> + NOOPT_XCODE5_X64_CC_FLAGS = -target x86_64-pc-win32-macho -c -g -O0 -Wall -Werror -Wextra -include AutoGen.h -funsigned-char -fno-ms-extensions -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 -ftrap-function=undefined_behavior_has_been_optimized_away_by_clang -D NO_MSABI_VA_FUNCS $(PLATFORM_FLAGS)
> +RELEASE_XCODE5_X64_CC_FLAGS = -target x86_64-pc-win32-macho -c -Os -Wall -Werror -Wextra -include AutoGen.h -funsigned-char -fno-ms-extensions -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 -ftrap-function=undefined_behavior_has_been_optimized_away_by_clang -D NO_MSABI_VA_FUNCS $(PLATFORM_FLAGS)
>
> *_XCODE5_*_ASLCC_FLAGS = -x c -save-temps -g -O0 -fshort-wchar -fno-strict-aliasing -Wall -Werror -Wno-missing-braces -c -include AutoGen.h
> *_XCODE5_*_ASLDLINK_FLAGS = -e _ReferenceAcpiTable -preload -segalign 0x20 -pie -seg1addr 0x240 -read_only_relocs suppress -map $(DEST_DIR_DEBUG)/$(BASE_NAME).map
> --
> 2.6.3.windows.1
>
> _______________________________________________
> edk2-devel mailing list
> edk2-devel@lists.01.org
> https://lists.01.org/mailman/listinfo/edk2-devel
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [Patch 1/2] BaseTools: Add -D NO_MSABI_VARGS to X64 XCODE5 CC_FLAGS
2017-05-19 12:49 ` Ard Biesheuvel
@ 2017-05-19 16:46 ` Andrew Fish
2017-05-19 16:56 ` Ard Biesheuvel
0 siblings, 1 reply; 8+ messages in thread
From: Andrew Fish @ 2017-05-19 16:46 UTC (permalink / raw)
To: Ard Biesheuvel; +Cc: Mike Kinney, edk2-devel@lists.01.org, Liming Gao
> On May 19, 2017, at 5:49 AM, Ard Biesheuvel <ard.biesheuvel@linaro.org> wrote:
>
> On 19 May 2017 at 07:52, Michael Kinney <michael.d.kinney@intel.com <mailto:michael.d.kinney@intel.com>> wrote:
>> https://bugzilla.tianocore.org/show_bug.cgi?id=561
>>
>> Update BaseTools/Conf/tools_def.template to add the define
>>
>> -D NO_MSABI_VAARGS
>>
>> To CC_FLAGS for X64 XCODE5 builds.
>>
>> The llvm/clang compiler used in XCODE5 builds supports the
>> _ms_ versions of the vararg builtins, but the compiler
>> generates build errors.
>>
>> The recommendation from the XCODE5 experts is to never use
>> the _ms_ version of the vararg builtins. The define
>> NO_MSABI_VARARGS is already supported in MdePkg/Include/Base.h
>> and forces the use the standard vararg builtins.
>>
>
> Are such builds compliant with the UEFI spec?
>
Ard I think you are confusing implementation and architecture. The UEFI Spec quotes an ABI, and __builtin_ms_* is a non standard compiler extension.
Clang was designed to be a cross compiler and for X64 (x86_64) we set the arch to clang via -target x86_64-pc-win32-macho. Basically this tells clang it is an x86_64 (X64) arch, with a Windows ABI (EFI ABI), and produce a Mach-O Executable (for debugging). So the default var args builtin does the right thing for the EFI ABI, and __builtin_ms_* is not supported. The x86_64-pc-win32-macho triple is only used for EFI and when I talked to the clang folks they were like why do you need __builtin_ms_* when it is the same as __builtin_*, please fix your include files.
Thanks,
Andrew Fish
>> Cc: Andrew Fish <afish@apple.com>
>> Cc: Liming Gao <liming.gao@intel.com>
>> Contributed-under: TianoCore Contribution Agreement 1.0
>> Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
>> ---
>> BaseTools/Conf/tools_def.template | 6 +++---
>> 1 file changed, 3 insertions(+), 3 deletions(-)
>>
>> diff --git a/BaseTools/Conf/tools_def.template b/BaseTools/Conf/tools_def.template
>> index 427ef1b..ed9e834 100755
>> --- a/BaseTools/Conf/tools_def.template
>> +++ b/BaseTools/Conf/tools_def.template
>> @@ -7494,9 +7494,9 @@ RELEASE_XCODE5_X64_ASM_FLAGS = -arch x86_64
>> *_XCODE5_*_VFRPP_FLAGS = -x c -E -P -DVFRCOMPILE -include $(DEST_DIR_DEBUG)/$(MODULE_NAME)StrDefs.h
>>
>>
>> - DEBUG_XCODE5_X64_CC_FLAGS = -target x86_64-pc-win32-macho -c -g -Os -Wall -Werror -Wextra -include AutoGen.h -funsigned-char -fno-ms-extensions -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 -ftrap-function=undefined_behavior_has_been_optimized_away_by_clang $(PLATFORM_FLAGS)
>> - NOOPT_XCODE5_X64_CC_FLAGS = -target x86_64-pc-win32-macho -c -g -O0 -Wall -Werror -Wextra -include AutoGen.h -funsigned-char -fno-ms-extensions -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 -ftrap-function=undefined_behavior_has_been_optimized_away_by_clang $(PLATFORM_FLAGS)
>> -RELEASE_XCODE5_X64_CC_FLAGS = -target x86_64-pc-win32-macho -c -Os -Wall -Werror -Wextra -include AutoGen.h -funsigned-char -fno-ms-extensions -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 -ftrap-function=undefined_behavior_has_been_optimized_away_by_clang $(PLATFORM_FLAGS)
>> + DEBUG_XCODE5_X64_CC_FLAGS = -target x86_64-pc-win32-macho -c -g -Os -Wall -Werror -Wextra -include AutoGen.h -funsigned-char -fno-ms-extensions -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 -ftrap-function=undefined_behavior_has_been_optimized_away_by_clang -D NO_MSABI_VA_FUNCS $(PLATFORM_FLAGS)
>> + NOOPT_XCODE5_X64_CC_FLAGS = -target x86_64-pc-win32-macho -c -g -O0 -Wall -Werror -Wextra -include AutoGen.h -funsigned-char -fno-ms-extensions -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 -ftrap-function=undefined_behavior_has_been_optimized_away_by_clang -D NO_MSABI_VA_FUNCS $(PLATFORM_FLAGS)
>> +RELEASE_XCODE5_X64_CC_FLAGS = -target x86_64-pc-win32-macho -c -Os -Wall -Werror -Wextra -include AutoGen.h -funsigned-char -fno-ms-extensions -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 -ftrap-function=undefined_behavior_has_been_optimized_away_by_clang -D NO_MSABI_VA_FUNCS $(PLATFORM_FLAGS)
>>
>> *_XCODE5_*_ASLCC_FLAGS = -x c -save-temps -g -O0 -fshort-wchar -fno-strict-aliasing -Wall -Werror -Wno-missing-braces -c -include AutoGen.h
>> *_XCODE5_*_ASLDLINK_FLAGS = -e _ReferenceAcpiTable -preload -segalign 0x20 -pie -seg1addr 0x240 -read_only_relocs suppress -map $(DEST_DIR_DEBUG)/$(BASE_NAME).map
>> --
>> 2.6.3.windows.1
>>
>> _______________________________________________
>> edk2-devel mailing list
>> edk2-devel@lists.01.org <mailto:edk2-devel@lists.01.org>
>> https://lists.01.org/mailman/listinfo/edk2-devel <https://lists.01.org/mailman/listinfo/edk2-devel>
> _______________________________________________
> edk2-devel mailing list
> edk2-devel@lists.01.org <mailto:edk2-devel@lists.01.org>
> https://lists.01.org/mailman/listinfo/edk2-devel <https://lists.01.org/mailman/listinfo/edk2-devel>
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [Patch 1/2] BaseTools: Add -D NO_MSABI_VARGS to X64 XCODE5 CC_FLAGS
2017-05-19 16:46 ` Andrew Fish
@ 2017-05-19 16:56 ` Ard Biesheuvel
0 siblings, 0 replies; 8+ messages in thread
From: Ard Biesheuvel @ 2017-05-19 16:56 UTC (permalink / raw)
To: Andrew Fish; +Cc: Mike Kinney, edk2-devel@lists.01.org, Liming Gao
On 19 May 2017 at 17:46, Andrew Fish <afish@apple.com> wrote:
>
> On May 19, 2017, at 5:49 AM, Ard Biesheuvel <ard.biesheuvel@linaro.org>
> wrote:
>
> On 19 May 2017 at 07:52, Michael Kinney <michael.d.kinney@intel.com> wrote:
>
> https://bugzilla.tianocore.org/show_bug.cgi?id=561
>
> Update BaseTools/Conf/tools_def.template to add the define
>
> -D NO_MSABI_VAARGS
>
> To CC_FLAGS for X64 XCODE5 builds.
>
> The llvm/clang compiler used in XCODE5 builds supports the
> _ms_ versions of the vararg builtins, but the compiler
> generates build errors.
>
> The recommendation from the XCODE5 experts is to never use
> the _ms_ version of the vararg builtins. The define
> NO_MSABI_VARARGS is already supported in MdePkg/Include/Base.h
> and forces the use the standard vararg builtins.
>
>
> Are such builds compliant with the UEFI spec?
>
>
> Ard I think you are confusing implementation and architecture. The UEFI Spec
> quotes an ABI, and __builtin_ms_* is a non standard compiler extension.
>
> Clang was designed to be a cross compiler and for X64 (x86_64) we set the
> arch to clang via -target x86_64-pc-win32-macho. Basically this tells clang
> it is an x86_64 (X64) arch, with a Windows ABI (EFI ABI), and produce a
> Mach-O Executable (for debugging). So the default var args builtin does the
> right thing for the EFI ABI, and __builtin_ms_* is not supported. The
> x86_64-pc-win32-macho triple is only used for EFI and when I talked to the
> clang folks they were like why do you need __builtin_ms_* when it is the
> same as __builtin_*, please fix your include files.
>
Thanks for clarifying. What confused me is the use of NO_MSABI_VAARGS,
which to a casual reader may seem to force a varargs ABI different
from the MS one, which is exactly what it is used for in libraries
such as OpensslLib IIRC.
In any case, if the clang target setting already fully defines the
varargs flavor of __builtin_va_xxx calls, then I suppose the resulting
code should be compliant. It may still be worthwhile to rename the
preprocessor macro to something more intuitive, but I won't insist.
Thanks,
Ard.
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [Patch 0/2] BaseTools: Fix XCODE5 build breaks for varargs
2017-05-19 6:52 [Patch 0/2] BaseTools: Fix XCODE5 build breaks for varargs Michael Kinney
2017-05-19 6:52 ` [Patch 1/2] BaseTools: Add -D NO_MSABI_VARGS to X64 XCODE5 CC_FLAGS Michael Kinney
2017-05-19 6:52 ` [Patch 2/2] BaseTools: Clean up tools_def.template for XCODE5 Michael Kinney
@ 2017-05-19 21:36 ` Andrew Fish
2017-05-22 4:13 ` Gao, Liming
3 siblings, 0 replies; 8+ messages in thread
From: Andrew Fish @ 2017-05-19 21:36 UTC (permalink / raw)
To: Mike Kinney; +Cc: edk2-devel, Liming Gao
Reviewed-by: Andrew Fish <afish@apple.com>
> On May 18, 2017, at 11:52 PM, Michael Kinney <michael.d.kinney@intel.com> wrote:
>
> * Add -D NO_MSABI_VAARGS to X64 XCODE CC_FLAGS
> * Clean up XCODE5 tool chain statements
>
> Cc: Andrew Fish <afish@apple.com>
> Cc: Liming Gao <liming.gao@intel.com>
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
>
> Michael Kinney (2):
> BaseTools: Add -D NO_MSABI_VARGS to X64 XCODE5 CC_FLAGS
> BaseTools: Clean up tools_def.template for XCODE5
>
> BaseTools/Conf/tools_def.template | 60 ++++++++++++++++++++-------------------
> 1 file changed, 31 insertions(+), 29 deletions(-)
>
> --
> 2.6.3.windows.1
>
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [Patch 0/2] BaseTools: Fix XCODE5 build breaks for varargs
2017-05-19 6:52 [Patch 0/2] BaseTools: Fix XCODE5 build breaks for varargs Michael Kinney
` (2 preceding siblings ...)
2017-05-19 21:36 ` [Patch 0/2] BaseTools: Fix XCODE5 build breaks for varargs Andrew Fish
@ 2017-05-22 4:13 ` Gao, Liming
3 siblings, 0 replies; 8+ messages in thread
From: Gao, Liming @ 2017-05-22 4:13 UTC (permalink / raw)
To: Kinney, Michael D, edk2-devel@lists.01.org; +Cc: Andrew Fish
Reviewed-by: Liming Gao <liming.gao@intel.com>
>-----Original Message-----
>From: Kinney, Michael D
>Sent: Friday, May 19, 2017 2:52 PM
>To: edk2-devel@lists.01.org
>Cc: Andrew Fish <afish@apple.com>; Gao, Liming <liming.gao@intel.com>;
>Kinney, Michael D <michael.d.kinney@intel.com>
>Subject: [Patch 0/2] BaseTools: Fix XCODE5 build breaks for varargs
>
>* Add -D NO_MSABI_VAARGS to X64 XCODE CC_FLAGS
>* Clean up XCODE5 tool chain statements
>
>Cc: Andrew Fish <afish@apple.com>
>Cc: Liming Gao <liming.gao@intel.com>
>Contributed-under: TianoCore Contribution Agreement 1.0
>Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
>
>Michael Kinney (2):
> BaseTools: Add -D NO_MSABI_VARGS to X64 XCODE5 CC_FLAGS
> BaseTools: Clean up tools_def.template for XCODE5
>
> BaseTools/Conf/tools_def.template | 60 ++++++++++++++++++++------------
>-------
> 1 file changed, 31 insertions(+), 29 deletions(-)
>
>--
>2.6.3.windows.1
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2017-05-22 4:13 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-05-19 6:52 [Patch 0/2] BaseTools: Fix XCODE5 build breaks for varargs Michael Kinney
2017-05-19 6:52 ` [Patch 1/2] BaseTools: Add -D NO_MSABI_VARGS to X64 XCODE5 CC_FLAGS Michael Kinney
2017-05-19 12:49 ` Ard Biesheuvel
2017-05-19 16:46 ` Andrew Fish
2017-05-19 16:56 ` Ard Biesheuvel
2017-05-19 6:52 ` [Patch 2/2] BaseTools: Clean up tools_def.template for XCODE5 Michael Kinney
2017-05-19 21:36 ` [Patch 0/2] BaseTools: Fix XCODE5 build breaks for varargs Andrew Fish
2017-05-22 4:13 ` Gao, Liming
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox