[edk2] [PATCH 0/4] BaseTools: Add VS2017 support, including ARM and AARCH64

Pete Batard posted 4 patches 6 years, 4 months ago
Failed in applying to current master (apply log)
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                                             |  30 +++
ArmPkg/Library/CompilerIntrinsicsLib/memset_ms.c                                             |  29 +++
BaseTools/Conf/build_rule.template                                                           |  30 +++
BaseTools/Conf/tools_def.template                                                            | 168 +++++++++++++
BaseTools/set_vsprefix_envs.bat                                                              |   9 +
MdeModulePkg/Application/UiApp/FrontPageCustomizedUiSupport.c                                |   2 +-
MdeModulePkg/Library/BootMaintenanceManagerUiLib/BootMaintenanceManagerCustomizedUiSupport.c |   2 +-
MdeModulePkg/Universal/HiiDatabaseDxe/ConfigRouting.c                                        |   2 +-
MdeModulePkg/Universal/Network/MnpDxe/MnpMain.c                                              |   2 +-
MdePkg/Include/Base.h                                                                        |  15 ++
MdePkg/Library/BaseLib/AArch64/CpuBreakpoint.asm                                             |  39 +++
MdePkg/Library/BaseLib/AArch64/DisableInterrupts.asm                                         |  37 +++
MdePkg/Library/BaseLib/AArch64/EnableInterrupts.asm                                          |  37 +++
MdePkg/Library/BaseLib/AArch64/GetInterruptsState.asm                                        |  49 ++++
MdePkg/Library/BaseLib/AArch64/MemoryFence.asm                                               |  38 +++
MdePkg/Library/BaseLib/AArch64/SetJumpLongJump.asm                                           | 101 ++++++++
MdePkg/Library/BaseLib/AArch64/SwitchStack.asm                                               |  69 ++++++
MdePkg/Library/BaseLib/Arm/CpuBreakpoint.asm                                                 |   5 +-
MdePkg/Library/BaseLib/BaseLib.inf                                                           |  27 ++-
MdePkg/Library/BaseStackCheckLib/BaseStackCheckLib.inf                                       |   5 +-
MdePkg/Library/BaseStackCheckLib/BaseStackCheckNull.c                                        |  18 ++
NetworkPkg/HttpBootDxe/HttpBootImpl.c                                                        |   2 +-
NetworkPkg/HttpBootDxe/HttpBootSupport.c                                                     |   2 +-
Nt32Pkg/Sec/SecMain.inf                                                                      |   2 +
27 files changed, 1019 insertions(+), 14 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/BaseLib/AArch64/CpuBreakpoint.asm
create mode 100644 MdePkg/Library/BaseLib/AArch64/DisableInterrupts.asm
create mode 100644 MdePkg/Library/BaseLib/AArch64/EnableInterrupts.asm
create mode 100644 MdePkg/Library/BaseLib/AArch64/GetInterruptsState.asm
create mode 100644 MdePkg/Library/BaseLib/AArch64/MemoryFence.asm
create mode 100644 MdePkg/Library/BaseLib/AArch64/SetJumpLongJump.asm
create mode 100644 MdePkg/Library/BaseLib/AArch64/SwitchStack.asm
create mode 100644 MdePkg/Library/BaseStackCheckLib/BaseStackCheckNull.c
[edk2] [PATCH 0/4] BaseTools: Add VS2017 support, including ARM and AARCH64
Posted by Pete Batard 6 years, 4 months ago
Seeing that Visual Studio Update 4 finally added native ARM64 compilation
support and this is an open task:
https://github.com/tianocore/tianocore.github.io/wiki/Tasks

This series is broken down into:
- A preliminary patch, to eliminate new warnings that would be produced for
  VS2017/IA32
- IA32 + X64 support
- ARM support
- AARCH64 support

Notes:
- Considering that the multiplication of toolchain flavours is probably not in
  our best interest when it comes to maintenance, I deliberately chose not to
  create extra VS2017 variants (for x64, ASL and EBC). For one thing, I had
  some issues with the x64 tools for ARM compilation (which may very well have
  been my own), and I'd rather see the variants being added after their need
  has been justified by their potential users, rather than preemptively.
