Bug 1194167 - relocation R_X86_64_32S against ... can not be used when making a shared object; recompile with -fPIC
Summary: relocation R_X86_64_32S against ... can not be used when making a shared obje...
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Fedora
Classification: Fedora
Component: redhat-rpm-config
Version: rawhide
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Florian Festi
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2015-02-19 09:12 UTC by Richard W.M. Jones
Modified: 2015-02-19 11:08 UTC (History)
4 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2015-02-19 11:08:36 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Richard W.M. Jones 2015-02-19 09:12:23 UTC
Description of problem:

Linking any trivial test program without -fPIC fails if you
use -specs=/usr/lib/rpm/redhat/redhat-hardened-ld (as used by RPM
builds).  This means absolutely everything has to be built with
-fPIC in Rawhide, which is certainly unexpected.

$ gcc test.c -lvirt
$ gcc test.c -lvirt -specs=/usr/lib/rpm/redhat/redhat-hardened-ld
/usr/bin/ld: /tmp/ccqyK5ia.o: relocation R_X86_64_32S against `virConnectOpen' can not be used when making a shared object; recompile with -fPIC
/tmp/ccqyK5ia.o: error adding symbols: Bad value
collect2: error: ld returned 1 exit status

$ cat test.c
#include <stdio.h>
#include <stdlib.h>
#include <libvirt/libvirt.h>
int
main (int argc, char *argv[])
{
  void *p = virConnectOpen;
  fprintf (stderr, "p = %p\n", p);
  exit (1);
}

Version-Release number of selected component (if applicable):

redhat-rpm-config-27-1.fc22.noarch

How reproducible:

100%

Steps to Reproduce:
1. See above.


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