Bug 229703 - RFE: use default hash-style=both instead of only gnu
RFE: use default hash-style=both instead of only gnu
Status: CLOSED NOTABUG
Product: Fedora
Classification: Fedora
Component: gcc (Show other bugs)
6
All Linux
medium Severity low
: ---
: ---
Assigned To: Jakub Jelinek
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2007-02-22 15:45 EST by Luciano Rocha
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-22 15:51:30 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 Luciano Rocha 2007-02-22 15:45:17 EST
Current binaries built on FC6 fail to execute on other systems due to using new
gnu hash style.

As it is possible to use both styles (gnu and sysv) on an executable, I suggest
change gcc default options to build with both styles.

Tests with kdebase.src.rpm show:

i. 1.2% increase in uncompressed size: +2MB to 169MB (output of rpm2cpio |
LANG=C wc -c)

ii. 0.95% *decrease* in compressed size: -712KB from 73.2MB (size of
kdebase-3.5.6-0.1.i386.rpm)

Interestingly, most libraries and executables in kdebase, if bigger than 200KB,
tend to compress better if compiled with hash-style=both than if compiled with
hash-style=gnu.

With this two interesting cases, and as hard-disks tend to be bigger and
cheaper, removable storage slower, and compatibility is usually a benefit, I
suggest that Fedora defaults to compile with both hash styles.

Of course, I suggest further testing. It could be limited to kdebase and/or to
my build system. I did the test by recompiling kdebase-3.5.6. The
hash-style=both test was used with the following change to %build:

%configure \
    CC="${CC:-gcc} -Wl,--hash-style=both" \
    CXX="${CXX:-g++} -Wl,--hash-style=both" \
Comment 1 Jakub Jelinek 2007-02-22 15:51:30 EST
Feel free to build your binaries that you want to reuse on other distributions
with that option.  All FC6+ rpms built with -Wl,--hash-style=gnu have rpm
generated dependency on the proper glibc, so you can't mistakenly install
them on older distributions.  Generally, running binaries built for a newer
distro on older doesn't work anyway (new symbols added to glibc and other symbol
versioned libraries).
Comment 2 Luciano Rocha 2007-02-22 16:01:17 EST
There were some instances of vendors shipping pre-compiled binaries that only
worked in Fedora (like syslinux). For some cases, like that one, there's no
dependency on newer glibc and other symbol versioned libraries. Only on the hash
style. Without the sysv style, the executables die imediatly on startup with
"Floating point exception". With it, they run fine.

For most complex programs, however, the dependency on glibc versioned libraries
will apply. But for the sake of the others, and for reducing the size of binary
RPMs, hash style default of both would be nice.

Anyway, it's only food for thought.

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