- ARM and ARM64 should be considered EXPERIMENTAL at this stage.
  I've had some good success compiling and running moderately complex drivers
  (e.g. ZFS file system driver) using the proposed patches on ARM/ARM64, and I
  am also confident that simple applications should be fine, but more work is
  required to produce QEMU ARM/AARCH64 firmware images, mostly due to missing
  .asm files. Since most of the RVCT .asm files can be reused mostly unchanged
  for MSFT, I was able to cajole the ARM process to go up to the QEMU image
  generation (which failed due to some alignment issue), which gives me some
  confidence that we should eventually be able to use the MSFT toolchain to
  produce working images for ARM and ARM64, but this will require some work.
- While the VS2017 version of IA32 and X64 do not silence any level 4 warnings
  by default, to bring them to par with VS2015, the ARM and ARM64 versions
  have to silence 3 of them, as VS is a bit less leniant than gcc/Clang.
  Again, it should be possible to remove the silencing of these warnings
  eventually, but this will require some work.
- Finally, you'll see that a whole section of build_rule.template had to be
  duplicated just so that we could remove the --convert-hex option for the
  MSFT ARM/ARM64 assemblers. Maybe there is a better way to achieve the
  removal of that option, but I haven't found it.

Regards,

/Pete

Pete Batard (4):
  MdeModulePkg, NetworkPkg: Fix VS2017 IA32 warnings
  BaseTools: Add VS2017 IA32 and X64 support
  BaseTools: Add VS2017 ARM support
  BaseTools: Add VS2017 AARCH64 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                                             |  30 +++
 ArmPkg/Library/CompilerIntrinsicsLib/memset_ms.c                                             |  29 +++
 BaseTools/Conf/build_rule.template                                                           |  30 +++
 BaseTools/Conf/tools_def.template                                                            | 168 +++++++++++++
 BaseTools/set_vsprefix_envs.bat                                                              |   9 +
 MdeModulePkg/Application/UiApp/FrontPageCustomizedUiSupport.c                                |   2 +-
 MdeModulePkg/Library/BootMaintenanceManagerUiLib/BootMaintenanceManagerCustomizedUiSupport.c |   2 +-
 MdeModulePkg/Universal/HiiDatabaseDxe/ConfigRouting.c                                        |   2 +-
 MdeModulePkg/Universal/Network/MnpDxe/MnpMain.c                                              |   2 +-
 MdePkg/Include/Base.h                                                                        |  15 ++
 MdePkg/Library/BaseLib/AArch64/CpuBreakpoint.asm                                             |  39 +++
 MdePkg/Library/BaseLib/AArch64/DisableInterrupts.asm                                         |  37 +++
 MdePkg/Library/BaseLib/AArch64/EnableInterrupts.asm                                          |  37 +++
 MdePkg/Library/BaseLib/AArch64/GetInterruptsState.asm                                        |  49 ++++
 MdePkg/Library/BaseLib/AArch64/MemoryFence.asm                                               |  38 +++
 MdePkg/Library/BaseLib/AArch64/SetJumpLongJump.asm                                           | 101 ++++++++
 MdePkg/Library/BaseLib/AArch64/SwitchStack.asm                                               |  69 ++++++
 MdePkg/Library/BaseLib/Arm/CpuBreakpoint.asm                                                 |   5 +-
 MdePkg/Library/BaseLib/BaseLib.inf                                                           |  27 ++-
 MdePkg/Library/BaseStackCheckLib/BaseStackCheckLib.inf                                       |   5 +-
 MdePkg/Library/BaseStackCheckLib/BaseStackCheckNull.c                                        |  18 ++
 NetworkPkg/HttpBootDxe/HttpBootImpl.c                                                        |   2 +-
 NetworkPkg/HttpBootDxe/HttpBootSupport.c                                                     |   2 +-
 Nt32Pkg/Sec/SecMain.inf                                                                      |   2 +
 27 files changed, 1019 insertions(+), 14 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/BaseLib/AArch64/CpuBreakpoint.asm
 create mode 100644 MdePkg/Library/BaseLib/AArch64/DisableInterrupts.asm
 create mode 100644 MdePkg/Library/BaseLib/AArch64/EnableInterrupts.asm
 create mode 100644 MdePkg/Library/BaseLib/AArch64/GetInterruptsState.asm
 create mode 100644 MdePkg/Library/BaseLib/AArch64/MemoryFence.asm
 create mode 100644 MdePkg/Library/BaseLib/AArch64/SetJumpLongJump.asm
 create mode 100644 MdePkg/Library/BaseLib/AArch64/SwitchStack.asm
 create mode 100644 MdePkg/Library/BaseStackCheckLib/BaseStackCheckNull.c

