From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Permerror (SPF Permanent Error: More than 10 MX records returned) identity=mailfrom; client-ip=134.134.136.100; helo=mga07.intel.com; envelope-from=liming.gao@intel.com; receiver=edk2-devel@lists.01.org Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 7D5852217CE3E for ; Fri, 8 Dec 2017 06:08:53 -0800 (PST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by orsmga105.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 08 Dec 2017 06:13:26 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.45,377,1508828400"; d="scan'208";a="184877979" Received: from fmsmsx106.amr.corp.intel.com ([10.18.124.204]) by fmsmga005.fm.intel.com with ESMTP; 08 Dec 2017 06:13:26 -0800 Received: from fmsmsx119.amr.corp.intel.com (10.18.124.207) by FMSMSX106.amr.corp.intel.com (10.18.124.204) with Microsoft SMTP Server (TLS) id 14.3.319.2; Fri, 8 Dec 2017 06:13:26 -0800 Received: from shsmsx102.ccr.corp.intel.com (10.239.4.154) by FMSMSX119.amr.corp.intel.com (10.18.124.207) with Microsoft SMTP Server (TLS) id 14.3.319.2; Fri, 8 Dec 2017 06:13:25 -0800 Received: from shsmsx104.ccr.corp.intel.com ([169.254.5.152]) by shsmsx102.ccr.corp.intel.com ([169.254.2.175]) with mapi id 14.03.0319.002; Fri, 8 Dec 2017 22:13:24 +0800 From: "Gao, Liming" To: Pete Batard , "edk2-devel@lists.01.org" Thread-Topic: [PATCH v3 0/6] Add ARM support for VS2017 Thread-Index: AQHTcC3PfdmC7jYSC0WcyaE9MnA3S6M5fNpw Date: Fri, 8 Dec 2017 14:13:23 +0000 Message-ID: <4A89E2EF3DFEDB4C8BFDE51014F606A14E18DBDA@SHSMSX104.ccr.corp.intel.com> References: <20171208140631.4252-1-pete@akeo.ie> In-Reply-To: <20171208140631.4252-1-pete@akeo.ie> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-version: 11.0.0.116 dlp-reaction: no-action x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Subject: Re: [PATCH v3 0/6] Add ARM support for VS2017 X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Dec 2017 14:08:53 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Pete: Thanks for your update. I have no other comment on BaseTools and MdePkg p= art. Reviewed-by: Liming Gao > -----Original Message----- > From: Pete Batard [mailto:pete@akeo.ie] > Sent: Friday, December 8, 2017 10:06 PM > To: edk2-devel@lists.01.org > Cc: Gao, Liming > Subject: [PATCH v3 0/6] Add ARM support for VS2017 >=20 > This v3 is the same as v2, except for the following comment added in > tools_def for VS2017: > # Building of XIP firmware images for ARM is not currently supported (onl= y applications). > # /FILEALIGN:4096 and other changes are needed for ARM firmware builds. >=20 > The following series adds ARM compilation support for the VS2017 toolchai= n. > * PATCH 1 targets the disabling of VS Level 4 warnings. The disabled warn= ings > for ARM are now aligned with IA32 and X64. > * PATCH 2 adds a NULL handler for the base stack check, since this is a G= CC > functionality. > * PATCH 3 updates MdePkg/Library/BaseLib so that the RVCT assembly source= s > are also used for MSFT. > * PATCH 4 adds the required compiler intrinsics replacements for division= , > shift and memset/memcpy. > * PATCH 5 adds variable argument handlers for print output. Note that thi= s > is done without relying on any external headers, with the VA_ARG macro > having been reverse engineered from MSFT ARM assembly output. > * PATCH 6 enables the selection of ARM in the conf templates. >=20 > With these patches, VS2017 toolchain users should be able to compile > regular UEFI ARM applications using EDK2. Note that, unlike ARM64 support= , > ARM support does not require a specific update of Visual Studio 2017, as > the ARM toolchain has been available from the very first release. >=20 > Additional notes: >=20 > We tested compiling and running the full UEFI Shell with this series, as > well as a small set of applications and drivers, and found no issues. > With an additional patch [1], it is also possible to use this proposal to > compile a complete QEMU ARM firmware. As the patch shows, the changes tha= t > need to be applied to the EDK2 sources to achieve this are actually very > minimal. >=20 > However, the generated firmware does not currently boot, possibly because > of the following warnings being generated by the MS compiler: > - ArmCpuDxe.dll : warning LNK4072: section count 118 exceeds max (96); im= age may not run > - UiApp.dll : warning LNK4072: section count 113 exceeds max (96); image = may not run >=20 > As far as I could see, the section count max is hardcoded so a workaround > would be needed to address those. >=20 > Also, because the VS2017 ARM compiler forces a section alignment of 4096 > bytes (which in turn forces use to use /FILEALIGN:4096 as a linker option > for the firmware generation), the generated firmware exceeds 2MB and we > had to double its size to 4MB. >=20 > At this stage, since the goal of this series is to allow users to compile > regular ARM UEFI applications using the VS2017 toolchain, I have non plan= s > to spend more time on the QEMU firmware issues, especially as I suspect > that reducing the firmware size back to 2 MB may not be achievable withou= t > Microsoft altering their compiler. I am however hopeful that ARM > specialists can take this matter over eventually... >=20 > Regards, >=20 > /Pete >=20 > [1] https://github.com/pbatard/edk2/commit/c4ce41094a46f4f3dc7ccc64a90604= 813f037b13 >=20 > Pete Batard (6): > MdePkg: Disable some Level 4 warnings for VS2017/ARM > MdePkg/Library/BaseStackCheckLib: Add Null handler for VS2017/ARM > MdePkg/Library/BaseLib: Enable VS2017/ARM builds > ArmPkg/Library/CompilerIntrinsicsLib: Enable VS2017/ARM builds > MdePkg/Include: Add VA list support for VS2017/ARM > BaseTools/Conf: Add VS2017/ARM support >=20 > ArmPkg/Library/CompilerIntrinsicsLib/Arm/rtdiv.asm | 255 +++= +++++++++++++++++ > ArmPkg/Library/CompilerIntrinsicsLib/Arm/rtsrsh.asm | 45 +++= + > ArmPkg/Library/CompilerIntrinsicsLib/CompilerIntrinsicsLib.inf | 13 +- > ArmPkg/Library/CompilerIntrinsicsLib/memcpy_ms.c | 34 +++ > ArmPkg/Library/CompilerIntrinsicsLib/memset_ms.c | 33 +++ > BaseTools/Conf/build_rule.template | 31 ++- > BaseTools/Conf/tools_def.template | 31 +++ > MdePkg/Include/Arm/ProcessorBind.h | 96 +++= +++-- > MdePkg/Include/Base.h | 13 + > MdePkg/Library/BaseLib/Arm/CpuBreakpoint.asm | 5 +- > MdePkg/Library/BaseLib/BaseLib.inf | 16 +- > MdePkg/Library/BaseStackCheckLib/BaseStackCheckLib.inf | 5 +- > MdePkg/Library/BaseStackCheckLib/BaseStackCheckNull.c | 18 ++ > 13 files changed, 565 insertions(+), 30 deletions(-) > create mode 100644 ArmPkg/Library/CompilerIntrinsicsLib/Arm/rtdiv.asm > create mode 100644 ArmPkg/Library/CompilerIntrinsicsLib/Arm/rtsrsh.asm > create mode 100644 ArmPkg/Library/CompilerIntrinsicsLib/memcpy_ms.c > create mode 100644 ArmPkg/Library/CompilerIntrinsicsLib/memset_ms.c > create mode 100644 MdePkg/Library/BaseStackCheckLib/BaseStackCheckNull.c >=20 > -- > 2.9.3.windows.2