On Thu, Feb 19, 2015 at 10:22:03AM +0100, Jakub Jelinek wrote: > On Thu, Feb 19, 2015 at 09:14:32AM +0000, Richard W.M. Jones wrote: > > > > https://bugzilla.redhat.com/show_bug.cgi?id=1194167 > > > > Basically everything in Rawhide which uses the normal RPM > > opt flags will now have to be compiled with -fPIC, otherwise > > you get errors like: > > > > /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 > > > > This is somewhat surprising .. > > Of course not. But, anything you link with > -specs=/usr/lib/rpm/redhat/redhat-hardened-ld > has to be compiled with > -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 > The latter will supply -fPIE by default if you don't specify > -fno-pic/-fpic/-fPIC/-fpie/-fPIE explicitly on the command line, > similarly to how redhat-hardened-ld supplies -pie if -shared is not given. > The rule is simple, objects to be linked into shared libraries > have to be compiled with -fpic or -fPIC. > Objects linked into position independent binaries have to be compiled > with -fpie or -fPIE or -fpic or -fPIC (the latter two being less efficient > for PIEs, on the other side can be linked into shared libraries too). > Objects linked into position dependent binaries can be compiled with any of > -fno-pic/-fpic/-fPIC/-fpie/-fPIE (-fno-pic is the default if you don't use > -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 and is the most efficient > -flag for position dependent binaries). The thing is, I'm not adding -specs=/usr/lib/rpm/redhat/redhat-hardened-ld explicitly in the real program. It's being added to everything by something in RPM. I'm not exactly sure what, maybe %{configure}? So I don't know how to control this behaviour in a real autotools-using program. Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming and virtualization blog: http://rwmj.wordpress.com virt-builder quickly builds VMs from scratch http://libguestfs.org/virt-builder.1.html -- devel mailing list devel@xxxxxxxxxxxxxxxxxxxxxxx https://admin.fedoraproject.org/mailman/listinfo/devel Fedora Code of Conduct: http://fedoraproject.org/code-of-conduct