-- 
2.14.2

_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel
Re: [edk2] [PATCH 0/4] BaseTools: Add VS2017 support, including ARM and AARCH64
Posted by Gao, Liming 6 years, 4 months ago
Pete:
 Thanks for your contribution. In fact, I have sent one patch serial to add VS2017 tool chain for IA32 and X64. https://lists.01.org/pipermail/edk2-devel/2017-October/016175.html 
 In my patch, I disable warning 4701&4703, because they are also disabled in VS2015. In tools_def.template, to align other VS tool chain, I use VS2017_BIN for 32bit, VS2017_BINX64 for 64bit. Could you follow this rule to define VS2017_BINARM for arm, VS2017_BINAARCH64 for AARCH64? On VS2017, I notice it doesn't set VS150COMNTOOLS env by default. So, I use vswhere.exe to detect VS2017 installation path. When we build source code with VS tool chain, we open normal cmd instead of VS cmd. So, we need to consider the case without VS env. In your patch on ARM support, <stdarg.h> is included in Base.h. This is a windows header file. So, VS env must be setup to build source code with ARM arch. Right? 
 Last, I suggest you base on my patch to add VS2017 ARM and AARCH64 arch. I will still work on VS2017 IA32 and X64. For your patches, I suggest you separate them per package. For example, to add ARM arch, you can create one patch in BaseTools, one patch in MdePkg, another one is ArmPkg. 

Thanks
Liming
> -----Original Message-----
> From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of Pete Batard
> Sent: Tuesday, November 14, 2017 8:32 PM
> To: edk2-devel@lists.01.org
> Subject: [edk2] [PATCH 0/4] BaseTools: Add VS2017 support, including ARM and AARCH64
> 
> Seeing that Visual Studio Update 4 finally added native ARM64 compilation
> support and this is an open task:
> https://github.com/tianocore/tianocore.github.io/wiki/Tasks
> 
> This series is broken down into:
> - A preliminary patch, to eliminate new warnings that would be produced for
>   VS2017/IA32
> - IA32 + X64 support
> - ARM support
> - AARCH64 support
> 
> Notes:
> - Considering that the multiplication of toolchain flavours is probably not in
>   our best interest when it comes to maintenance, I deliberately chose not to
>   create extra VS2017 variants (for x64, ASL and EBC). For one thing, I had
>   some issues with the x64 tools for ARM compilation (which may very well have
>   been my own), and I'd rather see the variants being added after their need
>   has been justified by their potential users, rather than preemptively.
> - ARM and ARM64 should be considered EXPERIMENTAL at this stage.
>   I've had some good success compiling and running moderately complex drivers
>   (e.g. ZFS file system driver) using the proposed patches on ARM/ARM64, and I
>   am also confident that simple applications should be fine, but more work is
>   required to produce QEMU ARM/AARCH64 firmware images, mostly due to missing
>   .asm files. Since most of the RVCT .asm files can be reused mostly unchanged
>   for MSFT, I was able to cajole the ARM process to go up to the QEMU image
>   generation (which failed due to some alignment issue), which gives me some
>   confidence that we should eventually be able to use the MSFT toolchain to
>   produce working images for ARM and ARM64, but this will require some work.
> - While the VS2017 version of IA32 and X64 do not silence any level 4 warnings
>   by default, to bring them to par with VS2015, the ARM and ARM64 versions
>   have to silence 3 of them, as VS is a bit less leniant than gcc/Clang.
>   Again, it should be possible to remove the silencing of these warnings
>   eventually, but this will require some work.
> - Finally, you'll see that a whole section of build_rule.template had to be
>   duplicated just so that we could remove the --convert-hex option for the
>   MSFT ARM/ARM64 assemblers. Maybe there is a better way to achieve the
>   removal of that option, but I haven't found it.
> 
> Regards,
> 
> /Pete
> 
> Pete Batard (4):
>   MdeModulePkg, NetworkPkg: Fix VS2017 IA32 warnings
>   BaseTools: Add VS2017 IA32 and X64 support
>   BaseTools: Add VS2017 ARM support
>   BaseTools: Add VS2017 AARCH64 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                                             |  30 +++
>  ArmPkg/Library/CompilerIntrinsicsLib/memset_ms.c                                             |  29 +++
>  BaseTools/Conf/build_rule.template                                                           |  30 +++
>  BaseTools/Conf/tools_def.template                                                            | 168 +++++++++++++
>  BaseTools/set_vsprefix_envs.bat                                                              |   9 +
>  MdeModulePkg/Application/UiApp/FrontPageCustomizedUiSupport.c                                |   2 +-
>  MdeModulePkg/Library/BootMaintenanceManagerUiLib/BootMaintenanceManagerCustomizedUiSupport.c |   2 +-
>  MdeModulePkg/Universal/HiiDatabaseDxe/ConfigRouting.c                                        |   2 +-
>  MdeModulePkg/Universal/Network/MnpDxe/MnpMain.c                                              |   2 +-
>  MdePkg/Include/Base.h                                                                        |  15 ++
>  MdePkg/Library/BaseLib/AArch64/CpuBreakpoint.asm                                             |  39 +++
>  MdePkg/Library/BaseLib/AArch64/DisableInterrupts.asm                                         |  37 +++
>  MdePkg/Library/BaseLib/AArch64/EnableInterrupts.asm                                          |  37 +++
>  MdePkg/Library/BaseLib/AArch64/GetInterruptsState.asm                                        |  49 ++++
>  MdePkg/Library/BaseLib/AArch64/MemoryFence.asm                                               |  38 +++
>  MdePkg/Library/BaseLib/AArch64/SetJumpLongJump.asm                                           | 101 ++++++++
>  MdePkg/Library/BaseLib/AArch64/SwitchStack.asm                                               |  69 ++++++
>  MdePkg/Library/BaseLib/Arm/CpuBreakpoint.asm                                                 |   5 +-
>  MdePkg/Library/BaseLib/BaseLib.inf                                                           |  27 ++-
>  MdePkg/Library/BaseStackCheckLib/BaseStackCheckLib.inf                                       |   5 +-
>  MdePkg/Library/BaseStackCheckLib/BaseStackCheckNull.c                                        |  18 ++
>  NetworkPkg/HttpBootDxe/HttpBootImpl.c                                                        |   2 +-
>  NetworkPkg/HttpBootDxe/HttpBootSupport.c                                                     |   2 +-
>  Nt32Pkg/Sec/SecMain.inf                                                                      |   2 +
>  27 files changed, 1019 insertions(+), 14 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/BaseLib/AArch64/CpuBreakpoint.asm
>  create mode 100644 MdePkg/Library/BaseLib/AArch64/DisableInterrupts.asm
>  create mode 100644 MdePkg/Library/BaseLib/AArch64/EnableInterrupts.asm
>  create mode 100644 MdePkg/Library/BaseLib/AArch64/GetInterruptsState.asm
>  create mode 100644 MdePkg/Library/BaseLib/AArch64/MemoryFence.asm
>  create mode 100644 MdePkg/Library/BaseLib/AArch64/SetJumpLongJump.asm
>  create mode 100644 MdePkg/Library/BaseLib/AArch64/SwitchStack.asm
>  create mode 100644 MdePkg/Library/BaseStackCheckLib/BaseStackCheckNull.c
> 
> --
> 2.14.2
> 
> _______________________________________________
> edk2-devel mailing list
> edk2-devel@lists.01.org
> https://lists.01.org/mailman/listinfo/edk2-devel
_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel
Re: [edk2] [PATCH 0/4] BaseTools: Add VS2017 support, including ARM and AARCH64
Posted by Pete Batard 6 years, 4 months ago
Hi Liming,

On 2017.11.14 16:03, Gao, Liming wrote:
>   In fact, I have sent one patch serial to add VS2017 tool chain for 
> IA32 and X64. https://lists.01.org/pipermail/edk2-devel/2017-October/016175.html

I missed that proposal, else I would have used it as my base. Thanks for 
pointing it out.

>   In my patch, I disable warning 4701&4703, because they are also disabled in VS2015.

Okay. Then I see no objections to disabling them.

I didn't see the /wd options for those in tools_def.template with 
VS2015, so I thought these needed to be addressed.

But from your looking at your proposal, I realize that these are 
disabled in ProcessorBind.h. Obviously, I'll update my ARM/AARCH64 
proposal so that the warnings for these toolchains are disabled there as 
well, instead of tools_def.template.

> In tools_def.template, to align other VS tool chain, I use VS2017_BIN for 32bit, 
> VS2017_BINX64 for 64bit. Could you follow this rule to define VS2017_BINARM for
> arm, VS2017_BINAARCH64 for AARCH64?

I will do that.

> On VS2017, I notice it doesn't set VS150COMNTOOLS env by default. 
> So, I use vswhere.exe to detect VS2017 installation path. When we build source
> code with VS tool chain, we open normal cmd instead of VS cmd.

I see. I've always been opening a VS command prompt before calling the 
EDK setup script, so I built my proposal around that. But I agree that 
it makes sense to be able to build from regular prompt, so I will try to 
follow your lead.

My only concern is that it may be difficult to locate the relevant ARM 
toolchains without %WindowsSdkVerBinPath% being properly defined.

