chenall/grub4dos

Can't compile grub4dos for UEFI

Closed this issue · 6 comments

Hi

Because build grub4dos-for_UEFI-2021-08-18 crashes with my laptop with error:
/EndEntire file path: /ACPI(a0341d0,0)/PCI(0,14)/USB(1,0)/HD(1,800,775800,77e4ab9900000000,1,1)/File(\efi\boot)/File(GRUB4DOS_BOOTIA32.EFI)/EndEntire

I am trying to compile grub4dos for efi by myself.
I am using Ubuntu 18.04. I have cloned grub4dos. Then checked out efi:
git checkout efi
then installed gcc-multilib however during configure I face error:
checking if C symbols get an underscore after compilation... no checking whether objcopy works for absolute addresses... no configure: error: GRUB requires a working absolute objcopy; upgrade your binutils

I've found workaround:
- if { ac_try='${OBJCOPY-objcopy} -O binary conftest.exec conftest'
+ if { ac_try='${OBJCOPY-objcopy} --only-section=.text -O binary conftest.exec conftest'

and now I face another error:
checking for .code16 addr64 assembler support... no configure: error: GRUB requires GAS .code16 addr32 support; upgrade your binutils

I cannot overcome this. Please help
@yaya2007 @chenall can you post HOWTO build ?

I even installed i386 version debian. Then ended up with error:
checking whether objcopy works for absolute addresses... configure: error: gcc cannot link at address 2000

a1ive commented

GCC 4.8 is required.
sudo apt install gcc-4.8 gcc-4.8-multilib

Thanks for reply. I installed gcc-4.8 and gcc-4.8-multilib on Ubuntu 18.04.

dpkg-query -L gcc-4.8
/.
/usr
/usr/bin
/usr/bin/gcc-4.8
/usr/bin/gcc-ar-4.8
/usr/bin/gcc-nm-4.8
/usr/bin/gcc-ranlib-4.8
/usr/bin/gcov-4.8
/usr/lib
/usr/lib/gcc
/usr/lib/gcc/x86_64-linux-gnu
/usr/lib/gcc/x86_64-linux-gnu/4.8
/usr/lib/gcc/x86_64-linux-gnu/4.8/collect2
/usr/lib/gcc/x86_64-linux-gnu/4.8/libgomp.spec
/usr/lib/gcc/x86_64-linux-gnu/4.8/libitm.spec
/usr/lib/gcc/x86_64-linux-gnu/4.8/lto-wrapper
/usr/lib/gcc/x86_64-linux-gnu/4.8/lto1
/usr/share
/usr/share/doc
/usr/share/doc/gcc-4.8-base
/usr/share/doc/gcc-4.8-base/NEWS.gz
/usr/share/doc/gcc-4.8-base/NEWS.html
/usr/share/doc/gcc-4.8-base/README.Bugs
/usr/share/doc/gcc-4.8-base/README.ssp
/usr/share/doc/gcc-4.8-base/changelog.gz
/usr/share/doc/gcc-4.8-base/gcc
/usr/share/doc/gcc-4.8-base/gcc/changelog.gz
/usr/share/doc/gcc-4.8-base/gomp
/usr/share/doc/gcc-4.8-base/gomp/changelog.gz
/usr/share/doc/gcc-4.8-base/itm
/usr/share/doc/gcc-4.8-base/itm/changelog.gz
/usr/share/doc/gcc-4.8-base/quadmath
/usr/share/doc/gcc-4.8-base/quadmath/changelog.gz
/usr/share/doc/gcc-4.8-base/test-summary.gz
/usr/share/man
/usr/share/man/man1
/usr/share/man/man1/gcc-4.8.1.gz
/usr/share/man/man1/gcc-ar-4.8.1.gz
/usr/share/man/man1/gcc-nm-4.8.1.gz
/usr/share/man/man1/gcc-ranlib-4.8.1.gz
/usr/share/man/man1/gcov-4.8.1.gz
/usr/bin/x86_64-linux-gnu-gcc-4.8
/usr/bin/x86_64-linux-gnu-gcc-ar-4.8
/usr/bin/x86_64-linux-gnu-gcc-nm-4.8
/usr/bin/x86_64-linux-gnu-gcc-ranlib-4.8
/usr/bin/x86_64-linux-gnu-gcov-4.8
/usr/share/doc/gcc-4.8
/usr/share/man/man1/x86_64-linux-gnu-gcc-4.8.1.gz
/usr/share/man/man1/x86_64-linux-gnu-gcc-ar-4.8.1.gz
/usr/share/man/man1/x86_64-linux-gnu-gcc-nm-4.8.1.gz
/usr/share/man/man1/x86_64-linux-gnu-gcc-ranlib-4.8.1.gz
/usr/share/man/man1/x86_64-linux-gnu-gcov-4.8.1.gz

dpkg-query -L gcc-4.8-multilib
/.
/usr
/usr/share
/usr/share/doc
/usr/share/doc/gcc-4.8-multilib

I updated gcc symlink:
gcc --version
gcc (Ubuntu 4.8.5-4ubuntu8) 4.8.5
Copyright (C) 2015 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Now I have error:
checking for .code16 addr64 assembler support... no configure: error: GRUB requires GAS .code16 addr32 support; upgrade your binutils

May I know what host OS you are using?

a1ive commented

May I know what host OS you are using?

Ubuntu 18.04
Please make sure that the following packages are installed:
gcc-4.8 gcc-4.8-multilib nasm p7zip-full autoconf automake make binutils-dev liblzma-dev upx
https://github.com/chenall/grub4dos-build/blob/f77d0346a9838f2d6b967bbe9999eab4e74eef79/start-grubdev.sh#L7

Thank you. Now I was able to compile grub4dos.
May you write few words about start-grubdev.sh usage?
I saw it builds some iso and runs in kvm.
Do you have some english readme for it?

a1ive commented

May you write few words about start-grubdev.sh usage?

This repo is used for continuous integration.