Bug 229703 - RFE: use default hash-style=both instead of only gnu
Summary: RFE: use default hash-style=both instead of only gnu
Alias: None
Product: Fedora
Classification: Fedora
Component: gcc
Version: 6
Hardware: All
OS: Linux
Target Milestone: ---
Assignee: Jakub Jelinek
QA Contact:
Depends On:
TreeView+ depends on / blocked
Reported: 2007-02-22 20:45 UTC by Luciano Rocha
Modified: 2007-11-30 22:11 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Last Closed: 2007-02-22 20:51:30 UTC
Type: ---

Attachments (Terms of Use)

Description Luciano Rocha 2007-02-22 20:45:17 UTC
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

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

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 20:51:30 UTC
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 21:01:17 UTC
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.