[edk2] [PATCH 3/6] MdePkg/Library/BaseLib: Enable VS2017/ARM builds

Pete Batard posted 6 patches 7 years ago
There is a newer version of this series
[edk2] [PATCH 3/6] MdePkg/Library/BaseLib: Enable VS2017/ARM builds
Posted by Pete Batard 7 years ago
Most of the RVCT assembly can be reused as is for MSFT except
for CpuBreakpoint.asm, which we need to force to Arm mode.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Pete Batard <pete@akeo.ie>
---
 MdePkg/Library/BaseLib/Arm/CpuBreakpoint.asm |  5 ++++-
 MdePkg/Library/BaseLib/BaseLib.inf           | 19 ++++++++++++++++---
 2 files changed, 20 insertions(+), 4 deletions(-)

diff --git a/MdePkg/Library/BaseLib/Arm/CpuBreakpoint.asm b/MdePkg/Library/BaseLib/Arm/CpuBreakpoint.asm
index 8a8065159bf2..2e508d6f1ad8 100644
--- a/MdePkg/Library/BaseLib/Arm/CpuBreakpoint.asm
+++ b/MdePkg/Library/BaseLib/Arm/CpuBreakpoint.asm
@@ -16,7 +16,10 @@
 
     EXPORT CpuBreakpoint
 
