Bug 479210 - static linking does not guarantee to work across RHEL major release
static linking does not guarantee to work across RHEL major release
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: glibc (Show other bugs)
i686 Linux
low Severity medium
: ---
: ---
Assigned To: Jakub Jelinek
Depends On:
  Show dependency treegraph
Reported: 2009-01-07 19:20 EST by Chris Lo
Modified: 2009-01-07 19:26 EST (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2009-01-07 19:26:35 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Chris Lo 2009-01-07 19:20:51 EST
Description of problem:
default glibc installation .SPEC has little downward kernel compatibility.
Even static link is not portable.

Conflicts: kernel < 2.6.9
%define enablekernel 2.6.9

Version-Release number of selected component (if applicable):
source compile platform RHEL 5.2
target compile running platform RHEL 3

How reproducible:
# vi hello.cpp

#include <iostream>

int main()
  std::cout << "Hello World!" << std::endl;
  return 0;

# g++ hello.cpp -m32 -static -o hello
# file hello
hello: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), for GNU/Linux 2.6.9, statically linked, for GNU/Linux 2.6.9, not stripped

# ./hello
Hello World!

Actual results:
On the target RHEL 3 platform using same static binary.
# ./hello
FATAL: kernel too old
Segmentation fault

Recompile glibc in RHEL 5.2 to have enablekernel 2.4.0 and Conflicts < 2.4.0 and recompile static also cannot run the program in lower version of RHEL.

Expected results:
static binary portability.

Additional info:
Comment 1 Jakub Jelinek 2009-01-07 19:26:35 EST
Statically linked programs are (unlike dynamically linked programs) never portable across major releases.  See http://people.redhat.com/drepper/no_static_linking.html

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