List Info

Thread: GCC4 breaks i386 kernels compiled with -Os?




GCC4 breaks i386 kernels compiled with -Os?
user name
2006-06-06 03:12:27
Hi,

I thought I'd give GCC 4 a spin on a build of -current.

MAKECONF points to:
HAVE_GCC=4
CFLAGS+= -pipe

So, the build successfully completed and all, then I go to
netboot the INSTALL kernel on an old OptiPlex GX1p box.

When the riser board (containing a comisa and ppbpci) is
installed it gets to com2 at isa0 and reboots.  Without the
riser board it gets to isapnp0 at isa0 and reboots.

However when I boot the GENERIC_LAPTOP kernel on my Compaq
M2005US
it gets to userlevel fine.  Booting GENERIC on the OptiPlex
also
works.

I'm inclined to believe, based on my previous experience
with GCC's
optimizer, and that INSTALL kernels are compiled with -Os,
that GCC
is not doing the right thing when told to optimize for size.

Or, am I, as usual, doing something wrong?

	Jonathan Kollasch
GCC4 breaks i386 kernels compiled with -Os?
user name
2006-06-14 07:28:56
On Mon, Jun 05, 2006 at 10:12:27PM -0500, Jonathan A.
Kollasch wrote:
> I'm inclined to believe, based on my previous
experience with GCC's
> optimizer, and that INSTALL kernels are compiled with
-Os, that GCC
> is not doing the right thing when told to optimize for
size.
> 
> Or, am I, as usual, doing something wrong?

Nope, almost certainly gcc.

I got around this with:

TOOLDIR=/home/jakllsch/build-1150230364/src/tooldir.NetBSD-3
.0-x86_64 ./build.sh -U -u -m i386 kernel=INSTALL

./tooldir.NetBSD-3.0-x86_64/bin/i386--netbsdelf-mdsetimage
sys/arch/i386/compile/obj/INSTALL/netbsd
distrib/i386/ramdisks/ramdisk-big/obj/ramdisk-big.fs

after setting up an override $MAKECONF with "COPTS+=
-O2" in addition
to the stuff that was in the $MAKECONF that the original
./build.sh
release was run with.

I've send-pr(1)ed.

	Jonathan Kollasch
[1-2]

about | contact  Other archives ( Real Estate discussion Medical topics )