Bug 74781 - compat-egcs needs better documention on usage
compat-egcs needs better documention on usage
Status: CLOSED WONTFIX
Product: Red Hat Linux
Classification: Retired
Component: compat-egcs (Show other bugs)
7.3
i386 Linux
medium Severity medium
: ---
: ---
Assigned To: Jakub Jelinek
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2002-10-01 12:30 EDT by Eric Ding
Modified: 2007-04-18 12:46 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2004-10-03 15:06:42 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Eric Ding 2002-10-01 12:30:44 EDT
From Bugzilla Helper:
User-Agent: Mozilla/5.0 Galeon/1.2.5 (X11; Linux i686; U;) Gecko/20020606

Description of problem:
When compiling and linking a shared library module which references semctl
and/or shmctl, the compat-egcs package produces a shared library with
dependencies on glibc 2.2, so that the library can't be used on RedHat 6.2.  On
RH 6.2, nm produces the following output:

         [~] nm libfoo.so | fgrep GLIBC_2.2
         U semctl@@GLIBC_2.2
         U shmctl@@GLIBC_2.2

Version-Release number of selected component (if applicable):


How reproducible:
Always

Steps to Reproduce:
1. Write a C file with a function that reference semctl or shmctl.
2. Compile the C file, and link it into a shared library with egcs after
   running the compat-egcs compatibility script.
3. Run nm on the shared library to see the symbols.
	

Actual Results:  The shared library references GLIBC 2.2 versions of semctl and
shmctl.

Expected Results:  The shared library should have referenced either unversioned
or GLIBC 2.1 (or GLIBC 2.0?) versions of semctl and shmctl.

Additional info:
Comment 1 Eric Ding 2002-10-10 16:55:48 EDT
After a day and a half of experimentation, I've come to the conclusion that
compat-egcs is ... seriously confusing.  :)  The only way I could create shared
libraries and executables that worked well on Red Hat 6.2 was to do the following:

1) run /usr/i386-glibc21-linux/bin/i386-glibc21-linux.sh to set the LDEMULATION
   and GCC_EXEC_PREFIX environment variables correctly.
2) compile and link with gcc 2.96 driving, *not* with egcs.  So with a simple
   program, I'd compile as follows:

   gcc -c test.c
   
3) When compiling C++ programs, I found that gcc 2.96 was not passing a flag
   that the egcs subprograms expected, namely __cplusplus.  So when compiling
   a C++ program, I have to do:

   g++ -D__cplusplus test.c

   and then...

4) I found that I have to actually use gcc 2.96 to link, *not* egcs as I had
   expected.  The latter simply fails to work because it's using the wrong
   object files/libraries when compiling.  So again, the possibilities might
   be:

   gcc -o test test.o
   gcc -shared -o libtest.so test.o
   gcc -shared -o libtest.so test.o -lstdc++
   g++ -shared -o libtest.so test.o

All of this leads me to wonder whether compat-egcs has been thoroughly tested
(never mind that it's completely undocumented...).  Have I come to the correct
conclusions, or not?
Comment 2 Eric Ding 2002-10-10 17:48:27 EDT
Or... just use i386-glibc21-linux-gcc and i386-glibc21-linux-c++.  I shoulda
guessed.  Or should I have?  Can someone write documentation for this stuff, please?
Comment 3 Jakub Jelinek 2004-10-03 15:06:42 EDT
compat-egcs is not included in the distribution any longer.

Note You need to log in before you can comment on or make changes to this bug.