I installed the latest Cygwin to test EDK2 builds. One problem is
lack of Cygwin build instructions. Based on what I see, the Cygwin
should run from Windows shell and not bash shell. Here are the
commands I tried:
set CYGWIN_HOME=D:\tmp\cygwin64
set NASM_PREFIX=D:\edk2build\tools\nasm211\
cd /d D:\edk2build\edk2
Edk2Setup.bat
build.exe -p ShellPkg\ShellPkg.dsc -b RELEASE -t CYGGCC -n 16 -a IA32
The first problem with the existing Cygwin setup is that it does not
support Win64. That is because:
*_CYGGCC_*_MAKE_PATH = DEF(MS_VS_BIN)\nmake.exe
.. resolves to a hard-coded path Win32 path:
C:\Program Files\Microsoft Visual Studio 8\Vc\bin
.. which does not exist on Win64 machines (my recent proposal to replace
hard coded Windows paths with EV references was rejected).
I don't see much point in setting up a Win32 test because quite a few
Windows users have switched to Win64. So instead I work around this
problem by modifying the hard-coded path. The next problem is:
NMAKE : fatal error U1077:
'"c:/cygwin/opt/tiano/i386-tiano-pe/i386-tiano-pe/bin/gcc"'
Another hard-coded Windows path. The name suggests a custom built gcc. Cygwin
doesn't ship with a compiler by this name. To work around I change it to the
Cygwin
native gcc 4.8.3 compiler and try again:
cc1.exe: error while loading shared libraries: ?: cannot open shared object
file
To resolve this, I add to the Path:
set path=D:\tmp\cygwin64\usr\i686-pc-cygwin\sys-root\usr\bin;%Path%
Next problem:
cygwin warning:
MS-DOS style path detected:
d:\edk2build\edk2\ShellPkg\Library\UefiFileHandleLib\UefiFileHandleLib.c
Preferred POSIX equivalent is:
/cygdrive/d/edk2build/edk2/ShellPkg/Library/UefiFileHandleLib/UefiFileHandleLib.c
CYGWIN environment variable option "nodosfilewarning" turns off this warning.
Consult the user's guide for more details about POSIX paths:
http://cygwin.com/cygwin-ug-net/using.html#using-pathnames
Solution: set CYGWIN=nodosfilewarning
Next problem: The first C file compiles without any error logged, yet
gcc comes back with return code 1 and no object file is written. The
cause is not obvious.
Next I try from the Cygwin bash shell:
$ cd /cygdrive/d/edk2build/edk2
. edksetup.sh
$ build -p ShellPkg/ShellPkg.dsc -b RELEASE -t CYGGCC -n 16 -a IA32
Result is:
build.py...
: error 7000: Failed to start command
C:\WINDDK\3790.1830\bin\x86\nmake.exe
Same happens if Cygwin make is used:
build.py...
: error 7000: Failed to start command
c:/cygwin/bin\make.exe
Work around: change tools_def: use cygwin style paths:
DEFINE CYGWIN_BIN = /cygdrive/d/tmp/cygwin64/bin/
DEFINE CYGWIN_BINIA32 = /cygdrive/d/tmp/cygwin64/bin/
DEFINE CYGWIN_BINX64 = /cygdrive/d/tmp/cygwin64/bin/
etc
Result is better. Some C files compile, then:
/cygdrive/d/edk2build/edk2/Build/Shell/RELEASE_CYGGCC/IA32/MdePkg/Library/BaseLib/BaseLib/OUTPUT/Ia32/EnablePaging64.iii:40:
Error: unsupported instruction `mov'
I need to set this test aside for the moment. I am sure Cygwin
can be made to work. But it seems like quite a few changes are
needed. Disclaimer: I don't use Cygwin much. maybe someone more
familiar with Cygwin could get it going more easily.
Thanks,
Scott
-----Original Message-----
From: Gao, Liming [mailto:[email protected]]
Sent: Friday, October 24, 2014 04:57 AM
To: [email protected]
Subject: Re: [edk2] EDK2 Developer Tools for Windows
Jordan:
Before deprecate those tool chains, I still want to make them work with the
updated Build Tools.
If there is no one to use them, I think we can remove them. Could you raise
your proposal in this mail list to collect more feedbacks?
Thanks
Liming
-----Original Message-----
From: Jordan Justen [mailto:[email protected]]
Sent: Friday, October 24, 2014 8:27 AM
To: [email protected]
Subject: Re: [edk2] EDK2 Developer Tools for Windows
On Thu, Oct 23, 2014 at 6:46 AM, Gao, Liming <[email protected]> wrote:
> 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.
Can we change CYGGCC like this?
I basically think CYGGCC is pointless, but I thought that the strange fact that
it used nmake was one of the main characteristics of it.
And, if we can change a toolchain so drastically, why can't we deprecate
toolchains? (For example, I think we should just deprecate CYGGCC and ELFGCC...)
-Jordan
> Next, could you create the full patch and send it for review?
>
> Thanks
> Liming
> -----Original Message-----
> From: Scott Duplichan [mailto:[email protected]]
> Sent: Wednesday, October 22, 2014 12:04 PM
> To: [email protected]
> 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:[email protected]]
> Sent: Tuesday, October 21, 2014 10:21 PM
> To: [email protected]
> 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:[email protected]]
> Sent: Wednesday, October 22, 2014 3:28 AM
> To: [email protected]
> 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\S
> hell\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:[email protected]]
> Sent: Tuesday, October 21, 2014 04:27 AM
> To: [email protected]
> 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:[email protected]]
> Sent: Tuesday, October 21, 2014 4:22 PM
> To: [email protected]
> 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:[email protected]]
> Sent: Tuesday, October 21, 2014 1:14 PM
> To: [email protected]
> 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
> [email protected]
> 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
> [email protected]
> 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
> [email protected]
> 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
> [email protected]
> 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
> [email protected]
> 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
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/edk2-devel
>
> ----------------------------------------------------------------------
> -------- _______________________________________________
> edk2-devel mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/edk2-devel
------------------------------------------------------------------------------
_______________________________________________
edk2-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/edk2-devel
------------------------------------------------------------------------------
_______________________________________________
edk2-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/edk2-devel
------------------------------------------------------------------------------
_______________________________________________
edk2-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/edk2-devel