Bug 258021

Summary: compat-gcc-32 dependency on GLIBC_2.3.4
Product: Red Hat Enterprise Linux 4 Reporter: Sev Binello <sev>
Component: compat-gcc-32Assignee: Jakub Jelinek <jakub>
Status: CLOSED NOTABUG QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: 4.5   
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2007-08-28 16:44:26 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:
Attachments:
Description Flags
simple C++ program that demonstrated g++32 dependency on GLIBC_2.3.4 none

Description Sev Binello 2007-08-27 20:42:47 UTC
Description of problem:

When using gcc32 on WS4 to build executables that we need to run on WS3 and WS4
a dependency on GLIBC_2.3.4 is incurred, thus we cannot run the executable on
WS3 machines. We have found that the dependency only occurs if we make a call
to "regexec".


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

gcc32 (GCC) 3.2.3 20030502 (Red Hat Linux 3.2.3-47.3)

How reproducible:
Always

Steps to Reproduce:
1.Build something that calls regexec on WS4 using gcc32 
2. Run it on WS3 machine
3. 
  
Actual results:
Get error that it cant find GLIBC_2.3.4

Expected results:
Should not build against GLIBC_2.3.4

Additional info:

Comment 1 Sev Binello 2007-08-27 21:07:58 UTC
Created attachment 174401 [details]
simple C++ program that demonstrated g++32 dependency on GLIBC_2.3.4

This is a simple C++ program that demonstrated g++32 dependency on GLIBC_2.3.4.

If you comment out the line with regexec then the dependency is eliminated

Comment 2 Jakub Jelinek 2007-08-28 16:44:26 UTC
If you are not linking against compat-glibc, you have to expect that.
So say on i386 that means compiling with
g++32 -I /usr/lib/i386-redhat-linux3E/include \
  -B /usr/lib/i386-redhat-linux3E/lib/
after making sure you have compat-glibc and compat-glibc-headers installed
if you want to run it on RHEL3.


Comment 3 Sev Binello 2007-08-28 17:01:48 UTC
Thank you, I will try that.
Is this process 
(i.e creating binaries on newer versions of RHat OS for older versions of OS)
documented anywhere, so I wont have to stumble around so much ?

Comment 4 Sev Binello 2007-08-28 17:16:36 UTC
Ok tried it.
Worked fine when using g++32 (with or without -I /usr/... and -B /usr/...) 
Are the -I and -B actually needed ?

Had problem when using gcc32 
See Below...

  gcc32 regexec2.cxx -I /usr/lib/i386-redhat-linux3E/include -B   
/usr/lib/i386-redhat-linux3E/lib/

/tmp/cc07FBBf.o(.eh_frame+0x11): undefined reference to `__gxx_personality_v0'
collect2: ld returned 1 exit status


Any idea why everything else worked ok before until we ran into the regexec call ?

Comment 5 Jakub Jelinek 2007-08-28 17:20:19 UTC
You shouldn't use gcc (resp. gcc32) to link C++ stuff, g++ (resp. g++32) takes
care of linking in libstdc++ and passing other needed options (in this case
-shared-libgcc is what matters).

Comment 6 Sev Binello 2007-08-28 19:05:26 UTC
Ok, but can you point me to documentation for using the compat libs.
Thanks.


Comment 7 Jakub Jelinek 2007-08-28 19:17:52 UTC
LC_ALL=C rpm -qpi compat-glibc-2.3.2-95.30.i386.rpm
Name        : compat-glibc                 Relocations: (not relocatable)
Version     : 2.3.2                             Vendor: Red Hat, Inc.
Release     : 95.30                         Build Date: Tue Nov 16 13:11:37 2004
Install Date: (not installed)               Build Host: porky.build.redhat.com
Group       : Development/Libraries         Source RPM:
compat-glibc-2.3.2-95.30.src.rpm
Size        : 3569066                          License: LGPL
Signature   : DSA/SHA1, Wed Jan  5 17:05:00 2005, Key ID 219180cddb42a60e
Packager    : Red Hat, Inc. <http://bugzilla.redhat.com/bugzilla>
Summary     : Compatibility C library
Description :
This package contains stub shared libraries and static libraries
from Red Hat Enterprise Linux 3.
To compile and link against these compatibility libraries, use
gcc32 -I /usr/lib/i386-redhat-linux3E/include \
      -B /usr/lib/i386-redhat-linux3E/lib/


Comment 8 Sev Binello 2007-09-06 20:50:49 UTC
Sorry, but this regexec keeps coming back to haunt us.
I have setup the compat libs and switches so as to produce
a WS3 compatible binary from WS4 machine as you outlined above

But now I cant link the WS3 copatatible binary on the WS4 machine
because  libXm.so has a dependency on 2.3.4
  /usr/X11R6/lib/libXm.so: undefined reference to `regexec.4

And who knows what other libs will also have this problem.
Can you tell us what  approach we should take here?

And, WHAT IS SO SPECIAL ABOUT REGEXEC ANYHOW ???

Thanks