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

Re: [Xen-devel] [PATCH v2] x86emul/test: generate non-pie executable for 64bit builds



On Mon, Sep 25, 2017 at 07:58:15AM -0600, Jan Beulich wrote:
> >>> On 25.09.17 at 15:40, <wei.liu2@xxxxxxxxxx> wrote:
> > --- a/tools/tests/x86_emulator/Makefile
> > +++ b/tools/tests/x86_emulator/Makefile
> > @@ -76,7 +76,7 @@ $(addsuffix .c,$(SIMD)) $(addsuffix -avx.c,$(filter 
> > sse%,$(SIMD))):
> >     ln -sf simd.c $@
> >  
> >  $(TARGET): x86_emulate.o test_x86_emulator.o
> > -   $(HOSTCC) -o $@ $^
> > +   $(HOSTCC) $(HOSTCFLAGS) -o $@ $^
> >  
> >  .PHONY: clean
> >  clean:
> > @@ -98,7 +98,9 @@ asm:
> >  
> >  asm/%: asm ;
> >  
> > -HOSTCFLAGS += $(CFLAGS_xeninclude) -I.
> > +HOSTCFLAGS-x86_64 :=
> > +$(call cc-option-add,HOSTCFLAGS-x86_64,HOSTCC,-no-pie)
> > +HOSTCFLAGS += $(CFLAGS_xeninclude) -I. $(HOSTCFLAGS-$(XEN_COMPILE_ARCH))
> 
> Hmm, so other than one could imply from gcc doc we get away
> without using -fno-PIE at all, i.e. it's only an issue with how
> linking is being done?

Yeah, it was ld that complained.

> Wouldn't it be better then to pass both (as
> long as supported, if we really care about older compilers here)?

I'm fine with that. -fno-PIE is supported a long time ago. I can fold in
the following diff to this patch.

diff --git a/tools/tests/x86_emulator/Makefile
b/tools/tests/x86_emulator/Makefile
index 87064494d1..fbe02cd2f9 100644
--- a/tools/tests/x86_emulator/Makefile
+++ b/tools/tests/x86_emulator/Makefile
@@ -98,7 +98,7 @@ asm:

 asm/%: asm ;

-HOSTCFLAGS-x86_64 :=
+HOSTCFLAGS-x86_64 := -fno-PIE
 $(call cc-option-add,HOSTCFLAGS-x86_64,HOSTCC,-no-pie)
 HOSTCFLAGS += $(CFLAGS_xeninclude) -I.  $(HOSTCFLAGS-$(XEN_COMPILE_ARCH))

_______________________________________________
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®.