diff mbox

[edk2] BaseTools: Added support to use GCC on Windows host (WINGCC)

Message ID 1394537323-30104-1-git-send-email-olivier.martin@arm.com
State New
Headers show

Commit Message

Olivier Martin March 11, 2014, 11:28 a.m. UTC
WINGCC EDK2 toolchain enables building EDK2 with GCC toolchain
on Windows host machine.
It currently only supports ARM and AARCH64 architectures.

Change-Id: I49eb3103137e5dd73c24a9596d25d4899ca76cfc
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Olivier Martin <olivier.martin@arm.com>
---
 BaseTools/Conf/build_rule.template | 10 ++--
 BaseTools/Conf/tools_def.template  | 97 ++++++++++++++++++++++++++++++++++++++
 2 files changed, 102 insertions(+), 5 deletions(-)
diff mbox

Patch

diff --git a/BaseTools/Conf/build_rule.template b/BaseTools/Conf/build_rule.template
index 1259251..b2fb32e 100644
--- a/BaseTools/Conf/build_rule.template
+++ b/BaseTools/Conf/build_rule.template
@@ -133,7 +133,7 @@ 
         "$(CC)" $(CC_FLAGS) -o ${dst} $(INC) ${src}
         "$(SYMRENAME)" $(SYMRENAME_FLAGS) ${dst}
 
-    <Command.ARMGCC, Command.ARMLINUXGCC>
+    <Command.ARMGCC, Command.ARMLINUXGCC, Command.WINGCC>
         "$(CC)" $(CC_FLAGS) -o ${dst} $(INC) ${src}
 
 
@@ -219,7 +219,7 @@ 
     <Command.RVCT>
         "$(SLINK)" $(SLINK_FLAGS) ${dst} --via $(OBJECT_FILES_LIST)
     
-    <Command.RVCTCYGWIN, Command.ARMGCC, Command.ARMLINUXGCC>
+    <Command.RVCTCYGWIN, Command.ARMGCC, Command.ARMLINUXGCC, Command.WINGCC>
         # $(OBJECT_FILES_LIST) has wrong paths for cygwin
         "$(SLINK)" $(SLINK_FLAGS) ${dst} $(OBJECT_FILES)
 
@@ -243,7 +243,7 @@ 
         "$(DLINK)" -o ${dst} $(DLINK_FLAGS) --start-group $(DLINK_SPATH) @$(STATIC_LIBRARY_FILES_LIST) --end-group $(DLINK2_FLAGS)
         "$(OBJCOPY)" $(OBJCOPY_FLAGS) ${dst}
 
-    <Command.ARMGCC, Command.ARMLINUXGCC>
+    <Command.ARMGCC, Command.ARMLINUXGCC, Command.WINGCC>
         "$(DLINK)" -o ${dst} $(DLINK_FLAGS) --start-group $(DLINK_SPATH) $(STATIC_LIBRARY_FILES) --end-group $(DLINK2_FLAGS)
 
     <Command.RVCT>
@@ -273,7 +273,7 @@ 
     <Command.GCC>
         "$(DLINK)" $(DLINK_FLAGS) --start-group $(DLINK_SPATH) @$(STATIC_LIBRARY_FILES_LIST) --end-group $(DLINK2_FLAGS)
 
-    <Command.ARMGCC, Command.ARMLINUXGCC>
+    <Command.ARMGCC, Command.ARMLINUXGCC, Command.WINGCC>
         "$(DLINK)" $(DLINK_FLAGS) --start-group $(DLINK_SPATH) $(STATIC_LIBRARY_FILES) --end-group $(DLINK2_FLAGS)
 
     <Command.RVCT>
@@ -294,7 +294,7 @@ 
     <OutputFile>
         $(DEBUG_DIR)(+)$(MODULE_NAME).efi
 
-    <Command.MSFT, Command.INTEL, Command.RVCT, Command.ARMGCC, Command.ARMLINUXGCC>  
+    <Command.MSFT, Command.INTEL, Command.RVCT, Command.ARMGCC, Command.ARMLINUXGCC, Command.WINGCC>
         "$(GENFW)" -e $(MODULE_TYPE) -o ${dst} ${src} $(GENFW_FLAGS)
         $(CP) ${dst} $(OUTPUT_DIR)
         $(CP) ${dst} $(BIN_DIR)
diff --git a/BaseTools/Conf/tools_def.template b/BaseTools/Conf/tools_def.template
index 8f5507d..02d728f 100644
--- a/BaseTools/Conf/tools_def.template
+++ b/BaseTools/Conf/tools_def.template
@@ -594,6 +594,12 @@  DEFINE SOURCERY_CYGWIN_TOOLS = /cygdrive/c/Program Files/CodeSourcery/Sourcery G
 #                             Required to build platforms or ACPI tables:
 #                               Intel(r) ACPI Compiler v20101013 from
 #                               http://www.acpica.org/downloads/previous_releases.php
