public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [Patch V2 0/7] Fix package build issues
@ 2021-11-03 22:59 Michael D Kinney
  2021-11-03 22:59 ` [Patch V2 1/7] DynamicTablesPkg: Add missing BaseStackCheckLib instance Michael D Kinney
                   ` (6 more replies)
  0 siblings, 7 replies; 19+ messages in thread
From: Michael D Kinney @ 2021-11-03 22:59 UTC (permalink / raw)
  To: devel
  Cc: Hao A Wu, Liming Gao, Bret Barkelew, Jiewen Yao, Jian J Wang,
	Ard Biesheuvel, Abner Chang, Daniel Schaefer, Sami Mujawar,
	Alexei Fedorov, Maciej Rabeda, Jiaxin Wu, Siyuan Fu, Eric Dong,
	Ray Ni, Rahul Kumar, Bob Feng, Yuwei Chen

New in V2
---------
* Update build_rules.template to fix Linux GCC ARM build 
  issue with HII resource sections.

This patch series fixes a number of diffent package build
issues.  These were discovered when evaluating the source
format changes from uncrustify and there where valid
package builds that are not working before applying the
uncrustify changes. 

* Missing RngLib mappings
* Missing ArmSoftFloatLib mapping
* Missing BaseStackCheckLib instance
* Incorrect use of UT_ASSERT_EQUAL() with pointers
* Incorrect use of cmocka will_return*() with pointers

Cc: Hao A Wu <hao.a.wu@intel.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Cc: Bret Barkelew <Bret.Barkelew@microsoft.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Jian J Wang <jian.j.wang@intel.com>
Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>
Cc: Abner Chang <abner.chang@hpe.com>
Cc: Daniel Schaefer <daniel.schaefer@hpe.com>
Cc: Sami Mujawar <Sami.Mujawar@arm.com>
Cc: Alexei Fedorov <Alexei.Fedorov@arm.com>
Cc: Maciej Rabeda <maciej.rabeda@linux.intel.com>
Cc: Jiaxin Wu <jiaxin.wu@intel.com>
Cc: Siyuan Fu <siyuan.fu@intel.com>
Cc: Eric Dong <eric.dong@intel.com>
Cc: Ray Ni <ray.ni@intel.com>
Cc: Rahul Kumar <rahul1.kumar@intel.com>
Cc: Bob Feng <bob.c.feng@intel.com>
Cc: Yuwei Chen <yuwei.chen@intel.com>
Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>

Michael D Kinney (7):
  DynamicTablesPkg: Add missing BaseStackCheckLib instance
  NetworkPkg/NetworkPkg.dsc: Add RngLib mapping for ARM and RISCV64
  SecurityPkg/SecurityPkg.dsc: Add missing RngLib for ARM and RISCV64
  SignedCapsulePkg/SignedCapsulePkg.dsc: Add RngLib mapping
  UefiCpuPkg/MtrrLib/UnitTest: Fix 32-bit GCC build issues
  MdeModulePkg/Variable/RuntimeDxeUnitTest: Fix 32-bit GCC builds
  BaseTools/Conf: Fix Linux GCC ARM build issues with HII

 BaseTools/Conf/build_rule.template                     |  4 +++-
 DynamicTablesPkg/DynamicTablesPkg.dsc                  |  2 +-
 .../VariableLockRequestToLockUnitTest.c                |  6 +++---
 NetworkPkg/NetworkPkg.dsc                              |  6 ++++++
 SecurityPkg/SecurityPkg.dsc                            |  9 ++++++++-
 SignedCapsulePkg/SignedCapsulePkg.dsc                  |  7 +++++++
 UefiCpuPkg/Library/MtrrLib/UnitTest/MtrrLibUnitTest.c  | 10 +++++-----
 7 files changed, 33 insertions(+), 11 deletions(-)

-- 
2.32.0.windows.1


^ permalink raw reply	[flat|nested] 19+ messages in thread

* [Patch V2 1/7] DynamicTablesPkg: Add missing BaseStackCheckLib instance
  2021-11-03 22:59 [Patch V2 0/7] Fix package build issues Michael D Kinney
@ 2021-11-03 22:59 ` Michael D Kinney
  2021-11-03 22:59 ` [Patch V2 2/7] NetworkPkg/NetworkPkg.dsc: Add RngLib mapping for ARM and RISCV64 Michael D Kinney
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 19+ messages in thread
From: Michael D Kinney @ 2021-11-03 22:59 UTC (permalink / raw)
  To: devel; +Cc: Sami Mujawar, Alexei Fedorov, Ard Biesheuvel, Sami Mujawar

Fix ARM and AARCH64 build issues by adding the BaseStackCheckLib
instance.

Cc: Sami Mujawar <Sami.Mujawar@arm.com>
Cc: Alexei Fedorov <Alexei.Fedorov@arm.com>
Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>
Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
Reviewed-by: Sami Mujawar <sami.mujawar@arm.com>
---
 DynamicTablesPkg/DynamicTablesPkg.dsc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/DynamicTablesPkg/DynamicTablesPkg.dsc b/DynamicTablesPkg/DynamicTablesPkg.dsc
index 46b2e667fd25..e1439a130143 100644
--- a/DynamicTablesPkg/DynamicTablesPkg.dsc
+++ b/DynamicTablesPkg/DynamicTablesPkg.dsc
@@ -35,6 +35,7 @@ [LibraryClasses]
 
 [LibraryClasses.ARM, LibraryClasses.AARCH64]
   NULL|ArmPkg/Library/CompilerIntrinsicsLib/CompilerIntrinsicsLib.inf
+  NULL|MdePkg/Library/BaseStackCheckLib/BaseStackCheckLib.inf
   PL011UartLib|ArmPlatformPkg/Library/PL011UartLib/PL011UartLib.inf
 
 [Components.common]
@@ -51,4 +52,3 @@ [BuildOptions]
   # Inhibit C6305: Potential mismatch between sizeof and countof quantities.
   *_VS2017_*_CC_FLAGS = /wd6305 /analyze
 !endif
-
-- 
2.32.0.windows.1


^ permalink raw reply related	[flat|nested] 19+ messages in thread

* [Patch V2 2/7] NetworkPkg/NetworkPkg.dsc: Add RngLib mapping for ARM and RISCV64
  2021-11-03 22:59 [Patch V2 0/7] Fix package build issues Michael D Kinney
  2021-11-03 22:59 ` [Patch V2 1/7] DynamicTablesPkg: Add missing BaseStackCheckLib instance Michael D Kinney
@ 2021-11-03 22:59 ` Michael D Kinney
  2021-11-04  0:20   ` Abner Chang
       [not found]   ` <16B42FEF94831C39.15345@groups.io>
  2021-11-03 22:59 ` [Patch V2 3/7] SecurityPkg/SecurityPkg.dsc: Add missing RngLib " Michael D Kinney
                   ` (4 subsequent siblings)
  6 siblings, 2 replies; 19+ messages in thread
From: Michael D Kinney @ 2021-11-03 22:59 UTC (permalink / raw)
  To: devel
  Cc: Maciej Rabeda, Jiaxin Wu, Siyuan Fu, Ard Biesheuvel, Abner Chang,
	Daniel Schaefer

Fix NetworkPkg build breaks for ARM and RISCV64 by adding RngLib
mapping.

Cc: Maciej Rabeda <maciej.rabeda@linux.intel.com>
Cc: Jiaxin Wu <jiaxin.wu@intel.com>
Cc: Siyuan Fu <siyuan.fu@intel.com>
Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>
Cc: Abner Chang <abner.chang@hpe.com>
Cc: Daniel Schaefer <daniel.schaefer@hpe.com>
Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
Reviewed-by: Daniel Schaefer <daniel.schaefer@hpe.com>
Reviewed-by: Maciej Rabeda <maciej.rabeda@linux.intel.com>
---
 NetworkPkg/NetworkPkg.dsc | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/NetworkPkg/NetworkPkg.dsc b/NetworkPkg/NetworkPkg.dsc
index cf2164aefe25..8691a0f5d07a 100644
--- a/NetworkPkg/NetworkPkg.dsc
+++ b/NetworkPkg/NetworkPkg.dsc
@@ -79,6 +79,12 @@ [LibraryClasses.ARM, LibraryClasses.AARCH64]
   NULL|MdePkg/Library/BaseStackCheckLib/BaseStackCheckLib.inf
   ArmSoftFloatLib|ArmPkg/Library/ArmSoftFloatLib/ArmSoftFloatLib.inf
 
+[LibraryClasses.ARM]
+  RngLib|MdePkg/Library/BaseRngLibTimerLib/BaseRngLibTimerLib.inf
+
+[LibraryClasses.RISCV64]
+  RngLib|MdePkg/Library/BaseRngLibTimerLib/BaseRngLibTimerLib.inf
+
 [PcdsFeatureFlag]
   gEfiMdePkgTokenSpaceGuid.PcdComponentName2Disable|TRUE
   gEfiMdePkgTokenSpaceGuid.PcdDriverDiagnostics2Disable|TRUE
-- 
2.32.0.windows.1


^ permalink raw reply related	[flat|nested] 19+ messages in thread

* [Patch V2 3/7] SecurityPkg/SecurityPkg.dsc: Add missing RngLib for ARM and RISCV64
  2021-11-03 22:59 [Patch V2 0/7] Fix package build issues Michael D Kinney
  2021-11-03 22:59 ` [Patch V2 1/7] DynamicTablesPkg: Add missing BaseStackCheckLib instance Michael D Kinney
  2021-11-03 22:59 ` [Patch V2 2/7] NetworkPkg/NetworkPkg.dsc: Add RngLib mapping for ARM and RISCV64 Michael D Kinney
@ 2021-11-03 22:59 ` Michael D Kinney
  2021-11-04  0:21   ` Abner Chang
  2021-11-03 22:59 ` [Patch V2 4/7] SignedCapsulePkg/SignedCapsulePkg.dsc: Add RngLib mapping Michael D Kinney
                   ` (3 subsequent siblings)
  6 siblings, 1 reply; 19+ messages in thread
