Bug 1247050 - glibc should support static PIE binaries
glibc should support static PIE binaries
Status: CLOSED RAWHIDE
Product: Fedora
Classification: Fedora
Component: glibc (Show other bugs)
rawhide
Unspecified Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: Carlos O'Donell
Fedora Extras Quality Assurance
:
: 1239796 (view as bug list)
Depends On:
Blocks: F23FTBFS 1239796
  Show dependency treegraph
 
Reported: 2015-07-27 04:40 EDT by Dominik 'Rathann' Mierzejewski
Modified: 2018-01-19 11:36 EST (History)
10 users (show)

See Also:
Fixed In Version: glibc-2.26.9000-44.fc28
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2016-02-05 10:19:36 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)


External Trackers
Tracker ID Priority Status Summary Last Updated
Sourceware 19574 None None None 2016-02-05 10:19 EST

  None (edit)
Description Dominik 'Rathann' Mierzejewski 2015-07-27 04:40:55 EDT
Description of problem:
libpthread.a is compiled without -fPIC, causing linking errors in other packages, for example prelink.

Version-Release number of selected component (if applicable):
glibc-static-2.21.90-18.fc24.x86_64

How reproducible:
Always.

Steps to Reproduce:
1. checkout prelink f22 branch
2. try to build it in rawhide mock

Actual results:
/bin/ld: /usr/lib/gcc/x86_64-redhat-linux/5.1.1/../../../../lib64/libpthread.a(libpthread.o): relocation R_X86_64_32S against `__stack_user' can not be used when making a shared object; recompile with -fPIC
/usr/lib/gcc/x86_64-redhat-linux/5.1.1/../../../../lib64/libpthread.a: error adding symbols: Bad value
collect2: error: ld returned 1 exit status

Expected results:
prelink builds normally.
Comment 1 Jakub Jelinek 2015-07-27 04:44:21 EDT
IMNSHO this is not a bug.  If you link against these libraries statically, you should link them statically too.
Comment 2 Carlos O'Donell 2015-07-27 22:29:56 EDT
(In reply to Jakub Jelinek from comment #1)
> IMNSHO this is not a bug.  If you link against these libraries statically,
> you should link them statically too.

Agreed.

(In reply to Dominik 'Rathann' Mierzejewski from comment #0)
> Description of problem:
> libpthread.a is compiled without -fPIC, causing linking errors in other
> packages, for example prelink.

Why are you linking in a static libpthread to create a shared object?
Comment 3 Dominik 'Rathann' Mierzejewski 2015-07-31 09:37:59 EDT
(In reply to Carlos O'Donell from comment #2)
> (In reply to Dominik 'Rathann' Mierzejewski from comment #0)
> > Description of problem:
> > libpthread.a is compiled without -fPIC, causing linking errors in other
> > packages, for example prelink.
> 
> Why are you linking in a static libpthread to create a shared object?

That's actually a question for Jakub, as prelink is his code. However, since execstack is being packaged separately (bug 1247795), this will become moot unless someone wants to unretire prelink.
Comment 4 Florian Weimer 2016-02-05 10:20:01 EST
*** Bug 1239796 has been marked as a duplicate of this bug. ***
Comment 5 Florian Weimer 2018-01-19 11:36:59 EST
glibc-2.26.9000-44.fc28 provides static PIE support on aarch64, i686, x86-64.

GCC 8 will simplify matters by including the -static-pie option.

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