public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Gao, Liming" <liming.gao@intel.com>
To: Pete Batard <pete@akeo.ie>,
	"edk2-devel@lists.01.org" <edk2-devel@lists.01.org>
Subject: Re: [PATCH v3 0/6] Add ARM support for VS2017
Date: Fri, 8 Dec 2017 14:13:23 +0000	[thread overview]
Message-ID: <4A89E2EF3DFEDB4C8BFDE51014F606A14E18DBDA@SHSMSX104.ccr.corp.intel.com> (raw)
In-Reply-To: <20171208140631.4252-1-pete@akeo.ie>

Pete:
  Thanks for your update. I have no other comment on BaseTools and MdePkg part. Reviewed-by: Liming Gao <liming.gao@intel.com>

> -----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 <liming.gao@intel.com>
> Subject: [PATCH v3 0/6] Add ARM support for VS2017
> 
> 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 (only applications).
> # /FILEALIGN:4096 and other changes are needed for ARM firmware builds.
> 
> The following series adds ARM compilation support for the VS2017 toolchain.
> * PATCH 1 targets the disabling of VS Level 4 warnings. The disabled warnings
>   for ARM are now aligned with IA32 and X64.
> * PATCH 2 adds a NULL handler for the base stack check, since this is a GCC
>   functionality.
> * PATCH 3 updates MdePkg/Library/BaseLib so that the RVCT assembly sources
>   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 this
>   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.
> 
> 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.
> 
> Additional notes:
> 
> 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 that
> need to be applied to the EDK2 sources to achieve this are actually very
> minimal.
> 
> 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); image may not run
> - UiApp.dll : warning LNK4072: section count 113 exceeds max (96); image may not run
> 
> As far as I could see, the section count max is hardcoded so a workaround
> would be needed to address those.
> 
> 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.
> 
> 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 plans
> 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 without
> Microsoft altering their compiler. I am however hopeful that ARM
> specialists can take this matter over eventually...
> 
> Regards,
> 
> /Pete
> 
> [1] https://github.com/pbatard/edk2/commit/c4ce41094a46f4f3dc7ccc64a90604813f037b13
> 
> 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
> 
>  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
> 
> --
> 2.9.3.windows.2



      parent reply	other threads:[~2017-12-08 14:08 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-08 14:06 [PATCH v3 0/6] Add ARM support for VS2017 Pete Batard
2017-12-08 14:06 ` [PATCH v3 1/6] MdePkg: Disable some Level 4 warnings for VS2017/ARM Pete Batard
2017-12-08 14:06 ` [PATCH v3 2/6] MdePkg/Library/BaseStackCheckLib: Add Null handler " Pete Batard
2017-12-08 14:06 ` [PATCH v3 3/6] MdePkg/Library/BaseLib: Enable VS2017/ARM builds Pete Batard
2017-12-08 14:06 ` [PATCH v3 4/6] ArmPkg/Library/CompilerIntrinsicsLib: " Pete Batard
2017-12-10 13:30   ` Gao, Liming
2017-12-12 19:59   ` Ard Biesheuvel
2017-12-13 13:56     ` Pete Batard
2017-12-14 14:05       ` Ard Biesheuvel
2017-12-08 14:06 ` [PATCH v3 5/6] MdePkg/Include: Add VA list support for VS2017/ARM Pete Batard
2017-12-08 14:06 ` [PATCH v3 6/6] BaseTools/Conf: Add VS2017/ARM support Pete Batard
2017-12-08 14:13 ` Gao, Liming [this message]

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=4A89E2EF3DFEDB4C8BFDE51014F606A14E18DBDA@SHSMSX104.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