deprecated practices in grub package - cause problem with gcc 3.4.2

Jayesh Salvi jayesh.salvi at
Thu Feb 24 06:49:43 CET 2005

I recently installed Fedora Core 3 and tried to compile the grub package
for L4 using gcc 3.4.2, I got some trivial compilation errors. Upon
trying the compilation on different machine with gcc 3.1 I found some
code following deprecated practices that escapes as warnings in < 3.4.2
but throws compilation errors with 3.4.2. Here are three such case I
found in the grub package. If this is indeed the case it might be
helpful to make the necessary changes to the repository code.




1) stage2/builtins.c

for gcc version 3.4.2 20041017 (Red Hat 3.4.2-6.fc3):


builtins.c:886: error: missing terminating " character

builtins.c:887: error: `Version' undeclared (first use in this function)

builtins.c:887: error: (Each undeclared identifier is reported only once

builtins.c:887: error: for each function it appears in.)

builtins.c:887: error: syntax error before ':' token

builtins.c:887:20: invalid suffix "x" on integer constant


for gcc version 3.1:


builtins.c:886:20: warning: multi-line string literals are deprecated




for gcc version 3.4.2 20041017 (Red Hat 3.4.2-6.fc3):


typedef unsigned int __u32;

__u32 long j_mount_id;


gives this error:

fsys_reiserfs.c:115: error: long, short, signed or unsigned used
invalidly for



gcc version 3.1:allows it



For switch-case construct: switch(i){

                                                Case 1: break;





3.1 gives:

            warning: deprecated use of label at end of compound


3.4.2 will not allow this:

smp-imps.c:437: error: label at end of compound statement



After changing the files and getting over the compilation errors I get
some linking errors.


Here is the trace:


gcc -DHAVE_CONFIG_H -I. -I. -I.. -I../stage1  -Wall -Wmissing-prototypes

-Wunused -Wshadow -Wpointer-arith -malign-jumps=1 -malign-loops=1

-malign-functions=1 -Wundef -Os -fno-builtin -nostdinc



pre_stage2_exec-md5.o `test -f md5.c || echo './'`md5.c

md5.c:1: warning: -malign-loops is obsolete, use -falign-loops

md5.c:1: warning: -malign-jumps is obsolete, use -falign-jumps

md5.c:1: warning: -malign-functions is obsolete, use -falign-functions

gcc  -g   -o pre_stage2.exec -nostdlib -Wl,-N -Wl,-Ttext -Wl,8200

pre_stage2_exec-asm.o pre_stage2_exec-bios.o pre_stage2_exec-boot.o

pre_stage2_exec-builtins.o pre_stage2_exec-common.o

pre_stage2_exec-cmdline.o pre_stage2_exec-disk_io.o

pre_stage2_exec-fsys_ext2fs.o pre_stage2_exec-fsys_fat.o

pre_stage2_exec-fsys_ffs.o pre_stage2_exec-fsys_minix.o

pre_stage2_exec-fsys_reiserfs.o pre_stage2_exec-fsys_vstafs.o

pre_stage2_exec-hercules.o pre_stage2_exec-serial.o

pre_stage2_exec-stage2.o pre_stage2_exec-md5.o

pre_stage2_exec-builtins.o(.text+0x138b): In function `install_func':

/home/jayesh/grub/stage2/builtins.c:1801: undefined reference to


undefined reference to `memcpy'

pre_stage2_exec-builtins.o(.text+0x2b17): In function `setup_func':

/home/jayesh/grub/stage2/builtins.c:3672: undefined reference to

collect2: ld returned 1 exit status

make[2]: *** [pre_stage2.exec] Error 1

make[2]: Leaving directory `/home/jayesh/grub/stage2'

make[1]: *** [all-recursive] Error 1

make[1]: Leaving directory `/home/jayesh/grub'

make: *** [all] Error 2




My versions of gcc and ld are as follows:


 [jayesh at orion grub]$ ld -v

GNU ld version 20040927


[jayesh at orion grub]$ gcc -v

Reading specs from /usr/lib/gcc/i386-redhat-linux/3.4.2/specs

Configured with: ../configure --prefix=/usr --mandir=/usr/share/man

--infodir=/usr/share/info --enable-shared --enable-threads=posix

--disable-checking --with-system-zlib --enable-__cxa_atexit

--disable-libunwind-exceptions --enable-java-awt=gtk

Thread model: posix

gcc version 3.4.2 20041017 (Red Hat 3.4.2-6.fc3)



I am not sure what is wrong with the linking of memcpy function. Please






-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the l4-hackers mailing list