public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Gao, Liming" <liming.gao@intel.com>
To: 唐佳诚 <chasontang@warmbloom.com>, edk2-devel <edk2-devel@lists.01.org>
Subject: Re: EmulatorPkg build issue with macOS mojave and Xcode 10
Date: Thu, 17 Jan 2019 03:49:40 +0000	[thread overview]
Message-ID: <4A89E2EF3DFEDB4C8BFDE51014F606A14E3B39BB@SHSMSX152.ccr.corp.intel.com> (raw)
In-Reply-To: <tencent_3BB814AA6D84E2EE159C8A0D@qq.com>

Hi, 
 NO_MSABI_VA_FUNCS flag is required. I miss to add it. I don't verify its boot. If you have any finding, please reply the mail. 

Thanks
Liming
>-----Original Message-----
>From: 唐佳诚 [mailto:chasontang@warmbloom.com]
>Sent: Thursday, January 17, 2019 11:45 AM
>To: Gao, Liming <liming.gao@intel.com>; edk2-devel <edk2-
>devel@lists.01.org>
>Subject: Re:RE: [edk2] EmulatorPkg build issue with macOS mojave and Xcode
>10
>
>Bugzilla: https://bugzilla.tianocore.org/show_bug.cgi?id=1471
>
>Thanks
>ChasonTang
>  ------------------ Original ------------------From:  "唐佳诚
>"<chasontang@warmbloom.com>;Date:  Thu, Jan 17, 2019 11:25 AMTo:  "Gao,
>Liming"<liming.gao@intel.com>; "edk2-devel"<edk2-devel@lists.01.org>;
>Subject:  Re:RE: [edk2] EmulatorPkg build issue with macOS mojave and Xcode
>10 Hi,
>  I clone your git repository and checkout XcodeEmulator branch, but failed
>with some error. The following are the error messages.
>
>> source ./edksetup.sh
>> cd EmulatorPkg
>> ./build.sh
>
>Building from: /Users/QianYun/Downloads/edk2
>using prebuilt tools
>'import sitecustomize' failed; use -v for traceback
>Build environment: Darwin-18.2.0-x86_64-i386-64bit
>Build start time: 11:00:23, Jan.17 2019
>
>WORKSPACE        = /Users/QianYun/Downloads/edk2
>EDK_TOOLS_PATH   = /Users/QianYun/Downloads/edk2/BaseTools
>CONF_PATH        = /Users/QianYun/Downloads/edk2/Conf
>
>
>Architecture(s)  = X64
>Build target     = DEBUG
>Toolchain        = XCODE32
>
>Active Platform          =
>/Users/QianYun/Downloads/edk2/EmulatorPkg/EmulatorPkg.dsc
>Flash Image Definition   =
>/Users/QianYun/Downloads/edk2/EmulatorPkg/EmulatorPkg.fdf
>
>Processing meta-data . done!
>Generating code . done!
>Generating makefile . done!
>Building ...
>/Users/QianYun/Downloads/edk2/MdePkg/Library/BaseLib/BaseLib.inf [X64]
>"gcc" -arch x86_64 -save-temps -g -O0 -mms-bitfields -fshort-wchar -fno-
>strict-aliasing -Wall -Werror -Wno-missing-braces -Wno-address -fomit-frame-
>pointer -static -c -include AutoGen.h -fno-stack-protector -o
>/Users/QianYun/Downloads/edk2/Build/EmulatorX64/DEBUG_XCODE32/X64/
>MdePkg/Library/BaseLib/BaseLib/OUTPUT/./CheckSum.obj -
>I/Users/QianYun/Downloads/edk2/MdePkg/Library/BaseLib/X64 -
>I/Users/QianYun/Downloads/edk2/MdePkg/Library/BaseLib -
>I/Users/QianYun/Downloads/edk2/Build/EmulatorX64/DEBUG_XCODE32/X64
>/MdePkg/Library/BaseLib/BaseLib/DEBUG -
>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/CheckSum.c
>"gcc" -arch x86_64 -save-temps -g -O0 -mms-bitfields -fshort-wchar -fno-
>strict-aliasing -Wall -Werror -Wno-missing-braces -Wno-address -fomit-frame-
>pointer -static -c -include AutoGen.h -fno-stack-protector -o
>/Users/QianYun/Downloads/edk2/Build/EmulatorX64/DEBUG_XCODE32/X64/
>MdePkg/Library/BaseLib/BaseLib/OUTPUT/./SwitchStack.obj -
>I/Users/QianYun/Downloads/edk2/MdePkg/Library/BaseLib/X64 -
>I/Users/QianYun/Downloads/edk2/MdePkg/Library/BaseLib -
>I/Users/QianYun/Downloads/edk2/Build/EmulatorX64/DEBUG_XCODE32/X64
>/MdePkg/Library/BaseLib/BaseLib/DEBUG -
>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
>/Users/QianYun/Downloads/edk2/MdePkg/Library/BaseLib/SwitchStack.c:66:
>3: error: '__builtin_ms_va_start' used in System V ABI function
>  __builtin_ms_va_start (Marker, NewStack);
>  ^
>1 error generated.
>make: ***
>[/Users/QianYun/Downloads/edk2/Build/EmulatorX64/DEBUG_XCODE32/X64
>/MdePkg/Library/BaseLib/BaseLib/OUTPUT/SwitchStack.obj] Error 1
>
>
>build.py...
> : error 7000: Failed to execute command
>	make -f
>/Users/QianYun/Downloads/edk2/Build/EmulatorX64/DEBUG_XCODE32/X64/
>MdePkg/Library/BaseLib/BaseLib/GNUmakefile pbuild
>[/Users/QianYun/Downloads/edk2/Build/EmulatorX64/DEBUG_XCODE32/X64]
>
>- Failed -
>Build end time: 11:00:26, Jan.17 2019
>Build total time: 00:00:03
>
>Then I checked the source code and cc flag between XcodeEmulator branch
>and master.
>XcodeEmulator:
>gcc -arch x86_64 -save-temps -g -O0 -mms-bitfields -fshort-wchar -fno-strict-
>aliasing -Wall -Werror -Wno-missing-braces -Wno-address -fomit-frame-
>pointer -static -c -include AutoGen.h -fno-stack-protector -o
>/Users/QianYun/Downloads/edk2/Build/EmulatorX64/DEBUG_XCODE32/X64/
>MdePkg/Library/BaseLib/BaseLib/OUTPUT/./SwitchStack.obj -
>I/Users/QianYun/Downloads/edk2/MdePkg/Library/BaseLib/X64 -
>I/Users/QianYun/Downloads/edk2/MdePkg/Library/BaseLib -
>I/Users/QianYun/Downloads/edk2/Build/EmulatorX64/DEBUG_XCODE32/X64
>/MdePkg/Library/BaseLib/BaseLib/DEBUG -
>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 0x10b000000 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"<liming.gao@intel.com>;Date:  Wed, Jan 16, 2019 11:33 PMTo:  "Gao,
>Liming"<liming.gao@intel.com>; "唐佳诚"<chasontang@warmbloom.com>;
>"edk2-devel"<edk2-devel@lists.01.org>; 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-bounces@lists.01.org] On Behalf Of
>Gao, Liming
>> Sent: Wednesday, January 16, 2019 12:10 AM
>> To: 唐佳诚 <chasontang@warmbloom.com>; edk2-devel <edk2-
>devel@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-bounces@lists.01.org] On Behalf Of
>唐佳诚
>> > Sent: Tuesday, January 15, 2019 10:57 AM
>> > To: edk2-devel <edk2-devel@lists.01.org>
>> > 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/Hos
>t/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/Hos
>t/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
>> > -I/Users/QianYun/Downloads/edk2-vUDK2018/MdeModulePkg/Include -
>I/Users/QianYun/Downloads/edk2-vUDK2018/EmulatorPkg
>> > -I/Users/QianYun/Downloads/edk2-vUDK2018/EmulatorPkg/Include
>> > /Users/QianYun/Downloads/edk2-
>vUDK2018/EmulatorPkg/Unix/Host/Host.c
>> > "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  -o
>> >
>> /Users/QianYun/Downloads/edk2-
>vUDK2018/Build/Emulator/DEBUG_XCODE5/X64/ShellPkg/Library/UefiShellN
>etwork1CommandsLib/U
>> > efiShellNetwork1CommandsLib/OUTPUT/./AutoGen.obj
>> > -I/Users/QianYun/Downloads/edk2-
>vUDK2018/ShellPkg/Library/UefiShellNetwork1CommandsLib
>> >
>> -I/Users/QianYun/Downloads/edk2-
>vUDK2018/Build/Emulator/DEBUG_XCODE5/X64/ShellPkg/Library/UefiShellN
>etwork1CommandsLib/
>> > UefiShellNetwork1CommandsLib/DEBUG -
>I/Users/QianYun/Downloads/edk2-vUDK2018/MdePkg
>> > -I/Users/QianYun/Downloads/edk2-vUDK2018/MdePkg/Include -
>I/Users/QianYun/Downloads/edk2-vUDK2018/MdePkg/Include
>> >  /X64 -I/Users/QianYun/Downloads/edk2-vUDK2018/ShellPkg -
>I/Users/QianYun/Downloads/edk2-vUDK2018/ShellPkg/Include
>> > -I/Users/QianYun/Downloads/edk2-vUDK2018/MdeModulePkg -
>I/Users/QianYun/Downloads/edk2-vUDK2018/MdeModulePkg/Include
>> >
>> /Users/QianYun/Downloads/edk2-
>vUDK2018/Build/Emulator/DEBUG_XCODE5/X64/ShellPkg/Library/UefiShellN
>etwork1CommandsLib/U
>> > efiShellNetwork1CommandsLib/DEBUG/AutoGen.c
>> > In file included from /Users/QianYun/Downloads/edk2-
>vUDK2018/EmulatorPkg/Unix/Host/Host.c:15:
>> > /Users/QianYun/Downloads/edk2-
>vUDK2018/EmulatorPkg/Unix/Host/Host.h:28:10: fatal error: 'stdio.h' file not
>found
>> > #include <stdio.h>
>> >          ^~~~~~~~~
>> > "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  -o
>> >
>> /Users/QianYun/Downloads/edk2-
>vUDK2018/Build/Emulator/DEBUG_XCODE5/X64/ShellPkg/Library/UefiShellDe
>bug1CommandsLib/Uef
>> > iShellDebug1CommandsLib/OUTPUT/./SerMode.obj
>> > -I/Users/QianYun/Downloads/edk2-
>vUDK2018/ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit
>> > -I/Users/QianYun/Downloads/edk2-
>vUDK2018/ShellPkg/Library/UefiShellDebug1CommandsLib/Edit
>> > -I/Users/QianYun/Downloads/edk2-
>vUDK2018/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView
>> > -I/Users/QianYun/Downloads/edk2-
>vUDK2018/ShellPkg/Library/UefiShellDebug1CommandsLib
>> > -I/Users/QianYun/Downloads/edk2-vUDK2018
>> >
>/Build/Emulator/DEBUG_XCODE5/X64/ShellPkg/Library/UefiShellDebug1Com
>mandsLib/UefiShellDebug1CommandsLib/DEBUG
>> > -I/Users/QianYun/Downloads/edk2-vUDK2018/MdePkg -
>I/Users/QianYun/Downloads/edk2-vUDK2018/MdePkg/Include
>> > -I/Users/QianYun/Downloads/edk2-vUDK2018/MdePkg/Include/X64 -
>I/Users/QianYun/Downloads/edk2-vUDK2018/ShellPkg
>> > -I/Users/QianYun/Downloads/edk2-vUDK2018/ShellPkg/Include -
>I/Users/QianYun/Downloads/edk2-vUDK2018/MdeModulePkg
>> > -I/Users/QianYun/Downloads/edk2-vUDK2018/MdeModulePkg/Include
>> > /Users/QianYun/Downloads/edk2-
>vUDK2018/ShellPkg/Library/UefiShellDebug1CommandsLib/SerMode.c
>> > 1 error generated.
>> > make: ***
>> > [/Users/QianYun/Downloads/edk2-
>vUDK2018/Build/Emulator/DEBUG_XCODE5/X64/EmulatorPkg/Unix/Host/Hos
>t/OUTPUT/Host.obj]
>> > Error 1
>> >
>> >
>> > build.py...
>> >  : error 7000: Failed to execute command
>> > 	make tbuild [/Users/QianYun/Downloads/edk2-
>vUDK2018/Build/Emulator/DEBUG_XCODE5/X64/EmulatorPkg/Unix/Host/Hos
>t]
>> >
>> >
>> > build.py...
>> >  : error F002: Failed to build module
>> > 	/Users/QianYun/Downloads/edk2-
>vUDK2018/EmulatorPkg/Unix/Host/Host.inf [X64, XCODE5, DEBUG]
>> >
>> > - Failed -
>> > Build end time: 15:16:01, Jan.14 2019
>> > Build total time: 00:00:39
>> >
>> > After careful analysis, i find out that the include search path is wrong. clang
>will search some path below by default.
>> >
>> > > clang++ -E -x c++ - -v < /dev/null
>> >
>> > Apple LLVM version 10.0.0 (clang-1000.11.45.5)
>> > Target: x86_64-apple-darwin18.2.0
>> > Thread model: posix
>> > InstalledDir:
>/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xcto
>olchain/usr/bin
>> >
>"/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xct
>oolchain/usr/bin/clang" -cc1 -triple
>> > x86_64-apple-macosx10.14.0 -Wdeprecated-objc-isa-usage -
>Werror=deprecated-objc-isa-usage -E -disable-free -disable-llvm-verifier
>> > -discard-value-names -main-file-name - -mrelocation-model pic -pic-level
>2 -mthread-model posix -mdisable-fp-elim -fno-strict-return
>> > -masm-verbose -munwind-tables -target-cpu penryn -dwarf-column-info
>-debugger-tuning=lldb -target-linker-version 409.12 -v
>> > -resource-dir
>/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xcto
>olchain/usr/lib/clang/10.0.0 -stdlib=libc++
>> > -fdeprecated-macro -fdebug-compilation-dir
>/Users/QianYun/Downloads/edk2-vUDK2018/EmulatorPkg -ferror-limit 19
>> > -fmessage-length 181 -stack-protector 1 -fblocks -fencode-extended-
>block-signature -fobjc-runtime=macosx-10.14.0 -fcxx-exceptions
>> > -fexceptions -fmax-type-align=16 -fdiagnostics-show-option -fcolor-
>diagnostics -o - -x c++ -
>> > clang -cc1 version 10.0.0 (clang-1000.11.45.5) default target x86_64-apple-
>darwin18.2.0
>> > ignoring nonexistent directory "/usr/include/c++/v1"
>> > #include "..." search starts here:
>> > #include <...> search starts here:
>> >
>/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xcto
>olchain/usr/include/c++/v1
>> >  /usr/local/include
>> >
>/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xcto
>olchain/usr/lib/clang/10.0.0/include
>> >
>/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xcto
>olchain/usr/include
>> >  /usr/include
>> >  /System/Library/Frameworks (framework directory)
>> >  /Library/Frameworks (framework directory)
>> > End of search list.
>> > # 1 "<stdin>"
>> > # 1 "<built-in>" 1
>> > # 1 "<built-in>" 3
>> > # 373 "<built-in>" 3
>> > # 1 "<command line>" 1
>> > # 1 "<built-in>" 2
>> > # 1 "<stdin>" 2
>> >
>> > But -target x86_64-pc-win32-macho will working in cross-compilation
>mode. it will search this path and stdio.h will not found
>> >
>> > > clang++ -target x86_64-pc-win32-macho -E -x c++ - -v < /dev/null
>> >
>> > Apple LLVM version 10.0.0 (clang-1000.11.45.5)
>> > Target: x86_64-pc-windows-macho
>> > Thread model: posix
>> > InstalledDir:
>/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xcto
>olchain/usr/bin
>> >
>"/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xct
>oolchain/usr/bin/clang" -cc1 -triple
>> > x86_64-pc-windows-macho -E -disable-free -disable-llvm-verifier -discard-
>value-names -main-file-name - -mrelocation-model pic
>> > -pic-level 2 -mthread-model posix -mdisable-fp-elim -fmath-errno -masm-
>verbose -mconstructor-aliases -target-cpu x86-64
>> > -dwarf-column-info -debugger-tuning=gdb -target-linker-version 409.12 -v
>-resource-dir
>> >
>/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xcto
>olchain/usr/lib/clang/10.0.0 -internal-isystem
>> >
>/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xcto
>olchain/usr/lib/clang/10.0.0/include -fdeprecated-macro
>> > -fdebug-compilation-dir /Users/QianYun/Downloads/edk2-
>vUDK2018/EmulatorPkg -ferror-limit 19 -fmessage-length 181
>> > -fno-use-cxa-atexit -fms-extensions -fms-compatibility -fms-compatibility-
>version=19.11 -std=c++14 -fdelayed-template-parsing
>> > -fobjc-runtime=gcc -fcxx-exceptions -fexceptions -fseh-exceptions -fdiag
>> >  nostics-show-option -fcolor-diagnostics -o - -x c++ -
>> > clang -cc1 version 10.0.0 (clang-1000.11.45.5) default target x86_64-apple-
>darwin18.2.0
>> > #include "..." search starts here:
>> > #include <...> search starts here:
>> >
>/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xcto
>olchain/usr/lib/clang/10.0.0/include
>> > End of search list.
>> > # 1 "<stdin>"
>> > # 1 "<built-in>" 1
>> > # 1 "<built-in>" 3
>> > # 366 "<built-in>" 3
>> > # 1 "<command line>" 1
>> > # 1 "<built-in>" 2
>> > # 1 "<stdin>" 2
>> >
>> > We can obviously see that the
>XcodeDefault.xctoolchain/usr/lib/clang/10.0.0/include is not include the
>stdio.h, so that, preview build
>> > error is stdio.h not found.
>> >
>> > And there is another thing that puzzles me. The
>EmulatorPkg/Unix/Host/Host.h define some name mangle, and include
>stdio.h(this file
>> > include endian.h), That will cause the macro definition to be redefined.
>> > This thing made me spend a lot of energy.Is there are anyone can solve
>my confusion.
>> > Thanks,
>> > ChasonTang
>> > _______________________________________________
>> > edk2-devel mailing list
>> > edk2-devel@lists.01.org
>> > https://lists.01.org/mailman/listinfo/edk2-devel
>> _______________________________________________
>> edk2-devel mailing list
>> edk2-devel@lists.01.org
>> https://lists.01.org/mailman/listinfo/edk2-devel

  reply	other threads:[~2019-01-17  3:49 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-15  2:56 EmulatorPkg build issue with macOS mojave and Xcode 10 唐佳诚
2019-01-15 16:10 ` Gao, Liming
2019-01-16 15:33   ` Gao, Liming
2019-01-17  3:25     ` 唐佳诚
2019-01-17  3:44       ` 唐佳诚
2019-01-17  3:49         ` Gao, Liming [this message]
  -- strict thread matches above, loose matches on Subject: below --
2019-01-15  2:35 唐佳诚
2019-01-14  7:47 唐佳诚

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4A89E2EF3DFEDB4C8BFDE51014F606A14E3B39BB@SHSMSX152.ccr.corp.intel.com \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox