[U-Boot] [BUG] qemu-x86_defconfig does not build with GCC 8.1

Heinrich Schuchardt xypron.glpk at gmx.de
Mon Aug 6 16:36:01 UTC 2018


On 08/06/2018 05:13 PM, Andy Shevchenko wrote:
> On Sun, Jul 29, 2018 at 3:09 PM, Heinrich Schuchardt <xypron.glpk at gmx.de> wrote:
>> On 07/29/2018 02:40 AM, Bin Meng wrote:
> 
>> Ubuntu Cosmic has gcc 8.2. Setting up a virtual machine with
>> virt-manager is quite easy.
> 
> Can you check if output of `gcc -v` has --enable-default-pie?

The flag is enabled both for gcc-7 and gcc-8 in Debian Buster.

> If so (I bet it is the case), can you try the following patch (sorry,
> it's mangled, needs manual apply)
> 
> --- a/Makefile
> +++ b/Makefile
> @@ -371,6 +371,7 @@ KBUILD_CPPFLAGS := -D__KERNEL__ -D__UBOOT__
> 
> KBUILD_CFLAGS   := -Wall -Wstrict-prototypes \
>                   -Wno-format-security \
> +                  -fno-pie \
>                   -fno-builtin -ffreestanding $(CSTD_FLAG)
> KBUILD_CFLAGS  += -fshort-wchar
> KBUILD_AFLAGS   := -D__ASSEMBLY__
> 
> P.S. I have no time right now to test this myself though.

With the flag building with gcc-8.1 works. But the interesting question
is whether the EFI subsystem will be able to relocate the runtime code
when the EFI sercice SetVirtualAddressMap is called.

Best regards

Heinrich



More information about the U-Boot mailing list