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

Re: [Xen-devel] Build problems with xen 4.7



On Fri, May 13, 2016 at 4:23 PM, Konrad Rzeszutek Wilk
<konrad.wilk@xxxxxxxxxx> wrote:
> On Fri, May 13, 2016 at 03:25:52PM +0100, M A Young wrote:
>> On Fri, 13 May 2016, Jan Beulich wrote:
>>
>> > >>> On 13.05.16 at 15:49, <konrad.wilk@xxxxxxxxxx> wrote:
>> > > ...
>> > >
>> > > Still an issue - with 4.7.0-rc1.
>> >
>> > And I don't recall anyone having contributed a fix/workaround.
>> >
>> > > If I do:
>> > >
>> > > $export CFLAGS=" "'
>> > > $make
>> > >
>> > > I end up with:
>> > > gcc -E -O1 -fno-omit-frame-pointer -m64 -DBUILD_ID -g 
>> > > -fno-strict-aliasing -std=gnu99
>> > >[...]
>> > > <command-line>:0:0: error: "__OBJECT_FILE__" redefined [-Werror]
>> > > <command-line>:0:0: note: this is the location of the previous definition
>> > > <command-line>:0:0: error: "__OBJECT_LABEL__" redefined [-Werror]
>> > > <command-line>:0:0: note: this is the location of the previous definition
>> > > cc1: all warnings being treated as errors
>> > > Makefile:62: recipe for target 'compat/callback.i' failed
>> >
>> > My previous recommendation stands: Then just don't do this.
>>
>> I hacked around it for my test builds (eg. see my test build at
>> https://copr.fedorainfracloud.org/coprs/myoung/xentest/build/204111/
>> ) by not setting CFLAGS in the environment, but by instead adding the
>> recommended Fedora RPM settings into config/StdGNU.mk via a different
>> environment variable.
>
> ah:
>
> --- xen-4.7.0/config/StdGNU.mk.orig     2016-04-15 22:56:52.191227591 +0100
> +++ xen-4.7.0/config/StdGNU.mk  2016-04-15 23:01:40.978829756 +0100
> @@ -37,6 +37,12 @@
>
>  ifneq ($(debug),y)
>  CFLAGS += -O2 -fomit-frame-pointer -fno-tree-coalesce-vars
> +ifeq ($(XEN_TARGET_ARCH),x86_64)
> +#might be cross-compiling so strip out possible x86_32 options
> +CFLAGS += $(shell echo $(CFLAGS_EXTRA) | sed -e 's/-m32//g' -e 
> 's/-march=i686//g' -e 's/-mtune=atom//g')
> +else
> +CFLAGS += $(CFLAGS_EXTRA)
> +endif
>  else
>  # Less than -O1 produces bad code and large stack frames
>  CFLAGS += -O1 -fno-omit-frame-pointer
>
>
> And in the spec file:
> export CFLAGS_EXTRA="$RPM_OPT_FLAGS"
> make %{?_smp_mflags} %{?efi_flags} prefix=/usr dist-xen

Something like the above solution worked for me (CentOS 7 -- I'm
suspecting a similar pattern here).

Adding CFLAGS="${RPM_OPT_FLAGS}" to my ./configure line made some
noises as though it was going to work, but none of it actually ended
up passed to the compiler (whereas it did with the little patch Konrad
posted).

Are we going to provide a proper way for distros to add flags like
this without having to hack the build system?

 -George

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

 


Rackspace

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