LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Linux From Scratch
User Name
Password
Linux From Scratch This Forum is for the discussion of LFS.
LFS is a project that provides you with the steps necessary to build your own custom Linux system.

Notices


Reply
  Search this Thread
Old 06-03-2011, 01:58 PM   #1
David2010
Member
 
Registered: May 2009
Posts: 255

Rep: Reputation: 23
LFS Grub won't compile


Ok I just finished the entire LFS build and everything else but grub 1.98 compiles.

I didn't set any optimizations and the toolchain works perfectly.

I am following LFS 6.8 = http://www.linuxfromscratch.org/lfs/view/stable/

Grub configures correctly but fails on make.

Commands I used:

tar -xf sources/grub*

cd grub*

./configure --prefix=/usr --sysconfdir=/etc --disable-grub-emu-usb --disable-grub-fstest --disable-efiemu

Code:
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking build system type... i686-pc-linux-gnu
checking host system type... i686-pc-linux-gnu
checking target system type... i686-pc-linux-gnu
checking for cmp... cmp
checking for bison... bison
checking for gawk... (cached) gawk
checking whether make sets $(MAKE)... (cached) yes
checking for ruby... no
checking for makeinfo... /usr/bin/makeinfo
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 for style of include used by make... GNU
checking dependency style of gcc... none
checking how to run the C preprocessor... gcc -E
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking minix/config.h usability... no
checking minix/config.h presence... no
checking for minix/config.h... no
checking whether it is safe to define __EXTENSIONS__... yes
checking whether NLS is requested... yes
checking for msgfmt... /usr/bin/msgfmt
checking for gmsgfmt... /usr/bin/msgfmt
checking for xgettext... /usr/bin/xgettext
checking for msgmerge... /usr/bin/msgmerge
checking for ld used by GCC... /usr/bin/ld
checking if the linker (/usr/bin/ld) is GNU ld... yes
checking for shared library run path origin... done
checking for CFPreferencesCopyAppValue... no
checking for CFLocaleCopyCurrent... no
checking for GNU gettext in libc... yes
checking whether to use NLS... yes
checking where the gettext function comes from... libc
checking for special C compiler options needed for large files... no
checking for _FILE_OFFSET_BITS value needed for large files... 64
checking whether byte ordering is bigendian... no
checking size of void *... 4
checking size of long... 4
checking whether our compiler is apple cc... no
checking for help2man... no
checking for posix_memalign... yes
checking for memalign... yes
checking for asprintf... yes
checking for vasprintf... yes
checking whether sys/types.h defines makedev... yes
checking for dirent.h that defines DIR... yes
checking for library containing opendir... none required
checking for memmove... yes
checking for sbrk... yes
checking for strdup... yes
checking for lstat... yes
checking for getuid... yes
checking for getgid... yes
checking sys/mkdev.h usability... no
checking sys/mkdev.h presence... no
checking for sys/mkdev.h... no
checking sys/sysmacros.h usability... yes
checking sys/sysmacros.h presence... yes
checking for sys/sysmacros.h... yes
checking malloc.h usability... yes
checking malloc.h presence... yes
checking for malloc.h... yes
checking termios.h usability... yes
checking termios.h presence... yes
checking for termios.h... yes
checking for sys/types.h... (cached) yes
checking for unistd.h... (cached) yes
checking for string.h... (cached) yes
checking for strings.h... (cached) yes
checking for sys/stat.h... (cached) yes
checking sys/fcntl.h usability... yes
checking sys/fcntl.h presence... yes
checking for sys/fcntl.h... yes
checking limits.h usability... yes
checking limits.h presence... yes
checking for limits.h... yes
checking for objcopy... objcopy
checking for strip... strip
checking for nm... nm
checking whether -falign-loops works... yes
checking whether -fno-dwarf2-cfi-asm works... yes
checking whether our target compiler is apple cc... no
checking for command to convert module to ELF format... 
checking whether `gcc' generates calls to `__enable_execute_stack()'... no
checking whether `gcc' has `-fPIE' as default... no
checking whether `gcc' accepts `-fstack-protector'... yes
checking whether `gcc' accepts `-mstack-arg-probe'... yes
checking for __bswapsi2... yes
checking for __bswapdi2... yes
checking for __ashldi3... yes
checking for __ashrdi3... yes
checking for __lshrdi3... yes
checking for __trampoline_setup... no
checking for __ucmpdi2... yes
checking for _restgpr_14_x... no
checking whether target compiler is working... yes
checking whether objcopy works for absolute addresses... yes
checking whether linker accepts --build-id=none... yes
checking if C symbols get an underscore after compilation... no
checking if __bss_start is defined by the compiler... yes
checking if edata is defined by the compiler... yes
checking if _edata is defined by the compiler... yes
checking if end is defined by the compiler... yes
checking if _end is defined by the compiler... yes
checking whether addr32 must be in the same line as the instruction... yes
checking for .code16 addr32 assembler support... yes
checking whether an absolute indirect call/jump must not be prefixed with an asterisk... no
checking whether -nostdinc -isystem works... yes
checking for freetype-config... no
checking whether ln can handle directories properly... yes
configure: creating ./config.status
config.status: creating Makefile
config.status: creating gensymlist.sh
config.status: creating genkernsyms.sh
config.status: creating stamp-h
config.status: creating config.h
config.status: linking include/grub/i386 to include/grub/cpu
config.status: linking include/grub/i386/pc to include/grub/machine
config.status: executing depfiles commands
config.status: executing po-directories commands
*******************************************************
GRUB2 will be compiled with following components:
Platform: i386-pc
With memory debugging: No
efiemu runtime: No (explicitly disabled)
grub-fstest: No (explicitly disabled)
grub-mkfont: No (need freetype2 library)
*******************************************************
A small snippet of running "make":

Code:
grub_mkisofs-gnulib_getopt.o:(.data+0x8): multiple definition of 
`optopt'
grub_mkisofs-gnulib_getopt.o:(.data+0x8): first defined here
grub_mkisofs-gnulib_getopt.o: In function `_getopt_internal_r':
getopt.c:(.text+0x1fe): multiple definition of `_getopt_internal_r'
grub_mkisofs-gnulib_getopt.o:getopt.c:(.text+0x1fe): first defined here
grub_mkisofs-gnulib_getopt.o: In function `_getopt_internal':
getopt.c:(.text+0x101f): multiple definition of `_getopt_internal'
grub_mkisofs-gnulib_getopt.o:getopt.c:(.text+0x101f): first defined here
grub_mkisofs-gnulib_getopt.o: In function `getopt':
getopt.c:(.text+0x109c): multiple definition of `getopt'
grub_mkisofs-gnulib_getopt.o:getopt.c:(.text+0x109c): first defined here
grub_mkisofs-gnulib_error.o: In function `error':
error.c:(.text+0xba): multiple definition of `error'
grub_mkisofs-gnulib_error.o:error.c:(.text+0xba): first defined here
grub_mkisofs-gnulib_error.o: In function `error_at_line':
error.c:(.text+0x13f): multiple definition of `error_at_line'
grub_mkisofs-gnulib_error.o:error.c:(.text+0x13f): first defined here
grub_mkisofs-gnulib_progname.o:(.bss+0x0): multiple definition of 
`program_name'grub_mkisofs-gnulib_progname.o:(.bss+0x0): first defined 
here
grub_mkisofs-gnulib_progname.o: In function `set_program_name':
progname.c:(.text+0x0): multiple definition of `set_program_name'
grub_mkisofs-gnulib_progname.o:progname.c:(.text+0x0): first defined 
here
collect2: ld returned 1 exit status
make: *** [grub-mkisofs] Error 1
I have seen this problem posted around the internet a couple times with no solution. What am I doing wrong?

If for some reason I really CAN'T get grub to work I can use lilo but I would prefer to use grub as I am more comfortable with configuring it.

I am also surprised at how big the LFS result is. With all symbols removed and man pages removed its roughly 200 MB large. Not bad but... not grand.

Last edited by David2010; 06-03-2011 at 02:02 PM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Glibc won't compile in chapter 5.7.1 of the LFS 6.6 book bigaurian Linux From Scratch 5 09-10-2010 01:14 PM
LFS gcc-4.0.3 on ubuntu 5.0.4 can't compile lfs-fan Linux From Scratch 6 07-30-2007 10:04 PM
Compile binutils as lfs or root? El Basto Linux From Scratch 5 09-13-2004 01:37 PM
libtool-1.5.6 doesn't compile, LFS navyblue77 Linux - Software 0 08-09-2004 05:07 PM
LFS compile over SSH on cygwin slightcrazed Linux From Scratch 6 10-21-2003 02:51 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Linux From Scratch

All times are GMT -5. The time now is 05:43 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration