From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from ma1-aaemail-dr-lapp02.apple.com (ma1-aaemail-dr-lapp02.apple.com [17.171.2.68]) by mx.groups.io with SMTP id smtpd.web12.5754.1602814295619680603 for ; Thu, 15 Oct 2020 19:11:35 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@apple.com header.s=20180706 header.b=mLWHjDl7; spf=pass (domain: apple.com, ip: 17.171.2.68, mailfrom: afish@apple.com) Received: from pps.filterd (ma1-aaemail-dr-lapp02.apple.com [127.0.0.1]) by ma1-aaemail-dr-lapp02.apple.com (8.16.0.42/8.16.0.42) with SMTP id 09G232k9040868; Thu, 15 Oct 2020 19:11:34 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=apple.com; h=from : content-type : mime-version : subject : date : references : to : in-reply-to : message-id; s=20180706; bh=dYJvnPYAeBW175UPpOBOr0wuxxcv1BUNeEn/WRD1oFY=; b=mLWHjDl7E9a+/yJE8GB8WCATuzpje7V+/Yz1QSWELrwZ+b7fl+3rM9dVnu072MoYA6xr S7vtAXRovoqzAn8UthJSF1h7AjrEKA3hxJaoCAdg2uHz2HrSDEr+opggNjGdnkAWX/H4 zZu36TCwuSscQOQ5c9wDasRLB20Itb+EDDScepaGpbONjziHz0bJykaZlf5uabBDsh3I Z7mHToYz4AicSVQJNRYC1tMaeI52bjJh+XP9qT9DEW3qrQuQqmAO9so55XMXqJmf91Lw YnVIoydcauhfQDEKAkKFS21NBXtVBa5lcaJP8kS6BZ/3Vc9EJM9PLMVK9oDPLTjsoSrE qQ== Received: from rn-mailsvcp-mta-lapp02.rno.apple.com (rn-mailsvcp-mta-lapp02.rno.apple.com [10.225.203.150]) by ma1-aaemail-dr-lapp02.apple.com with ESMTP id 3439mv52rb-60 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NO); Thu, 15 Oct 2020 19:11:34 -0700 Received: from rn-mailsvcp-mmp-lapp01.rno.apple.com (rn-mailsvcp-mmp-lapp01.rno.apple.com [17.179.253.14]) by rn-mailsvcp-mta-lapp02.rno.apple.com (Oracle Communications Messaging Server 8.1.0.6.20200729 64bit (built Jul 29 2020)) with ESMTPS id <0QI9005SHVF8T1G0@rn-mailsvcp-mta-lapp02.rno.apple.com>; Thu, 15 Oct 2020 19:11:34 -0700 (PDT) Received: from process_milters-daemon.rn-mailsvcp-mmp-lapp01.rno.apple.com by rn-mailsvcp-mmp-lapp01.rno.apple.com (Oracle Communications Messaging Server 8.1.0.6.20200729 64bit (built Jul 29 2020)) id <0QI900000VBFK000@rn-mailsvcp-mmp-lapp01.rno.apple.com>; Thu, 15 Oct 2020 19:11:33 -0700 (PDT) X-Va-A: X-Va-T-CD: 4aed6d51041d65cf37c631f6e73d9d3b X-Va-E-CD: 0e97c8df0489df178b983445b89867ca X-Va-R-CD: 8b007e8ffd3365a77500ff05637ced77 X-Va-CD: 0 X-Va-ID: e41720ce-a99d-4464-920c-e849aa92c17a X-V-A: X-V-T-CD: 4aed6d51041d65cf37c631f6e73d9d3b X-V-E-CD: 0e97c8df0489df178b983445b89867ca X-V-R-CD: 8b007e8ffd3365a77500ff05637ced77 X-V-CD: 0 X-V-ID: d2c1befb-1100-4ead-bcb8-24dd8fe83e46 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.235,18.0.687 definitions=2020-10-16_01:2020-10-14,2020-10-16 signatures=0 Received: from [17.235.21.30] (unknown [17.235.21.30]) by rn-mailsvcp-mmp-lapp01.rno.apple.com (Oracle Communications Messaging Server 8.1.0.6.20200729 64bit (built Jul 29 2020)) with ESMTPSA id <0QI90061RVF7I300@rn-mailsvcp-mmp-lapp01.rno.apple.com>; Thu, 15 Oct 2020 19:11:32 -0700 (PDT) From: "Andrew Fish" 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: Thu, 15 Oct 2020 19:11:31 -0700 References: To: edk2-devel-groups-io , Daniele Crudo In-reply-to: Message-id: 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_01:2020-10-14,2020-10-16 signatures=0 Content-type: multipart/alternative; boundary="Apple-Mail=_F4143883-699D-4857-A95A-25C50E6C2FC9" --Apple-Mail=_F4143883-699D-4857-A95A-25C50E6C2FC9 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 Daniele, The logo issue is due to the [Hii-Binary-Package.UEFI_HII] build rule not= being supported by XCODE and RVCT those toolchains don=E2=80=99t contain r= esource compilers for PE/COFF files so they can=E2=80=99t inject HII into P= E/COFF images. I submitted patches to fix this a while back and they got st= uck and I got bogged down on my day job. This reminds me I need to get thos= e patches moving again.=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? I don=E2=80=99t think it is likely that your graphics issue is related to = HII resources. Most of the times when I track down the =E2=80=9Cit does not= work with clang (Xcode uses clang)=E2=80=9D it ends up being the clang com= piler 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? T= hat would be helpful to know if it is likely an undefined behavior differen= ce.=20 Unfortunately the graphics issue is going to be hard to track down if we c= an=E2=80=99t reproduce it locally.=20 [1] Easiest way to find them is: /Volumes/Case/edk2-github(master)>git grep '$(TOOL_CHAIN_TAG) =3D=3D "XCOD= E5"' 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" Thanks, Andrew Fish > 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.f= d with xcode5 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: >=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 QEM= U/KVM. > I noticed that with that files I have no tianocore logo at boot and more= over, since I have gpu passthrough I cannot boot the vm if hdmi is not atta= ched (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 for= 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 b= oot 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 my= 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 > --Apple-Mail=_F4143883-699D-4857-A95A-25C50E6C2FC9 Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=utf-8 Daniele,
<= br class=3D"">
The logo issue is due to the  [Hii= -Binary-Package.UEFI_HII] build rule not 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 whi= le back and they got stuck and I got bogged down on my day job. This remind= s me I need to get those patches moving again.

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

