Hello Liming, OK, here is the patch:
BaseTools: Modify gcc 4.9 tool chain definition to support building from Windows. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Scott Duplichan <sc...@notabs.org> -- Index: BaseTools/Conf/build_rule.template =================================================================== --- BaseTools/Conf/build_rule.template (revision 16228) +++ BaseTools/Conf/build_rule.template (working copy) @@ -131,12 +131,34 @@ <Command.GCC, Command.RVCT> # For RVCTCYGWIN CC_FLAGS must be first to work around pathing issues "$(CC)" $(CC_FLAGS) -o ${dst} $(INC) ${src} - "$(SYMRENAME)" $(SYMRENAME_FLAGS) ${dst} <Command.ARMGCC, Command.ARMLINUXGCC, command.XCODE> "$(CC)" $(CC_FLAGS) -o ${dst} $(INC) ${src} +[C-Code-File.COMMON.IPF] + <InputFile> + ?.c + ?.C + ?.cc + ?.CC + ?.cpp + ?.Cpp + ?.CPP + <ExtraDependency> + $(MAKE_FILE) + + <OutputFile> + $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.obj + + <Command.MSFT, Command.INTEL> + "$(CC)" /Fo${dst} $(CC_FLAGS) $(INC) ${src} + + <Command.GCC, Command.RVCT> + # For RVCTCYGWIN CC_FLAGS must be first to work around pathing issues + "$(CC)" $(CC_FLAGS) -o ${dst} $(INC) ${src} + "$(SYMRENAME)" $(SYMRENAME_FLAGS) ${dst} + [C-Header-File] <InputFile> *.h, *.H Index: BaseTools/Conf/tools_def.template =================================================================== --- BaseTools/Conf/tools_def.template (revision 16228) +++ BaseTools/Conf/tools_def.template (working copy) @@ -182,8 +182,8 @@ DEFINE GCC48_IA32_PREFIX = /usr/bin/ DEFINE GCC48_X64_PREFIX = /usr/bin/ -DEFINE GCC49_IA32_PREFIX = /usr/bin/ -DEFINE GCC49_X64_PREFIX = /usr/bin/ +DEFINE GCC49_IA32_PREFIX = ENV(GCC49_BIN) +DEFINE GCC49_X64_PREFIX = ENV(GCC49_BIN) DEFINE UNIX_IASL_BIN = ENV(IASL_PREFIX)iasl DEFINE WIN_ASL_BIN_DIR = C:\ASL @@ -4489,7 +4489,8 @@ #################################################################################### *_GCC49_*_*_FAMILY = GCC -*_GCC49_*_MAKE_PATH = make +*_GCC49_*_MAKE_PATH = DEF(GCC49_IA32_PREFIX)make +*_GCC49_*_*_DLL = ENV(GCC49_DLL) *_GCC49_*_ASL_PATH = DEF(UNIX_IASL_BIN) *_GCC49_*_PP_FLAGS = DEF(GCC_PP_FLAGS) @@ -4613,7 +4614,7 @@ *_CYGGCC_*_*_FAMILY = GCC *_CYGGCC_*_*_DLL = DEF(CYGWIN_BIN) -*_CYGGCC_*_MAKE_PATH = DEF(MS_VS_BIN)\nmake.exe +*_CYGGCC_*_MAKE_PATH = DEF(CYGWIN_BIN)\make.exe *_CYGGCC_*_ASL_PATH = DEF(DEFAULT_WIN_ASL_BIN) *_CYGGCC_IA32_DLINK_FLAGS = DEF(GCC_IA32_X64_DLINK_FLAGS) --image-base=0 @@ -4720,7 +4721,7 @@ *_CYGGCCxASL_*_*_FAMILY = GCC *_CYGGCCxASL_*_*_DLL = DEF(CYGWIN_BIN) -*_CYGGCCxASL_*_MAKE_PATH = DEF(MS_VS_BIN)\nmake.exe +*_CYGGCCxASL_*_MAKE_PATH = DEF(CYGWIN_BIN)\make.exe *_CYGGCCxASL_*_MAKE_FLAGS = /nologo *_CYGGCCxASL_*_PP_FLAGS = -E -x assembler-with-cpp -include AutoGen.h Index: BaseTools/Source/Python/AutoGen/GenMake.py =================================================================== --- BaseTools/Source/Python/AutoGen/GenMake.py (revision 16228) +++ BaseTools/Source/Python/AutoGen/GenMake.py (working copy) @@ -679,7 +679,11 @@ NewFile = self.PlaceMacro(str(F), self.Macros) # In order to use file list macro as dependency if T.GenListFile: - self.ListFileMacros[T.ListFileMacro].append(str(F)) + # gnu tools need forward slash path separater, even on Windows + if self.PlatformInfo.ToolChainFamily in ('GCC'): + self.ListFileMacros[T.ListFileMacro].append(str(F).replace ('\\', '/')) + else: + self.ListFileMacros[T.ListFileMacro].append(str(F)) self.FileListMacros[T.FileListMacro].append(NewFile) elif T.GenFileListMacro: self.FileListMacros[T.FileListMacro].append(NewFile) -- Thanks, Scott -----Original Message----- From: Gao, Liming [mailto:liming....@intel.com] Sent: Thursday, October 23, 2014 08:46 AM To: edk2-devel@lists.sourceforge.net Subject: Re: [edk2] EDK2 Developer Tools for Windows Scott: Yes. GenMake.py change is also required. But, this change will impact CYGGCC tool chain. So, CYGGCC Make path should be changed to DEF(CYGWIN_BIN)\make.exe instead of DEF(MS_VS_BIN)\nmake.exe. Next, could you create the full patch and send it for review? Thanks Liming -----Original Message----- From: Scott Duplichan [mailto:sc...@notabs.org] Sent: Wednesday, October 22, 2014 12:04 PM To: edk2-devel@lists.sourceforge.net Subject: Re: [edk2] EDK2 Developer Tools for Windows Hello Liming, Ah, yes. Why didn't I think of that! I retested on Windows and Linux using your patch below and it all passes. The GenMake.py patch and the corresponding update of build.exe are still needed. Thanks, Scott -----Original Message----- From: Gao, Liming [mailto:liming....@intel.com] Sent: Tuesday, October 21, 2014 10:21 PM To: edk2-devel@lists.sourceforge.net Subject: Re: [edk2] EDK2 Developer Tools for Windows Scott: Could we configure GCC49_DLL like below to resolve this issue? set GCC49_DLL=D:\edk2build\tools\gcc491-x86\dll; D:\edk2build\tools\gcc491-x86\bin Thanks Liming -----Original Message----- From: Scott Duplichan [mailto:sc...@notabs.org] Sent: Wednesday, October 22, 2014 3:28 AM To: edk2-devel@lists.sourceforge.net Subject: Re: [edk2] EDK2 Developer Tools for Windows Hello Liming, The build_rule.template part of this revised patch looks good. It removes the need for the non-ipf symrename echo work around, and makes the build output easier to look at. The new tools_def.template patch almost works. I get an echo fail for Windows hosted ARM/AARCH64 builds: "echo" objcopy not needed for d:\edk2build\edk2\Build\Shell\RELEASE_GCC49\ARM\ShellPkg\Application\Shell\Shell\DEBUG\Shell.dll '"echo"' is not recognized as an internal or external command. One solution would be to treat Windows hosted builds of ARM/AARCH64 same as x86: let it invoke objcopy with no flags. Here is the reason the echo.exe in the gcc bin directory is no longer invoked: When the build system tries to invoke "echo", it adds only the gcc dll directory (*_GCC49_*_*_DLL) to the path. It does not add the gcc bin directory to the path. The original patch solves this problem by 'abusing' the purpose of *_GCC49_*_*_DLL and putting both DLL and BIN paths there. Other solutions are putting echo.exe in the DLL directory (confusing), or in the pre-existing path, or in BaseTools\Bin\Win32. But these methods add extra steps when setting up the build environment. IA32 X64 ARM ARCH64 Windows host pass pass fail fail Linux host pass pass Here are the commands I used for testing on Windows: cd /d D:\edk2build\edk2 Edk2Setup.bat set NASM_PREFIX=D:\edk2build\tools\nasm211\ set GCC49_BIN=D:\edk2build\tools\gcc491-x86\bin\ set GCC49_DLL=D:\edk2build\tools\gcc491-x86\dll\ set GCC49_ARM_PREFIX=D:\edk2build\tools\gcc491-arm\bin\ set GCC49_AARCH64_PREFIX=D:\edk2build\tools\gcc491-aarch64\bin\ build.exe -p ShellPkg\ShellPkg.dsc -b RELEASE -t GCC49 -n 16 -a IA32 build.exe -p ShellPkg\ShellPkg.dsc -b RELEASE -t GCC49 -n 16 -a X64 build.exe -p ShellPkg\ShellPkg.dsc -b RELEASE -t GCC49 -n 16 -a ARM build.exe -p ShellPkg\ShellPkg.dsc -b RELEASE -t GCC49 -n 16 -a AARCH64 Though I didn't test Linux hosted ARM/AARCH64 builds, they should still work. Thanks, Scott -----Original Message----- From: Gao, Liming [mailto:liming....@intel.com] Sent: Tuesday, October 21, 2014 04:27 AM To: edk2-devel@lists.sourceforge.net Subject: Re: [edk2] EDK2 Developer Tools for Windows Scott: Update the patch for BaseTools/Conf files. 1. Update build_rule.template to add the specific rule for IPF arch. Then, the specific echo is not required. 2. Update tools_def.template to configure GCC49_BIN and GCC49_DLL. It is the compatible change. Index: build_rule.template =================================================================== --- build_rule.template (revision 16124) +++ build_rule.template (working copy) @@ -131,12 +131,34 @@ <Command.GCC, Command.RVCT> # For RVCTCYGWIN CC_FLAGS must be first to work around pathing issues "$(CC)" $(CC_FLAGS) -o ${dst} $(INC) ${src} - "$(SYMRENAME)" $(SYMRENAME_FLAGS) ${dst} <Command.ARMGCC, Command.ARMLINUXGCC, command.XCODE> "$(CC)" $(CC_FLAGS) -o ${dst} $(INC) ${src} +[C-Code-File.COMMON.IPF] + <InputFile> + ?.c + ?.C + ?.cc + ?.CC + ?.cpp + ?.Cpp + ?.CPP + <ExtraDependency> + $(MAKE_FILE) + + <OutputFile> + $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.obj + + <Command.MSFT, Command.INTEL> + "$(CC)" /Fo${dst} $(CC_FLAGS) $(INC) ${src} + + <Command.GCC, Command.RVCT> + # For RVCTCYGWIN CC_FLAGS must be first to work around pathing issues + "$(CC)" $(CC_FLAGS) -o ${dst} $(INC) ${src} + "$(SYMRENAME)" $(SYMRENAME_FLAGS) ${dst} + [C-Header-File] <InputFile> *.h, *.H Index: tools_def.template =================================================================== --- tools_def.template (revision 16124) +++ tools_def.template (working copy) @@ -182,8 +182,8 @@ DEFINE GCC48_IA32_PREFIX = /usr/bin/ DEFINE GCC48_X64_PREFIX = /usr/bin/ -DEFINE GCC49_IA32_PREFIX = /usr/bin/ -DEFINE GCC49_X64_PREFIX = /usr/bin/ +DEFINE GCC49_IA32_PREFIX = ENV(GCC49_BIN) +DEFINE GCC49_X64_PREFIX = ENV(GCC49_BIN) DEFINE UNIX_IASL_BIN = ENV(IASL_PREFIX)iasl DEFINE WIN_ASL_BIN_DIR = C:\ASL @@ -4489,7 +4489,8 @@ #################################################################################### *_GCC49_*_*_FAMILY = GCC -*_GCC49_*_MAKE_PATH = make +*_GCC49_*_MAKE_PATH = DEF(GCC49_IA32_PREFIX)make +*_GCC49_*_*_DLL = ENV(GCC49_DLL) *_GCC49_*_ASL_PATH = DEF(UNIX_IASL_BIN) *_GCC49_*_PP_FLAGS = DEF(GCC_PP_FLAGS) Thanks Liming -----Original Message----- From: Gao, Liming [mailto:liming....@intel.com] Sent: Tuesday, October 21, 2014 4:22 PM To: edk2-devel@lists.sourceforge.net Subject: Re: [edk2] EDK2 Developer Tools for Windows Scott: I will download them and try again. For the patch, I provide another compatible version in previous mail. Have you any comment for it? Linux user doesn't need to set GCC49_BIN, GCC49_DLL env, because /usr/bin/ is the default system PATH. Windows user need to set GCC49_BIN, GCC49_DLL and IASL_PREFIX env to use this tool chain. Index: Conf/tools_def.template =================================================================== --- Conf/tools_def.template (revision 16124) +++ Conf/tools_def.template (working copy) @@ -182,8 +182,8 @@ DEFINE GCC48_IA32_PREFIX = /usr/bin/ DEFINE GCC48_X64_PREFIX = /usr/bin/ -DEFINE GCC49_IA32_PREFIX = /usr/bin/ -DEFINE GCC49_X64_PREFIX = /usr/bin/ +DEFINE GCC49_IA32_PREFIX = ENV(GCC49_BIN) +DEFINE GCC49_X64_PREFIX = ENV(GCC49_BIN) -*_GCC49_*_MAKE_PATH = make +*_GCC49_*_MAKE_PATH = DEF(GCC49_BIN)make +*_GCC49_*_*_DLL = DEF(GCC49_DLL) *_GCC49_*_ASL_PATH = DEF(UNIX_IASL_BIN) Thanks Liming -----Original Message----- From: Scott Duplichan [mailto:sc...@notabs.org] Sent: Tuesday, October 21, 2014 1:14 PM To: edk2-devel@lists.sourceforge.net Subject: [edk2] EDK2 Developer Tools for Windows Here are Windows hosted gcc tool chains for EDK2 builds: https://sourceforge.net/projects/edk2developertoolsforwindows/files/ I will add more readme files tomorrow. The tools build IA32, X64, IPF, ARM, and AARCH64 from Windows. X64 builds are well tested. I have not yet boot tested IA32 builds but plan to. I don't have a way to boot test IPF, ARM, and AARCH64 builds. Only gcc 4.9.1 tool chains are uploaded. Older gcc versions can be built if needed. A patch is included to add support for IA32, X64, ARM, and AARCH64. If there is any interest in IPF it can be added too. This patch "breaks" non-Windows builds. The fix is to execute: export GCC49_X86=/usr .. before building. I think logic needs to be added to edksetup.sh to set GCC49_X86 if it is not already set. Linux guys, what is the best way? Thanks, Scott ------------------------------------------------------------------------------ Comprehensive Server Monitoring with Site24x7. Monitor 10 servers for $9/Month. Get alerted through email, SMS, voice calls or mobile push notifications. Take corrective actions from your mobile device. http://p.sf.net/sfu/Zoho _______________________________________________ edk2-devel mailing list edk2-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/edk2-devel ------------------------------------------------------------------------------ Comprehensive Server Monitoring with Site24x7. Monitor 10 servers for $9/Month. Get alerted through email, SMS, voice calls or mobile push notifications. Take corrective actions from your mobile device. http://p.sf.net/sfu/Zoho _______________________________________________ edk2-devel mailing list edk2-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/edk2-devel ------------------------------------------------------------------------------ Comprehensive Server Monitoring with Site24x7. Monitor 10 servers for $9/Month. Get alerted through email, SMS, voice calls or mobile push notifications. Take corrective actions from your mobile device. http://p.sf.net/sfu/Zoho _______________________________________________ edk2-devel mailing list edk2-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/edk2-devel ------------------------------------------------------------------------------ Comprehensive Server Monitoring with Site24x7. Monitor 10 servers for $9/Month. Get alerted through email, SMS, voice calls or mobile push notifications. Take corrective actions from your mobile device. http://p.sf.net/sfu/Zoho _______________________________________________ edk2-devel mailing list edk2-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/edk2-devel ------------------------------------------------------------------------------ Comprehensive Server Monitoring with Site24x7. Monitor 10 servers for $9/Month. Get alerted through email, SMS, voice calls or mobile push notifications. Take corrective actions from your mobile device. http://p.sf.net/sfu/Zoho _______________________________________________ edk2-devel mailing list edk2-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/edk2-devel ------------------------------------------------------------------------------ Comprehensive Server Monitoring with Site24x7. Monitor 10 servers for $9/Month. Get alerted through email, SMS, voice calls or mobile push notifications. Take corrective actions from your mobile device. http://p.sf.net/sfu/Zoho _______________________________________________ edk2-devel mailing list edk2-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/edk2-devel ------------------------------------------------------------------------------ _______________________________________________ edk2-devel mailing list edk2-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/edk2-devel
win-gcc49.patch
Description: Binary data
------------------------------------------------------------------------------
_______________________________________________ edk2-devel mailing list edk2-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/edk2-devel