Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 22447 - compiling grub 0.92 using gcc 3.3
Summary: compiling grub 0.92 using gcc 3.3
Status: RESOLVED DUPLICATE of bug 21215
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Gentoo Linux bug wranglers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-06-08 10:15 UTC by Travis Tilley (RETIRED)
Modified: 2005-07-17 13:06 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments
patch to get grub to compile using gcc 3.3 (grub-gcc33.patch,3.08 KB, patch)
2003-06-08 10:16 UTC, Travis Tilley (RETIRED)
Details | Diff
Patch for configure, replaces obsolete -malign= with -falign= (grub-0.92-configure.patch,418 bytes, patch)
2003-06-08 19:21 UTC, Robert Moss (RETIRED)
Details | Diff
Patch for configure, replaces obsolete -malign with -falign (grub-0.92-configure.patch,418 bytes, patch)
2003-06-08 19:21 UTC, Robert Moss (RETIRED)
Details | Diff
Patch for configure, replaces obsolete -malign with -falign (grub-0.92-configure.patch,418 bytes, patch)
2003-06-08 19:22 UTC, Robert Moss (RETIRED)
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Travis Tilley (RETIRED) gentoo-dev 2003-06-08 10:15:09 UTC
grub wont compile using gcc 3.3, so i have borrowed a patch from suse for grub
0.93 and edited it so that it will patch cleanly against an already patched
gentoo grub 0.92. This should also work for 0.93, if only after a little
editing, but I havent tested it. I've only tried booting with 0.92.
Comment 1 Travis Tilley (RETIRED) gentoo-dev 2003-06-08 10:16:02 UTC
Created attachment 12945 [details, diff]
patch to get grub to compile using gcc 3.3
Comment 2 Boyd Waters 2003-06-08 18:47:17 UTC
http://forums.gentoo.org/viewtopic.php?t=50679&postdays=0&postorder=asc&start=200#357180

I was able to compile Grub-CVS (0.93) on x86 with GCC, by using these CFLAGS:

CFLAGS="-minline-all-stringops -Os"
Comment 3 Robert Moss (RETIRED) gentoo-dev 2003-06-08 19:21:03 UTC
Created attachment 12964 [details, diff]
Patch for configure, replaces obsolete -malign= with -falign=

When compiling grub 0.92 with either GCC 3.2.2, 3.2.3 or 3.3 (unsure about
other versions), this removes the warnings about -malign-functions,
-malign-loops and -malign-jumps being obsolete, and replaces them with their
modern equivalents, -falign-functions, -falign-loops and -falign-jumps. This
removes the need for the -Os configure.in patch (I think? - can someone with
GCC 3.3 check that for me; works here without it on GCC 3.2.2).
Comment 4 Robert Moss (RETIRED) gentoo-dev 2003-06-08 19:21:44 UTC
Created attachment 12965 [details, diff]
Patch for configure, replaces obsolete -malign with -falign

When compiling grub 0.92 with either GCC 3.2.2, 3.2.3 or 3.3 (unsure about
other versions), this removes the warnings about -malign-functions,
-malign-loops and -malign-jumps being obsolete, and replaces them with their
modern equivalents, -falign-functions, -falign-loops and -falign-jumps. This
removes the need for the -Os configure.in patch (I think? - can someone with
GCC 3.3 check that for me; works here without it on GCC 3.2.2).
Comment 5 Robert Moss (RETIRED) gentoo-dev 2003-06-08 19:22:11 UTC
Created attachment 12966 [details, diff]
Patch for configure, replaces obsolete -malign with -falign

When compiling grub 0.92 with either GCC 3.2.2, 3.2.3 or 3.3 (unsure about
other versions), this removes the warnings about -malign-functions,
-malign-loops and -malign-jumps being obsolete, and replaces them with their
modern equivalents, -falign-functions, -falign-loops and -falign-jumps. This
removes the need for the -Os configure.in patch (I think? - can someone with
GCC 3.3 check that for me; works here without it on GCC 3.2.2).
Comment 6 Robert Moss (RETIRED) gentoo-dev 2003-06-08 19:23:19 UTC
Sorry about that guys - I kept getting something about a "malformed multipart post" and kept trying again... sincere apologies...
Comment 7 Travis Tilley (RETIRED) gentoo-dev 2003-06-08 19:48:32 UTC
the warnings about -malign-* shouldnt kill the compile. let me paste here what i get for error 
messages. 
 
