[U-Boot] [RFC 1/1] efi_loader: fix building of helloworld.efi on x86_64

Alexander Graf agraf at suse.de
Tue Sep 12 10:31:42 UTC 2017



On 12.09.17 10:18, Heinrich Schuchardt wrote:
> On 09/12/2017 05:00 AM, Bin Meng wrote:
>> Hi Heinrich,
>>
>> On Sun, Sep 10, 2017 at 4:55 PM, Heinrich Schuchardt <xypron.glpk at gmx.de> wrote:
>>> Variable EFI_LDS is set based on CONFIG_EFI_STUB_64BIT.
>>> It influences which lds script is used for compiling helloworld.efi.
>>> This results in building helloworld.efi failing on x86_64 if
>>> CONFIG_EFI_STUB_64BIT is not set. CONFIG_EFI_STUB_64BIT is only
>>> visible if EFI_STUB is selected. We should be able to compile a 64bit
>>> helloworld.efi irrespective of EFI_STUB.
>>>
>>> With the patch the bitness of the efi build is taken from the
>>> architecture choice.
>>>
>>> Signed-off-by: Heinrich Schuchardt <xypron.glpk at gmx.de>
>>> ---
>>> For proper testing
>>> https://lists.denx.de/pipermail/u-boot/2017-September/305184.html
>>> must be fixed.
>>>
>>> So I send this as RFC.
>>
>> Sorry I missed this. This does not go to the U-Boot ML. Did you intend
>> to keep the discussion among us?
>>
> CC: U-Boot Mailing List <u-boot at lists.denx.de>
> 
>>>
>>> Alex, do you remember why CONFIG_EFI_STUB_64BIT was introduced in the
>>> first place.
>>>
>>
>> The CONFIG_EFI_STUB_64BIT was introduced to support booting from a
>> 64-bit EFI BIOS.
>>
>>> Would you ever use a stub with a different bitness than U-Boot?
>>>
>>
>> Yes, for example U-Boot x86 32-bit to boot a 64-bit EFI payload.
> 
> My understanding is that the EFI stub is used if U-Boot is loaded as an
> EFI application.
> 
> It has nothing to do with the EFI application or driver loaded by
> U-boot's bootefi command, which I assume you reference as "to boot a
> 64-bit EFI payload".
> 
> A stub with different bitness than U-Boot would be needed if we wanted
> to load 64 bit U-Boot as a 32 bit EFI application or a 32 bit U-Boot as
> a 64 bit EFI application. Is this required in any scenario?

That's what Bin just explained, no? Running U-Boot on x86 as 32bit 
binary was/is quite common, but usually you're running on a 64bit UEFI 
implementation.

Or you want to run 64-bit U-Boot on an older Mac which only has 32bit 
UEFI...


Alex


More information about the U-Boot mailing list