From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from ma1-aaemail-dr-lapp03.apple.com (ma1-aaemail-dr-lapp03.apple.com [17.171.2.72]) by mx.groups.io with SMTP id smtpd.web12.21789.1602869185690142630 for ; Fri, 16 Oct 2020 10:26:25 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@apple.com header.s=20180706 header.b=r957TsTK; spf=pass (domain: apple.com, ip: 17.171.2.72, mailfrom: afish@apple.com) Received: from pps.filterd (ma1-aaemail-dr-lapp03.apple.com [127.0.0.1]) by ma1-aaemail-dr-lapp03.apple.com (8.16.0.42/8.16.0.42) with SMTP id 09GHNmKA039947; Fri, 16 Oct 2020 10:26:21 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=apple.com; h=from : message-id : content-type : mime-version : subject : date : in-reply-to : cc : to : references; s=20180706; bh=6IT+kYaI2onC14xqDzG3FiIThz20UifXqRBR6kZ3PoQ=; b=r957TsTKlDZOt7t0cSLVCiY3Wrxz/cdqZNJa0+usWEEMsZrSKMcLGPgipsy68YriecD+ MsBuvNsZlyJxlr56+pIPPGeGXPsxOwAR1lKCzFRjUhKgY/x+zihRcebzKRRe0IEcP1aT mU7apvWjytSYyqZQiR9x3LTtHREj3iZ6HeYXNVoJkkkywMjiYlSuOAcyrJJPwPjloMis tPfupszqTOdqu9R8uoNfbAZ6rniUNYsCM390Ugqsm1HcmahxFnyxsWz7P7HDKTOtnrM7 uJBhofZoKsR3qQIMTsxVlyRBrH8R8nhM60hDOrNLdAtlGZlFiiqGey5QZqc71pCGxiEp YQ== Received: from rn-mailsvcp-mta-lapp03.rno.apple.com (rn-mailsvcp-mta-lapp03.rno.apple.com [10.225.203.151]) by ma1-aaemail-dr-lapp03.apple.com with ESMTP id 343bxwmdsa-9 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NO); Fri, 16 Oct 2020 10:26:21 -0700 Received: from rn-mailsvcp-mmp-lapp04.rno.apple.com (rn-mailsvcp-mmp-lapp04.rno.apple.com [17.179.253.17]) by rn-mailsvcp-mta-lapp03.rno.apple.com (Oracle Communications Messaging Server 8.1.0.6.20200729 64bit (built Jul 29 2020)) with ESMTPS id <0QIB00QPY1RV9NB0@rn-mailsvcp-mta-lapp03.rno.apple.com>; Fri, 16 Oct 2020 10:26:19 -0700 (PDT) Received: from process_milters-daemon.rn-mailsvcp-mmp-lapp04.rno.apple.com by rn-mailsvcp-mmp-lapp04.rno.apple.com (Oracle Communications Messaging Server 8.1.0.6.20200729 64bit (built Jul 29 2020)) id <0QIB00U001GZPB00@rn-mailsvcp-mmp-lapp04.rno.apple.com>; Fri, 16 Oct 2020 10:26:19 -0700 (PDT) X-Va-A: X-Va-T-CD: 4ddc11f9b8f5b925413972d5a8e8042b X-Va-E-CD: 0e97c8df0489df178b983445b89867ca X-Va-R-CD: 8b007e8ffd3365a77500ff05637ced77 X-Va-CD: 0 X-Va-ID: 76908cc7-b409-4a6a-aac3-9f9353437d23 X-V-A: X-V-T-CD: 4ddc11f9b8f5b925413972d5a8e8042b X-V-E-CD: 0e97c8df0489df178b983445b89867ca X-V-R-CD: 8b007e8ffd3365a77500ff05637ced77 X-V-CD: 0 X-V-ID: 45ab0445-2497-466e-ab88-e7f72b448332 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.235,18.0.687 definitions=2020-10-16_09:2020-10-16,2020-10-16 signatures=0 Received: from [17.235.21.30] (unknown [17.235.21.30]) by rn-mailsvcp-mmp-lapp04.rno.apple.com (Oracle Communications Messaging Server 8.1.0.6.20200729 64bit (built Jul 29 2020)) with ESMTPSA id <0QIB00RBP1RT3Q00@rn-mailsvcp-mmp-lapp04.rno.apple.com>; Fri, 16 Oct 2020 10:26:19 -0700 (PDT) From: "Andrew Fish" Message-id: <1D62256C-60B6-4453-AA33-1DCF7E125DD9@apple.com> MIME-version: 1.0 (Mac OS X Mail 13.4 \(3608.120.23.2.1\)) Subject: Re: [edk2-devel] Issues with edk2 compilation with xcode5 on mac OS - files compiled but strange behaviors Date: Fri, 16 Oct 2020 10:26:17 -0700 In-reply-to: Cc: edk2-devel-groups-io To: Daniele Crudo References: X-Mailer: Apple Mail (2.3608.120.23.2.1) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.235,18.0.687 definitions=2020-10-16_09:2020-10-16,2020-10-16 signatures=0 Content-type: multipart/alternative; boundary="Apple-Mail=_6B80F98E-0D97-4CA7-B009-28E3DD002F7E" --Apple-Mail=_6B80F98E-0D97-4CA7-B009-28E3DD002F7E Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 > On Oct 15, 2020, at 11:24 PM, Daniele Crudo wr= ote: >=20 > Hi, thank you Andrew. > The debug version doesn't have any issue, so the issue is only with rele= ase. OK so the DEBUG and RELEASE both build with -Os. This is firmware things h= ave to fit in the ROM. The big difference between DEBUG and release is the = DEBUG prints get stripped out, so that usually means timing issues :(.=20 The compiler flags live in BaseTools/Conf/tools_def.template and you can = edit them in Conf/tools_def.txt > The mac version seems to skip tftpDynamicCommand.efi and LinuxInitrdDyna= micShellCommand.efi (see attached debug logs), but it's not related to this= and it's not related to the logo, because the debug version as I said it j= ust works. What logo are your talking about? I see the TianoCore logo failed in your = macOS debug log as I would expect [1]d: "HII Image Package with logo not found in PE/COFF resource section=E2=80= =9D I don=E2=80=99t see that error message in the kali log, so that matches wh= at I would expect.=20 It sounds like you are talking about a logo coming from your Hackintosh EF= I boot shim? Or the macOS booter? This is all the Hackintosh stuff that is loading.=20 [Bds] Expand PciRoot(0x0)/Pci(0x1F,0x2)/Sata(0x2,0xFFFF,0x0) -> PciRoot(0x= 0)/Pci(0x1F,0x2)/Sata(0x2,0xFFFF,0x0)/HD(1,GPT,58F0B968-76EA-4F98-BD18-44DC= 6D57AEBA,0x800,0x7F7DF)/\EFI\BOOT\BOOTX64.EFI Loading driver at 0x0007DDEB000 EntryPoint=3D0x0007DDEFE36 Bootstrap.efi Loading driver at 0x0007DC77000 EntryPoint=3D0x0007DCED3A5 OpenCore.efi Loading driver at 0x0007DDDA000 EntryPoint=3D0x0007DDDA5C9 AE4C11C8-1D6C-F= 24E-A183-E1CA36D1A8A9.efi Loading driver at 0x0007F88E000 EntryPoint=3D0x0007F8920BD OpenRuntime.efi Loading driver at 0x0007DD45000 EntryPoint=3D0x0007DD56C4B OpenCanopy.efi Loading driver at 0x0007DD66000 EntryPoint=3D0x0007DD6FC53 AudioDxe.efi Loading driver at 0x0007DDCE000 EntryPoint=3D0x0007DDD17C9 UsbMouseDxe.efi Loading driver at 0x0007D054000 EntryPoint=3D0x0007D0A220C apfs.efi And this is the macOS booter (1st stage OS loader, the thing Mac EFI firmw= are loads directly)=20 Loading driver at 0x0007CE48000 EntryPoint=3D0x0007CE51673 boot.efi > I will try another toolchain, just to have some time to figure out how t= o setup the environment. >=20 There was some work on a CLANGPDB toolchain that worked on all platforms.= =20 So it sounds like you have some kind of graphics issue on a RELEASE build?= What happens if on a RELEASE XCODE build you just boot to the UEFI Shell? [1] https://github.com/tianocore/edk2/blob/master/MdeModulePkg/Logo/Logo.c= #L131 Thanks, Andrew Fish > Thank you >=20 > Il giorno ven 16 ott 2020 alle ore 04:11 Andrew Fish > ha scritto: > Daniele, >=20 > The logo issue is due to the [Hii-Binary-Package.UEFI_HII] build rule n= ot being supported by XCODE and RVCT those toolchains don=E2=80=99t contain= resource compilers for PE/COFF files so they can=E2=80=99t inject HII into= PE/COFF images. I submitted patches to fix this a while back and they got = stuck and I got bogged down on my day job. This reminds me I need to get th= ose patches moving again.=20 >=20 > Due to the issue above the XCODE build skips some drivers/apps in OVMF [= 1] but I don=E2=80=99t think that is your issue? >=20 > I don=E2=80=99t think it is likely that your graphics issue is related t= o HII resources. Most of the times when I track down the =E2=80=9Cit does n= ot work with clang (Xcode uses clang)=E2=80=9D it ends up being the clang c= ompiler optimizing away undefined behavior that the other compilers ignored= . I=E2=80=99m not sure if there is a another clang toolchain you could try?= That would be helpful to know if it is likely an undefined behavior differ= ence.=20 >=20 > Unfortunately the graphics issue is going to be hard to track down if we= can=E2=80=99t reproduce it locally.=20 >=20 > [1] Easiest way to find them is: > /Volumes/Case/edk2-github(master)>git grep '$(TOOL_CHAIN_TAG) =3D=3D "XC= ODE5"' > OvmfPkg/OvmfPkgIa32.dsc:252:!if $(TOOL_CHAIN_TAG) =3D=3D "XCODE5" > OvmfPkg/OvmfPkgIa32X64.dsc:256:!if $(TOOL_CHAIN_TAG) =3D=3D "XCODE5" > OvmfPkg/OvmfPkgX64.dsc:256:!if $(TOOL_CHAIN_TAG) =3D=3D "XCODE5" > OvmfPkg/OvmfXen.dsc:233:!if $(TOOL_CHAIN_TAG) =3D=3D "XCODE5" > UefiCpuPkg/UefiCpuPkg.dsc:63:!if $(TOOL_CHAIN_TAG) =3D=3D "XCODE5" >=20 > Thanks, >=20 > Andrew Fish >=20 >> On Oct 15, 2020, at 8:22 AM, crudo.daniele@gmail.com wrote: >>=20 >> Good morning, I have an issue with compiled OVMF_CODE.fd and OVMF_VARS.= fd with xcode5 on mac os - Catalina 10.15.7 (I tried v. 202005 and v. 20200= 8 stable releases from github). >> My commands for v. 202008, on mac OS: >>=20 >> git clone https://github.com/tianocore/edk2.git >> cd edk2 >> git clean -ffdx >> git reset --hard >> git submodule deinit --force --all >> git checkout edk2-stable202008 >> git submodule update --init --force >> source edksetup.sh >> nice make -C "$EDK_TOOLS_PATH" -j $(getconf _NPROCESSORS_ONLN) >> build -a X64 -b RELEASE -p OvmfPkg/OvmfPkgX64.dsc -t XCODE5 >>=20 >> Files are compiled and saved (apparently correctly). >> And I'm using OVMF_CODE.fd and OVMF_VARS.fd to boot a mac OS vm with QE= MU/KVM. >> I noticed that with that files I have no tianocore logo at boot and mor= eover, since I have gpu passthrough I cannot boot the vm if hdmi is not att= ached (2 monitors setup, hdmi<-->hdmi and dvi<-->dvi to vga adapter<-->vga)= . >> If I have hdmi attached I can boot without any problem. >>=20 >> I tried to compile with the same commands edk2 on kali linux, except fo= r the last line which became: >> build -a X64 -b RELEASE -p OvmfPkg/OvmfPkgX64.dsc -t GCC5 >>=20 >> and the generated files work well (I have the tianocore logo and I can = boot without hdmi attached, i.e. only one monitor). >>=20 >> What's going on? >> Anybody can explain? >> Is xcode5 incompatible, is there something wrong in the code or is it m= y fault? >> At the beginning I thought about an edk2 bug, so I opened an issue into= the bugtracker, full history here: >> Bug 3006 >>=20 >> I attach also the compilation log from mac OS. >>=20 >> Thanks >>=20 >> Daniele >>=20 >> >=20 > --Apple-Mail=_6B80F98E-0D97-4CA7-B009-28E3DD002F7E Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=utf-8

