public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "King Sumo" <kingsumos@gmail.com>
To: devel@edk2.groups.io
Subject: UefiPayloadPkg build error
Date: Mon, 23 Aug 2021 12:54:14 -0300	[thread overview]
Message-ID: <CAGfcU4S2x=KiJNcDiUbt3BJo4UGMT4Wp5PDaoYxV2cacw2nVeA@mail.gmail.com> (raw)

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

Hi,

The following commit broke the UefiPayloadPkg build:

commit d63595c3c91624f258f291adee329724edeac12e (HEAD)
Author: Zhiguang Liu <zhiguang.liu@intel.com>
Date:   Sun Apr 25 15:50:46 2021 +0800


    UefiPayloadPkg: Update the function definition of HobConstructor


Environment: GCC5 / openSUSE 15.x
 build -a IA32 -a X64 -p UefiPayloadPkg/UefiPayloadPkg.dsc -b DEBUG -t GCC5
-D BOOTLOADER=COREBOOT

Build log:
/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]
   Hob->EfiMemoryTop        = (EFI_PHYSICAL_ADDRESS) EfiMemoryTop;
                              ^
/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]
   Hob->EfiMemoryBottom     = (EFI_PHYSICAL_ADDRESS) EfiMemoryBottom;
                              ^
/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]
   Hob->EfiFreeMemoryTop    = (EFI_PHYSICAL_ADDRESS) EfiFreeMemoryTop;
                              ^



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:

diff --git a/UefiPayloadPkg/Library/PayloadEntryHobLib/Hob.c
b/UefiPayloadPkg/Library/PayloadEntryHobLib/Hob.c
index 768c3db770..53ee1440f5 100644
--- a/UefiPayloadPkg/Library/PayloadEntryHobLib/Hob.c
+++ b/UefiPayloadPkg/Library/PayloadEntryHobLib/Hob.c
@@ -77,9 +77,9 @@ HobConstructor (
   Hob->Version             = EFI_HOB_HANDOFF_TABLE_VERSION;
   Hob->BootMode            = BOOT_WITH_FULL_CONFIGURATION;

-  Hob->EfiMemoryTop        = (EFI_PHYSICAL_ADDRESS) EfiMemoryTop;
-  Hob->EfiMemoryBottom     = (EFI_PHYSICAL_ADDRESS) EfiMemoryBottom;
-  Hob->EfiFreeMemoryTop    = (EFI_PHYSICAL_ADDRESS) EfiFreeMemoryTop;
+  Hob->EfiMemoryTop        = (EFI_PHYSICAL_ADDRESS) (UINTN)EfiMemoryTop;
+  Hob->EfiMemoryBottom     = (EFI_PHYSICAL_ADDRESS) (UINTN)EfiMemoryBottom;
+  Hob->EfiFreeMemoryTop    = (EFI_PHYSICAL_ADDRESS)
(UINTN)EfiFreeMemoryTop;
   Hob->EfiFreeMemoryBottom = (EFI_PHYSICAL_ADDRESS) (UINTN) (HobEnd+1);
   Hob->EfiEndOfHobList     = (EFI_PHYSICAL_ADDRESS) (UINTN) HobEnd;

Thanks,
Sumo

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

             reply	other threads:[~2021-08-23 15:54 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-23 15:54 King Sumo [this message]
2021-08-24 16:54 ` [edk2-devel] UefiPayloadPkg build error King Sumo
2021-08-26  0:20 ` Guo Dong

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAGfcU4S2x=KiJNcDiUbt3BJo4UGMT4Wp5PDaoYxV2cacw2nVeA@mail.gmail.com' \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox