egcs-1.1.2 miscompiles Linux (only) with glibc-2.1.1?!

Wolfram Gloger wmglo@dent.med.uni-muenchen.de
Wed Jun 30 08:13:00 GMT 1999


Arghh !  It's the _preprocessor_ that behaves differently under
glibc2.0 and glibc2.1 bootstraps of egcs-1.1.2!

I was really going crazy over this, but here is a nice simple
testcase:

cpp-bpl.c
======================================================================
#if (~0UL) == 0xffffffffUL
#error "32 Bit platform"
#else
#error "64 Bit platform"
#endif
======================================================================

md:/home/wmglo/src/egcs-bugs% /pkg/egcs-1.1.2/bin/gcc cpp-bpl.c 
cpp-bpl.c:2: #error "32 Bit platform"
md:/home/wmglo/src/egcs-bugs% gcc cpp-bpl.c 
cpp-bpl.c:4: #error "64 Bit platform"

(the only difference between /pkg/egcs-1.1.2/bin/gcc and gcc is that
the former has been bootstrapped against glibc2.0, the latter against
glibc2.1).  This is on 32bit Intel, of course.

The Linux ncr53c8xx driver contains this test, but only for Linux
versions before 2.2.0, which is why H.J. didn't see this bug.

This compile-time test for 32bit vs. 64bit is probably broken, and the
glibc-2.1-bootstrapped version of egcs-1.1.2 is actually more correct
than the glibc-2.0-bootstrapped version (were the test worked), right?

Regards,
Wolfram.
-- 
`Surf the sea, not double-u three...'
wmglo@dent.med.uni-muenchen.de


More information about the Libc-hacker mailing list