From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: intel.com, ip: 134.134.136.126, mailfrom: tzy.way.ooi@intel.com) Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by groups.io with SMTP; Wed, 17 Jul 2019 02:25:54 -0700 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga007.jf.intel.com ([10.7.209.58]) by orsmga106.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 17 Jul 2019 02:25:53 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,273,1559545200"; d="scan'208";a="158408438" Received: from pgsmsx104.gar.corp.intel.com ([10.221.44.91]) by orsmga007.jf.intel.com with ESMTP; 17 Jul 2019 02:25:51 -0700 Received: from pgsmsx109.gar.corp.intel.com ([169.254.14.91]) by PGSMSX104.gar.corp.intel.com ([169.254.3.64]) with mapi id 14.03.0439.000; Wed, 17 Jul 2019 17:25:50 +0800 From: "Ooi, Tzy Way" To: Leif Lindholm CC: "devel@edk2.groups.io" , Ard BieSheuvel , "Kinney, Michael D" , "Loh, Tien Hock" Subject: Re: [edk2-devel] [PATCH v6 edk2-platforms 1/1] Silicon/Synopsys/Designware/Driver: DwEmacSnpDxe: Add DesignWare EMAC driver Thread-Topic: [edk2-devel] [PATCH v6 edk2-platforms 1/1] Silicon/Synopsys/Designware/Driver: DwEmacSnpDxe: Add DesignWare EMAC driver Thread-Index: AQHVNVuKD5Rtk2wLCkeu0fDmFzVf56bFHqYAgAfmojD////4gIABkeJg Date: Wed, 17 Jul 2019 09:25:49 +0000 Message-ID: <5F1105621EDF844291AF8B109E27C06D34D2EC31@PGSMSX109.gar.corp.intel.com> References: <20190708070507.2493-1-tzy.way.ooi@intel.com> <20190711164316.o7cioscn55mv6bqi@bivouac.eciton.net> <5F1105621EDF844291AF8B109E27C06D34D2E67E@PGSMSX109.gar.corp.intel.com> <20190716172227.wuczvla67izm7ccr@bivouac.eciton.net> In-Reply-To: <20190716172227.wuczvla67izm7ccr@bivouac.eciton.net> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-version: 11.0.600.7 dlp-reaction: no-action x-ctpclassification: CTP_NT x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiOGZmZmZkYzUtY2IzOS00ZTUyLTllZDMtOTA3YzA2M2EyYjg0IiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoienJuTWhQYmUzeHhEc2gyUmFvWlwvMGd4cFFvRmhjZkE2b1o2QUtXZitnMWI1T0h1OERtQW40Smh2UVFIa0Q0YXkifQ== x-originating-ip: [172.30.20.206] MIME-Version: 1.0 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Hi Leif, Ya. I am on Linux. I managed to replicated the warning that you have provi= ded in the previous email thread by using the gcc 8.3. Currently, I'm looking at the compiler warning/error. While I am fixing t= he issue when compiling the source code, I encountered another issue where = the compiler complain "undefined reference to __stack_chk_fail". I check fr= om google and it can be solved by setting -fnostack-protector. Hence, I wou= ld like to ask if is it ok to set this to the CFLAGs for the compiler? Thank you Best regards, Tzy Way -----Original Message----- From: Leif Lindholm =20 Sent: Wednesday, July 17, 2019 1:22 AM To: Ooi, Tzy Way Cc: devel@edk2.groups.io; Ard BieSheuvel ; Kinn= ey, Michael D ; Loh, Tien Hock Subject: Re: [edk2-devel] [PATCH v6 edk2-platforms 1/1] Silicon/Synopsys/D= esignware/Driver: DwEmacSnpDxe: Add DesignWare EMAC driver Hi Tzy Way, On Tue, Jul 16, 2019 at 09:37:38AM +0000, Ooi, Tzy Way wrote: > I am new to the compilation tools. May I know if you can share to me=20 > how to run the compilation with Debian's gcc 8.3 so that I can see the= =20 > same warning described below? Currently, I am using linaro toolchain=20 > 7.2.1 and follow the guide in the link below to compile the source=20 > code. > > https://github.com/tianocore/edk2-platforms >=20 > I am not able to see any warning in the compilation messages. Wonder=20 > if I need to enable something, for example some CFLAGS during=20 > compilation? Yeah, the tools are getting stricter all the time - but we don't want to m= erge code we can't build with the toolchains included in current long-term = supported Linux distributions. What does your setup look like today - are you on Windows or Linux? If Linux, can you use WSL? Cross compilation tools for both ARM and AARCH64 (and the very latest ones= Ia32/X64) are available in several current Linux distributions (and hence = in WSL). Best Regards, Leif >=20 > Thank you in advance. >=20 > Best regards, > Tzy Way >=20 > -----Original Message----- > From: devel@edk2.groups.io On Behalf Of Leif=20 > Lindholm > Sent: Friday, July 12, 2019 12:43 AM > To: Ooi, Tzy Way > Cc: devel@edk2.groups.io; Ard BieSheuvel ;=20 > Kinney, Michael D ; Loh, Tien Hock=20 > > Subject: Re: [edk2-devel] [PATCH v6 edk2-platforms 1/1]=20 > Silicon/Synopsys/Designware/Driver: DwEmacSnpDxe: Add DesignWare EMAC=20 > driver >=20 > Hi Tzy Way, >=20 > Nearly there, but please make sure BaseTools/Scripts/PatchCheck.py runs = without warnings or errors (there are quite a few still in this version). >=20 > Building the .dsc using current edk2 fails with 'MdeModulePkg/Library/Dx= eNetLib/DxeNetLib.inf is not found in packages path' > The path needs to be updated to NetworkPkg/Library/DxeNetLib/DxeNetLib.i= nf. >=20 > Secondly, could you add NOOPT as a BUILD_TARGET, in addition to DEBUG an= d RELEASE? >=20 > Also, Debian's gcc 8.3 throws a set of compilation errors (both DEBUG an= d RELEASE) when building for AARCH64: >=20 > /work/git/edk2-platforms/Silicon/Synopsys/DesignWare/Drivers/DwEmacSnpDx= e/EmacDxeUtil.c: In function <80><98>EmacSetupTxdesc<80><99>: > /work/git/edk2-platforms/Silicon/Synopsys/DesignWare/Drivers/DwEmacSnpDx= e/EmacDxeUtil.c:236:81: error: iteration 9 invokes undefined behavior [-Wer= ror=3Daggressive-loop-optimizations] > TxDescriptor->AddrNext =3D (UINT32)(UINTN)EmacDriver->TxdescRingMap= [Index + 1].AddrMap; > > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~ > /work/git/edk2-platforms/Silicon/Synopsys/DesignWare/Drivers/DwEmacSnpDx= e/EmacDxeUtil.c:233:3: note: within this loop > for (Index =3D 0; Index < CONFIG_TX_DESCR_NUM; Index++) { > ^~~ > /work/git/edk2-platforms/Silicon/Synopsys/DesignWare/Drivers/DwEmacSnpDx= e/EmacDxeUtil.c: In function <80><98>EmacSetupRxdesc<80><99>: > /work/git/edk2-platforms/Silicon/Synopsys/DesignWare/Drivers/DwEmacSnpDx= e/EmacDxeUtil.c:270:81: error: iteration 9 invokes undefined behavior [-Wer= ror=3Daggressive-loop-optimizations] > RxDescriptor->AddrNext =3D (UINT32)(UINTN)EmacDriver->RxdescRingMap= [Index + 1].AddrMap; > > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~ > /work/git/edk2-platforms/Silicon/Synopsys/DesignWare/Drivers/DwEmacSnpDx= e/EmacDxeUtil.c:267:3: note: within this loop > for (Index =3D 0; Index < CONFIG_RX_DESCR_NUM; Index++) { > ^~~ > cc1: all warnings being treated as errors >=20 >=20 > It also throws the following errors when building for ARM: > /work/git/edk2-platforms/Silicon/Synopsys/DesignWare/Drivers/DwEmacSnpDx= e/DwEmacSnpDxe.c: In function <80><98>SnpTransmit<80><99>: > /work/git/edk2-platforms/Silicon/Synopsys/DesignWare/Drivers/DwEmacSnpDx= e/DwEmacSnpDxe.c:962:21: error: cast to pointer from integer of different s= ize [-Werror=3Dint-to-pointer-cast] > TxDescriptorMap =3D (VOID *)Snp->MacDriver.TxdescRingMap[DescNum].Add= rMap; > ^ > /work/git/edk2-platforms/Silicon/Synopsys/DesignWare/Drivers/DwEmacSnpDx= e/DwEmacSnpDxe.c:1026:51: error: cast from pointer to integer of different = size [-Werror=3Dpointer-to-int-cast] > Snp->RecycledTxBuf[Snp->RecycledTxBufCount] =3D (UINT64) Data; > ^ > /work/git/edk2-platforms/Silicon/Synopsys/DesignWare/Drivers/DwEmacSnpDx= e/DwEmacSnpDxe.c: In function <80><98>SnpReceive<80><99>: > /work/git/edk2-platforms/Silicon/Synopsys/DesignWare/Drivers/DwEmacSnpDx= e/DwEmacSnpDxe.c:1143:21: error: cast to pointer from integer of different = size [-Werror=3Dint-to-pointer-cast] > RxDescriptorMap =3D (VOID *)Snp->MacDriver.RxdescRingMap[DescNum].Add= rMap; > ^ > cc1: all warnings being treated as errors >=20 >=20 > Could you please look into and address these issues for the next version= ? >=20 > Best Regards, >=20 > Leif >=20 > On Mon, Jul 08, 2019 at 03:05:07PM +0800, tzy.way.ooi@intel.com wrote: > > From: Ooi Tzy Way > >=20 > > Add driver support for the Ethernet MAC based on Synopsys DesignWare > > 3504-0 Universal 10/100/1000 Ethernet MAC and KSZ9031 PHY > >=20 > > Cc: Ard BieSheuvel > > Cc: Leif Lindholm > > Cc: Michael D Kinney > > Cc: Loh Tien Hock > >=20 > > Contributed-under: Tianocore Contribution Agreement 1.1 > > Signed-off-by: Ooi Tzy Way > >=20 > > --- > > v6: > > - Update to recent version for EDK2 specific file formats > > - Update the directory layout to Silicon/Synopsys/DesignWare > > - Add a DesignWare.dsc for building this driver > > - Update the license > > - Update the .c file to declare its own include file > > - Remove __ in defining the header file > > - Fix indentation > > - Delete commented-out code >=20 >=20 >=20