I don=E2=80= =99t think it is likely that your graphics issue is related to HII resourc= es. Most of the times when I track down the =E2=80=9Cit does not work with = clang (Xcode uses clang)=E2=80=9D it ends up being the clang compiler optim= izing 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 b= e helpful to know if it is likely an undefined behavior difference. =

Unfortunately the graphics issue is going= to be hard to track down if we can=E2=80=99t reproduce it locally. =
[1] Easiest way to find them is:
/Volumes/Case/edk= 2-github(master)>git grep '$(TO= OL_CHAIN_TAG) =3D=3D "XCODE5"'
OvmfPkg/OvmfPkgIa32.dsc:252:!if $(TOOL_CHAIN_TAG) =3D=3D "XCODE= 5"
OvmfPkg/OvmfPk= gIa32X64.dsc:256:!if $(TOOL_CHAIN_TAG) =3D=3D "XCODE5"
OvmfPkg/OvmfPkgX64.dsc:256:!if $= (TOOL_CHAIN_TAG) =3D=3D "XCODE5"
OvmfPkg/OvmfXen.dsc<= /span>:233:!if $(TOOL_CHAIN_TAG) =3D=3D "XCODE5"
UefiCpuPkg/UefiCpuPkg.dsc= :63:!if $(TOOL_CHAIN_TAG) =3D=3D "XCODE5"
=
<= span style=3D"white-space: pre-wrap;" class=3D"">Thanks,

=
Andrew Fish

On Oct 15, 2020, at 8:22 AM, <= a href=3D"mailto:crudo.daniele@gmail.com" class=3D"">crudo.daniele@gmail.co= m wrote:

<= pre id=3D"comment_text_0" class=3D"bz_comment_text" style=3D"width: 50em; b= ackground-color: #ffffff;">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. 202008 stable= releases from github).
My commands for v. 202008, on mac OS:=

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
=
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 moni= tors 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 ed= k2 on kali linux, except for the last line which became:
buil= d -a X64 -b RELEASE -p OvmfPkg/OvmfPkgX64.dsc -t GCC5

and 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 th= e compilation log from mac OS.

Thanks

Daniele
<log-macOs.txt.zi= p>

--Apple-Mail=_F4143883-699D-4857-A95A-25C50E6C2FC9--