Re: [edk2] EmulatorPkg build issue with macOS mojave and Xcode 10

2019-01-16 Thread Gao, Liming
UG -
>I/Users/QianYun/Downloads/edk2/MdePkg -
>I/Users/QianYun/Downloads/edk2/MdePkg/Include -
>I/Users/QianYun/Downloads/edk2/MdePkg/Include/X64
>/Users/QianYun/Downloads/edk2/MdePkg/Library/BaseLib/SwitchStack.c
>
>master:
>clang -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
>-Wno-varargs -ftrap-
>function=undefined_behavior_has_been_optimized_away_by_clang -D
>NO_MSABI_VA_FUNCS  -o
>/Users/QianYun/Code/edk2/Build/Emulator/DEBUG_XCODE5/X64/MdePkg/Li
>brary/BaseLib/BaseLib/OUTPUT/./SwitchStack.obj -
>I/Users/QianYun/Code/edk2/MdePkg/Library/BaseLib/X64 -
>I/Users/QianYun/Code/edk2/MdePkg/Library/BaseLib -
>I/Users/QianYun/Code/edk2/Build/Emulator/DEBUG_XCODE5/X64/MdePkg/
>Library/BaseLib/BaseLib/DEBUG -I/Users/QianYun/Code/edk2/MdePkg -
>I/Users/QianYun/Code/edk2/MdePkg/Include -
>I/Users/QianYun/Code/edk2/MdePkg/Include/X64
>/Users/QianYun/Code/edk2/MdePkg/Library/BaseLib/SwitchStack.c
>
>Maybe we should add NO_MSABI_VA_FUNCS to avoid the error. Then i edit
>Conf/tools_def.txt DEBUG_XCODE32_X64_CC_FLAGS
>RELEASE_XCODE32_X64_CC_FLAGS to add this flag. then it success, but run
>failed
>
>> cd Build/EmulatorX64/DEBUG_XCODE5/X64
>> ./Host
>
>EDK II UNIX Host Emulation Environment from
>http://www.tianocore.org/edk2/
>  BootMode 0x00
>  OS Emulator passing in 128 KB of temp RAM at 0x10b00 to SEC
>MapFd0() Failed res =: Invalid argument
>ERROR : Can not open Firmware Device File ../FV/FV_RECOVERY.fd (7).  Exiting.
>
>Thanks for you help, i'll try to rebuild the toochain in UDK2018 or master
>branch, if there are some progress, i'll report my working condition.
>
>By the way, the gdb attach Host executable file cannot find
>the ../FV/FV_RECOVERY.fd file, so i have to enter the output directory and
>execute it, since that the current working directory of build.sh is
>edk2/EmulatorPkg, Maybe we can fix it for the more convenient debugging
>
>Thanks
>ChasonTang
>
>  -- Original --From:  "Gao,
>Liming";Date:  Wed, Jan 16, 2019 11:33 PMTo:  "Gao,
>Liming"; "唐佳诚";
>"edk2-devel"; Subject:  RE: [edk2] EmulatorPkg
>build issue with macOS mojave and Xcode 10 Hi,
>  I do the minimal change in Edk2 to make sure EmulatorPkg pass build in MAC.
>Here is the code https://github.com/lgao4/edk2/tree/XcodeEmulator. Please
>try to verify its functionality. If you request add this support, please enter 
>one
>BZ (https://bugzilla.tianocore.org) for it.
>
>Thanks
>Liming
>> -Original Message-
>> From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of
>Gao, Liming
>> Sent: Wednesday, January 16, 2019 12:10 AM
>> To: 唐佳诚 ; edk2-devel de...@lists.01.org>
>> Subject: Re: [edk2] EmulatorPkg build issue with macOS mojave and Xcode
>10
>>
>> I check the history. EmulatorPkg doesn't support macOS. EmulatorePkg
>depends on XCODE32 tool chain to generate the host application.
>> But, XCODE32 tool chain has been removed at edk2
>f7bd152c2a05bd75471305184c25f14f01ccf0b7.
>>
>> I just try to add back this change, and call build.sh without the change. I
>meet with new issue. Seemly, I need to install XQuartz. I will
>> continue to try it. Besides, I suggest you directly use edk2 master instead 
>> of
>UDK2018 branch. If I do some fix, you can directly get it.
>>
>>
>/Users/tiano/lgao4/AllPkg/Edk2/EmulatorPkg/Unix/Host/X11GraphicsWindo
>w.c:21:10: fatal error: 'X11/Xlib.h' file not found
>>
>> Thanks
>> Liming
>> > -Original Message-
>> > From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of
>唐佳诚
>> > Sent: Tuesday, January 15, 2019 10:57 AM
>> > To: edk2-devel 
>> > Subject: [edk2] EmulatorPkg build issue with macOS mojave and Xcode 10
>> >
>> > Hi Dear EmulatorPkg Maintainer:
>> >   I'm a newbie at this, I am sorry for the wrong format of the previous 
>> > mail.
>There are some issue when building EmulatorPkg. Any
>> > inspiration or help will appreciated!
>> >
>> > OS Environment: macOS mojave with Xcode 10 command line tool and
>installed macOS_SDK_headers_for_macOS_10.14.pkg
>> > Download edk2-UDK2018.zip
>> > Initializing workspace
>> > > source ./edk2setup.sh
>> >
>> > WORKSPACE: /Users/QianYun/Downloads/edk2-vUDK2018
>> > EDK_TOOLS_PATH: /Users/QianYun/Downloads/edk2-
>vUDK2018/BaseToo

Re: [edk2] EmulatorPkg build issue with macOS mojave and Xcode 10

2019-01-16 Thread 唐佳诚
ode/edk2/MdePkg/Library/BaseLib 
-I/Users/QianYun/Code/edk2/Build/Emulator/DEBUG_XCODE5/X64/MdePkg/Library/BaseLib/BaseLib/DEBUG
 -I/Users/QianYun/Code/edk2/MdePkg -I/Users/QianYun/Code/edk2/MdePkg/Include 
-I/Users/QianYun/Code/edk2/MdePkg/Include/X64 
/Users/QianYun/Code/edk2/MdePkg/Library/BaseLib/SwitchStack.c

Maybe we should add NO_MSABI_VA_FUNCS to avoid the error. Then i edit 
Conf/tools_def.txt DEBUG_XCODE32_X64_CC_FLAGS RELEASE_XCODE32_X64_CC_FLAGS to 
add this flag. then it success, but run failed

> cd Build/EmulatorX64/DEBUG_XCODE5/X64
> ./Host

EDK II UNIX Host Emulation Environment from http://www.tianocore.org/edk2/
  BootMode 0x00
  OS Emulator passing in 128 KB of temp RAM at 0x10b00 to SEC
MapFd0() Failed res =: Invalid argument
ERROR : Can not open Firmware Device File ../FV/FV_RECOVERY.fd (7).  Exiting.

Thanks for you help, i'll try to rebuild the toochain in UDK2018 or master 
branch, if there are some progress, i'll report my working condition.

By the way, the gdb attach Host executable file cannot find the 
../FV/FV_RECOVERY.fd file, so i have to enter the output directory and execute 
it, since that the current working directory of build.sh is edk2/EmulatorPkg, 
Maybe we can fix it for the more convenient debugging

Thanks
ChasonTang

  -- Original --From:  "Gao, 
Liming";Date:  Wed, Jan 16, 2019 11:33 PMTo:  "Gao, 
Liming"; "唐佳诚"; 
"edk2-devel"; Subject:  RE: [edk2] EmulatorPkg build 
issue with macOS mojave and Xcode 10 Hi, 
  I do the minimal change in Edk2 to make sure EmulatorPkg pass build in MAC. 
Here is the code https://github.com/lgao4/edk2/tree/XcodeEmulator. Please try 
to verify its functionality. If you request add this support, please enter one 
BZ (https://bugzilla.tianocore.org) for it. 

Thanks
Liming
> -Original Message-
> From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of Gao, 
> Liming
> Sent: Wednesday, January 16, 2019 12:10 AM
> To: 唐佳诚 ; edk2-devel 
> Subject: Re: [edk2] EmulatorPkg build issue with macOS mojave and Xcode 10
> 
> I check the history. EmulatorPkg doesn't support macOS. EmulatorePkg depends 
> on XCODE32 tool chain to generate the host application.
> But, XCODE32 tool chain has been removed at edk2 
> f7bd152c2a05bd75471305184c25f14f01ccf0b7.
> 
> I just try to add back this change, and call build.sh without the change. I 
> meet with new issue. Seemly, I need to install XQuartz. I will
> continue to try it. Besides, I suggest you directly use edk2 master instead 
> of UDK2018 branch. If I do some fix, you can directly get it.
> 
> /Users/tiano/lgao4/AllPkg/Edk2/EmulatorPkg/Unix/Host/X11GraphicsWindow.c:21:10:
>  fatal error: 'X11/Xlib.h' file not found
> 
> Thanks
> Liming
> > -Original Message-
> > From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of 唐佳诚
> > Sent: Tuesday, January 15, 2019 10:57 AM
> > To: edk2-devel 
> > Subject: [edk2] EmulatorPkg build issue with macOS mojave and Xcode 10
> >
> > Hi Dear EmulatorPkg Maintainer:
> >   I'm a newbie at this, I am sorry for the wrong format of the previous 
> > mail. There are some issue when building EmulatorPkg. Any
> > inspiration or help will appreciated!
> >
> > OS Environment: macOS mojave with Xcode 10 command line tool and installed 
> > macOS_SDK_headers_for_macOS_10.14.pkg
> > Download edk2-UDK2018.zip
> > Initializing workspace
> > > source ./edk2setup.sh
> >
> > WORKSPACE: /Users/QianYun/Downloads/edk2-vUDK2018
> > EDK_TOOLS_PATH: /Users/QianYun/Downloads/edk2-vUDK2018/BaseTools
> > CONF_PATH: /Users/QianYun/Downloads/edk2-vUDK2018/Conf
> > Copying $EDK_TOOLS_PATH/Conf/build_rule.template
> >  to /Users/QianYun/Downloads/edk2-vUDK2018/Conf/build_rule.txt
> > Copying $EDK_TOOLS_PATH/Conf/tools_def.template
> >  to /Users/QianYun/Downloads/edk2-vUDK2018/Conf/tools_def.txt
> > Copying $EDK_TOOLS_PATH/Conf/target.template
> >  to /Users/QianYun/Downloads/edk2-vUDK2018/Conf/target.txt
> >
> > > cd EmulatorPkg && ./build.sh
> >
> > The BaseTools will build successfully, and EmulatorPkg will fail to build.
> >
> > 'import sitecustomize' failed; use -v for traceback
> > Build environment: Darwin-18.2.0-x86_64-i386-64bit
> > Build start time: 15:10:45, Jan.14 2019
> >
> > WORKSPACE= /Users/QianYun/Downloads/edk2-vUDK2018
> > ECP_SOURCE   = 
> > /Users/QianYun/Downloads/edk2-vUDK2018/EdkCompatibilityPkg
> > EDK_SOURCE   = 
> > /Users/QianYun/Downloads/edk2-vUDK2018/EdkCompatibilityPkg
> > EFI_SOURCE   = 
> > /Users/QianYun/Downloads/edk2-vUDK2018/EdkCompatibilityPkg
> > EDK_TOOLS_PATH   = /Us

Re: [edk2] EmulatorPkg build issue with macOS mojave and Xcode 10

2019-01-16 Thread 唐佳诚
hStack.c

Maybe we should add NO_MSABI_VA_FUNCS to avoid the error. Then i edit 
Conf/tools_def.txt DEBUG_XCODE32_X64_CC_FLAGS RELEASE_XCODE32_X64_CC_FLAGS to 
add this flag. then it success, but run failed

> cd Build/EmulatorX64/DEBUG_XCODE5/X64
> ./Host

EDK II UNIX Host Emulation Environment from http://www.tianocore.org/edk2/
  BootMode 0x00
  OS Emulator passing in 128 KB of temp RAM at 0x10b00 to SEC
MapFd0() Failed res =: Invalid argument
ERROR : Can not open Firmware Device File ../FV/FV_RECOVERY.fd (7).  Exiting.

Thanks for you help, i'll try to rebuild the toochain in UDK2018 or master 
branch, if there are some progress, i'll report my working condition.

By the way, the gdb attach Host executable file cannot find the 
../FV/FV_RECOVERY.fd file, so i have to enter the output directory and execute 
it, since that the current working directory of build.sh is edk2/EmulatorPkg, 
Maybe we can fix it for the more convenient debugging

Thanks
ChasonTang

  -- Original --From:  "Gao, 
Liming";Date:  Wed, Jan 16, 2019 11:33 PMTo:  "Gao, 
Liming"; "唐佳诚"; 
"edk2-devel"; Subject:  RE: [edk2] EmulatorPkg build 
issue with macOS mojave and Xcode 10 Hi, 
  I do the minimal change in Edk2 to make sure EmulatorPkg pass build in MAC. 
Here is the code https://github.com/lgao4/edk2/tree/XcodeEmulator. Please try 
to verify its functionality. If you request add this support, please enter one 
BZ (https://bugzilla.tianocore.org) for it. 

Thanks
Liming
> -Original Message-
> From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of Gao, 
> Liming
> Sent: Wednesday, January 16, 2019 12:10 AM
> To: 唐佳诚 ; edk2-devel 
> Subject: Re: [edk2] EmulatorPkg build issue with macOS mojave and Xcode 10
> 
> I check the history. EmulatorPkg doesn't support macOS. EmulatorePkg depends 
> on XCODE32 tool chain to generate the host application.
> But, XCODE32 tool chain has been removed at edk2 
> f7bd152c2a05bd75471305184c25f14f01ccf0b7.
> 
> I just try to add back this change, and call build.sh without the change. I 
> meet with new issue. Seemly, I need to install XQuartz. I will
> continue to try it. Besides, I suggest you directly use edk2 master instead 
> of UDK2018 branch. If I do some fix, you can directly get it.
> 
> /Users/tiano/lgao4/AllPkg/Edk2/EmulatorPkg/Unix/Host/X11GraphicsWindow.c:21:10:
>  fatal error: 'X11/Xlib.h' file not found
> 
> Thanks
> Liming
> > -Original Message-
> > From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of 唐佳诚
> > Sent: Tuesday, January 15, 2019 10:57 AM
> > To: edk2-devel 
> > Subject: [edk2] EmulatorPkg build issue with macOS mojave and Xcode 10
> >
> > Hi Dear EmulatorPkg Maintainer:
> >   I'm a newbie at this, I am sorry for the wrong format of the previous 
> > mail. There are some issue when building EmulatorPkg. Any
> > inspiration or help will appreciated!
> >
> > OS Environment: macOS mojave with Xcode 10 command line tool and installed 
> > macOS_SDK_headers_for_macOS_10.14.pkg
> > Download edk2-UDK2018.zip
> > Initializing workspace
> > > source ./edk2setup.sh
> >
> > WORKSPACE: /Users/QianYun/Downloads/edk2-vUDK2018
> > EDK_TOOLS_PATH: /Users/QianYun/Downloads/edk2-vUDK2018/BaseTools
> > CONF_PATH: /Users/QianYun/Downloads/edk2-vUDK2018/Conf
> > Copying $EDK_TOOLS_PATH/Conf/build_rule.template
> >  to /Users/QianYun/Downloads/edk2-vUDK2018/Conf/build_rule.txt
> > Copying $EDK_TOOLS_PATH/Conf/tools_def.template
> >  to /Users/QianYun/Downloads/edk2-vUDK2018/Conf/tools_def.txt
> > Copying $EDK_TOOLS_PATH/Conf/target.template
> >  to /Users/QianYun/Downloads/edk2-vUDK2018/Conf/target.txt
> >
> > > cd EmulatorPkg && ./build.sh
> >
> > The BaseTools will build successfully, and EmulatorPkg will fail to build.
> >
> > 'import sitecustomize' failed; use -v for traceback
> > Build environment: Darwin-18.2.0-x86_64-i386-64bit
> > Build start time: 15:10:45, Jan.14 2019
> >
> > WORKSPACE= /Users/QianYun/Downloads/edk2-vUDK2018
> > ECP_SOURCE   = 
> > /Users/QianYun/Downloads/edk2-vUDK2018/EdkCompatibilityPkg
> > EDK_SOURCE   = 
> > /Users/QianYun/Downloads/edk2-vUDK2018/EdkCompatibilityPkg
> > EFI_SOURCE   = 
> > /Users/QianYun/Downloads/edk2-vUDK2018/EdkCompatibilityPkg
> > EDK_TOOLS_PATH   = /Users/QianYun/Downloads/edk2-vUDK2018/BaseTools
> > CONF_PATH= /Users/QianYun/Downloads/edk2-vUDK2018/Conf
> > build: : warning: Tool chain [XCODE32] is not defined
> >
> >
> > build.py...
> >  : error 4000: Not available
> > [XCODE32] not defined. No toolchain ava

Re: [edk2] EmulatorPkg build issue with macOS mojave and Xcode 10

2019-01-16 Thread Gao, Liming
Hi, 
  I do the minimal change in Edk2 to make sure EmulatorPkg pass build in MAC. 
Here is the code https://github.com/lgao4/edk2/tree/XcodeEmulator. Please try 
to verify its functionality. If you request add this support, please enter one 
BZ (https://bugzilla.tianocore.org) for it. 

Thanks
Liming
> -Original Message-
> From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of Gao, 
> Liming
> Sent: Wednesday, January 16, 2019 12:10 AM
> To: 唐佳诚 ; edk2-devel 
> Subject: Re: [edk2] EmulatorPkg build issue with macOS mojave and Xcode 10
> 
> I check the history. EmulatorPkg doesn't support macOS. EmulatorePkg depends 
> on XCODE32 tool chain to generate the host application.
> But, XCODE32 tool chain has been removed at edk2 
> f7bd152c2a05bd75471305184c25f14f01ccf0b7.
> 
> I just try to add back this change, and call build.sh without the change. I 
> meet with new issue. Seemly, I need to install XQuartz. I will
> continue to try it. Besides, I suggest you directly use edk2 master instead 
> of UDK2018 branch. If I do some fix, you can directly get it.
> 
> /Users/tiano/lgao4/AllPkg/Edk2/EmulatorPkg/Unix/Host/X11GraphicsWindow.c:21:10:
>  fatal error: 'X11/Xlib.h' file not found
> 
> Thanks
> Liming
> > -Original Message-
> > From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of 唐佳诚
> > Sent: Tuesday, January 15, 2019 10:57 AM
> > To: edk2-devel 
> > Subject: [edk2] EmulatorPkg build issue with macOS mojave and Xcode 10
> >
> > Hi Dear EmulatorPkg Maintainer:
> >   I'm a newbie at this, I am sorry for the wrong format of the previous 
> > mail. There are some issue when building EmulatorPkg. Any
> > inspiration or help will appreciated!
> >
> > OS Environment: macOS mojave with Xcode 10 command line tool and installed 
> > macOS_SDK_headers_for_macOS_10.14.pkg
> > Download edk2-UDK2018.zip
> > Initializing workspace
> > > source ./edk2setup.sh
> >
> > WORKSPACE: /Users/QianYun/Downloads/edk2-vUDK2018
> > EDK_TOOLS_PATH: /Users/QianYun/Downloads/edk2-vUDK2018/BaseTools
> > CONF_PATH: /Users/QianYun/Downloads/edk2-vUDK2018/Conf
> > Copying $EDK_TOOLS_PATH/Conf/build_rule.template
> >  to /Users/QianYun/Downloads/edk2-vUDK2018/Conf/build_rule.txt
> > Copying $EDK_TOOLS_PATH/Conf/tools_def.template
> >  to /Users/QianYun/Downloads/edk2-vUDK2018/Conf/tools_def.txt
> > Copying $EDK_TOOLS_PATH/Conf/target.template
> >  to /Users/QianYun/Downloads/edk2-vUDK2018/Conf/target.txt
> >
> > > cd EmulatorPkg && ./build.sh
> >
> > The BaseTools will build successfully, and EmulatorPkg will fail to build.
> >
> > 'import sitecustomize' failed; use -v for traceback
> > Build environment: Darwin-18.2.0-x86_64-i386-64bit
> > Build start time: 15:10:45, Jan.14 2019
> >
> > WORKSPACE= /Users/QianYun/Downloads/edk2-vUDK2018
> > ECP_SOURCE   = 
> > /Users/QianYun/Downloads/edk2-vUDK2018/EdkCompatibilityPkg
> > EDK_SOURCE   = 
> > /Users/QianYun/Downloads/edk2-vUDK2018/EdkCompatibilityPkg
> > EFI_SOURCE   = 
> > /Users/QianYun/Downloads/edk2-vUDK2018/EdkCompatibilityPkg
> > EDK_TOOLS_PATH   = /Users/QianYun/Downloads/edk2-vUDK2018/BaseTools
> > CONF_PATH= /Users/QianYun/Downloads/edk2-vUDK2018/Conf
> > build: : warning: Tool chain [XCODE32] is not defined
> >
> >
> > build.py...
> >  : error 4000: Not available
> > [XCODE32] not defined. No toolchain available for build!
> >
> >
> > - Failed -
> > Build end time: 15:10:46, Jan.14 2019
> > Build total time: 00:00:00
> >
> > Edit EmulatorPkg/build.sh and ./build.sh again
> >
> > diff --git a/build.sh.new b/build.sh
> > index 4f653d2..339c6b3 100755
> > --- a/build.sh.new
> > +++ b/build.sh
> > @@ -63,8 +63,17 @@ case `uname` in
> >  echo UnixPkg requires Snow Leopard or later OS
> >  exit 1
> >else
> > -HOST_TOOLS=XCODE5
> > -TARGET_TOOLS=XCODE5
> > +CLANG_VER=$(clang -ccc-host-triple x86_64-pc-win32-macho 2>&1 
> > >/dev/null) || true
> > +if [[ "$CLANG_VER" == *-ccc-host-triple* ]]
> > +then
> > +# only older versions of Xcode support -ccc-host-tripe, for newer 
> > versions
> > +# it is -target
> > +  HOST_TOOLS=XCODE32
> > +  TARGET_TOOLS=XCODE5
> > +else
> > +  HOST_TOOLS=XCODE32
> > +  TARGET_TOOLS=XCLANG
> > +fi
> >fi
> >BUILD

Re: [edk2] EmulatorPkg build issue with macOS mojave and Xcode 10

2019-01-15 Thread Gao, Liming
I check the history. EmulatorPkg doesn't support macOS. EmulatorePkg depends on 
XCODE32 tool chain to generate the host application. But, XCODE32 tool chain 
has been removed at edk2 f7bd152c2a05bd75471305184c25f14f01ccf0b7. 

I just try to add back this change, and call build.sh without the change. I 
meet with new issue. Seemly, I need to install XQuartz. I will continue to try 
it. Besides, I suggest you directly use edk2 master instead of UDK2018 branch. 
If I do some fix, you can directly get it. 

/Users/tiano/lgao4/AllPkg/Edk2/EmulatorPkg/Unix/Host/X11GraphicsWindow.c:21:10: 
fatal error: 'X11/Xlib.h' file not found

Thanks
Liming
> -Original Message-
> From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of 唐佳诚
> Sent: Tuesday, January 15, 2019 10:57 AM
> To: edk2-devel 
> Subject: [edk2] EmulatorPkg build issue with macOS mojave and Xcode 10
> 
> Hi Dear EmulatorPkg Maintainer:
>   I'm a newbie at this, I am sorry for the wrong format of the previous mail. 
> There are some issue when building EmulatorPkg. Any
> inspiration or help will appreciated!
> 
> OS Environment: macOS mojave with Xcode 10 command line tool and installed 
> macOS_SDK_headers_for_macOS_10.14.pkg
> Download edk2-UDK2018.zip
> Initializing workspace
> > source ./edk2setup.sh
> 
> WORKSPACE: /Users/QianYun/Downloads/edk2-vUDK2018
> EDK_TOOLS_PATH: /Users/QianYun/Downloads/edk2-vUDK2018/BaseTools
> CONF_PATH: /Users/QianYun/Downloads/edk2-vUDK2018/Conf
> Copying $EDK_TOOLS_PATH/Conf/build_rule.template
>  to /Users/QianYun/Downloads/edk2-vUDK2018/Conf/build_rule.txt
> Copying $EDK_TOOLS_PATH/Conf/tools_def.template
>  to /Users/QianYun/Downloads/edk2-vUDK2018/Conf/tools_def.txt
> Copying $EDK_TOOLS_PATH/Conf/target.template
>  to /Users/QianYun/Downloads/edk2-vUDK2018/Conf/target.txt
> 
> > cd EmulatorPkg && ./build.sh
> 
> The BaseTools will build successfully, and EmulatorPkg will fail to build.
> 
> 'import sitecustomize' failed; use -v for traceback
> Build environment: Darwin-18.2.0-x86_64-i386-64bit
> Build start time: 15:10:45, Jan.14 2019
> 
> WORKSPACE= /Users/QianYun/Downloads/edk2-vUDK2018
> ECP_SOURCE   = /Users/QianYun/Downloads/edk2-vUDK2018/EdkCompatibilityPkg
> EDK_SOURCE   = /Users/QianYun/Downloads/edk2-vUDK2018/EdkCompatibilityPkg
> EFI_SOURCE   = /Users/QianYun/Downloads/edk2-vUDK2018/EdkCompatibilityPkg
> EDK_TOOLS_PATH   = /Users/QianYun/Downloads/edk2-vUDK2018/BaseTools
> CONF_PATH= /Users/QianYun/Downloads/edk2-vUDK2018/Conf
> build: : warning: Tool chain [XCODE32] is not defined
> 
> 
> build.py...
>  : error 4000: Not available
>   [XCODE32] not defined. No toolchain available for build!
> 
> 
> - Failed -
> Build end time: 15:10:46, Jan.14 2019
> Build total time: 00:00:00
> 
> Edit EmulatorPkg/build.sh and ./build.sh again
> 
> diff --git a/build.sh.new b/build.sh
> index 4f653d2..339c6b3 100755
> --- a/build.sh.new
> +++ b/build.sh
> @@ -63,8 +63,17 @@ case `uname` in
>  echo UnixPkg requires Snow Leopard or later OS
>  exit 1
>else
> -HOST_TOOLS=XCODE5
> -TARGET_TOOLS=XCODE5
> +CLANG_VER=$(clang -ccc-host-triple x86_64-pc-win32-macho 2>&1 
> >/dev/null) || true
> +if [[ "$CLANG_VER" == *-ccc-host-triple* ]]
> +then
> +# only older versions of Xcode support -ccc-host-tripe, for newer 
> versions
> +# it is -target
> +  HOST_TOOLS=XCODE32
> +  TARGET_TOOLS=XCODE5
> +else
> +  HOST_TOOLS=XCODE32
> +  TARGET_TOOLS=XCLANG
> +fi
>fi
>BUILD_NEW_SHELL="-D BUILD_NEW_SHELL"
>BUILD_FAT="-D BUILD_FAT"
> 
> However, this attempt still failed.
> 
> Building ... 
> /Users/QianYun/Downloads/edk2-vUDK2018/EmulatorPkg/Unix/Host/Host.inf [X64]
> "clang" -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 
> -Wno-varargs
> -ftrap-function=undefined_behavior_has_been_optimized_away_by_clang -D 
> NO_MSABI_VA_FUNCS
> -I/Users/QianYun/Downloads/edk2-vUDK2018/EmulatorPkg/Unix/Host/X11IncludeHack 
> -o
> /Users/QianYun/Downloads/edk2-vUDK2018/Build/Emulator/DEBUG_XCODE5/X64/EmulatorPkg/Unix/Host/Host/OUTPUT/./Host.obj
> -I/Users/QianYun/Downloads/edk2-vUDK2018/EmulatorPkg/Unix/Host/X64
> -I/Users/QianYun/Downloads/edk2-vUDK2018/EmulatorPkg/Unix/Host
> -I/Users/QianYun/Downloads/edk2-vUDK2018/Build/Emulator/DEBUG_XCODE5/X64/EmulatorPkg/Unix/Host/Host/DEBUG
> -I/Users/QianYun/Downloads/edk2-vUDK2018/MdePkg 
> -I/Users/QianYun/Downloads/edk2-vUDK2018/MdePkg/Include
> -I/Users/QianYun/Downloads/edk2-v
>  UDK2018/MdePkg/Include/X64 
> -I/Users/QianYun/Downloads/edk2-vUDK2018/MdeModulePkg
>