On Oct 15, 2= 020, at 11:24 PM, Daniele Crudo <crudo.daniele@gmail.com> wrote:

Hi, tha= nk you Andrew.
The debug version doesn't have any issue, so = the issue is only with release.

OK so the DEBUG and RELEASE both build with -Os. This is = firmware things have to fit in the ROM. The big difference between DEBUG an= d release is the DEBUG prints get stripped out, so that usually means timin= g issues :(. 

The compiler flags l= ive in  BaseTools/Conf/tools_def.template and you can edit them i= n Conf/tools_def.txt

The mac vers= ion seems to skip tftpDynamicCommand.efi and LinuxInitrdDynamicSh= ellCommand.efi (see attached debug logs), but it's not related to this and = it's not related to the logo, because the debug version as I said it just w= orks.

What log= o are your talking about? I see the TianoCore logo failed in your macOS deb= ug log as I would expect [1]d:
"HII Image Package with logo = not found in PE/COFF resource section=E2=80=9D
I don=E2=80=99t se= e that error message in the kali log, so that matches what I would expect.&= nbsp;

It sounds like you are talking ab= out a logo coming from your Hackintosh EFI boot shim? Or the macOS booter?<= /div>
This is all the Hackintosh stuff that is loading. 
[Bds] Expand PciRoot(0x0)/Pci(0x1F,0x2)/Sata(0x2,0xFFFF,0x0) -> Pc= iRoot(0x0)/Pci(0x1F,0x2)/Sata(0x2,0xFFFF,0x0)/HD(1,GPT,58F0B968-76EA-4F98-B= D18-44DC6D57AEBA,0x800,0x7F7DF)/\EFI\BOOT\BOOTX64.EFI
=
Loading driver at 0x0007DDEB000 EntryPoint= =3D0x0007DDEFE36 Bootstrap.efi
Loading driver at 0x00= 07DC77000 EntryPoint=3D0x0007DCED3A5 OpenCore.efi
Load= ing driver at 0x0007DDDA000 EntryPoint=3D0x0007DDDA5C9 AE4C11C8-1D6C-F24E-A= 183-E1CA36D1A8A9.efi
Loading driver at 0x0007F88E000 E= ntryPoint=3D0x0007F8920BD OpenRuntime.efi
Loading driv= er at 0x0007DD45000 EntryPoint=3D0x0007DD56C4B OpenCanopy.efi
Loading driver at 0x0007DD66000 EntryPoint=3D0x0007DD6FC53 AudioDxe= .efi
Loading driver at 0x0007DDCE000 EntryPoint=3D0x00= 07DDD17C9 UsbMouseDxe.efi
Loading driver at 0x0007D054= 000 EntryPoint=3D0x0007D0A220C apfs.efi
And this is the macOS booter (1st stage = OS loader, the thing Mac EFI firmware loads directly) 
Loading driver at 0x0007CE48000 EntryPoint=3D0x0007C= E51673 boot.efi


I will try another toolchain, just to= have some time to figure out how to setup the environment.


There was some work on a CLANGPDB toolchain that worked on all pla= tforms. 

So it sounds like you hav= e some kind of graphics issue on a RELEASE build? What happens if on a RELE= ASE XCODE build you just boot to the UEFI Shell?

<= /div>

Thanks,

Andrew Fish

Thank you

Il giorno ven 16 = ott 2020 alle ore 04:11 Andrew Fish <afish@apple.com> ha scritto:
Daniele,

The logo issue is due to the  [Hii-Binary-Package.UEFI_HII] bui= ld rule not being supported by XCODE and RVCT those toolchains don=E2=80=99t contain resource com= pilers for PE/COFF files so they can=E2=80=99t inject HII into PE/COFF imag= es. I submitted patches to fix this a while back and they got stuck and I g= ot bogged down on my day job. This reminds me I need to get those patches m= oving again.

Due to the issue above the XCODE build skip= s some drivers/apps in OVMF [1] but I don=E2=80=99t think that is your issu= e?

I don=E2=80=99t think it is likely that your graphi= cs issue is related to HII resources. Most of the times when I track down t= he =E2=80=9Cit does not work with clang (Xcode uses clang)=E2=80=9D it ends= up being the clang compiler optimizing away undefined behavior that the ot= her compilers ignored. I=E2=80=99m not sure if there is a another clang too= lchain you could try? That would be helpful to know if it is likely an unde= fined behavior difference.

Unfortuna= tely the graphics issue is going to be hard to track down if we can=E2=80= =99t reproduce it locally.

<= span style=3D"white-space:pre-wrap" class=3D"">[1] Easiest way to find them= is:
/Volumes/Case/edk2-github(master)>git grep '$(TOOL_CHAIN_TAG) =3D=3D "XCODE5"'
OvmfPkg/OvmfPkgIa32.dsc:252:!if $(TOOL_CHAIN_TAG) =3D=3D "XCODE5"
OvmfPkg/OvmfPkgIa32X64.dsc:256:!if $(TOOL_CHAIN_TAG) = =3D=3D "XCODE5"
OvmfPkg/OvmfP= kgX64.dsc:256:!if $(TOOL_CHAIN_TAG) =3D=3D "XCODE5"
OvmfPkg/OvmfX= en.dsc:233:!if $(TOOL_CHAIN_TAG) =3D=3D "XCODE5"
UefiCpuPkg/UefiCpuPkg.dsc:63:!if $(TOOL_CHAIN= _TAG) =3D=3D "XCODE5"

Thanks,
<= span style=3D"white-space:pre-wrap" class=3D"">
=
Andrew Fish=

On Oct 15, 2020, at 8:22 AM, crudo.dan= iele@gmail.com wrote:

Good =
morning, I have an issue with compiled OVMF_CODE.fd and OVMF_VARS.fd with x=
code5 on mac os - Catalina 10.15.7 (I tried v. 202005 and v. 202008 stable =
releases from github).
My commands for v. 202008, on mac OS:<= br class=3D"">
git clone https://github.com/tianocore/edk= 2.git cd edk2 git clean -ffdx git reset --hard git submodule deinit --force --all git checkout edk2-stable202008 git submodule update --init --force source edksetup.sh nice make -C "$EDK_TOOLS_PATH" -j $(getconf _NPROCESSORS_ONLN) build -a X64 -b RELEASE -p OvmfPkg/OvmfPkgX64.dsc -t XCODE5
=
Files are compiled and saved (apparently correctly).
And I'm using OVMF_CODE.fd and OVMF_VARS.fd to boot a mac OS vm with= QEMU/KVM.

I noticed that with = that files I have no tianocore logo at boot and moreover, since I have gpu = passthrough I cannot boot the vm if hdmi is not attached (2 monitors setup,= hdmi<-->hdmi and dvi<-->dvi to vga adapter<-->vga).
If I have hdmi attached I can boot without any problem.

I tried to compile with the same commands edk2 on kal= i linux, except for the last line which became:
build -a X64 = -b RELEASE -p OvmfPkg/OvmfPkgX64.dsc -t GCC5

a= nd the generated files work well (I have the tianocore logo and I can boot = without hdmi attached, i.e. only one monitor).
What's going on?
Anybody can explain?
Is xcode5 incompatible, is there something wrong in the code or is i= t my fault?
At the beginning I thought about an edk2 bug, so = I opened an issue into the bugtracker, full history here:
Bug 3006

I attach also the co= mpilation log from mac OS.

Thanks

Daniele
<log-macOs.txt.zip>
=
<ovmf-kali-debug.log><ovmf-macos-debug.log>

--Apple-Mail=_6B80F98E-0D97-4CA7-B009-28E3DD002F7E--