LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Getting an error while compiling grub (https://www.linuxquestions.org/questions/linux-newbie-8/getting-an-error-while-compiling-grub-603343/)

Couling 11-29-2007 04:22 PM

Getting an error while compiling grub
 
I'm trying to make a very minimal linux system for myself.

I get an error while trying to compile grub. The same happens for both versions 0.95 and 0.96.

I'm using the linux from scratch live cd as a host enviroment.
http://www.linuxfromscratch.org/livecd/

I'm afraid I have no idea where to start with this one.

Thanks for your help

./configure --prefix=/hd/usr
Code:

checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
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 whether to enable maintainer-specific portions of Makefiles... no
checking for gcc... gcc
checking for gcc... (cached) gcc
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables...
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 ANSI C... none needed
checking for style of include used by make... GNU
checking dependency style of gcc... 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 -Wundef works... yes
checking whether -falign-loops works... yes
checking for objcopy... objcopy
checking if C symbols get an underscore after compilation... no
checking whether objcopy works for absolute addresses... 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 if start is defined by the compiler... no
checking if _start is defined by the compiler... yes
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 for opendisk in -lutil... no
checking for wgetch in -lncurses... yes
checking how to run the C preprocessor... gcc -E
checking for egrep... 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 for string.h... (cached) yes
checking for strings.h... (cached) yes
checking ncurses/curses.h usability... no
checking ncurses/curses.h presence... no
checking for ncurses/curses.h... no
checking ncurses.h usability... yes
checking ncurses.h presence... yes
checking for ncurses.h... yes
checking curses.h usability... yes
checking curses.h presence... yes
checking for curses.h... yes
configure: creating ./config.status
config.status: creating Makefile
config.status: creating stage1/Makefile
config.status: creating stage2/Makefile
config.status: creating docs/Makefile
config.status: creating lib/Makefile
config.status: creating util/Makefile
config.status: creating grub/Makefile
config.status: creating netboot/Makefile
config.status: creating util/grub-image
config.status: creating util/grub-install
config.status: creating util/grub-md5-crypt
config.status: creating util/grub-terminfo
config.status: creating util/grub-set-default
config.status: creating config.h
config.status: executing depfiles commands

make
Code:

make  all-recursive
make[1]: Entering directory `/hd/build/grub-0.96'
Making all in netboot
make[2]: Entering directory `/hd/build/grub-0.96/netboot'
make[2]: Nothing to be done for `all'.
make[2]: Leaving directory `/hd/build/grub-0.96/netboot'
Making all in stage2
make[2]: Entering directory `/hd/build/grub-0.96/stage2'
gcc -Os -fno-stack-protector -fno-builtin -nostdinc  -DSUPPORT_SERIAL=1 -DSUPPORT_HERCULES=1 -DFSYS_EXT2FS=1 -DFSYS_FAT=1 -DFSYS_FFS=1 -DFSYS_UFS2=1 -DFSYS_MINIX=1 -DFSYS_REISERFS=1 -DFSYS_VSTAFS=1 -DFSYS_JFS=1 -DFSYS_XFS=1 -DFSYS_ISO9660=1 -DUSE_MD5_PASSWORDS=1 -DHAVE_CONFIG_H -I. -I. -I.. -I../stage1 -Wall -Wmissing-prototypes -Wunused -Wshadow -Wpointer-arith -falign-jumps=1 -falign-loops=1 -falign-functions=1 -Wundef -g -c -o pre_stage2_exec-asm.o `test -f 'asm.S' || echo './'`asm.S
if gcc -DHAVE_CONFIG_H -I. -I. -I.. -I../stage1  -Wall -Wmissing-prototypes -Wunused -Wshadow -Wpointer-arith -falign-jumps=1 -falign-loops=1 -falign-functions=1 -Wundef -Os -fno-stack-protector -fno-builtin -nostdinc  -DSUPPORT_SERIAL=1 -DSUPPORT_HERCULES=1 -DFSYS_EXT2FS=1 -DFSYS_FAT=1 -DFSYS_FFS=1 -DFSYS_UFS2=1 -DFSYS_MINIX=1 -DFSYS_REISERFS=1 -DFSYS_VSTAFS=1 -DFSYS_JFS=1 -DFSYS_XFS=1 -DFSYS_ISO9660=1 -DUSE_MD5_PASSWORDS=1 -g -MT pre_stage2_exec-bios.o -MD -MP -MF ".deps/pre_stage2_exec-bios.Tpo" -c -o pre_stage2_exec-bios.o `test -f 'bios.c' || echo './'`bios.c; \
        then mv -f ".deps/pre_stage2_exec-bios.Tpo" ".deps/pre_stage2_exec-bios.Po"; else rm -f ".deps/pre_stage2_exec-bios.Tpo"; exit 1; fi
if gcc -DHAVE_CONFIG_H -I. -I. -I.. -I../stage1  -Wall -Wmissing-prototypes -Wunused -Wshadow -Wpointer-arith -falign-jumps=1 -falign-loops=1 -falign-functions=1 -Wundef -Os -fno-stack-protector -fno-builtin -nostdinc  -DSUPPORT_SERIAL=1 -DSUPPORT_HERCULES=1 -DFSYS_EXT2FS=1 -DFSYS_FAT=1 -DFSYS_FFS=1 -DFSYS_UFS2=1 -DFSYS_MINIX=1 -DFSYS_REISERFS=1 -DFSYS_VSTAFS=1 -DFSYS_JFS=1 -DFSYS_XFS=1 -DFSYS_ISO9660=1 -DUSE_MD5_PASSWORDS=1 -g -MT pre_stage2_exec-boot.o -MD -MP -MF ".deps/pre_stage2_exec-boot.Tpo" -c -o pre_stage2_exec-boot.o `test -f 'boot.c' || echo './'`boot.c; \
        then mv -f ".deps/pre_stage2_exec-boot.Tpo" ".deps/pre_stage2_exec-boot.Po"; else rm -f ".deps/pre_stage2_exec-boot.Tpo"; exit 1; fi
boot.c: In function ‘load_image’:
boot.c:67: warning: pointer targets in passing argument 1 of ‘grub_read’ differ in signedness
boot.c:101: warning: pointer targets in passing argument 1 of ‘grub_strcmp’ differ in signedness
boot.c: In function ‘bsd_boot’:
boot.c:937: warning: pointer targets in assignment differ in signedness
if gcc -DHAVE_CONFIG_H -I. -I. -I.. -I../stage1  -Wall -Wmissing-prototypes -Wunused -Wshadow -Wpointer-arith -falign-jumps=1 -falign-loops=1 -falign-functions=1 -Wundef -Os -fno-stack-protector -fno-builtin -nostdinc  -DSUPPORT_SERIAL=1 -DSUPPORT_HERCULES=1 -DFSYS_EXT2FS=1 -DFSYS_FAT=1 -DFSYS_FFS=1 -DFSYS_UFS2=1 -DFSYS_MINIX=1 -DFSYS_REISERFS=1 -DFSYS_VSTAFS=1 -DFSYS_JFS=1 -DFSYS_XFS=1 -DFSYS_ISO9660=1 -DUSE_MD5_PASSWORDS=1 -g -MT pre_stage2_exec-builtins.o -MD -MP -MF ".deps/pre_stage2_exec-builtins.Tpo" -c -o pre_stage2_exec-builtins.o `test -f 'builtins.c' || echo './'`builtins.c; \
        then mv -f ".deps/pre_stage2_exec-builtins.Tpo" ".deps/pre_stage2_exec-builtins.Po"; else rm -f ".deps/pre_stage2_exec-builtins.Tpo"; exit 1; fi
builtins.c: In function ‘blocklist_func’:
builtins.c:147: error: invalid storage class for function ‘disk_read_blocklist_func’
builtins.c:147: warning: no previous prototype for ‘disk_read_blocklist_func’
builtins.c: In function ‘color_func’:
builtins.c:594: error: invalid storage class for function ‘color_number’
builtins.c:594: warning: no previous prototype for ‘color_number’
builtins.c: In function ‘install_func’:
builtins.c:1779: error: invalid storage class for function ‘disk_read_savesect_func’
builtins.c:1779: warning: no previous prototype for ‘disk_read_savesect_func’
builtins.c:1795: error: invalid storage class for function ‘disk_read_blocklist_func’
builtins.c:1795: warning: no previous prototype for ‘disk_read_blocklist_func’
builtins.c: In function ‘setkey_func’:
builtins.c:3614: error: invalid storage class for function ‘find_key_code’
builtins.c:3614: warning: no previous prototype for ‘find_key_code’
builtins.c:3631: error: invalid storage class for function ‘find_ascii_code’
builtins.c:3631: warning: no previous prototype for ‘find_ascii_code’
builtins.c: In function ‘uppermem_func’:
builtins.c:4657: warning: dereferencing type-punned pointer will break strict-aliasing rules
make[2]: *** [pre_stage2_exec-builtins.o] Error 1
make[2]: Leaving directory `/hd/build/grub-0.96/stage2'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/hd/build/grub-0.96'
make: *** [all] Error 2


aus9 11-29-2007 04:31 PM

you do not need to compile grub again.....just pinch a few files from a distro including a live cd.......it will depend on whether your kernel has inbuilt support or module support for certain formats.

so copy

stage 1, stage 2 and most likely e2 if you are going mini and the executable grub off your cd or current system to install onto your hard drive

use the command
find / -name grub
to find your executable and lib files off the cd etc

then use a live cd to embed grub into mbr or your new partition.

my signature has info on stuff if you do not know it.

good luck

stevenaaus 11-29-2007 11:23 PM

Rpmbuild and compiling grub-0.97-13.src.rpm
 
Quote:

you do not need to compile grub again
Linux is about being able to do things ;>

[Not talking about aus9] From what i can gather, Grub devs aren't the most accomodating. I wanted to contribute to Grub years ago, but was told to direct development into grub-2. Yeah, right. 5(?) years later and still never hear of grub-2. What's the story behind grub's development ?

~I'd~ love to be able to compile Grub with Graphical support. I have a couple of my own grub patches that i'd like to apply to fedora 7's grub.. Below is my problem.

...I'll take this forum home and see if i can help out Couling.

Code:

Rpmbuild and compiling grub-0.97-13.src.rpm with graphics/splash support

Working with fedora7... I'm just wondering how to build grub with
graphical/splash screen support.  I try rpmbuild --rebuild
grub-0.97-13.src.rpm, which fails with "autoreconf: automake failed with exit
status: 1". I also try rpm -i grub-0.97-13.src.rpm  and then rpmbuild -bp
grub.spec which succeeds but the graphics patches dont seem to be applied to
the stage2 directory.

So i try: cd stage2 ; for i in *graphics ; mv $i `basename $i .graphics` ;
done and stage2 builds, but i when i replace the stage2 with the custom one, i
still get no graphics. Trying to make the whole project after "cd stage2 ; for
i ..." I get a header mismatch when  "cd grub ; make"

I have a couple of patches which i like to incorporate into the graphical
splash version  but can't do so because of this complicated build procedure
failing. (I don't have any probs with the console version). Could someone
please help me out.


aus9 11-30-2007 01:54 AM

a long time ago, I discovered, even tho I am not a programmer that it was the stage 2 that gave splashimage support.

http://www.linuxquestions.org/questi...part-a-230389/

http://www.linuxquestions.org/questi...rt-two-230513/

sorry to patronise you..I thought you were just trying something too hard when there was an easier solution.

Let me know how you go, I use Mdv but will do anything to help where I can.

Couling 11-30-2007 06:36 PM

aus9, your comment got me wondering... if my distro wont compile grub, what version is installed on it: 0.97.

This made me realise there was a 0.97! Not sure why I missed it on the FTP site the first time, but it does compile.

I can only assume that previous versions were written for earlier compiler versions.

Thanks (and sorry to waste your time)

stevenaaus 12-01-2007 03:41 PM

Move along people, nothing to see
 
Yeah, grub-0.96 needs gcc 3.4 to compile, but grub-0.97 works fine with modern gcc-4. If you do have an older GCC handy you can (for example, if you had gcc-3.4 installed)

Code:

./configure --prefix=/hd/usr CC=gcc34 && make
@aus9: Thanks for the links. I don't have much web time to go searching at length myself.


All times are GMT -5. The time now is 07:52 AM.