BaseTools: Modify gcc 4.8 and 4.9 tool chain definition to support building from...
authorScott Duplichan <scott@notabs.org>
Tue, 18 Nov 2014 02:38:20 +0000 (02:38 +0000)
committerlgao4 <lgao4@Edk2>
Tue, 18 Nov 2014 02:38:20 +0000 (02:38 +0000)
Here is a new patch that adds Windows support for both gcc 4.8.x and gcc 4.9.x.
This time testing is more thorough: boot testing using Duet for all 4 combinations of
IA32/X64 and gcc 4.8.2 and gcc 4.9.1 passes. A Windows hosted gcc 4.8.2 has been added here:
http://sourceforge.net/projects/edk2developertoolsforwindows/

The environment variable settings for Windows look like:

set UEFI_BUILD_TOOLS=%cd%\tools
set NASM_PREFIX=%UEFI_BUILD_TOOLS%\nasm211\
set GCC48_BIN=%UEFI_BUILD_TOOLS%\gcc482-x86\bin\
set GCC48_DLL=%UEFI_BUILD_TOOLS%\gcc482-x86\dll\;%GCC48_BIN%
set GCC48_ARM_PREFIX=%UEFI_BUILD_TOOLS%\gcc482-arm\bin\
set GCC48_AARCH64_PREFIX=%UEFI_BUILD_TOOLS%\gcc482-aarch64\bin\
set GCC49_BIN=%UEFI_BUILD_TOOLS%\gcc491-x86\bin\
set GCC49_DLL=%UEFI_BUILD_TOOLS%\gcc491-x86\dll\;%GCC49_BIN%
set GCC49_ARM_PREFIX=%UEFI_BUILD_TOOLS%\gcc491-arm\bin\
set GCC49_AARCH64_PREFIX=%UEFI_BUILD_TOOLS%\gcc491-aarch64\bin\

No change is needed for building from Linux.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Scott Duplichan <scott@notabs.org>
Reviewed-by: Liming Gao <liming.gao@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16400 6f19259b-4bc3-4df7-8a09-765794883524

BaseTools/Conf/build_rule.template
BaseTools/Conf/tools_def.template
BaseTools/Source/Python/AutoGen/GenMake.py

index 496fd66..f1edf3a 100644 (file)
     <Command.GCC, Command.RVCT>\r
         # For RVCTCYGWIN CC_FLAGS must be first to work around pathing issues\r
         "$(CC)" $(CC_FLAGS) -o ${dst} $(INC) ${src}\r
-        "$(SYMRENAME)" $(SYMRENAME_FLAGS) ${dst}\r
 \r
     <Command.ARMGCC, Command.ARMLINUXGCC, command.XCODE>\r
         "$(CC)" $(CC_FLAGS) -o ${dst} $(INC) ${src}\r
 \r
+[C-Code-File.COMMON.IPF]\r
+    <InputFile>\r
+        ?.c\r
+        ?.C\r
+        ?.cc\r
+        ?.CC\r
+        ?.cpp\r
+        ?.Cpp\r
+        ?.CPP\r
+\r
+    <ExtraDependency>\r
+        $(MAKE_FILE)\r
+\r
+    <OutputFile>\r
+        $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.obj\r
+\r
+    <Command.MSFT, Command.INTEL>\r
+        "$(CC)" /Fo${dst} $(CC_FLAGS) $(INC) ${src}\r
+\r
+    <Command.GCC, Command.RVCT>\r
+        # For RVCTCYGWIN CC_FLAGS must be first to work around pathing issues\r
+        "$(CC)" $(CC_FLAGS) -o ${dst} $(INC) ${src}\r
+        "$(SYMRENAME)" $(SYMRENAME_FLAGS) ${dst}\r
 \r
 [C-Header-File]\r
     <InputFile>\r
index 45cfaff..302a90e 100644 (file)
@@ -179,11 +179,11 @@ DEFINE GCC46_X64_PREFIX        = /usr/bin/
 DEFINE GCC47_IA32_PREFIX       = /usr/bin/\r
 DEFINE GCC47_X64_PREFIX        = /usr/bin/\r
 \r
-DEFINE GCC48_IA32_PREFIX       = /usr/bin/\r
-DEFINE GCC48_X64_PREFIX        = /usr/bin/\r
+DEFINE GCC48_IA32_PREFIX       = ENV(GCC48_BIN)\r
+DEFINE GCC48_X64_PREFIX        = ENV(GCC48_BIN)\r
 \r
-DEFINE GCC49_IA32_PREFIX       = /usr/bin/\r
-DEFINE GCC49_X64_PREFIX        = /usr/bin/\r
+DEFINE GCC49_IA32_PREFIX       = ENV(GCC49_BIN)\r
+DEFINE GCC49_X64_PREFIX        = ENV(GCC49_BIN)\r
 \r
 DEFINE UNIX_IASL_BIN           = ENV(IASL_PREFIX)iasl\r
 DEFINE WIN_ASL_BIN_DIR         = C:\ASL\r
@@ -333,14 +333,14 @@ DEFINE SOURCERY_CYGWIN_TOOLS = /cygdrive/c/Program Files/CodeSourcery/Sourcery G
 #                             Required to build platforms or ACPI tables:\r
 #                               Intel(r) ACPI Compiler v20101013 from\r
 #                               http://www.acpica.org/downloads/previous_releases.php\r
-#   GCC48       -Linux-  Requires:\r
-#                             GCC 4.8\r
+#   GCC48       -Linux,Windows-  Requires:\r
+#                             GCC 4.8 targeting x86_64-linux-gnu\r
 #                        Optional:\r
 #                             Required to build platforms or ACPI tables:\r
 #                               Intel(r) ACPI Compiler v20101013 from\r
 #                               http://www.acpica.org/downloads/previous_releases.php\r
-#   GCC49       -Linux-  Requires:\r
-#                             GCC 4.9\r
+#   GCC49       -Linux,Windows-  Requires:\r
+#                             GCC 4.9 targeting x86_64-linux-gnu\r
 #                        Optional:\r
 #                             Required to build platforms or ACPI tables:\r
 #                               Intel(r) ACPI Compiler v20101013 from\r
@@ -4367,7 +4367,8 @@ RELEASE_GCC47_AARCH64_CC_FLAGS   = DEF(GCC47_AARCH64_CC_FLAGS) -Wno-unused-but-s
 ####################################################################################\r
 *_GCC48_*_*_FAMILY               = GCC\r
 \r
-*_GCC48_*_MAKE_PATH                    = make\r
+*_GCC48_*_MAKE_PATH                    = DEF(GCC48_IA32_PREFIX)make\r
+*_GCC48_*_*_DLL                        = ENV(GCC48_DLL)\r
 *_GCC48_*_ASL_PATH                     = DEF(UNIX_IASL_BIN)\r
 \r
 *_GCC48_*_PP_FLAGS                     = DEF(GCC_PP_FLAGS)\r
@@ -4489,7 +4490,8 @@ RELEASE_GCC48_AARCH64_CC_FLAGS   = DEF(GCC48_AARCH64_CC_FLAGS) -Wno-unused-but-s
 ####################################################################################\r
 *_GCC49_*_*_FAMILY               = GCC\r
 \r
-*_GCC49_*_MAKE_PATH                    = make\r
+*_GCC49_*_MAKE_PATH                    = DEF(GCC49_IA32_PREFIX)make\r
+*_GCC49_*_*_DLL                        = ENV(GCC49_DLL)\r
 *_GCC49_*_ASL_PATH                     = DEF(UNIX_IASL_BIN)\r
 \r
 *_GCC49_*_PP_FLAGS                     = DEF(GCC_PP_FLAGS)\r
index 50bee0d..edbf243 100644 (file)
@@ -679,7 +679,8 @@ cleanlib:
                     NewFile = self.PlaceMacro(str(F), self.Macros)\r
                     # In order to use file list macro as dependency\r
                     if T.GenListFile:\r
-                        self.ListFileMacros[T.ListFileMacro].append(str(F))\r
+                        # gnu tools need forward slash path separater, even on Windows\r
+                        self.ListFileMacros[T.ListFileMacro].append(str(F).replace ('\\', '/'))\r
                         self.FileListMacros[T.FileListMacro].append(NewFile)\r
                     elif T.GenFileListMacro:\r
                         self.FileListMacros[T.FileListMacro].append(NewFile)\r