grub4dos
grub4dos copied to clipboard
Build failed on Arch Linux with binutils 2.29.1-1 and GCC 7.2.0-3
I cloned this Git repository, and tried to build it on Arch Linux. I always got this error message during running configure: "configure: error: GRUB requires a working absolute objcopy; upgrade your binutils" below is the full log. ======[cut here]====== neo_chen^NeoLinuxWorkstation ~/TEMP/grup4dos (0) >>$ ./configure
checking for a BSD-compatible install... /usr/bin/install -c checking whether build environment is sane... yes checking for a thread-safe mkdir -p... /usr/bin/mkdir -p checking for gawk... gawk checking whether make sets $(MAKE)... yes checking whether make supports nested variables... yes checking for style of include used by make... GNU checking for gcc... gcc checking whether the C compiler works... yes checking for C compiler default output file name... a.out checking for suffix of executables... checking whether we are cross compiling... no checking for suffix of object files... o checking whether we are using the GNU C compiler... yes checking whether gcc accepts -g... yes checking for gcc option to accept ISO C89... none needed checking dependency style of gcc... gcc3 checking dependency style of gcc... gcc3 checking build system type... x86_64-unknown-linux-gnu checking host system type... x86_64-unknown-linux-gnu checking whether to enable maintainer-specific portions of Makefiles... no checking for gcc... (cached) gcc checking for gcc... (cached) gcc checking whether we are using the GNU C compiler... (cached) yes checking whether gcc accepts -g... (cached) yes checking for gcc option to accept ISO C89... (cached) none needed checking dependency style of gcc... (cached) gcc3 checking dependency style of gcc... (cached) gcc3 checking for ranlib... ranlib checking whether optimization for size works... yes checking whether gcc has -fno-stack-protector... yes checking whether gcc has -fno-reorder-functions... yes checking whether -Wundef works... yes checking whether -falign-loops works... yes checking whether linker accepts `--build-id=none'... yes checking for objcopy... objcopy 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 ======[cut here]======
apt-get install gcc-multilib
Arch Linux doesn't use APT!
And, on x86-64, Arch Linux merged gcc-multilib and gcc
According to the upstream grub2 code base, replace ${OBJCOPY-objcopy} -O binary conftest.exec conftest with ${OBJCOPY-objcopy} --only-section=.text -O binary conftest.exec conftest in configure should work.
This didn't work for me. Any other things to try?
According to the upstream grub2 code base, replace
${OBJCOPY-objcopy} -O binary conftest.exec conftestwith${OBJCOPY-objcopy} --only-section=.text -O binary conftest.exec conftestinconfigureshould work.
This worked for me but in Linux Mint 19