Bug 227584 - gcc produces binaries that cannot be run on previous Fedora or on RHEL
Summary: gcc produces binaries that cannot be run on previous Fedora or on RHEL
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Fedora
Classification: Fedora
Component: gcc
Version: 6
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Jakub Jelinek
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2007-02-06 22:38 UTC by H. Peter Anvin
Modified: 2007-11-30 22:11 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2007-02-07 08:29:47 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

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.


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