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

Re: [Xen-devel] [PATCH] x86emul/test: disable pie for 64-bit builds



>>> On 25.09.17 at 14:55, <wei.liu2@xxxxxxxxxx> wrote:
> On Mon, Sep 25, 2017 at 05:54:41AM -0600, Jan Beulich wrote:
>> >>> On 25.09.17 at 13:43, <wei.liu2@xxxxxxxxxx> wrote:
>> > On Mon, Sep 25, 2017 at 05:35:05AM -0600, Jan Beulich wrote:
>> >> >>> On 25.09.17 at 12:49, <wei.liu2@xxxxxxxxxx> wrote:
>> >> > PIE may (and commonly will) result in the binary being loaded above
>> >> > the 4Gb boundary, which can't work with at least the VZEROUPPER compat
>> >> > mode test.
>> >> > 
>> >> > Reported-by: Wei Liu <wei.liu2@xxxxxxxxxx>
>> >> > Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>
>> >> > Signed-off-by: Wei Liu <wei.liu2@xxxxxxxxxx>
>> >> > ---
>> >> > Cc: Jan Beulich <jbeulich@xxxxxxxx>
>> >> > Cc: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
>> >> > 
>> >> > With this patch, vzeroupper passes, but one other test fails.
>> >> > Testing SSE packed single 64-bit code sequence...[line 368] failed!
>> >> 
>> >> Feel free to mail me the binary again, albeit that one's going to
>> >> be more difficult to debug without being able to see it myself.
>> >> 
>> >> > @@ -98,7 +98,9 @@ asm:
>> >> >  
>> >> >  asm/%: asm ;
>> >> >  
>> >> > -HOSTCFLAGS += $(CFLAGS_xeninclude) -I.
>> >> > +HOSTCFLAGS-x86_64 :=
>> >> > +$(call cc-option-add,HOSTCFLAGS,HOSTCC,-no-pie)
>> >> > +HOSTCFLAGS += $(CFLAGS_xeninclude) -I. 
>> >> > $(HOSTCFLAGS-$(XEN_COMPILE_ARCH))
>> >> 
>> >> I don't understand this change to my original patch: You now
>> >> conditionally add -no-pie to HOSTCFLAGS (i.e. also for 32-bit builds),
>> >> and HOSTCFLAGS-x86_64 remains empty. I also don't see why the
>> > 
>> > My bad. The flag should be conditionally added to HOSTCFLAGS-x86_64.
>> > 
>> >> addition needs to be conditional: In order to be able to build the
>> >> entire test, a reasonably new tool chain is needed anyway (much
>> >> newer than what we require for building everything else). And finally
>> > 
>> > It needs to be conditional because not all gcc versions support -no-pie.
>> 
>> You mean older one (which would be no problem, as said) or even
>> up-to-date ones (due to the way they're being configured)?
> 
> Let me be precise because I don't know which version you count as old or
> up-to-date.
> 
> Gcc <5.4 has -pie but no -no-pie. IIRC passing -no-pie will cause the
> linker to return an error. I don't have a machine that old to verify it
> though.

Okay, gcc below 5 counts as "old" here for me; iirc I had to update
to that version to actually be able to properly build and run all
current tests.

>> >> - is there a difference between -no-pie and -fno-PIE / -fno-pie?
>> >> 
>> > 
>> > I can't tell the difference by reading the manpage TBH. I only know one
>> > works while the other doesn't by trial and error.
>> 
>> Oh, that's certainly worthwhile adding to the description then.
> 
> After reading a bit more into the manual: the -no-pie option is for
> the linker, while the -fno-pie option is for code generation.
> 
> The build rune is in fact using HOSTCC to link the executable, hence we
> need -fno-pie.
> 
> I'm not sure why omitting -fno-PIE is not a problem, but it works.

All pretty confusing. Are you going to send a cleaned up patch
then?

Jan


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