Bug 479210 - static linking does not guarantee to work across RHEL major release
Summary: static linking does not guarantee to work across RHEL major release
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: glibc
Version: 5.2
Hardware: i686
OS: Linux
low
medium
Target Milestone: ---
: ---
Assignee: Jakub Jelinek
QA Contact: BaseOS QE
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2009-01-08 00:20 UTC by Chris Lo
Modified: 2009-01-08 00:26 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2009-01-08 00:26:35 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Chris Lo 2009-01-08 00:20:51 UTC
Description of problem:
default glibc installation .SPEC has little downward kernel compatibility.
Even static link is not portable.

glibc.spec
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-08 00:26:35 UTC
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.