Re: linux-2.3.[23] won't boot with egcs-2.93.22: Some progress

Horst von Brand (vonbrand@inf.utfsm.cl)
Mon, 24 May 1999 10:25:52 -0400


Horst von Brand <vonbrand@sleipnir.valparaiso.cl> said:

> This is i586/100 UP, binutils-2.9.1.0.24, glibc-2.1.1pre3; most of the
> rest is stock RedHat-6.0

> It was reported that the above combination won't boot (it fails loading
> block-major-3 even for IDE builtin!). egcs-1.1.2 (i.e., 2.91.66) works
> fine.

Now known cause: drivers/block/ide.c:init_hwif_data sets the noprobe field
of the interface to 1 (when it should be 0), so the drives aren't probed
for. The reason is quite subtle (it was explained on egcs@egcs.cygsnus.com):
Before the setting of that field, the array element (a short) on which it
depends is set by a memcpy(), and this is a unholy mess of macros that
finally expand (in this case) into a inline function that does assignments
via pointers to long. Now the C standard disallows accessing any object
through a pointer that is not a pointer to its type or to char, and egcs on
this base moves the asignments around... doing them _after_ the test.

No easy way out in sight (except using -fno-strict-aliasing, and loosing
optimizations...). Note that this could affect _each_ use of mempcpy(),
memset(), ... They'll have to be rewritten in assembly (but this means
loosing the possibility of interleaving them with other operations, which
egcs does now), and possibly lots of other places in the kernel could be
hit by this.

-- 
Dr. Horst H. von Brand                       mailto:vonbrand@inf.utfsm.cl
Departamento de Informatica                     Fono: +56 32 654431
Universidad Tecnica Federico Santa Maria              +56 32 654239
Casilla 110-V, Valparaiso, Chile                Fax:  +56 32 797513

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/