Bug 1395718

Summary: Unable to build binaries for RHEL-5 on RHEL-6 against compat-glibc stubs
Product: Red Hat Enterprise Linux 6 Reporter: Arjun Shankar <ashankar>
Component: compat-glibcAssignee: Carlos O'Donell <codonell>
Status: CLOSED WONTFIX QA Contact: qe-baseos-tools-bugs
Severity: high Docs Contact:
Priority: unspecified    
Version: 6.9CC: mnewsome
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-08-29 19:04:03 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description Arjun Shankar 2016-11-16 14:00:04 UTC
Trying to compile hello-world for RHEL-5 against compat-glibc on RHEL-6.9 fails when using the latest compat-glibc-2.5-46.2:

The program:
#include <stdio.h>
int main (void) { printf ("Hello, World!\n"); return 0; }

The command line (needs `compat-gcc-34'):
$ gcc34 -I /usr/lib/x86_64-redhat-linux5E/include \
        -B /usr/lib/x86_64-redhat-linux5E/lib64/ hello.c

The error:
/usr/lib/x86_64-redhat-linux5E/lib64/crt1.o: In function `_start':
(.text+0x12): undefined reference to `__libc_csu_fini'
/usr/lib/x86_64-redhat-linux5E/lib64/crt1.o: In function `_start':
(.text+0x19): undefined reference to `__libc_csu_init'
collect2: ld returned 1 exit status

I'm assigning a 'High' severity to this bug because the package's functionality is currently unavailable for use.

Comment 1 Carlos O'Donell 2016-11-16 20:07:31 UTC
When this package was imported in 2010:

commit 52c1c4b798fbe322fd67ecce7429b09ac03be6ec
Author: Dennis Gregorovic <dgregor>
Date:   Tue Jan 19 15:42:40 2010 +0000

    compat-glibc-2.5-46.src.rpm

The libc.so changes which handle turning that file into a linker script were lost. This means that libc_nonshared.a is not being included in the link. This means the package is unsuable.

The immediate workaround is to add libc_nonshared.a back into the link.

e.g.

$ gcc34 -I /usr/lib/x86_64-redhat-linux5E/include \
        -B /usr/lib/x86_64-redhat-linux5E/lib64 
        -o hello hello.c \
        /usr/lib/x86_64-redhat-linux5E/lib64/libc_nonshared.a

Potentially worse and unsolvable is the missing --as-needed on ld.so for any interfaces provided by the dynamic loader, but it might just work since the dynamic loader is added to all global symbol search scopes automatically.

Either way, the code that is missing needs to get added back, and ld.so needs to be shipped. Given the workaround I'm not sure if this is serious enough to warrant an update for the compat package.

Comment 4 Carlos O'Donell 2017-08-29 19:04:03 UTC
Given the workaround in place for rhel-6.9 and rhel-6.10 and the low severity of this issue, I'm marking this as CLOSED/WONTFIX.