[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [XTF PATCH] build: disable PIE during linking if necessary



On Wed, Feb 01, 2017 at 04:23:53PM +0000, Andrew Cooper wrote:
> On 01/02/17 16:21, Wei Liu wrote:
> > Starting from ee3e265688, $(CC) is used for linking. That means all
> > default $(CC) flags coming from distro takes effect.
> >
> > On Debian Stretch, gcc contains -pie by default, which makes the final
> > object fail to link. We need to explicitly disable PIE when linking.
> > Since not all versions of gcc support -no-pie, test its availability
> > before adding.
> >
> > Example error message:
> >
> > /usr/bin/ld: /local/work/xtf.git/arch/x86/boot/head_pv64.o: relocation 
> > R_X86_64_32S against symbol `start_info' can not be used when making a 
> > shared object;
> > recompile with -fPIC
> > /usr/bin/ld: /local/work/xtf.git/arch/x86/entry_64-pv64.o: relocation 
> > R_X86_64_32S against `.text' can not be used when making a shared object; 
> > recompile with
> > -fPIC
> > /usr/bin/ld: final link failed: Nonrepresentable section on output
> > collect2: error: ld returned 1 exit status
> >
> > Signed-off-by: Wei Liu <wei.liu2@xxxxxxxxxx>
> 
> LGTM.  Any objection if I s/DISABLE_PIE_LDFLAGS/COMMON_LDFLAGS/ on
> commit? I don't think the name needs to be that specific.

NP. Do whatever you like.

I just want to get it fixed. ;-)

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
https://lists.xen.org/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.