Red Hat Bugzilla – Bug 4636
quake2 gamei386.so & egcs
Last modified: 2008-05-01 11:37:51 EDT
When I compile the gamei386.so for quake2 with Redhat 6.0's
egcs, the binary I get crashes quake2. But if I compile it
with the gcc rpm from redhat 5.2 it works fine.
You're mixing glibc-2.0.x compiled binaries with a glibc-2.1
shared library. The usual failure mode is that some glibc-2.0.x binary
compiles in stdin/stdout/stderr statically. Since certain data
structures have changed between glibc-2.0.x and glibc-2.1.x, you
will get a segfault.
I've been having this problem too, so I thought I'd try using the
compat packages (compat-egcs-5.2-1.0.3a.1, compat-glibc-5.2-184.108.40.206 &
compat-binutils-5.2-220.127.116.11.23.1) to compile a glibc-2.0.x gamei386.so
like the one that is distributed with QuakeII.
This doesn't work. I've read the white paper
(http://www.redhat.com/knowledgebase/glibccompat) and as much
information as I can on the subject, but to no avail. I'm posting an
excerpt from my Makefile in case this is the problem:
------- Makefile -------
BASE_CFLAGS=-Dstricmp=strcasecmp -DC_ONLY \
# -nostdinc \
# -I/usr/i386-glibc20-linux/include \
# -I/usr/lib/gcc-lib/i386-glibc20-linux/egcs-2.90.29/include \
# -nostdlib \
DO_CC=$(CC) $(CFLAGS) $(SHLIBCFLAGS) -o $@ -c $<
game$(ARCH).$(SHLIBEXT) : $(GAME_OBJS)
$(CC) $(CFLAGS) $(SHLIBLDFLAGS) -o $@ $(GAME_OBJS)
The commented out lines are various hacks I've tried. Only when I
use them, does ldd report that gamei386.so is "statically linked" as
it does with the distributed binary. Otherwise, "ldd gamei386.so"
/lib/libNoVersion.so.1 => /lib/libNoVersion.so.1 (0x400a4000)
libc.so.6 => /lib/libc.so.6 (0x400aa000)
/lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x2aaaa000)
Also, /usr/i386-glibc20-linux/bin/wrapper contains a reference to
the non-existent directory /usr/i386-glibc20/lib. I would report this,
but the compat packages don't seem to be in Bugzilla.