Bug 227584

Summary: gcc produces binaries that cannot be run on previous Fedora or on RHEL
Product: [Fedora] Fedora Reporter: H. Peter Anvin <hpa>
Component: gccAssignee: Jakub Jelinek <jakub>
Status: CLOSED NOTABUG QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: 6   
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-02-07 08:29:47 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 H. Peter Anvin 2007-02-06 22:38:02 UTC
Description of problem:
gcc produces binaries that cannot be run on previous Fedora, or on RHEL.
This can easily be fixed by changing --hash=gnu to --hash=both in the specfile.

Version-Release number of selected component (if applicable):
gcc-4.1.1-51.fc6

How reproducible:
Compile a binary on FC6.  Try running it on FC5 or RHEL.


Steps to Reproduce:
1.
2.
3.
  
Actual results:


Expected results:


Additional info:

Comment 1 Jakub Jelinek 2007-02-07 08:29:47 UTC
That's intentional.
Generally, you can't run binaries/libraries on older releases either, due to
glibc/libstdc++/libgcc etc. symbol versioning or older SONAMEs of libraries
on the older distributions.
So, if you want to create binaries/libraries usable on older distributions,
you need to have that in mind and either build them in a chroot containing
the oldest distribution you want to support, or using e.g. a compatibility
gcc and glibc.  compat-gcc-34 in FC6 e.g. defaults to -Wl,--hash-style=sysv
and therefore what it generates is, as long as it is linked against compatibility
glibc and other compatibility libraries (and compiled against compatibility
headers) should be usable on (some) older releases.

-Wl,--hash-style=gnu is intentional, it makes the allocated part of
binaries/libraries quite a bit smaller and requiring less memory at runtime.

Comment 2 Jakub Jelinek 2007-02-07 08:43:18 UTC
Forgot to say, this is mentioned in FC6 release notes.