Bug 4636

Summary: quake2 gamei386.so & egcs
Product: [Retired] Red Hat Linux Reporter: jszabo
Component: egcsAssignee: David Lawrence <dkl>
Status: CLOSED WONTFIX QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: 6.0   
Target Milestone: ---   
Target Release: ---   
Hardware: i386   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 1999-08-21 14:16:42 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description jszabo 1999-08-21 03:37:46 UTC
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.


Joe

Comment 1 Jeff Johnson 1999-08-21 14:16:59 UTC
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.

Comment 2 Robert Clark 1999-09-23 18:22:59 UTC
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-2.0.7.1 &
compat-binutils-5.2-2.9.1.0.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 -------

env PATH="/usr/i386-glibc20-linux/bin:$PATH"
env LD_LIBRARY_PATH="/usr/i386-glibc20-linux/lib"

ARCH=i386
CC=i386-glibc20-linux-gcc
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 \
#	-B/usr/i386-glibc20-linux/bin/

CFLAGS=$(BASE_CFLAGS)

LDFLAGS=-ldl -lm
SHLIBEXT=so
SHLIBCFLAGS=-fPIC
SHLIBLDFLAGS=-shared \
#	-nostdlib \
#	-L/usr/i386-glibc20-linux/lib

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"
returns:

/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.

Robert.