Bug 227584 - gcc produces binaries that cannot be run on previous Fedora or on RHEL
gcc produces binaries that cannot be run on previous Fedora or on RHEL
Status: CLOSED NOTABUG
Product: Fedora
Classification: Fedora
Component: gcc (Show other bugs)
6
All Linux
medium Severity medium
: ---
: ---
Assigned To: Jakub Jelinek
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2007-02-06 17:38 EST by H. Peter Anvin
Modified: 2007-11-30 17:11 EST (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2007-02-07 03:29:47 EST
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 H. Peter Anvin 2007-02-06 17:38:02 EST
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 03:29:47 EST
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 03:43:18 EST
Forgot to say, this is mentioned in FC6 release notes.

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