grub-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: GRUB build failure


From: Glenn Washburn
Subject: Re: GRUB build failure
Date: Wed, 19 Aug 2020 13:51:44 -0500

On Wed, 19 Aug 2020 10:30:34 +0000
Naveen Chaudhary <naveenchaudhary2010@hotmail.com> wrote:

> Hi,
> 
> I figured out that I should add "--disable-werror" to the configure.
> 
> After this I was able to build successfully.

Hmm, interesting. I also compile on ubuntu (upgrade to 20.04) with no
added CFLAGS and do not have this problem.  In the configure, I see
detection for disabling PIE compiling/linking.

checking whether `gcc' has `-fPIE' as default... yes
checking whether linker accepts -no-pie... yes
checking whether linker accepts -nopie... no
checking whether linker needs disabling of PIE to work... no

And compiler options -fno-PIE and -fno-pie and linker option -no-pie
are used.

I don't think building with PIE is useful nor the norm for grub (maybe
I'm wrong?).  Do you have those configure lines?  Perhaps this is
related to your compiler version?  I'm using gcc version 9.3.0 (Ubuntu
9.3.0-10ubuntu2).

If you're doing development, perhaps you can use CFLAGS="-fno-PIE
-fno-pie" and LDFLAGS='-no-pie' instead of "--disable-werror".



> ________________________________
> From: Naveen Chaudhary
> Sent: Wednesday, August 19, 2020 3:54 PM
> To: bug-grub@gnu.org <bug-grub@gnu.org>; grub-devel@gnu.org
> <grub-devel@gnu.org> Subject: GRUB build failure
> 
> Hi,
> 
> Host : Ubuntu 18.04.3 LTS
> GCC : gcc (Ubuntu 7.3.0-16ubuntu3) 7.3.0
> uname : Linux vm 5.0.0-27-generic #28~18.04.1-Ubuntu SMP Thu Aug 22
> 03:00:32 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux
> 
> I have clone the GRUB2 from https://github.com/rhboot/grub2 today and
> the HEAD points to e7b8856f8be3292afdb38d2e8c70ad8d62a61e10 (linux:
> Fix integer overflows in initrd size handling).
> 
> I followed the below steps to compile after cloning :
> $ ./bootstrap
> $ ./autogen.sh
> 
> $ export EFI_ARCH=x86_64
> 
> $ ./configure --with-platform=efi --target=$EFI_ARCH
> --program-prefix=""
> 
> $ make
> 
> 
> I get the below error :
> 
> 
> Making all in grub-core
> 
> make[2]: Entering directory
> '/home/naveen/Desktop/workspace/grub2/grub-core' make  all-am
> make[3]: Entering directory
> '/home/naveen/Desktop/workspace/grub2/grub-core' gcc -std=gnu99 -Os
> -m64 -Wall -W -Wshadow -Wpointer-arith -Wundef -Wchar-subscripts
> -Wcomment -Wdeprecated-declarations -Wdisabled-optimization
> -Wdiv-by-zero -Wfloat-equal -Wformat-extra-args -Wformat-security
> -Wformat-y2k -Wimplicit -Wimplicit-function-declaration
> -Wimplicit-int -Wmain -Wmissing-braces -Wmissing-format-attribute
> -Wmultichar -Wparentheses -Wreturn-type -Wsequence-point -Wshadow
> -Wsign-compare -Wswitch -Wtrigraphs -Wunknown-pragmas -Wunused
> -Wunused-function -Wunused-label -Wunused-parameter -Wunused-value
> -Wunused-variable -Wwrite-strings -Wnested-externs
> -Wstrict-prototypes -g -Wredundant-decls -Wmissing-prototypes
> -Wmissing-declarations  -Wextra -Wattributes -Wendif-labels
> -Winit-self -Wint-to-pointer-cast -Winvalid-pch
> -Wmissing-field-initializers -Wnonnull -Woverflow -Wvla
> -Wpointer-to-int-cast -Wstrict-aliasing -Wvariadic-macros
> -Wvolatile-register-var -Wpointer-sign -Wmissing-include-dirs
> -Wmissing-prototypes -Wmissing-declarations -Wformat=2
> -freg-struct-return -mno-mmx -mno-sse -mno-sse2 -mno-sse3 -mno-3dnow
> -msoft-float -fno-dwarf2-cfi-asm -mno-stack-arg-probe
> -fno-asynchronous-unwind-tables -fno-unwind-tables -fno-ident
> -mcmodel=large -mno-red-zone -fno-stack-protector -Wtrampolines
> -Werror   -ffreestanding   -m64 -Wl,-melf_x86_64 -Wl,--build-id=none
> -nostdlib -Wl,-N -Wl,-r,-d   -o disk.module lib/disk_module-disk.o
> /usr/bin/x86_64-linux-gnu-ld: -r and -pie may not be used together
> collect2: error: ld returned 1 exit status Makefile:27605: recipe for
> target 'disk.module' failed make[3]: *** [disk.module] Error 1
> 
> 
> 
> Can someone please direct me what am I missing and why I get this
> error.
> 
> 
> Regards,
> 
> Naveen
> 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]