<div dir="ltr">Hi,<div><br></div><div>The following commit broke the UefiPayloadPkg build:</div><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><div>commit d63595c3c91624f258f291adee329724edeac12e (HEAD)</div><div>Author: Zhiguang Liu <<a href="mailto:zhiguang.liu@intel.com">zhiguang.liu@intel.com</a>></div><div>Date:   Sun Apr 25 15:50:46 2021 +0800</div></blockquote><div><br></div><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><div>    UefiPayloadPkg: Update the function definition of HobConstructor</div></blockquote><div><br></div><div>Environment: GCC5 / openSUSE 15.x</div><div> build -a IA32 -a X64 -p UefiPayloadPkg/UefiPayloadPkg.dsc -b DEBUG -t GCC5 -D BOOTLOADER=COREBOOT<br><br></div><div>Build log:<br>/home/lxuser/edk2/edk2-orig/UefiPayloadPkg/Library/PayloadEntryHobLib/Hob.c:80:30: error: cast from pointer to integer of different size [-Werror=pointer-to-int-cast]<br>   Hob->EfiMemoryTop        = (EFI_PHYSICAL_ADDRESS) EfiMemoryTop;<br>                              ^<br>/home/lxuser/edk2/edk2-orig/UefiPayloadPkg/Library/PayloadEntryHobLib/Hob.c:81:30: error: cast from pointer to integer of different size [-Werror=pointer-to-int-cast]<br>   Hob->EfiMemoryBottom     = (EFI_PHYSICAL_ADDRESS) EfiMemoryBottom;<br>                              ^<br>/home/lxuser/edk2/edk2-orig/UefiPayloadPkg/Library/PayloadEntryHobLib/Hob.c:82:30: error: cast from pointer to integer of different size [-Werror=pointer-to-int-cast]<br>   Hob->EfiFreeMemoryTop    = (EFI_PHYSICAL_ADDRESS) EfiFreeMemoryTop;<br>                              ^<br><br><br></div><div><br></div><div>The below patch fixes the build, however I'm not sure if this is the best way to solve the issue - or if there are any side effects:</div><div><br></div><div>diff --git a/UefiPayloadPkg/Library/PayloadEntryHobLib/Hob.c b/UefiPayloadPkg/Library/PayloadEntryHobLib/Hob.c<br>index 768c3db770..53ee1440f5 100644<br>--- a/UefiPayloadPkg/Library/PayloadEntryHobLib/Hob.c<br>+++ b/UefiPayloadPkg/Library/PayloadEntryHobLib/Hob.c<br>@@ -77,9 +77,9 @@ HobConstructor (<br>   Hob->Version             = EFI_HOB_HANDOFF_TABLE_VERSION;<br>   Hob->BootMode            = BOOT_WITH_FULL_CONFIGURATION;<br><br>-  Hob->EfiMemoryTop        = (EFI_PHYSICAL_ADDRESS) EfiMemoryTop;<br>-  Hob->EfiMemoryBottom     = (EFI_PHYSICAL_ADDRESS) EfiMemoryBottom;<br>-  Hob->EfiFreeMemoryTop    = (EFI_PHYSICAL_ADDRESS) EfiFreeMemoryTop;<br>+  Hob->EfiMemoryTop        = (EFI_PHYSICAL_ADDRESS) (UINTN)EfiMemoryTop;<br>+  Hob->EfiMemoryBottom     = (EFI_PHYSICAL_ADDRESS) (UINTN)EfiMemoryBottom;<br>+  Hob->EfiFreeMemoryTop    = (EFI_PHYSICAL_ADDRESS) (UINTN)EfiFreeMemoryTop;<br>   Hob->EfiFreeMemoryBottom = (EFI_PHYSICAL_ADDRESS) (UINTN) (HobEnd+1);<br>   Hob->EfiEndOfHobList     = (EFI_PHYSICAL_ADDRESS) (UINTN) HobEnd;<br></div><div><br></div><div>Thanks,</div><div>Sumo</div></div>


 <div width="1" style="color:white;clear:both">_._,_._,_</div> <hr>   Groups.io Links:<p>   You receive all messages sent to this group.    <p> <a target="_blank" href="https://edk2.groups.io/g/devel/message/79728">View/Reply Online (#79728)</a> |    |  <a target="_blank" href="https://groups.io/mt/85088671/1813853">Mute This Topic</a>  | <a href="https://edk2.groups.io/g/devel/post">New Topic</a><br>    <a href="https://edk2.groups.io/g/devel/editsub/1813853">Your Subscription</a> | <a href="mailto:devel+owner@edk2.groups.io">Contact Group Owner</a> |  <a href="https://edk2.groups.io/g/devel/unsub">Unsubscribe</a>  [edk2-devel-archive@redhat.com]<br> <div width="1" style="color:white;clear:both">_._,_._,_</div>