Bug 881842

Summary: When linking statically only against elfutils libs, one needs to provide complete path to static library
Product: Red Hat Developer Toolset Reporter: Miroslav Franc <mfranc>
Component: doc-Release_NotesAssignee: Eliska Slobodova <eslobodo>
Status: CLOSED CURRENTRELEASE QA Contact:
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: DTS 1.1 RHEL 6CC: mcermak, ohudlick, pmachata
Target Milestone: ---   
Target Release: 1.1   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-01-22 16:41:11 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:
Embargoed:

Description Miroslav Franc 2012-11-29 16:41:27 UTC
Description of problem:

When linking against one of the elfutils libs with -static -l<library> it's not working because their suffix changed from a to ar (bug 865388).  When RHEL versions of elfutils static libraries are present the program is linked against them instead of dts versions.


Reproducer:

gcc -static somecfile.c -lelf

Without elfutils-libelf-devel-static present the reproducer above fails, with the package present it succeeds, but you can verify with strace that it's linking the program against RHEL version because linker assumes static libraries end with ".a".


Workaround is to provide complete path to the static library.

gcc -static somecfile.c /opt/rh/devtoolset-1.1/root/usr/lib/libelf.ar


I believe this should be documented for DTS 1.1.