-  AREA Cpu_Breakpoint, CODE, READONLY
+; Force ARM mode for this section, as MSFT assembler defaults to THUMB
+  AREA Cpu_Breakpoint, CODE, READONLY, ARM
+
+    ARM
 
 ;/**
 ;  Generates a breakpoint on the CPU.
diff --git a/MdePkg/Library/BaseLib/BaseLib.inf b/MdePkg/Library/BaseLib/BaseLib.inf
index 320ac457ea3d..4337a125d516 100644
--- a/MdePkg/Library/BaseLib/BaseLib.inf
+++ b/MdePkg/Library/BaseLib/BaseLib.inf
@@ -821,8 +821,9 @@ [Sources.EBC]
 [Sources.ARM]
   Arm/InternalSwitchStack.c
   Arm/Unaligned.c
-  Math64.c                   | RVCT 
-    
+  Math64.c                   | RVCT
+  Math64.c                   | MSFT
+
   Arm/SwitchStack.asm        | RVCT
   Arm/SetJumpLongJump.asm    | RVCT
   Arm/DisableInterrupts.asm  | RVCT
@@ -831,7 +832,16 @@ [Sources.ARM]
   Arm/CpuPause.asm           | RVCT
   Arm/CpuBreakpoint.asm      | RVCT
   Arm/MemoryFence.asm        | RVCT
- 
+
+  Arm/SwitchStack.asm        | MSFT
+  Arm/SetJumpLongJump.asm    | MSFT
+  Arm/DisableInterrupts.asm  | MSFT
+  Arm/EnableInterrupts.asm   | MSFT
+  Arm/GetInterruptsState.asm | MSFT
+  Arm/CpuPause.asm           | MSFT
+  Arm/CpuBreakpoint.asm      | MSFT
+  Arm/MemoryFence.asm        | MSFT
+
   Arm/Math64.S                  | GCC
   Arm/SwitchStack.S             | GCC
   Arm/EnableInterrupts.S        | GCC
@@ -870,3 +880,6 @@ [Pcd]
 
 [FeaturePcd]
   gEfiMdePkgTokenSpaceGuid.PcdVerifyNodeInList  ## CONSUMES
+
+[BuildOptions]
+  MSFT:*_*_ARM_CC_FLAGS = /GL-
-- 
2.9.3.windows.2

_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel
Re: [edk2] [PATCH 3/6] MdePkg/Library/BaseLib: Enable VS2017/ARM builds
Posted by Gao, Liming 7 years ago
Pete:
  Why override compiler option /GL- here?

> -----Original Message-----
> From: Pete Batard [mailto:pete@akeo.ie]
> Sent: Monday, December 4, 2017 9:12 PM
> To: edk2-devel@lists.01.org
> Cc: Gao, Liming <liming.gao@intel.com>
> Subject: [PATCH 3/6] MdePkg/Library/BaseLib: Enable VS2017/ARM builds
> 
> Most of the RVCT assembly can be reused as is for MSFT except
> for CpuBreakpoint.asm, which we need to force to Arm mode.
> 
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Pete Batard <pete@akeo.ie>
> ---
>  MdePkg/Library/BaseLib/Arm/CpuBreakpoint.asm |  5 ++++-
>  MdePkg/Library/BaseLib/BaseLib.inf           | 19 ++++++++++++++++---
>  2 files changed, 20 insertions(+), 4 deletions(-)
> 
> diff --git a/MdePkg/Library/BaseLib/Arm/CpuBreakpoint.asm b/MdePkg/Library/BaseLib/Arm/CpuBreakpoint.asm
> index 8a8065159bf2..2e508d6f1ad8 100644
> --- a/MdePkg/Library/BaseLib/Arm/CpuBreakpoint.asm
> +++ b/MdePkg/Library/BaseLib/Arm/CpuBreakpoint.asm
> @@ -16,7 +16,10 @@
> 
>      EXPORT CpuBreakpoint
> 
> -  AREA Cpu_Breakpoint, CODE, READONLY
> +; Force ARM mode for this section, as MSFT assembler defaults to THUMB
> +  AREA Cpu_Breakpoint, CODE, READONLY, ARM
> +
> +    ARM
> 
>  ;/**
>  ;  Generates a breakpoint on the CPU.
> diff --git a/MdePkg/Library/BaseLib/BaseLib.inf b/MdePkg/Library/BaseLib/BaseLib.inf
> index 320ac457ea3d..4337a125d516 100644
> --- a/MdePkg/Library/BaseLib/BaseLib.inf
> +++ b/MdePkg/Library/BaseLib/BaseLib.inf
> @@ -821,8 +821,9 @@ [Sources.EBC]
>  [Sources.ARM]
>    Arm/InternalSwitchStack.c
>    Arm/Unaligned.c
> -  Math64.c                   | RVCT
> -
> +  Math64.c                   | RVCT
> +  Math64.c                   | MSFT
> +
>    Arm/SwitchStack.asm        | RVCT
>    Arm/SetJumpLongJump.asm    | RVCT
>    Arm/DisableInterrupts.asm  | RVCT
> @@ -831,7 +832,16 @@ [Sources.ARM]
>    Arm/CpuPause.asm           | RVCT
>    Arm/CpuBreakpoint.asm      | RVCT
>    Arm/MemoryFence.asm        | RVCT
> -
> +
> +  Arm/SwitchStack.asm        | MSFT
> +  Arm/SetJumpLongJump.asm    | MSFT
> +  Arm/DisableInterrupts.asm  | MSFT
> +  Arm/EnableInterrupts.asm   | MSFT
> +  Arm/GetInterruptsState.asm | MSFT
> +  Arm/CpuPause.asm           | MSFT
> +  Arm/CpuBreakpoint.asm      | MSFT
> +  Arm/MemoryFence.asm        | MSFT
> +
>    Arm/Math64.S                  | GCC
>    Arm/SwitchStack.S             | GCC
>    Arm/EnableInterrupts.S        | GCC
> @@ -870,3 +880,6 @@ [Pcd]
> 
>  [FeaturePcd]
>    gEfiMdePkgTokenSpaceGuid.PcdVerifyNodeInList  ## CONSUMES
> +
> +[BuildOptions]
> +  MSFT:*_*_ARM_CC_FLAGS = /GL-
> --
> 2.9.3.windows.2

_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel
Re: [edk2] [PATCH 3/6] MdePkg/Library/BaseLib: Enable VS2017/ARM builds
Posted by Pete Batard 7 years ago
On 2017.12.04 15:40, Gao, Liming wrote:
> Pete:
>    Why override compiler option /GL- here?

I carried this /GL- override from an earlier patch, as I was initially 
experiencing breakage when trying to compile some drivers without it 
during linking.

However, I have now re-tested without this option, and I can't see any 
instance where /GL- appears to be needed.

I will therefore remove it and submit a new patch.

Regards,

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