[Solved] GRUB with EFI fails to compile, type error
Posted: Sat Oct 01, 2016 8:52 am
Pretty straightforward, I've been trying to get grub to build with EFI stuff, but to no avail, here's where I'm stuck now:
After the following ./configure:
... I get a crash during the make
Here's the snippet in question which crashes, the full code is at the paste here (and of course, in the GRUB source): http://pastebin.com/NvPSsv3q
I'm not too sure why the types don't match, my guess is that there would be something wrong with the way GRUB did one of it's type definitions, but that's just a guess. Another thing that probably affects it is that I'm using WSL, but I can't test on a real linux 64 bit machine at the moment, so if all else looks good, that might be it. My gcc's machinedump is x86_64-linux-gnu, for reference.
If you've looked at the source and at the variable declaration, obviously, I can just edit the source to cast them to unsigned long long when it prints them, but that seems like a band-aid fix, is there a more fundamental problem with the way I'm compiling this? I'll try editing the source anyway and get back shortly with a reply detailing how it went. If I take a while, assume it didn't go well.
- Mikumiku747
After the following ./configure:
Code: Select all
CFLAGS="-Wno-error" ./configure --with-platform=efi --target=x86_64 && make
Code: Select all
gcc -Iutil/mkisofs -I./util/mkisofs -I. -I./include -I./gnulib -I./include -Wall -W -DGRUB_LIBDIR=\"/usr/local/lib/`echo grub/x86_64-efi | sed 's,x,x,'`\" -DLOCALEDIR=\"\" -Wno-error -DGRUB_MACHINE_EFI=1 -DGRUB_UTIL=1 -D_FILE_OFFSET_BITS=64 -I./util/mkisofs/include -Wno-all -Werror -MD -c -o grub_mkisofs-util_mkisofs_mkisofs.o util/mkisofs/mkisofs.c
util/mkisofs/mkisofs.c: In function ‘main’:
util/mkisofs/mkisofs.c:1405:7: error: format ‘%llu’ expects argument of type ‘long long unsigned int’, but argument 3 has type ‘uint64_t’ [-Werror=format=]
fprintf (stderr, _("%llu extents written (%llu MiB)\n"), last_extent, last_extent >> 9);
^
util/mkisofs/mkisofs.c:1405:7: error: format ‘%llu’ expects argument of type ‘long long unsigned int’, but argument 4 has type ‘uint64_t’ [-Werror=format=]
cc1: all warnings being treated as errors
make: *** [grub_mkisofs-util_mkisofs_mkisofs.o] Error 1
Code: Select all
#endif
fprintf (stderr, _("%llu extents written (%llu MiB)\n"), last_extent, last_extent >> 9);
}
If you've looked at the source and at the variable declaration, obviously, I can just edit the source to cast them to unsigned long long when it prints them, but that seems like a band-aid fix, is there a more fundamental problem with the way I'm compiling this? I'll try editing the source anyway and get back shortly with a reply detailing how it went. If I take a while, assume it didn't go well.
- Mikumiku747