In your proposal, you seem to be hardcoding WINSDK10_PREFIX to something 
like "%ProgramFiles(x86)%\Windows Kits\10\bin\x86" but that won't work 
with ARM/ARM64 as we will need to get the actual version of the defayult 
SDK installed for VS2017 (e.g. "C:\Program Files (x86)\Windows 
Kits\10\bin\10.0.16299.0\") as the ARM toolchains will not work otherwise.

For instance, on my VS2017 installation the "arm64\" under "Windows 
Kits\10\bin\" does not contain the latest version of the ARM64 tools and 
libraries, which is problematic as proper ARM64 compilation support was 
only enabled with the latest update. Only the one under "Windows 
Kits\10\bin\10.0.16299.0\" does.

All in all, rather than try to guess the SDK path, I think we should try 
to locate and call "%ProgramFiles(x86)%\Microsoft Visual 
Studio\2017\Community\Common7\Tools\vsdevcmd\core\winsdk.bat", to have 
the VS environment provide us with the actual SDK version to use, as 
determined by Microsoft.

> In your patch on ARM support, <stdarg.h> is included in Base.h.
> This is a windows header file. So, VS env must be setup to build source
> code with ARM arch. Right?

That is correct. I had a quick look at removing that header, but didn't 
see much harm in keeping it. However, now that I understand our 
constraints better, I will make sure that header is not referenced.

I will also do the same for memset_ms.c and memcpy_ms.c, introduced for 
ARM/ARM64 (In CompilerIntrinsicsLib), as it references <stddef.h> for 
size_t.

> Last, I suggest you base on my patch to add VS2017 ARM and AARCH64 arch.
 > For your patches, I suggest you separate them per package.

I will follow both these suggestions and send a v2 when ready.

Regards,

/Pete




_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel
Re: [edk2] [PATCH 0/4] BaseTools: Add VS2017 support, including ARM and AARCH64
Posted by Kurt Kennett 6 years, 4 months ago
Does this build and boot a platform?

This should not be committed until a platform is building and booting to UEFI shell, IMO.

K2

-----Original Message-----
From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of Pete Batard
Sent: Tuesday, November 14, 2017 4:32 AM
To: edk2-devel@lists.01.org
Subject: [edk2] [PATCH 0/4] BaseTools: Add VS2017 support, including ARM and AARCH64

Seeing that Visual Studio Update 4 finally added native ARM64 compilation support and this is an open task:
https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Ftianocore%2Ftianocore.github.io%2Fwiki%2FTasks&data=02%7C01%7Ckurt.kennett%40microsoft.com%7C0062ea8181264455563b08d52b5bd042%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C636462595702607346&sdata=L4JTYL92%2FYzobAaoY5GiTevCKF2f3KhByhmJHFCeVc4%3D&reserved=0

This series is broken down into:
- A preliminary patch, to eliminate new warnings that would be produced for
  VS2017/IA32
- IA32 + X64 support
- ARM support
- AARCH64 support

Notes:
- Considering that the multiplication of toolchain flavours is probably not in
  our best interest when it comes to maintenance, I deliberately chose not to
  create extra VS2017 variants (for x64, ASL and EBC). For one thing, I had
  some issues with the x64 tools for ARM compilation (which may very well have
  been my own), and I'd rather see the variants being added after their need
  has been justified by their potential users, rather than preemptively.
- ARM and ARM64 should be considered EXPERIMENTAL at this stage.
  I've had some good success compiling and running moderately complex drivers
  (e.g. ZFS file system driver) using the proposed patches on ARM/ARM64, and I
  am also confident that simple applications should be fine, but more work is
  required to produce QEMU ARM/AARCH64 firmware images, mostly due to missing
  .asm files. Since most of the RVCT .asm files can be reused mostly unchanged
  for MSFT, I was able to cajole the ARM process to go up to the QEMU image
  generation (which failed due to some alignment issue), which gives me some
  confidence that we should eventually be able to use the MSFT toolchain to
  produce working images for ARM and ARM64, but this will require some work.
- While the VS2017 version of IA32 and X64 do not silence any level 4 warnings
  by default, to bring them to par with VS2015, the ARM and ARM64 versions
  have to silence 3 of them, as VS is a bit less leniant than gcc/Clang.
  Again, it should be possible to remove the silencing of these warnings
  eventually, but this will require some work.
- Finally, you'll see that a whole section of build_rule.template had to be
  duplicated just so that we could remove the --convert-hex option for the
  MSFT ARM/ARM64 assemblers. Maybe there is a better way to achieve the
  removal of that option, but I haven't found it.

Regards,

/Pete

Pete Batard (4):
  MdeModulePkg, NetworkPkg: Fix VS2017 IA32 warnings
  BaseTools: Add VS2017 IA32 and X64 support
  BaseTools: Add VS2017 ARM support
  BaseTools: Add VS2017 AARCH64 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                                             |  30 +++
 ArmPkg/Library/CompilerIntrinsicsLib/memset_ms.c                                             |  29 +++
 BaseTools/Conf/build_rule.template                                                           |  30 +++
 BaseTools/Conf/tools_def.template                                                            | 168 +++++++++++++
 BaseTools/set_vsprefix_envs.bat                                                              |   9 +
 MdeModulePkg/Application/UiApp/FrontPageCustomizedUiSupport.c                                |   2 +-
 MdeModulePkg/Library/BootMaintenanceManagerUiLib/BootMaintenanceManagerCustomizedUiSupport.c |   2 +-
 MdeModulePkg/Universal/HiiDatabaseDxe/ConfigRouting.c                                        |   2 +-
 MdeModulePkg/Universal/Network/MnpDxe/MnpMain.c                                              |   2 +-
 MdePkg/Include/Base.h                                                                        |  15 ++
 MdePkg/Library/BaseLib/AArch64/CpuBreakpoint.asm                                             |  39 +++
 MdePkg/Library/BaseLib/AArch64/DisableInterrupts.asm                                         |  37 +++
 MdePkg/Library/BaseLib/AArch64/EnableInterrupts.asm                                          |  37 +++
 MdePkg/Library/BaseLib/AArch64/GetInterruptsState.asm                                        |  49 ++++
 MdePkg/Library/BaseLib/AArch64/MemoryFence.asm                                               |  38 +++
 MdePkg/Library/BaseLib/AArch64/SetJumpLongJump.asm                                           | 101 ++++++++
 MdePkg/Library/BaseLib/AArch64/SwitchStack.asm                                               |  69 ++++++
 MdePkg/Library/BaseLib/Arm/CpuBreakpoint.asm                                                 |   5 +-
 MdePkg/Library/BaseLib/BaseLib.inf                                                           |  27 ++-
 MdePkg/Library/BaseStackCheckLib/BaseStackCheckLib.inf                                       |   5 +-
 MdePkg/Library/BaseStackCheckLib/BaseStackCheckNull.c                                        |  18 ++
 NetworkPkg/HttpBootDxe/HttpBootImpl.c                                                        |   2 +-
 NetworkPkg/HttpBootDxe/HttpBootSupport.c                                                     |   2 +-
 Nt32Pkg/Sec/SecMain.inf                                                                      |   2 +
 27 files changed, 1019 insertions(+), 14 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/BaseLib/AArch64/CpuBreakpoint.asm
 create mode 100644 MdePkg/Library/BaseLib/AArch64/DisableInterrupts.asm
 create mode 100644 MdePkg/Library/BaseLib/AArch64/EnableInterrupts.asm
 create mode 100644 MdePkg/Library/BaseLib/AArch64/GetInterruptsState.asm
 create mode 100644 MdePkg/Library/BaseLib/AArch64/MemoryFence.asm
 create mode 100644 MdePkg/Library/BaseLib/AArch64/SetJumpLongJump.asm
 create mode 100644 MdePkg/Library/BaseLib/AArch64/SwitchStack.asm
 create mode 100644 MdePkg/Library/BaseStackCheckLib/BaseStackCheckNull.c

--
2.14.2

_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.01.org%2Fmailman%2Flistinfo%2Fedk2-devel&data=02%7C01%7Ckurt.kennett%40microsoft.com%7C0062ea8181264455563b08d52b5bd042%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C636462595702607346&sdata=bQcyjBCjCRoXCWXiEcTKhFoKPaOvzlGxRozfwXYA35U%3D&reserved=0
_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel
Re: [edk2] [PATCH 0/4] BaseTools: Add VS2017 support, including ARM and AARCH64
Posted by Pete Batard 6 years, 4 months ago
Hi Kurt,

On 2017.11.14 16:16, Kurt Kennett wrote:
> Does this build and boot a platform?

Not yet, but I believe I got pretty close to a full build for ARM.

However, the resources I can devote to finalizing ARM image generation, 
and even more so, to add the missing resources for AARCH64 image 
generation are limited, even more so as I am no ARM specialist.

I was actually hoping that, with the application of these patches, EDK2 
contributors would step in to help with the effort of filling the 
assembly gaps, as well as finalize image generation for ARM and AARCH64.

> This should not be committed until a platform is building and booting to UEFI shell, IMO.

Well, I see it a bit as a catch 22.

If we don't get the VS2017 ARM toolchains in, I don't think many people 
will be willing to help with the image generation, because there will be 
very little incentive for them to do so. And if we wait for image 
generation to be sorted out before adding the toolchains, it may very 
well be a couple more years before everything is finalized... which 
would penalize the people who simply want the convenience of VS2017 
support to build regular ARM and AARCH64 applications.

IMO, a gradual approach to introducing VS2017 ARM/AARCH64 support might 
be preferable to an "all or nothing" one.

Regards,

/Pete
_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel