Bug 1194167

Summary: relocation R_X86_64_32S against ... can not be used when making a shared object; recompile with -fPIC
Product: [Fedora] Fedora Reporter: Richard W.M. Jones <rjones>
Component: redhat-rpm-configAssignee: Florian Festi <ffesti>
Status: CLOSED NOTABUG QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: rawhideCC: ffesti, jonathan, ktdreyer, mskalick
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-02-19 11:08:36 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 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.