Bug 1395718 - Unable to build binaries for RHEL-5 on RHEL-6 against compat-glibc stubs
Summary: Unable to build binaries for RHEL-5 on RHEL-6 against compat-glibc stubs
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: compat-glibc
Version: 6.9
Hardware: Unspecified
OS: Unspecified
unspecified
high
Target Milestone: rc
: ---
Assignee: Carlos O'Donell
QA Contact: qe-baseos-tools-bugs
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-11-16 14:00 UTC by Arjun Shankar
Modified: 2017-08-29 19:04 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2017-08-29 19:04:03 UTC
Target Upstream Version:


Attachments (Terms of Use)

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.


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