From: Michael D Kinney @ 2021-11-03 22:59 UTC (permalink / raw)
  To: devel
  Cc: Jiewen Yao, Jian J Wang, Ard Biesheuvel, Abner Chang,
	Daniel Schaefer, Jiewen Yao

Fix SecurityPkg build breaks for ARM and RISCV64 by adding RngLib
mapping.

Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Jian J Wang <jian.j.wang@intel.com>
Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>
Cc: Abner Chang <abner.chang@hpe.com>
Cc: Daniel Schaefer <daniel.schaefer@hpe.com>
Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
Acked-by: Jiewen Yao <Jiewen.yao@intel.com>
Reviewed-by: Daniel Schaefer <daniel.schaefer@hpe.com>
---
 SecurityPkg/SecurityPkg.dsc | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/SecurityPkg/SecurityPkg.dsc b/SecurityPkg/SecurityPkg.dsc
index 37318c64c59f..73a93c2285b1 100644
--- a/SecurityPkg/SecurityPkg.dsc
+++ b/SecurityPkg/SecurityPkg.dsc
@@ -84,6 +84,14 @@ [LibraryClasses.ARM, LibraryClasses.AARCH64]
   # Add support for GCC stack protector
   NULL|MdePkg/Library/BaseStackCheckLib/BaseStackCheckLib.inf
 
+  ArmSoftFloatLib|ArmPkg/Library/ArmSoftFloatLib/ArmSoftFloatLib.inf
+
+[LibraryClasses.ARM]
+  RngLib|MdePkg/Library/BaseRngLibTimerLib/BaseRngLibTimerLib.inf
+
+[LibraryClasses.RISCV64]
+  RngLib|MdePkg/Library/BaseRngLibTimerLib/BaseRngLibTimerLib.inf
+
 [LibraryClasses.common.PEIM]
   PeimEntryPoint|MdePkg/Library/PeimEntryPoint/PeimEntryPoint.inf
   PeiServicesLib|MdePkg/Library/PeiServicesLib/PeiServicesLib.inf
@@ -381,4 +389,3 @@ [BuildOptions]
    MSFT:*_*_IA32_DLINK_FLAGS = /ALIGN:256
   INTEL:*_*_IA32_DLINK_FLAGS = /ALIGN:256
         *_*_*_CC_FLAGS       = -D DISABLE_NEW_DEPRECATED_INTERFACES
-
-- 
2.32.0.windows.1


^ permalink raw reply related	[flat|nested] 19+ messages in thread

* [Patch V2 4/7] SignedCapsulePkg/SignedCapsulePkg.dsc: Add RngLib mapping
  2021-11-03 22:59 [Patch V2 0/7] Fix package build issues Michael D Kinney
                   ` (2 preceding siblings ...)
  2021-11-03 22:59 ` [Patch V2 3/7] SecurityPkg/SecurityPkg.dsc: Add missing RngLib " Michael D Kinney
@ 2021-11-03 22:59 ` Michael D Kinney
  2021-11-04  0:21   ` Abner Chang
  2021-11-03 22:59 ` [Patch V2 5/7] UefiCpuPkg/MtrrLib/UnitTest: Fix 32-bit GCC build issues Michael D Kinney
                   ` (2 subsequent siblings)
  6 siblings, 1 reply; 19+ messages in thread
From: Michael D Kinney @ 2021-11-03 22:59 UTC (permalink / raw)
  To: devel; +Cc: Jian J Wang, Ard Biesheuvel, Abner Chang, Daniel Schaefer

Fix build breaks for all architectures by adding RngLib mapping.

Cc: Jian J Wang <jian.j.wang@intel.com>
Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>
Cc: Abner Chang <abner.chang@hpe.com>
Cc: Daniel Schaefer <daniel.schaefer@hpe.com>
Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
Reviewed-by: Daniel Schaefer <daniel.schaefer@hpe.com>
---
 SignedCapsulePkg/SignedCapsulePkg.dsc | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/SignedCapsulePkg/SignedCapsulePkg.dsc b/SignedCapsulePkg/SignedCapsulePkg.dsc
index 2152d3d15668..8a27207a6f20 100644
--- a/SignedCapsulePkg/SignedCapsulePkg.dsc
+++ b/SignedCapsulePkg/SignedCapsulePkg.dsc
@@ -93,6 +93,7 @@ [LibraryClasses]
   EdkiiSystemCapsuleLib|SignedCapsulePkg/Library/EdkiiSystemCapsuleLib/EdkiiSystemCapsuleLib.inf
   IniParsingLib|SignedCapsulePkg/Library/IniParsingLib/IniParsingLib.inf
   PlatformFlashAccessLib|SignedCapsulePkg/Library/PlatformFlashAccessLibNull/PlatformFlashAccessLibNull.inf
+  RngLib|MdePkg/Library/BaseRngLib/BaseRngLib.inf
 
 [LibraryClasses.ARM]
   ArmSoftFloatLib|ArmPkg/Library/ArmSoftFloatLib/ArmSoftFloatLib.inf
@@ -108,6 +109,12 @@ [LibraryClasses.AARCH64, LibraryClasses.ARM]
   # Add support for GCC stack protector
   NULL|MdePkg/Library/BaseStackCheckLib/BaseStackCheckLib.inf
 
+[LibraryClasses.ARM]
+  RngLib|MdePkg/Library/BaseRngLibTimerLib/BaseRngLibTimerLib.inf
+
+[LibraryClasses.RISCV64]
+  RngLib|MdePkg/Library/BaseRngLibTimerLib/BaseRngLibTimerLib.inf
+
 [LibraryClasses.common.PEI_CORE]
   HobLib|MdePkg/Library/PeiHobLib/PeiHobLib.inf
   MemoryAllocationLib|MdePkg/Library/PeiMemoryAllocationLib/PeiMemoryAllocationLib.inf
-- 
2.32.0.windows.1


^ permalink raw reply related	[flat|nested] 19+ messages in thread

* [Patch V2 5/7] UefiCpuPkg/MtrrLib/UnitTest: Fix 32-bit GCC build issues
  2021-11-03 22:59 [Patch V2 0/7] Fix package build issues Michael D Kinney
                   ` (3 preceding siblings ...)
  2021-11-03 22:59 ` [Patch V2 4/7] SignedCapsulePkg/SignedCapsulePkg.dsc: Add RngLib mapping Michael D Kinney
@ 2021-11-03 22:59 ` Michael D Kinney
  2021-11-04  4:59   ` Ni, Ray
  2021-11-03 22:59 ` [Patch V2 6/7] MdeModulePkg/Variable/RuntimeDxeUnitTest: Fix 32-bit GCC builds Michael D Kinney
  2021-11-03 22:59 ` [Patch V2 7/7] BaseTools/Conf: Fix Linux GCC ARM build issues with HII Michael D Kinney
  6 siblings, 1 reply; 19+ messages in thread
From: Michael D Kinney @ 2021-11-03 22:59 UTC (permalink / raw)
  To: devel; +Cc: Eric Dong, Ray Ni, Rahul Kumar, Philippe Mathieu-Daude

When using UT_ASSERT_EQUAL() on a pointer value, it must be
cast to UINTN.  This follows the samples provided with the
UnitTestFrameworkPkg.

Cc: Eric Dong <eric.dong@intel.com>
Cc: Ray Ni <ray.ni@intel.com>
Cc: Rahul Kumar <rahul1.kumar@intel.com>
Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
Reviewed-by: Philippe Mathieu-Daude <philmd@redhat.com>
---
 UefiCpuPkg/Library/MtrrLib/UnitTest/MtrrLibUnitTest.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/UefiCpuPkg/Library/MtrrLib/UnitTest/MtrrLibUnitTest.c b/UefiCpuPkg/Library/MtrrLib/UnitTest/MtrrLibUnitTest.c
index 30ee1dc32522..e84b9390601d 100644
--- a/UefiCpuPkg/Library/MtrrLib/UnitTest/MtrrLibUnitTest.c
+++ b/UefiCpuPkg/Library/MtrrLib/UnitTest/MtrrLibUnitTest.c
@@ -599,7 +599,7 @@ UnitTestMtrrGetFixedMtrr (
     }
 
     Result = MtrrGetFixedMtrr (&FixedSettings);
-    UT_ASSERT_EQUAL (Result, &FixedSettings);
+    UT_ASSERT_EQUAL ((UINTN)Result, (UINTN)&FixedSettings);
     UT_ASSERT_MEM_EQUAL (&FixedSettings, &ExpectedFixedSettings, sizeof (FixedSettings));
   }
 
@@ -612,7 +612,7 @@ UnitTestMtrrGetFixedMtrr (
   ZeroMem (&FixedSettings, sizeof (FixedSettings));
   ZeroMem (&ExpectedFixedSettings, sizeof (ExpectedFixedSettings));
   Result = MtrrGetFixedMtrr (&FixedSettings);
-  UT_ASSERT_EQUAL (Result, &FixedSettings);
+  UT_ASSERT_EQUAL ((UINTN)Result, (UINTN)&FixedSettings);
   UT_ASSERT_MEM_EQUAL (&ExpectedFixedSettings, &FixedSettings, sizeof (ExpectedFixedSettings));
 
   return UNIT_TEST_PASSED;
@@ -653,7 +653,7 @@ UnitTestMtrrGetAllMtrrs (
     AsmWriteMsr64 (MSR_IA32_MTRR_PHYSMASK0 + (Index << 1), VariableMtrr[Index].Mask);
   }
   Result = MtrrGetAllMtrrs (&Mtrrs);
-  UT_ASSERT_EQUAL (Result, &Mtrrs);
+  UT_ASSERT_EQUAL ((UINTN)Result, (UINTN)&Mtrrs);
   UT_ASSERT_MEM_EQUAL (Mtrrs.Variables.Mtrr, VariableMtrr, sizeof (MTRR_VARIABLE_SETTING) * SystemParameter.VariableMtrrCount);
 
   //
@@ -665,7 +665,7 @@ UnitTestMtrrGetAllMtrrs (
   SystemParameter.MtrrSupported = FALSE;
   InitializeMtrrRegs (&SystemParameter);
   Result = MtrrGetAllMtrrs (&Mtrrs);
-  UT_ASSERT_EQUAL (Result, &Mtrrs);
+  UT_ASSERT_EQUAL ((UINTN)Result, (UINTN)&Mtrrs);
   UT_ASSERT_MEM_EQUAL (&ExpectedMtrrs, &Mtrrs, sizeof (ExpectedMtrrs));
 
   //
@@ -718,7 +718,7 @@ UnitTestMtrrSetAllMtrrs (
     GenerateRandomMtrrPair (SystemParameter.PhysicalAddressBits, GenerateRandomCacheType (), &Mtrrs.Variables.Mtrr[Index], NULL);
   }
   Result = MtrrSetAllMtrrs (&Mtrrs);
-  UT_ASSERT_EQUAL (Result, &Mtrrs);
+  UT_ASSERT_EQUAL ((UINTN)Result, (UINTN)&Mtrrs);
 
   UT_ASSERT_EQUAL (AsmReadMsr64 (MSR_IA32_MTRR_DEF_TYPE), Mtrrs.MtrrDefType);
   for (Index = 0; Index < SystemParameter.VariableMtrrCount; Index++) {
-- 
2.32.0.windows.1


^ permalink raw reply related	[flat|nested] 19+ messages in thread

* [Patch V2 6/7] MdeModulePkg/Variable/RuntimeDxeUnitTest: Fix 32-bit GCC builds
  2021-11-03 22:59 [Patch V2 0/7] Fix package build issues Michael D Kinney
                   ` (4 preceding siblings ...)
  2021-11-03 22:59 ` [Patch V2 5/7] UefiCpuPkg/MtrrLib/UnitTest: Fix 32-bit GCC build issues Michael D Kinney
@ 2021-11-03 22:59 ` Michael D Kinney
  2021-11-03 23:46   ` [EXTERNAL] " Bret Barkelew
  2021-11-04  0:34   ` [edk2-devel] " Wu, Hao A
  2021-11-03 22:59 ` [Patch V2 7/7] BaseTools/Conf: Fix Linux GCC ARM build issues with HII Michael D Kinney
  6 siblings, 2 replies; 19+ messages in thread
From: Michael D Kinney @ 2021-11-03 22:59 UTC (permalink / raw)
  To: devel; +Cc: Hao A Wu, Liming Gao, Bret Barkelew, Philippe Mathieu-Daude

When using will_return() on a pointer value, it must be
cast to UINTN to be compatible with 32-bit GCC builds.
This uses the same approach in samples provided in the
UnitTestFramworkPkg when passing pointer values to
UT_ASSERT_EQUAL().

Cc: Hao A Wu <hao.a.wu@intel.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Cc: Bret Barkelew <Bret.Barkelew@microsoft.com>
Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
Reviewed-by: Philippe Mathieu-Daude <philmd@redhat.com>
---
 .../RuntimeDxeUnitTest/VariableLockRequestToLockUnitTest.c  | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/MdeModulePkg/Universal/Variable/RuntimeDxe/RuntimeDxeUnitTest/VariableLockRequestToLockUnitTest.c b/MdeModulePkg/Universal/Variable/RuntimeDxe/RuntimeDxeUnitTest/VariableLockRequestToLockUnitTest.c
index 44d70e639d77..880994fe71fc 100644
--- a/MdeModulePkg/Universal/Variable/RuntimeDxe/RuntimeDxeUnitTest/VariableLockRequestToLockUnitTest.c
+++ b/MdeModulePkg/Universal/Variable/RuntimeDxe/RuntimeDxeUnitTest/VariableLockRequestToLockUnitTest.c
@@ -287,7 +287,7 @@ LockingAnUnlockedVariableShouldFail (
   // With a policy, make sure that writes still work, since the variable doesn't exist.
   will_return( StubGetVariableNull, TEST_POLICY_ATTRIBUTES_NULL );    // Attributes
   will_return( StubGetVariableNull, 0 );                              // Size
-  will_return( StubGetVariableNull, NULL );                           // DataPtr
+  will_return( StubGetVariableNull, (UINTN)NULL );                    // DataPtr
   will_return( StubGetVariableNull, EFI_NOT_FOUND);                   // Status
 
   Status = VariableLockRequestToLock (NULL, TEST_VAR_1_NAME, &mTestGuid1);
@@ -342,7 +342,7 @@ LockingALockedVariableWithMatchingDataShouldSucceed (
   Data = 1;
   will_return( StubGetVariableNull, TEST_POLICY_ATTRIBUTES_NULL );    // Attributes
   will_return( StubGetVariableNull, sizeof (Data) );                  // Size
-  will_return( StubGetVariableNull, &Data );                          // DataPtr
+  will_return( StubGetVariableNull, (UINTN)&Data );                   // DataPtr
   will_return( StubGetVariableNull, EFI_SUCCESS);                     // Status
 
   Status = VariableLockRequestToLock (NULL, TEST_VAR_1_NAME, &mTestGuid1);
@@ -397,7 +397,7 @@ LockingALockedVariableWithNonMatchingDataShouldFail (
   Data = 2;
   will_return( StubGetVariableNull, TEST_POLICY_ATTRIBUTES_NULL );    // Attributes
   will_return( StubGetVariableNull, sizeof (Data) );                  // Size
-  will_return( StubGetVariableNull, &Data );                          // DataPtr
+  will_return( StubGetVariableNull, (UINTN)&Data );                   // DataPtr
   will_return( StubGetVariableNull, EFI_SUCCESS);                     // Status
 
   Status = VariableLockRequestToLock (NULL, TEST_VAR_1_NAME, &mTestGuid1);
-- 
2.32.0.windows.1


^ permalink raw reply related	[flat|nested] 19+ messages in thread

* [Patch V2 7/7] BaseTools/Conf: Fix Linux GCC ARM build issues with HII
  2021-11-03 22:59 [Patch V2 0/7] Fix package build issues Michael D Kinney
                   ` (5 preceding siblings ...)
  2021-11-03 22:59 ` [Patch V2 6/7] MdeModulePkg/Variable/RuntimeDxeUnitTest: Fix 32-bit GCC builds Michael D Kinney
@ 2021-11-03 22:59 ` Michael D Kinney
  2021-11-04  6:17   ` 回复: [edk2-devel] " gaoliming
  2021-11-04 10:49   ` Leif Lindholm
  6 siblings, 2 replies; 19+ messages in thread
From: Michael D Kinney @ 2021-11-03 22:59 UTC (permalink / raw)
  To: devel; +Cc: Bob Feng, Liming Gao, Yuwei Chen, Leif Lindholm, Ard Biesheuvel

Update builds_rules.template to add $(SLINK) to the GCC
steps for processing HII resources to produce a static
library instead of an object file.  This improves linker
compatibility and specifically fixes a link failure seen
on Linux GCC ARM builds of the MdeModulePkg due to
mismatched ABI types between the HII resource section
and the rest of the libraries.

Cc: Bob Feng <bob.c.feng@intel.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Cc: Yuwei Chen <yuwei.chen@intel.com>
Cc: Leif Lindholm <leif@nuviainc.com>
Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>
Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
---
 BaseTools/Conf/build_rule.template | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/BaseTools/Conf/build_rule.template b/BaseTools/Conf/build_rule.template
index 3add1029f276..5f59044da36d 100755
--- a/BaseTools/Conf/build_rule.template
+++ b/BaseTools/Conf/build_rule.template
@@ -668,6 +668,8 @@
 
     <Command.GCC>
         "$(GENFW)" -o $(OUTPUT_DIR)(+)$(MODULE_NAME)hii.rc -g $(MODULE_GUID) --hiibinpackage $(HII_BINARY_PACKAGES) $(GENFW_FLAGS)
-        "$(RC)" $(RC_FLAGS) $(OUTPUT_DIR)(+)$(MODULE_NAME)hii.rc ${dst}
+        "$(RC)" $(RC_FLAGS) $(OUTPUT_DIR)(+)$(MODULE_NAME)hii.rc $(OUTPUT_DIR)(+)$(MODULE_NAME)hii.rc.obj
+        "$(SLINK)" cr  ${dst} $(OUTPUT_DIR)(+)$(MODULE_NAME)hii.rc.obj
+
     <Command.XCODE, Command.RVCT, Command.CLANGGCC>
         "$(GENFW)" -o $(OUTPUT_DIR)(+)$(MODULE_NAME)hii.rc -g $(MODULE_GUID) --hiibinpackage $(HII_BINARY_PACKAGES) $(GENFW_FLAGS)
-- 
2.32.0.windows.1


^ permalink raw reply related	[flat|nested] 19+ messages in thread

* Re: [EXTERNAL] [Patch V2 6/7] MdeModulePkg/Variable/RuntimeDxeUnitTest: Fix 32-bit GCC builds
  2021-11-03 22:59 ` [Patch V2 6/7] MdeModulePkg/Variable/RuntimeDxeUnitTest: Fix 32-bit GCC builds Michael D Kinney
@ 2021-11-03 23:46   ` Bret Barkelew
  2021-11-04  0:34   ` [edk2-devel] " Wu, Hao A
  1 sibling, 0 replies; 19+ messages in thread
From: Bret Barkelew @ 2021-11-03 23:46 UTC (permalink / raw)
  To: Kinney, Michael D, devel@edk2.groups.io
  Cc: Hao A Wu, Liming Gao, Philippe Mathieu-Daude

[-- Attachment #1: Type: text/plain, Size: 3428 bytes --]

Reviewed-by: Bret Barkelew <bret.barkelew@microsoft.com>

- Bret

From: Michael D Kinney<mailto:michael.d.kinney@intel.com>
Sent: Wednesday, November 3, 2021 4:00 PM
To: devel@edk2.groups.io<mailto:devel@edk2.groups.io>
Cc: Hao A Wu<mailto:hao.a.wu@intel.com>; Liming Gao<mailto:gaoliming@byosoft.com.cn>; Bret Barkelew<mailto:Bret.Barkelew@microsoft.com>; Philippe Mathieu-Daude<mailto:philmd@redhat.com>
Subject: [EXTERNAL] [Patch V2 6/7] MdeModulePkg/Variable/RuntimeDxeUnitTest: Fix 32-bit GCC builds

When using will_return() on a pointer value, it must be
cast to UINTN to be compatible with 32-bit GCC builds.
This uses the same approach in samples provided in the
UnitTestFramworkPkg when passing pointer values to
UT_ASSERT_EQUAL().

Cc: Hao A Wu <hao.a.wu@intel.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Cc: Bret Barkelew <Bret.Barkelew@microsoft.com>
Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
Reviewed-by: Philippe Mathieu-Daude <philmd@redhat.com>
---
 .../RuntimeDxeUnitTest/VariableLockRequestToLockUnitTest.c  | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/MdeModulePkg/Universal/Variable/RuntimeDxe/RuntimeDxeUnitTest/VariableLockRequestToLockUnitTest.c b/MdeModulePkg/Universal/Variable/RuntimeDxe/RuntimeDxeUnitTest/VariableLockRequestToLockUnitTest.c
index 44d70e639d77..880994fe71fc 100644
--- a/MdeModulePkg/Universal/Variable/RuntimeDxe/RuntimeDxeUnitTest/VariableLockRequestToLockUnitTest.c
+++ b/MdeModulePkg/Universal/Variable/RuntimeDxe/RuntimeDxeUnitTest/VariableLockRequestToLockUnitTest.c
@@ -287,7 +287,7 @@ LockingAnUnlockedVariableShouldFail (
   // With a policy, make sure that writes still work, since the variable doesn't exist.
   will_return( StubGetVariableNull, TEST_POLICY_ATTRIBUTES_NULL );    // Attributes
   will_return( StubGetVariableNull, 0 );                              // Size
-  will_return( StubGetVariableNull, NULL );                           // DataPtr
+  will_return( StubGetVariableNull, (UINTN)NULL );                    // DataPtr
   will_return( StubGetVariableNull, EFI_NOT_FOUND);                   // Status

   Status = VariableLockRequestToLock (NULL, TEST_VAR_1_NAME, &mTestGuid1);
@@ -342,7 +342,7 @@ LockingALockedVariableWithMatchingDataShouldSucceed (
   Data = 1;
   will_return( StubGetVariableNull, TEST_POLICY_ATTRIBUTES_NULL );    // Attributes
   will_return( StubGetVariableNull, sizeof (Data) );                  // Size
-  will_return( StubGetVariableNull, &Data );                          // DataPtr
+  will_return( StubGetVariableNull, (UINTN)&Data );                   // DataPtr
   will_return( StubGetVariableNull, EFI_SUCCESS);                     // Status

   Status = VariableLockRequestToLock (NULL, TEST_VAR_1_NAME, &mTestGuid1);
@@ -397,7 +397,7 @@ LockingALockedVariableWithNonMatchingDataShouldFail (
   Data = 2;
   will_return( StubGetVariableNull, TEST_POLICY_ATTRIBUTES_NULL );    // Attributes
   will_return( StubGetVariableNull, sizeof (Data) );                  // Size
-  will_return( StubGetVariableNull, &Data );                          // DataPtr
+  will_return( StubGetVariableNull, (UINTN)&Data );                   // DataPtr
   will_return( StubGetVariableNull, EFI_SUCCESS);                     // Status

   Status = VariableLockRequestToLock (NULL, TEST_VAR_1_NAME, &mTestGuid1);
--
2.32.0.windows.1


[-- Attachment #2: Type: text/html, Size: 7042 bytes --]

^ permalink raw reply related	[flat|nested] 19+ messages in thread

* Re: [Patch V2 2/7] NetworkPkg/NetworkPkg.dsc: Add RngLib mapping for ARM and RISCV64
  2021-11-03 22:59 ` [Patch V2 2/7] NetworkPkg/NetworkPkg.dsc: Add RngLib mapping for ARM and RISCV64 Michael D Kinney
@ 2021-11-04  0:20   ` Abner Chang
       [not found]   ` <16B42FEF94831C39.15345@groups.io>
  1 sibling, 0 replies; 19+ messages in thread
From: Abner Chang @ 2021-11-04  0:20 UTC (permalink / raw)
  To: Michael D Kinney, devel@edk2.groups.io
  Cc: Maciej Rabeda, Jiaxin Wu, Siyuan Fu, Ard Biesheuvel,
	Schaefer, Daniel (ROM Janitor)

[-- Attachment #1: Type: text/plain, Size: 1929 bytes --]

Reviewed-by: Abner Chang <abner.chang@hpe.com>
________________________________
From: Michael D Kinney <michael.d.kinney@intel.com>
Sent: Thursday, November 4, 2021 6:59 AM
To: devel@edk2.groups.io <devel@edk2.groups.io>
Cc: Maciej Rabeda <maciej.rabeda@linux.intel.com>; Jiaxin Wu <jiaxin.wu@intel.com>; Siyuan Fu <siyuan.fu@intel.com>; Ard Biesheuvel <ardb+tianocore@kernel.org>; Chang, Abner (HPS SW/FW Technologist) <abner.chang@hpe.com>; Schaefer, Daniel (ROM Janitor) <daniel.schaefer@hpe.com>
Subject: [Patch V2 2/7] NetworkPkg/NetworkPkg.dsc: Add RngLib mapping for ARM and RISCV64

Fix NetworkPkg build breaks for ARM and RISCV64 by adding RngLib
mapping.

Cc: Maciej Rabeda <maciej.rabeda@linux.intel.com>
Cc: Jiaxin Wu <jiaxin.wu@intel.com>
Cc: Siyuan Fu <siyuan.fu@intel.com>
Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>
Cc: Abner Chang <abner.chang@hpe.com>
Cc: Daniel Schaefer <daniel.schaefer@hpe.com>
Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
Reviewed-by: Daniel Schaefer <daniel.schaefer@hpe.com>
Reviewed-by: Maciej Rabeda <maciej.rabeda@linux.intel.com>
---
 NetworkPkg/NetworkPkg.dsc | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/NetworkPkg/NetworkPkg.dsc b/NetworkPkg/NetworkPkg.dsc
index cf2164aefe25..8691a0f5d07a 100644
--- a/NetworkPkg/NetworkPkg.dsc
+++ b/NetworkPkg/NetworkPkg.dsc
@@ -79,6 +79,12 @@ [LibraryClasses.ARM, LibraryClasses.AARCH64]
   NULL|MdePkg/Library/BaseStackCheckLib/BaseStackCheckLib.inf
   ArmSoftFloatLib|ArmPkg/Library/ArmSoftFloatLib/ArmSoftFloatLib.inf

+[LibraryClasses.ARM]
+  RngLib|MdePkg/Library/BaseRngLibTimerLib/BaseRngLibTimerLib.inf
+
+[LibraryClasses.RISCV64]
+  RngLib|MdePkg/Library/BaseRngLibTimerLib/BaseRngLibTimerLib.inf
+
 [PcdsFeatureFlag]
   gEfiMdePkgTokenSpaceGuid.PcdComponentName2Disable|TRUE
   gEfiMdePkgTokenSpaceGuid.PcdDriverDiagnostics2Disable|TRUE
--
2.32.0.windows.1


[-- Attachment #2: Type: text/html, Size: 3317 bytes --]

^ permalink raw reply related	[flat|nested] 19+ messages in thread

* Re: [Patch V2 3/7] SecurityPkg/SecurityPkg.dsc: Add missing RngLib for ARM and RISCV64
  2021-11-03 22:59 ` [Patch V2 3/7] SecurityPkg/SecurityPkg.dsc: Add missing RngLib " Michael D Kinney
@ 2021-11-04  0:21   ` Abner Chang
  0 siblings, 0 replies; 19+ messages in thread
From: Abner Chang @ 2021-11-04  0:21 UTC (permalink / raw)
  To: Michael D Kinney, devel@edk2.groups.io
  Cc: Jiewen Yao, Jian J Wang, Ard Biesheuvel,
	Schaefer, Daniel (ROM Janitor), Jiewen Yao

[-- Attachment #1: Type: text/plain, Size: 2158 bytes --]

Acked-by: Abner Chang <abner.chang@hpe.com>
________________________________
From: Michael D Kinney <michael.d.kinney@intel.com>
Sent: Thursday, November 4, 2021 6:59 AM
To: devel@edk2.groups.io <devel@edk2.groups.io>
Cc: Jiewen Yao <jiewen.yao@intel.com>; Jian J Wang <jian.j.wang@intel.com>; Ard Biesheuvel <ardb+tianocore@kernel.org>; Chang, Abner (HPS SW/FW Technologist) <abner.chang@hpe.com>; Schaefer, Daniel (ROM Janitor) <daniel.schaefer@hpe.com>; Jiewen Yao <Jiewen.yao@intel.com>
Subject: [Patch V2 3/7] SecurityPkg/SecurityPkg.dsc: Add missing RngLib for ARM and RISCV64

Fix SecurityPkg build breaks for ARM and RISCV64 by adding RngLib
mapping.

Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Jian J Wang <jian.j.wang@intel.com>
Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>
Cc: Abner Chang <abner.chang@hpe.com>
Cc: Daniel Schaefer <daniel.schaefer@hpe.com>
Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
Acked-by: Jiewen Yao <Jiewen.yao@intel.com>
Reviewed-by: Daniel Schaefer <daniel.schaefer@hpe.com>
---
 SecurityPkg/SecurityPkg.dsc | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/SecurityPkg/SecurityPkg.dsc b/SecurityPkg/SecurityPkg.dsc
index 37318c64c59f..73a93c2285b1 100644
--- a/SecurityPkg/SecurityPkg.dsc
+++ b/SecurityPkg/SecurityPkg.dsc
@@ -84,6 +84,14 @@ [LibraryClasses.ARM, LibraryClasses.AARCH64]
   # Add support for GCC stack protector
   NULL|MdePkg/Library/BaseStackCheckLib/BaseStackCheckLib.inf

+  ArmSoftFloatLib|ArmPkg/Library/ArmSoftFloatLib/ArmSoftFloatLib.inf
+
+[LibraryClasses.ARM]
+  RngLib|MdePkg/Library/BaseRngLibTimerLib/BaseRngLibTimerLib.inf
+
+[LibraryClasses.RISCV64]
+  RngLib|MdePkg/Library/BaseRngLibTimerLib/BaseRngLibTimerLib.inf
+
 [LibraryClasses.common.PEIM]
   PeimEntryPoint|MdePkg/Library/PeimEntryPoint/PeimEntryPoint.inf
   PeiServicesLib|MdePkg/Library/PeiServicesLib/PeiServicesLib.inf
@@ -381,4 +389,3 @@ [BuildOptions]
    MSFT:*_*_IA32_DLINK_FLAGS = /ALIGN:256
   INTEL:*_*_IA32_DLINK_FLAGS = /ALIGN:256
         *_*_*_CC_FLAGS       = -D DISABLE_NEW_DEPRECATED_INTERFACES
-
--
2.32.0.windows.1


[-- Attachment #2: Type: text/html, Size: 3791 bytes --]

^ permalink raw reply related	[flat|nested] 19+ messages in thread

* Re: [Patch V2 4/7] SignedCapsulePkg/SignedCapsulePkg.dsc: Add RngLib mapping
  2021-11-03 22:59 ` [Patch V2 4/7] SignedCapsulePkg/SignedCapsulePkg.dsc: Add RngLib mapping Michael D Kinney
@ 2021-11-04  0:21   ` Abner Chang
  0 siblings, 0 replies; 19+ messages in thread
From: Abner Chang @ 2021-11-04  0:21 UTC (permalink / raw)
  To: Michael D Kinney, devel@edk2.groups.io
  Cc: Jian J Wang, Ard Biesheuvel, Schaefer, Daniel (ROM Janitor)

[-- Attachment #1: Type: text/plain, Size: 2222 bytes --]

Acked-by: Abner Chang <abner.chang@hpe.com>
________________________________
From: Michael D Kinney <michael.d.kinney@intel.com>
Sent: Thursday, November 4, 2021 6:59 AM
To: devel@edk2.groups.io <devel@edk2.groups.io>
Cc: Jian J Wang <jian.j.wang@intel.com>; Ard Biesheuvel <ardb+tianocore@kernel.org>; Chang, Abner (HPS SW/FW Technologist) <abner.chang@hpe.com>; Schaefer, Daniel (ROM Janitor) <daniel.schaefer@hpe.com>
Subject: [Patch V2 4/7] SignedCapsulePkg/SignedCapsulePkg.dsc: Add RngLib mapping

Fix build breaks for all architectures by adding RngLib mapping.

Cc: Jian J Wang <jian.j.wang@intel.com>
Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>
Cc: Abner Chang <abner.chang@hpe.com>
Cc: Daniel Schaefer <daniel.schaefer@hpe.com>
Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
Reviewed-by: Daniel Schaefer <daniel.schaefer@hpe.com>
---
 SignedCapsulePkg/SignedCapsulePkg.dsc | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/SignedCapsulePkg/SignedCapsulePkg.dsc b/SignedCapsulePkg/SignedCapsulePkg.dsc
index 2152d3d15668..8a27207a6f20 100644
--- a/SignedCapsulePkg/SignedCapsulePkg.dsc
+++ b/SignedCapsulePkg/SignedCapsulePkg.dsc
@@ -93,6 +93,7 @@ [LibraryClasses]
   EdkiiSystemCapsuleLib|SignedCapsulePkg/Library/EdkiiSystemCapsuleLib/EdkiiSystemCapsuleLib.inf
   IniParsingLib|SignedCapsulePkg/Library/IniParsingLib/IniParsingLib.inf
   PlatformFlashAccessLib|SignedCapsulePkg/Library/PlatformFlashAccessLibNull/PlatformFlashAccessLibNull.inf
+  RngLib|MdePkg/Library/BaseRngLib/BaseRngLib.inf

 [LibraryClasses.ARM]
   ArmSoftFloatLib|ArmPkg/Library/ArmSoftFloatLib/ArmSoftFloatLib.inf
@@ -108,6 +109,12 @@ [LibraryClasses.AARCH64, LibraryClasses.ARM]
   # Add support for GCC stack protector
   NULL|MdePkg/Library/BaseStackCheckLib/BaseStackCheckLib.inf

+[LibraryClasses.ARM]
+  RngLib|MdePkg/Library/BaseRngLibTimerLib/BaseRngLibTimerLib.inf
+
+[LibraryClasses.RISCV64]
+  RngLib|MdePkg/Library/BaseRngLibTimerLib/BaseRngLibTimerLib.inf
+
 [LibraryClasses.common.PEI_CORE]
   HobLib|MdePkg/Library/PeiHobLib/PeiHobLib.inf
   MemoryAllocationLib|MdePkg/Library/PeiMemoryAllocationLib/PeiMemoryAllocationLib.inf
--
2.32.0.windows.1


[-- Attachment #2: Type: text/html, Size: 4013 bytes --]

^ permalink raw reply related	[flat|nested] 19+ messages in thread

* Re: [edk2-devel] [Patch V2 2/7] NetworkPkg/NetworkPkg.dsc: Add RngLib mapping for ARM and RISCV64
       [not found]   ` <16B42FEF94831C39.15345@groups.io>
@ 2021-11-04  0:23     ` Abner Chang
  0 siblings, 0 replies; 19+ messages in thread
From: Abner Chang @ 2021-11-04  0:23 UTC (permalink / raw)
  To: Michael D Kinney, devel@edk2.groups.io,
	Chang, Abner (HPS SW/FW Technologist)
  Cc: Maciej Rabeda, Jiaxin Wu, Siyuan Fu, Ard Biesheuvel,
	Schaefer, Daniel (ROM Janitor)

[-- Attachment #1: Type: text/plain, Size: 2614 bytes --]

Change my review tag to Acked-by.

Acked-by: Abner Chang <abner.chang@hpe.com>

________________________________
From: devel@edk2.groups.io <devel@edk2.groups.io> on behalf of Abner Chang <abner.chang@hpe.com>
Sent: Thursday, November 4, 2021 8:20 AM
To: Michael D Kinney <michael.d.kinney@intel.com>; devel@edk2.groups.io <devel@edk2.groups.io>
Cc: Maciej Rabeda <maciej.rabeda@linux.intel.com>; Jiaxin Wu <jiaxin.wu@intel.com>; Siyuan Fu <siyuan.fu@intel.com>; Ard Biesheuvel <ardb+tianocore@kernel.org>; Schaefer, Daniel (ROM Janitor) <daniel.schaefer@hpe.com>
Subject: Re: [edk2-devel] [Patch V2 2/7] NetworkPkg/NetworkPkg.dsc: Add RngLib mapping for ARM and RISCV64

Reviewed-by: Abner Chang <abner.chang@hpe.com>
________________________________
From: Michael D Kinney <michael.d.kinney@intel.com>
Sent: Thursday, November 4, 2021 6:59 AM
To: devel@edk2.groups.io <devel@edk2.groups.io>
Cc: Maciej Rabeda <maciej.rabeda@linux.intel.com>; Jiaxin Wu <jiaxin.wu@intel.com>; Siyuan Fu <siyuan.fu@intel.com>; Ard Biesheuvel <ardb+tianocore@kernel.org>; Chang, Abner (HPS SW/FW Technologist) <abner.chang@hpe.com>; Schaefer, Daniel (ROM Janitor) <daniel.schaefer@hpe.com>
Subject: [Patch V2 2/7] NetworkPkg/NetworkPkg.dsc: Add RngLib mapping for ARM and RISCV64

Fix NetworkPkg build breaks for ARM and RISCV64 by adding RngLib
mapping.

Cc: Maciej Rabeda <maciej.rabeda@linux.intel.com>
Cc: Jiaxin Wu <jiaxin.wu@intel.com>
Cc: Siyuan Fu <siyuan.fu@intel.com>
Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>
Cc: Abner Chang <abner.chang@hpe.com>
Cc: Daniel Schaefer <daniel.schaefer@hpe.com>
Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
Reviewed-by: Daniel Schaefer <daniel.schaefer@hpe.com>
Reviewed-by: Maciej Rabeda <maciej.rabeda@linux.intel.com>
---
 NetworkPkg/NetworkPkg.dsc | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/NetworkPkg/NetworkPkg.dsc b/NetworkPkg/NetworkPkg.dsc
index cf2164aefe25..8691a0f5d07a 100644
--- a/NetworkPkg/NetworkPkg.dsc
+++ b/NetworkPkg/NetworkPkg.dsc
@@ -79,6 +79,12 @@ [LibraryClasses.ARM, LibraryClasses.AARCH64]
   NULL|MdePkg/Library/BaseStackCheckLib/BaseStackCheckLib.inf
   ArmSoftFloatLib|ArmPkg/Library/ArmSoftFloatLib/ArmSoftFloatLib.inf

+[LibraryClasses.ARM]
+  RngLib|MdePkg/Library/BaseRngLibTimerLib/BaseRngLibTimerLib.inf
+
+[LibraryClasses.RISCV64]
+  RngLib|MdePkg/Library/BaseRngLibTimerLib/BaseRngLibTimerLib.inf
+
 [PcdsFeatureFlag]
   gEfiMdePkgTokenSpaceGuid.PcdComponentName2Disable|TRUE
   gEfiMdePkgTokenSpaceGuid.PcdDriverDiagnostics2Disable|TRUE
--
2.32.0.windows.1



[-- Attachment #2: Type: text/html, Size: 6067 bytes --]

^ permalink raw reply related	[flat|nested] 19+ messages in thread

* Re: [edk2-devel] [Patch V2 6/7] MdeModulePkg/Variable/RuntimeDxeUnitTest: Fix 32-bit GCC builds
  2021-11-03 22:59 ` [Patch V2 6/7] MdeModulePkg/Variable/RuntimeDxeUnitTest: Fix 32-bit GCC builds Michael D Kinney
  2021-11-03 23:46   ` [EXTERNAL] " Bret Barkelew
@ 2021-11-04  0:34   ` Wu, Hao A
  1 sibling, 0 replies; 19+ messages in thread
From: Wu, Hao A @ 2021-11-04  0:34 UTC (permalink / raw)
  To: devel@edk2.groups.io, Kinney, Michael D
  Cc: Liming Gao, Bret Barkelew, Philippe Mathieu-Daude

> -----Original Message-----
> From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf Of Michael D
> Kinney
> Sent: Thursday, November 4, 2021 7:00 AM
> To: devel@edk2.groups.io
> Cc: Wu, Hao A <hao.a.wu@intel.com>; Liming Gao
> <gaoliming@byosoft.com.cn>; Bret Barkelew <Bret.Barkelew@microsoft.com>;
> Philippe Mathieu-Daude <philmd@redhat.com>
> Subject: [edk2-devel] [Patch V2 6/7]
> MdeModulePkg/Variable/RuntimeDxeUnitTest: Fix 32-bit GCC builds
> 
> When using will_return() on a pointer value, it must be cast to UINTN to be
> compatible with 32-bit GCC builds.
> This uses the same approach in samples provided in the UnitTestFramworkPkg
> when passing pointer values to UT_ASSERT_EQUAL().


Reviewed-by: Hao A Wu <hao.a.wu@intel.com>

Best Regards,
Hao Wu


> 
> Cc: Hao A Wu <hao.a.wu@intel.com>
> Cc: Liming Gao <gaoliming@byosoft.com.cn>
> Cc: Bret Barkelew <Bret.Barkelew@microsoft.com>
> Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
> Reviewed-by: Philippe Mathieu-Daude <philmd@redhat.com>
> ---
>  .../RuntimeDxeUnitTest/VariableLockRequestToLockUnitTest.c  | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git
> a/MdeModulePkg/Universal/Variable/RuntimeDxe/RuntimeDxeUnitTest/Variabl
> eLockRequestToLockUnitTest.c
> b/MdeModulePkg/Universal/Variable/RuntimeDxe/RuntimeDxeUnitTest/Variabl
> eLockRequestToLockUnitTest.c
> index 44d70e639d77..880994fe71fc 100644
> ---
> a/MdeModulePkg/Universal/Variable/RuntimeDxe/RuntimeDxeUnitTest/Variabl
> eLockRequestToLockUnitTest.c
> +++
> b/MdeModulePkg/Universal/Variable/RuntimeDxe/RuntimeDxeUnitTest/Vari
> +++ ableLockRequestToLockUnitTest.c
> @@ -287,7 +287,7 @@ LockingAnUnlockedVariableShouldFail (
>    // With a policy, make sure that writes still work, since the variable doesn't
> exist.
>    will_return( StubGetVariableNull, TEST_POLICY_ATTRIBUTES_NULL );    //
> Attributes
>    will_return( StubGetVariableNull, 0 );                              // Size
> -  will_return( StubGetVariableNull, NULL );                           // DataPtr
> +  will_return( StubGetVariableNull, (UINTN)NULL );                    // DataPtr
>    will_return( StubGetVariableNull, EFI_NOT_FOUND);                   // Status
> 
>    Status = VariableLockRequestToLock (NULL, TEST_VAR_1_NAME,
> &mTestGuid1); @@ -342,7 +342,7 @@
> LockingALockedVariableWithMatchingDataShouldSucceed (
>    Data = 1;
>    will_return( StubGetVariableNull, TEST_POLICY_ATTRIBUTES_NULL );    //
> Attributes
>    will_return( StubGetVariableNull, sizeof (Data) );                  // Size
> -  will_return( StubGetVariableNull, &Data );                          // DataPtr
> +  will_return( StubGetVariableNull, (UINTN)&Data );                   // DataPtr
>    will_return( StubGetVariableNull, EFI_SUCCESS);                     // Status
> 
>    Status = VariableLockRequestToLock (NULL, TEST_VAR_1_NAME,
> &mTestGuid1); @@ -397,7 +397,7 @@
> LockingALockedVariableWithNonMatchingDataShouldFail (
>    Data = 2;
>    will_return( StubGetVariableNull, TEST_POLICY_ATTRIBUTES_NULL );    //
> Attributes
>    will_return( StubGetVariableNull, sizeof (Data) );                  // Size
> -  will_return( StubGetVariableNull, &Data );                          // DataPtr
> +  will_return( StubGetVariableNull, (UINTN)&Data );                   // DataPtr
>    will_return( StubGetVariableNull, EFI_SUCCESS);                     // Status
> 
>    Status = VariableLockRequestToLock (NULL, TEST_VAR_1_NAME,
> &mTestGuid1);
> --
> 2.32.0.windows.1
> 
> 
> 
> 
> 


^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [Patch V2 5/7] UefiCpuPkg/MtrrLib/UnitTest: Fix 32-bit GCC build issues
  2021-11-03 22:59 ` [Patch V2 5/7] UefiCpuPkg/MtrrLib/UnitTest: Fix 32-bit GCC build issues Michael D Kinney
@ 2021-11-04  4:59   ` Ni, Ray
  0 siblings, 0 replies; 19+ messages in thread
From: Ni, Ray @ 2021-11-04  4:59 UTC (permalink / raw)
  To: Kinney, Michael D, devel@edk2.groups.io
  Cc: Dong, Eric, Kumar, Rahul1, Philippe Mathieu-Daude

Reviewed-by: Ray Ni <ray.ni@intel.com>

-----Original Message-----
From: Kinney, Michael D <michael.d.kinney@intel.com> 
Sent: Thursday, November 4, 2021 7:00 AM
To: devel@edk2.groups.io
Cc: Dong, Eric <eric.dong@intel.com>; Ni, Ray <ray.ni@intel.com>; Kumar, Rahul1 <rahul1.kumar@intel.com>; Philippe Mathieu-Daude <philmd@redhat.com>
Subject: [Patch V2 5/7] UefiCpuPkg/MtrrLib/UnitTest: Fix 32-bit GCC build issues

When using UT_ASSERT_EQUAL() on a pointer value, it must be cast to UINTN.  This follows the samples provided with the UnitTestFrameworkPkg.

Cc: Eric Dong <eric.dong@intel.com>
Cc: Ray Ni <ray.ni@intel.com>
Cc: Rahul Kumar <rahul1.kumar@intel.com>
Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
Reviewed-by: Philippe Mathieu-Daude <philmd@redhat.com>
---
 UefiCpuPkg/Library/MtrrLib/UnitTest/MtrrLibUnitTest.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/UefiCpuPkg/Library/MtrrLib/UnitTest/MtrrLibUnitTest.c b/UefiCpuPkg/Library/MtrrLib/UnitTest/MtrrLibUnitTest.c
index 30ee1dc32522..e84b9390601d 100644
--- a/UefiCpuPkg/Library/MtrrLib/UnitTest/MtrrLibUnitTest.c
+++ b/UefiCpuPkg/Library/MtrrLib/UnitTest/MtrrLibUnitTest.c
@@ -599,7 +599,7 @@ UnitTestMtrrGetFixedMtrr (
     }
 
     Result = MtrrGetFixedMtrr (&FixedSettings);
-    UT_ASSERT_EQUAL (Result, &FixedSettings);
+    UT_ASSERT_EQUAL ((UINTN)Result, (UINTN)&FixedSettings);
     UT_ASSERT_MEM_EQUAL (&FixedSettings, &ExpectedFixedSettings, sizeof (FixedSettings));
   }
 
@@ -612,7 +612,7 @@ UnitTestMtrrGetFixedMtrr (
   ZeroMem (&FixedSettings, sizeof (FixedSettings));
   ZeroMem (&ExpectedFixedSettings, sizeof (ExpectedFixedSettings));
   Result = MtrrGetFixedMtrr (&FixedSettings);
-  UT_ASSERT_EQUAL (Result, &FixedSettings);
+  UT_ASSERT_EQUAL ((UINTN)Result, (UINTN)&FixedSettings);
   UT_ASSERT_MEM_EQUAL (&ExpectedFixedSettings, &FixedSettings, sizeof (ExpectedFixedSettings));
 
   return UNIT_TEST_PASSED;
@@ -653,7 +653,7 @@ UnitTestMtrrGetAllMtrrs (
     AsmWriteMsr64 (MSR_IA32_MTRR_PHYSMASK0 + (Index << 1), VariableMtrr[Index].Mask);
   }
   Result = MtrrGetAllMtrrs (&Mtrrs);
-  UT_ASSERT_EQUAL (Result, &Mtrrs);
+  UT_ASSERT_EQUAL ((UINTN)Result, (UINTN)&Mtrrs);
   UT_ASSERT_MEM_EQUAL (Mtrrs.Variables.Mtrr, VariableMtrr, sizeof (MTRR_VARIABLE_SETTING) * SystemParameter.VariableMtrrCount);
 
   //
@@ -665,7 +665,7 @@ UnitTestMtrrGetAllMtrrs (
   SystemParameter.MtrrSupported = FALSE;
   InitializeMtrrRegs (&SystemParameter);
   Result = MtrrGetAllMtrrs (&Mtrrs);
-  UT_ASSERT_EQUAL (Result, &Mtrrs);
+  UT_ASSERT_EQUAL ((UINTN)Result, (UINTN)&Mtrrs);
   UT_ASSERT_MEM_EQUAL (&ExpectedMtrrs, &Mtrrs, sizeof (ExpectedMtrrs));
 
   //
@@ -718,7 +718,7 @@ UnitTestMtrrSetAllMtrrs (
     GenerateRandomMtrrPair (SystemParameter.PhysicalAddressBits, GenerateRandomCacheType (), &Mtrrs.Variables.Mtrr[Index], NULL);
   }
   Result = MtrrSetAllMtrrs (&Mtrrs);
-  UT_ASSERT_EQUAL (Result, &Mtrrs);
+  UT_ASSERT_EQUAL ((UINTN)Result, (UINTN)&Mtrrs);
 
   UT_ASSERT_EQUAL (AsmReadMsr64 (MSR_IA32_MTRR_DEF_TYPE), Mtrrs.MtrrDefType);
   for (Index = 0; Index < SystemParameter.VariableMtrrCount; Index++) {
--
2.32.0.windows.1


^ permalink raw reply related	[flat|nested] 19+ messages in thread

* 回复: [edk2-devel] [Patch V2 7/7] BaseTools/Conf: Fix Linux GCC ARM build issues with HII
  2021-11-03 22:59 ` [Patch V2 7/7] BaseTools/Conf: Fix Linux GCC ARM build issues with HII Michael D Kinney
@ 2021-11-04  6:17   ` gaoliming
  2021-11-04 10:49   ` Leif Lindholm
  1 sibling, 0 replies; 19+ messages in thread
From: gaoliming @ 2021-11-04  6:17 UTC (permalink / raw)
  To: devel, michael.d.kinney
  Cc: 'Bob Feng', 'Yuwei Chen', 'Leif Lindholm',
	'Ard Biesheuvel'

Mike: 

> -----邮件原件-----
> 发件人: devel@edk2.groups.io <devel@edk2.groups.io> 代表 Michael D
> Kinney
> 发送时间: 2021年11月4日 7:00
> 收件人: devel@edk2.groups.io
> 抄送: Bob Feng <bob.c.feng@intel.com>; Liming Gao
> <gaoliming@byosoft.com.cn>; Yuwei Chen <yuwei.chen@intel.com>; Leif
> Lindholm <leif@nuviainc.com>; Ard Biesheuvel <ardb+tianocore@kernel.org>
> 主题: [edk2-devel] [Patch V2 7/7] BaseTools/Conf: Fix Linux GCC ARM build
> issues with HII
> 
> Update builds_rules.template to add $(SLINK) to the GCC
> steps for processing HII resources to produce a static
> library instead of an object file.  This improves linker
> compatibility and specifically fixes a link failure seen
> on Linux GCC ARM builds of the MdeModulePkg due to
> mismatched ABI types between the HII resource section
> and the rest of the libraries.
> 
> Cc: Bob Feng <bob.c.feng@intel.com>
> Cc: Liming Gao <gaoliming@byosoft.com.cn>
> Cc: Yuwei Chen <yuwei.chen@intel.com>
> Cc: Leif Lindholm <leif@nuviainc.com>
> Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>
> Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
> ---
>  BaseTools/Conf/build_rule.template | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/BaseTools/Conf/build_rule.template
> b/BaseTools/Conf/build_rule.template
> index 3add1029f276..5f59044da36d 100755
> --- a/BaseTools/Conf/build_rule.template
> +++ b/BaseTools/Conf/build_rule.template
> @@ -668,6 +668,8 @@
> 
>      <Command.GCC>
>          "$(GENFW)" -o $(OUTPUT_DIR)(+)$(MODULE_NAME)hii.rc -g
> $(MODULE_GUID) --hiibinpackage $(HII_BINARY_PACKAGES)
> $(GENFW_FLAGS)
> -        "$(RC)" $(RC_FLAGS) $(OUTPUT_DIR)(+)$(MODULE_NAME)hii.rc
> ${dst}
> +        "$(RC)" $(RC_FLAGS) $(OUTPUT_DIR)(+)$(MODULE_NAME)hii.rc
> $(OUTPUT_DIR)(+)$(MODULE_NAME)hii.rc.obj
> +        "$(SLINK)" cr  ${dst}
> $(OUTPUT_DIR)(+)$(MODULE_NAME)hii.rc.obj
> +

Here,cr is the fixed command. Do you think to add SLINK_FLAGS macro for
this option?

Thanks
Liming
>      <Command.XCODE, Command.RVCT, Command.CLANGGCC>
>          "$(GENFW)" -o $(OUTPUT_DIR)(+)$(MODULE_NAME)hii.rc -g
> $(MODULE_GUID) --hiibinpackage $(HII_BINARY_PACKAGES)
> $(GENFW_FLAGS)
> --
> 2.32.0.windows.1
> 
> 
> 
> 
> 




^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [Patch V2 7/7] BaseTools/Conf: Fix Linux GCC ARM build issues with HII
  2021-11-03 22:59 ` [Patch V2 7/7] BaseTools/Conf: Fix Linux GCC ARM build issues with HII Michael D Kinney
  2021-11-04  6:17   ` 回复: [edk2-devel] " gaoliming
@ 2021-11-04 10:49   ` Leif Lindholm
  2021-11-04 17:08     ` [edk2-devel] " Michael D Kinney
  1 sibling, 1 reply; 19+ messages in thread
From: Leif Lindholm @ 2021-11-04 10:49 UTC (permalink / raw)
  To: Michael D Kinney; +Cc: devel, Bob Feng, Liming Gao, Yuwei Chen, Ard Biesheuvel

On Wed, Nov 03, 2021 at 15:59:54 -0700, Michael D Kinney wrote:
> Update builds_rules.template to add $(SLINK) to the GCC
> steps for processing HII resources to produce a static
> library instead of an object file.  This improves linker
> compatibility and specifically fixes a link failure seen
> on Linux GCC ARM builds of the MdeModulePkg due to
> mismatched ABI types between the HII resource section
> and the rest of the libraries.
> 
> Cc: Bob Feng <bob.c.feng@intel.com>
> Cc: Liming Gao <gaoliming@byosoft.com.cn>
> Cc: Yuwei Chen <yuwei.chen@intel.com>
> Cc: Leif Lindholm <leif@nuviainc.com>
> Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>
> Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>

This arguably looks like a plain fix in the first place.

However, I am only able to trigger the build failure for the NOOPT
target. That may be useful to mention in the commit message.

With that:
Reviewed-by: Leif Lindholm <leif@nuviainc.com>

> ---
>  BaseTools/Conf/build_rule.template | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/BaseTools/Conf/build_rule.template b/BaseTools/Conf/build_rule.template
> index 3add1029f276..5f59044da36d 100755
> --- a/BaseTools/Conf/build_rule.template
> +++ b/BaseTools/Conf/build_rule.template
> @@ -668,6 +668,8 @@
>  
>      <Command.GCC>
>          "$(GENFW)" -o $(OUTPUT_DIR)(+)$(MODULE_NAME)hii.rc -g $(MODULE_GUID) --hiibinpackage $(HII_BINARY_PACKAGES) $(GENFW_FLAGS)
> -        "$(RC)" $(RC_FLAGS) $(OUTPUT_DIR)(+)$(MODULE_NAME)hii.rc ${dst}
> +        "$(RC)" $(RC_FLAGS) $(OUTPUT_DIR)(+)$(MODULE_NAME)hii.rc $(OUTPUT_DIR)(+)$(MODULE_NAME)hii.rc.obj
> +        "$(SLINK)" cr  ${dst} $(OUTPUT_DIR)(+)$(MODULE_NAME)hii.rc.obj
> +
>      <Command.XCODE, Command.RVCT, Command.CLANGGCC>
>          "$(GENFW)" -o $(OUTPUT_DIR)(+)$(MODULE_NAME)hii.rc -g $(MODULE_GUID) --hiibinpackage $(HII_BINARY_PACKAGES) $(GENFW_FLAGS)
> -- 
> 2.32.0.windows.1
> 

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [edk2-devel] [Patch V2 7/7] BaseTools/Conf: Fix Linux GCC ARM build issues with HII
  2021-11-04 10:49   ` Leif Lindholm
@ 2021-11-04 17:08     ` Michael D Kinney
  2021-11-05  3:01       ` Michael D Kinney
  0 siblings, 1 reply; 19+ messages in thread
From: Michael D Kinney @ 2021-11-04 17:08 UTC (permalink / raw)
  To: devel@edk2.groups.io, leif@nuviainc.com, Kinney, Michael D
  Cc: Feng, Bob C, Liming Gao, Chen, Christine, Ard Biesheuvel

Hi Leif,

I will add NOOPT information to the commit message.

Unfortunately, this change caused a boot to shell failure for ArmVirtPkg QEMU.  TFTP dynamic shell command failed to find HII package.

	https://github.com/tianocore/edk2/pull/2166
	https://dev.azure.com/tianocore/edk2-ci/_build/results?buildId=32907&view=logs&j=cf2d8b26-a21c-5c68-abf4-b944c123e462&t=5ffbbe5c-1d3a-55f5-5ef3-8a0ef80d76a1&l=547

I am investigating and will send a V3 with updates.

Mike

> -----Original Message-----
> From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf Of Leif Lindholm
> Sent: Thursday, November 4, 2021 3:50 AM
> To: Kinney, Michael D <michael.d.kinney@intel.com>
> Cc: devel@edk2.groups.io; Feng, Bob C <bob.c.feng@intel.com>; Liming Gao <gaoliming@byosoft.com.cn>; Chen, Christine
> <yuwei.chen@intel.com>; Ard Biesheuvel <ardb+tianocore@kernel.org>
> Subject: Re: [edk2-devel] [Patch V2 7/7] BaseTools/Conf: Fix Linux GCC ARM build issues with HII
> 
> On Wed, Nov 03, 2021 at 15:59:54 -0700, Michael D Kinney wrote:
> > Update builds_rules.template to add $(SLINK) to the GCC
> > steps for processing HII resources to produce a static
> > library instead of an object file.  This improves linker
> > compatibility and specifically fixes a link failure seen
> > on Linux GCC ARM builds of the MdeModulePkg due to
> > mismatched ABI types between the HII resource section
> > and the rest of the libraries.
> >
> > Cc: Bob Feng <bob.c.feng@intel.com>
> > Cc: Liming Gao <gaoliming@byosoft.com.cn>
> > Cc: Yuwei Chen <yuwei.chen@intel.com>
> > Cc: Leif Lindholm <leif@nuviainc.com>
> > Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>
> > Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
> 
> This arguably looks like a plain fix in the first place.
> 
> However, I am only able to trigger the build failure for the NOOPT
> target. That may be useful to mention in the commit message.
> 
> With that:
> Reviewed-by: Leif Lindholm <leif@nuviainc.com>
> 
> > ---
> >  BaseTools/Conf/build_rule.template | 4 +++-
> >  1 file changed, 3 insertions(+), 1 deletion(-)
> >
> > diff --git a/BaseTools/Conf/build_rule.template b/BaseTools/Conf/build_rule.template
> > index 3add1029f276..5f59044da36d 100755
> > --- a/BaseTools/Conf/build_rule.template
> > +++ b/BaseTools/Conf/build_rule.template
> > @@ -668,6 +668,8 @@
> >
> >      <Command.GCC>
> >          "$(GENFW)" -o $(OUTPUT_DIR)(+)$(MODULE_NAME)hii.rc -g $(MODULE_GUID) --hiibinpackage $(HII_BINARY_PACKAGES)
> $(GENFW_FLAGS)
> > -        "$(RC)" $(RC_FLAGS) $(OUTPUT_DIR)(+)$(MODULE_NAME)hii.rc ${dst}
> > +        "$(RC)" $(RC_FLAGS) $(OUTPUT_DIR)(+)$(MODULE_NAME)hii.rc $(OUTPUT_DIR)(+)$(MODULE_NAME)hii.rc.obj
> > +        "$(SLINK)" cr  ${dst} $(OUTPUT_DIR)(+)$(MODULE_NAME)hii.rc.obj
> > +
> >      <Command.XCODE, Command.RVCT, Command.CLANGGCC>
> >          "$(GENFW)" -o $(OUTPUT_DIR)(+)$(MODULE_NAME)hii.rc -g $(MODULE_GUID) --hiibinpackage $(HII_BINARY_PACKAGES)
> $(GENFW_FLAGS)
> > --
> > 2.32.0.windows.1
> >
> 
> 
> 
> 


^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [edk2-devel] [Patch V2 7/7] BaseTools/Conf: Fix Linux GCC ARM build issues with HII
  2021-11-04 17:08     ` [edk2-devel] " Michael D Kinney
@ 2021-11-05  3:01       ` Michael D Kinney
  0 siblings, 0 replies; 19+ messages in thread
From: Michael D Kinney @ 2021-11-05  3:01 UTC (permalink / raw)
  To: devel@edk2.groups.io, leif@nuviainc.com, Kinney, Michael D
  Cc: Feng, Bob C, Liming Gao, Chen, Christine, Ard Biesheuvel

Hi Leif,

I am dropping patch 7 from this series.

I am not able to get the ARM build failure resolved at this time.

The basic issue is that the GCC builds are using objcopy to create
and ELF image with an section named .hii with the HII data.  However,
objcopy can not set the ELF fields for the ABI correctly and some of
the linkers will complain if the ABI does not match, even if there
is no code associated with the ELF image.

We may need to consider a better solution for generating resource
sections that works for all toolchains instead of trying to use
objcopy.

Mike

> -----Original Message-----
> From: Kinney, Michael D <michael.d.kinney@intel.com>
> Sent: Thursday, November 4, 2021 10:08 AM
> To: devel@edk2.groups.io; leif@nuviainc.com; Kinney, Michael D <michael.d.kinney@intel.com>
> Cc: Feng, Bob C <bob.c.feng@intel.com>; Liming Gao <gaoliming@byosoft.com.cn>; Chen, Christine <yuwei.chen@intel.com>; Ard
> Biesheuvel <ardb+tianocore@kernel.org>
> Subject: RE: [edk2-devel] [Patch V2 7/7] BaseTools/Conf: Fix Linux GCC ARM build issues with HII
> 
> Hi Leif,
> 
> I will add NOOPT information to the commit message.
> 
> Unfortunately, this change caused a boot to shell failure for ArmVirtPkg QEMU.  TFTP dynamic shell command failed to find
> HII package.
> 
> 	https://github.com/tianocore/edk2/pull/2166
> 	https://dev.azure.com/tianocore/edk2-ci/_build/results?buildId=32907&view=logs&j=cf2d8b26-a21c-5c68-abf4-
> b944c123e462&t=5ffbbe5c-1d3a-55f5-5ef3-8a0ef80d76a1&l=547
> 
> I am investigating and will send a V3 with updates.
> 
> Mike
> 
> > -----Original Message-----
> > From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf Of Leif Lindholm
> > Sent: Thursday, November 4, 2021 3:50 AM
> > To: Kinney, Michael D <michael.d.kinney@intel.com>
> > Cc: devel@edk2.groups.io; Feng, Bob C <bob.c.feng@intel.com>; Liming Gao <gaoliming@byosoft.com.cn>; Chen, Christine
> > <yuwei.chen@intel.com>; Ard Biesheuvel <ardb+tianocore@kernel.org>
> > Subject: Re: [edk2-devel] [Patch V2 7/7] BaseTools/Conf: Fix Linux GCC ARM build issues with HII
> >
> > On Wed, Nov 03, 2021 at 15:59:54 -0700, Michael D Kinney wrote:
> > > Update builds_rules.template to add $(SLINK) to the GCC
> > > steps for processing HII resources to produce a static
> > > library instead of an object file.  This improves linker
> > > compatibility and specifically fixes a link failure seen
> > > on Linux GCC ARM builds of the MdeModulePkg due to
> > > mismatched ABI types between the HII resource section
> > > and the rest of the libraries.
> > >
> > > Cc: Bob Feng <bob.c.feng@intel.com>
> > > Cc: Liming Gao <gaoliming@byosoft.com.cn>
> > > Cc: Yuwei Chen <yuwei.chen@intel.com>
> > > Cc: Leif Lindholm <leif@nuviainc.com>
> > > Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>
> > > Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
> >
> > This arguably looks like a plain fix in the first place.
> >
> > However, I am only able to trigger the build failure for the NOOPT
> > target. That may be useful to mention in the commit message.
> >
> > With that:
> > Reviewed-by: Leif Lindholm <leif@nuviainc.com>
> >
> > > ---
> > >  BaseTools/Conf/build_rule.template | 4 +++-
> > >  1 file changed, 3 insertions(+), 1 deletion(-)
> > >
> > > diff --git a/BaseTools/Conf/build_rule.template b/BaseTools/Conf/build_rule.template
> > > index 3add1029f276..5f59044da36d 100755
> > > --- a/BaseTools/Conf/build_rule.template
> > > +++ b/BaseTools/Conf/build_rule.template
> > > @@ -668,6 +668,8 @@
> > >
> > >      <Command.GCC>
> > >          "$(GENFW)" -o $(OUTPUT_DIR)(+)$(MODULE_NAME)hii.rc -g $(MODULE_GUID) --hiibinpackage $(HII_BINARY_PACKAGES)
> > $(GENFW_FLAGS)
> > > -        "$(RC)" $(RC_FLAGS) $(OUTPUT_DIR)(+)$(MODULE_NAME)hii.rc ${dst}
> > > +        "$(RC)" $(RC_FLAGS) $(OUTPUT_DIR)(+)$(MODULE_NAME)hii.rc $(OUTPUT_DIR)(+)$(MODULE_NAME)hii.rc.obj
> > > +        "$(SLINK)" cr  ${dst} $(OUTPUT_DIR)(+)$(MODULE_NAME)hii.rc.obj
> > > +
> > >      <Command.XCODE, Command.RVCT, Command.CLANGGCC>
> > >          "$(GENFW)" -o $(OUTPUT_DIR)(+)$(MODULE_NAME)hii.rc -g $(MODULE_GUID) --hiibinpackage $(HII_BINARY_PACKAGES)
> > $(GENFW_FLAGS)
> > > --
> > > 2.32.0.windows.1
> > >
> >
> >
> > 
> >


^ permalink raw reply	[flat|nested] 19+ messages in thread

end of thread, other threads:[~2021-11-05  3:01 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-11-03 22:59 [Patch V2 0/7] Fix package build issues Michael D Kinney
2021-11-03 22:59 ` [Patch V2 1/7] DynamicTablesPkg: Add missing BaseStackCheckLib instance Michael D Kinney
2021-11-03 22:59 ` [Patch V2 2/7] NetworkPkg/NetworkPkg.dsc: Add RngLib mapping for ARM and RISCV64 Michael D Kinney
2021-11-04  0:20   ` Abner Chang
     [not found]   ` <16B42FEF94831C39.15345@groups.io>
2021-11-04  0:23     ` [edk2-devel] " Abner Chang
2021-11-03 22:59 ` [Patch V2 3/7] SecurityPkg/SecurityPkg.dsc: Add missing RngLib " Michael D Kinney
2021-11-04  0:21   ` Abner Chang
2021-11-03 22:59 ` [Patch V2 4/7] SignedCapsulePkg/SignedCapsulePkg.dsc: Add RngLib mapping Michael D Kinney
2021-11-04  0:21   ` Abner Chang
2021-11-03 22:59 ` [Patch V2 5/7] UefiCpuPkg/MtrrLib/UnitTest: Fix 32-bit GCC build issues Michael D Kinney
2021-11-04  4:59   ` Ni, Ray
2021-11-03 22:59 ` [Patch V2 6/7] MdeModulePkg/Variable/RuntimeDxeUnitTest: Fix 32-bit GCC builds Michael D Kinney
2021-11-03 23:46   ` [EXTERNAL] " Bret Barkelew
2021-11-04  0:34   ` [edk2-devel] " Wu, Hao A
2021-11-03 22:59 ` [Patch V2 7/7] BaseTools/Conf: Fix Linux GCC ARM build issues with HII Michael D Kinney
2021-11-04  6:17   ` 回复: [edk2-devel] " gaoliming
2021-11-04 10:49   ` Leif Lindholm
2021-11-04 17:08     ` [edk2-devel] " Michael D Kinney
2021-11-05  3:01       ` Michael D Kinney

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox