[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 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


> 
> Another thing you might need to know if you are building xen on Fedora 24 
> is that you need to add -fno-tree-coalesce-vars if you are on a gcc-6.0.0 
> package (it may be fixed in gcc-6.1.1-2.fc24 which has just come out but I 
> haven't tested it yet).
> 
>       Michael Young

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