+#   WINGCC      -win64-  Requires:
+#                             Windows GNU GCC toolchain, 4.8.0
+#                        Optional:
+#                             Required to build platforms or ACPI tables:
+#                               Intel(r) ACPI Compiler (iasl.exe) v20101013 from
+#                               http://www.acpica.org/downloads/previous_releases.php
 # * Commented out - All versions of VS2005 use the same standard install directory
 #
 ####################################################################################
@@ -5908,6 +5914,97 @@  RELEASE_ARMLINUXGCC_AARCH64_ASM_FLAGS   = $(ARCHASM_FLAGS) $(PLATFORM_FLAGS)
   DEBUG_ARMLINUXGCC_AARCH64_CC_FLAGS = $(ARCHCC_FLAGS) $(PLATFORM_FLAGS) DEF(GCC_AARCH64_CC_FLAGS) -Wno-address -O0
 RELEASE_ARMLINUXGCC_AARCH64_CC_FLAGS = $(ARCHCC_FLAGS) $(PLATFORM_FLAGS) DEF(GCC_AARCH64_CC_FLAGS) -Wno-address -Wno-unused-but-set-variable
 
+####################################################################################
+#
+# GCC for Windows host
+#
+####################################################################################
+*_WINGCC_*_*_FAMILY          = GCC
+*_WINGCC_*_*_BUILDRULEFAMILY = WINGCC
+
+*_WINGCC_*_MAKE_PATH         = make
+*_WINGCC_*_MAKE_FLAGS        = --no-print-directory
+
+##################
+# ASL definitions
+##################
+*_WINGCC_*_ASL_PATH           = DEF(WIN_IASL_BIN)
+*_WINGCC_*_ASL_FLAGS          = -tc -li
+*_WINGCC_*_ASL_OUTFLAGS       = DEF(DEFAULT_WIN_ASL_OUTFLAGS)
+*_WINGCC_*_ASLPP_FLAGS        = $(ARCHCC_FLAGS)
+*_WINGCC_*_ASLCC_FLAGS        = $(ARCHCC_FLAGS)
+
+##################
+# ARM definitions
+##################
+
+*_WINGCC_ARM_CC_PATH         = ENV(WINGCC_ARM_PREFIX)gcc
+*_WINGCC_ARM_SLINK_PATH      = ENV(WINGCC_ARM_PREFIX)ar
+*_WINGCC_ARM_DLINK_PATH      = ENV(WINGCC_ARM_PREFIX)ld
+*_WINGCC_ARM_ASM_PATH        = ENV(WINGCC_ARM_PREFIX)as
+*_WINGCC_ARM_PP_PATH         = ENV(WINGCC_ARM_PREFIX)gcc
+*_WINGCC_ARM_VFRPP_PATH      = ENV(WINGCC_ARM_PREFIX)gcc
+*_WINGCC_ARM_ASLCC_PATH      = ENV(WINGCC_ARM_PREFIX)gcc
+*_WINGCC_ARM_ASLDLINK_PATH   = ENV(WINGCC_ARM_PREFIX)ld
+*_WINGCC_ARM_ASLPP_PATH      = ENV(WINGCC_ARM_PREFIX)gcc
+
+#
+# Use default values, or override in DSC file
+#
+*_WINGCC_ARM_ARCHCC_FLAGS    = -mthumb
+*_WINGCC_ARM_ARCHASM_FLAGS   =
+*_WINGCC_ARM_ARCHDLINK_FLAGS =
+*_WINGCC_ARM_PLATFORM_FLAGS  = -march=armv7-a
+*_WINGCC_ARM_PP_FLAGS        = $(ARCHCC_FLAGS) $(PLATFORM_FLAGS) -E -x assembler-with-cpp -include $(DEST_DIR_DEBUG)/AutoGen.h
+*_WINGCC_ARM_RC_FLAGS        = DEF(GCC_ARM_RC_FLAGS)
+*_WINGCC_ARM_VFRPP_FLAGS     = $(ARCHCC_FLAGS) $(PLATFORM_FLAGS) DEF(GCC_VFRPP_FLAGS)
+*_WINGCC_ARM_SLINK_FLAGS     = -cr
+*_WINGCC_ARM_DLINK_FLAGS     =  $(ARCHDLINK_FLAGS) DEF(GCC_ARM_AARCH64_DLINK_COMMON) --oformat=elf32-littlearm
+*_WINGCC_ARM_ASLDLINK_FLAGS  = DEF(GCC_ARM_AARCH64_DLINK_COMMON) --oformat=elf32-littlearm
+
+  DEBUG_WINGCC_ARM_ASM_FLAGS = $(ARCHASM_FLAGS) $(PLATFORM_FLAGS) -mlittle-endian -g
+RELEASE_WINGCC_ARM_ASM_FLAGS = $(ARCHASM_FLAGS) $(PLATFORM_FLAGS) -mlittle-endian
+
+  DEBUG_WINGCC_ARM_CC_FLAGS = $(ARCHCC_FLAGS) $(PLATFORM_FLAGS) DEF(GCC_ARM_CC_FLAGS) -fno-stack-protector -O0 -mno-unaligned-access
+RELEASE_WINGCC_ARM_CC_FLAGS = $(ARCHCC_FLAGS) $(PLATFORM_FLAGS) DEF(GCC_ARM_CC_FLAGS) -fno-stack-protector -Wno-unused-but-set-variable -mno-unaligned-access
+
+######################
+# AArch64 definitions
+######################
+# AARCH64 64bit ARM GNU/Linux GCC (ARM Architecture 64)
+
+*_WINGCC_AARCH64_CC_PATH         = ENV(WINGCC_AARCH64_PREFIX)gcc
+*_WINGCC_AARCH64_SLINK_PATH      = ENV(WINGCC_AARCH64_PREFIX)ar
+*_WINGCC_AARCH64_DLINK_PATH      = ENV(WINGCC_AARCH64_PREFIX)ld
+*_WINGCC_AARCH64_ASM_PATH        = ENV(WINGCC_AARCH64_PREFIX)as
+*_WINGCC_AARCH64_PP_PATH         = ENV(WINGCC_AARCH64_PREFIX)gcc
+*_WINGCC_AARCH64_VFRPP_PATH      = ENV(WINGCC_AARCH64_PREFIX)gcc
+*_WINGCC_AARCH64_ASLCC_PATH      = ENV(WINGCC_AARCH64_PREFIX)gcc
+*_WINGCC_AARCH64_ASLDLINK_PATH   = ENV(WINGCC_AARCH64_PREFIX)ld
+*_WINGCC_AARCH64_ASLPP_PATH      = ENV(WINGCC_AARCH64_PREFIX)gcc
+
+#
+# Use default values, or override in DSC file
+#
+*_WINGCC_AARCH64_ARCHCC_FLAGS    =
+*_WINGCC_AARCH64_ARCHASM_FLAGS   =
+*_WINGCC_AARCH64_ARCHDLINK_FLAGS =
+*_WINGCC_AARCH64_PLATFORM_FLAGS  =
+*_WINGCC_AARCH64_PP_FLAGS        = $(ARCHCC_FLAGS) $(PLATFORM_FLAGS) -E -x assembler-with-cpp -include $(DEST_DIR_DEBUG)/AutoGen.h
+*_WINGCC_AARCH64_RC_FLAGS        = DEF(GCC_ARM_RC_FLAGS)
+*_WINGCC_AARCH64_VFRPP_FLAGS     = $(ARCHCC_FLAGS) $(PLATFORM_FLAGS) DEF(GCC_VFRPP_FLAGS)
+*_WINGCC_AARCH64_SLINK_FLAGS     = -cr
+*_WINGCC_AARCH64_DLINK_FLAGS     =  $(ARCHDLINK_FLAGS) DEF(GCC_ARM_AARCH64_DLINK_COMMON) --oformat=elf64-littleaarch64
+*_WINGCC_AARCH64_ASLDLINK_FLAGS  = DEF(GCC_ARM_AARCH64_ASLDLINK_FLAGS)
+
+  DEBUG_WINGCC_AARCH64_ASM_FLAGS = $(ARCHASM_FLAGS) $(PLATFORM_FLAGS) -mlittle-endian -g
+RELEASE_WINGCC_AARCH64_ASM_FLAGS = $(ARCHASM_FLAGS) $(PLATFORM_FLAGS) -mlittle-endian
+
+  DEBUG_WINGCC_AARCH64_CC_FLAGS = $(ARCHCC_FLAGS) $(PLATFORM_FLAGS) DEF(GCC_AARCH64_CC_FLAGS) -O0
+RELEASE_WINGCC_AARCH64_CC_FLAGS = $(ARCHCC_FLAGS) $(PLATFORM_FLAGS) DEF(GCC_AARCH64_CC_FLAGS) -Wno-unused-but-set-variable
+
+
+
 #################
 # ASM 16 linker defintions
 #################