ayanami root # gcc --version 
gcc (GCC) 3.3 (Gentoo Linux 1.4, PVR 3.3) 
Copyright (C) 2003 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. 
 
ayanami root # emerge /usr/portage/sys-apps/grub/grub-0.92-r1.ebuild 
 
(configure and compiler messages, etc...) 
 
source='fsys_reiserfs.c' object='pre_stage2_exec-fsys_reiserfs.o' libtool=no \ 
depfile='.deps/pre_stage2_exec-fsys_reiserfs.Po' 
tmpdepfile='.deps/pre_stage2_exec-fsys_reiserfs.TPo' \ 
depmode=gcc3 /bin/sh ../depcomp \ 
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  -DSUPPORT_SERIAL=1 -DSUPPORT_HERCULES=1 -DFSYS_EXT2FS=1 -DFSYS_FAT=1 
-DFSYS_FFS=1 -DFSYS_MINIX=1 -DFSYS_REISERFS=1 -DFSYS_VSTAFS=1 -DFSYS_JFS=1 -DFSYS_XFS=1 
-DUSE_MD5_PASSWORDS=1 -g -c -o pre_stage2_exec-fsys_reiserfs.o `test -f fsys_reiserfs.c || echo 
'./'`fsys_reiserfs.c 
cc1: warning: -malign-loops is obsolete, use -falign-loops 
cc1: warning: -malign-jumps is obsolete, use -falign-jumps 
cc1: warning: -malign-functions is obsolete, use -falign-functions 
fsys_reiserfs.c:115: error: long, short, signed or unsigned used invalidly for `j_mount_id' 
fsys_minix.c: In function `minix_dir': 
fsys_minix.c:303: warning: `str_chk' might be used uninitialized in this function 
fsys_reiserfs.c: In function `next_key': 
fsys_reiserfs.c:761: warning: operation on `depth' may be undefined 
make[2]: *** [pre_stage2_exec-fsys_reiserfs.o] Error 1 
make[2]: *** Waiting for unfinished jobs.... 
make[2]: Leaving directory `/var/tmp/portage/grub-0.92-r1/work/grub-0.92/stage2' 
make[1]: *** [all-recursive] Error 1 
make[1]: Leaving directory `/var/tmp/portage/grub-0.92-r1/work/grub-0.92' 
make: *** [all] Error 2 
 
!!! ERROR: sys-apps/grub-0.92-r1 failed. 
!!! Function src_compile, Line 60, Exitcode 2 
!!! Building failed! 
 
 
In those errors, the key error would be "fsys_reiserfs.c:115: error: long, short, signed or unsigned 
used invalidly for `j_mount_id'". So, a patch JUST to get this to compile would (should... i think) only 
need: 
 
diff -urN ./grub-0.92-old/stage2/fsys_reiserfs.c ./grub-0.92/stage2/fsys_reiserfs.c 
--- ./grub-0.92-old/stage2/fsys_reiserfs.c	2001-10-11 07:14:29.000000000 -0400 
+++ ./grub-0.92/stage2/fsys_reiserfs.c	2003-06-08 10:50:45.000000000 -0400 
@@ -112,7 +112,7 @@ 
   /* offset in the log of where to start replay after a crash */ 
   __u32 j_first_unflushed_offset; 
   /* mount id to detect very old transactions */ 
-  __u32 long j_mount_id; 
+  __u32 j_mount_id; 
 }; 
 
 /* magic string to find desc blocks in the journal */ 
 
 
However, the suse patch also did some other cleaning up, like changing the -malign-* to -falign-*, 
so I figured it couldnt hurt to leave that in. However, it isnt that that is preventing grub 0.92 or 0.93 
from compiling using gcc 3.3. 
 
Comment 8 Donny Davies (RETIRED) gentoo-dev 2003-06-17 08:12:47 UTC
im really not the person for this, 1) I dont use Grub  2) I dont use gcc-3.3
:-)

we could use somebody who wants to "do" grub...
Comment 9 Seemant Kulleen (RETIRED) gentoo-dev 2003-06-18 04:36:07 UTC

*** This bug has been marked as a duplicate of 21215 ***