xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Peng Fan <van.freenix@gmail.com>
To: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>, julien.grall@arm.com
Cc: Marcos Matsunaga <marcos.matsunaga@oracle.com>,
	xen-devel@lists.xen.org, Jan Beulich <JBeulich@suse.com>,
	M A Young <m.a.young@durham.ac.uk>
Subject: Re: Build problems with xen 4.7
Date: Mon, 8 Aug 2016 22:37:35 +0800	[thread overview]
Message-ID: <20160808143732.GA6990@linux-7smt.suse> (raw)
In-Reply-To: <20160513152329.GB5128@char.us.oracle.com>

Hi,

On Fri, May 13, 2016 at 11:23:29AM -0400, Konrad Rzeszutek Wilk 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@oracle.com> 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

I met similar issue when cross compile xen for ARM64 on X86 PC using yocto poky 4.9.3
toolchain.

aarch64-poky-linux-gcc -O2 -pipe -g -feliminate-unused-debug-types -O1 -fno-omit-frame-pointer -DBUILD_ID -g -fno-strict-aliasing -std=gnu99 -Wall -Wstrict-prototypes -Wdeclaration-after-statement -Wno-unused-but-set-variable -Wno-unused-local-typedefs -O1 -fno-omit-frame-pointer -DBUILD_ID -g -fno-strict-aliasing -std=gnu99 -Wall -Wstrict-prototypes -Wdeclaration-after-statement -Wno-unused-but-set-variable -Wno-unused-local-typedefs -O1 -fno-omit-frame-pointer -DBUILD_ID -g -fno-strict-aliasing -std=gnu99 -Wall -Wstrict-prototypes -Wdeclaration-after-statement -Wno-unused-but-set-variable -Wno-unused-local-typedefs -nostdinc -fno-builtin -fno-common -Werror -Wredundant-decls -Wno-pointer-arith -pipe -g -D__XEN__ -include /home/Freenix/work/sw-stash/imx8/8qm/xen/xen/xen/include/xen/config.h '-D__OBJECT_FILE__="/home/Freenix/work/sw-stash/imx8/8qm/xen/xen/xen/xen"' -Wa,--strip-local-absolute -fno-optimize-sibling-calls -fno-omit-frame-pointer -MMD -MF /home/Freenix/work/sw-stash/imx8/8qm/xen/xen/xen/.xen.d -mcpu=generic -mgeneral-regs-only -DCONFIG_EARLY_PRINTK -DEARLY_PRINTK_INC=\"debug-imx8qm.inc\" -DEARLY_PRINTK_BAUD= -DEARLY_UART_BASE_ADDRESS=0x5a060000 -DEARLY_UART_REG_SHIFT= -fno-optimize-sibling-calls -I/home/Freenix/work/sw-stash/imx8/8qm/xen/xen/xen/include -fno-stack-protector -fno-exceptions -Wnested-externs -DGCC_HAS_VISIBILITY_ATTRIBUTE -O1 -fno-omit-frame-pointer -DBUILD_ID -g -fno-strict-aliasing -std=gnu99 -Wall -Wstrict-prototypes -Wdeclaration-after-statement -Wno-unused-but-set-variable -Wno-unused-local-typedefs -O1 -fno-omit-frame-pointer -DBUILD_ID -g -fno-strict-aliasing -std=gnu99 -Wall -Wstrict-prototypes -Wdeclaration-after-statement -Wno-unused-but-set-variable -Wno-unused-local-typedefs -nostdinc -fno-builtin -fno-common -Werror -Wredundant-decls -Wno-pointer-arith -pipe -g -D__XEN__ -include /home/Freenix/work/sw-stash/imx8/8qm/xen/xen/xen/include/xen/config.h '-D__OBJECT_FILE__="asm-offsets.s"' -Wa,--strip-local-absolute -fno-optimize-sibling-calls -fno-omit-frame-pointer -MMD -MF ./.asm-offsets.s.d -mcpu=generic -mgeneral-regs-only -DCONFIG_EARLY_PRINTK -DEARLY_PRINTK_INC=\"debug-imx8qm.inc\" -DEARLY_PRINTK_BAUD= -DEARLY_UART_BASE_ADDRESS=0x5a060000 -DEARLY_UART_REG_SHIFT= -I/home/Freenix/work/sw-stash/imx8/8qm/xen/xen/xen/include -fno-stack-protector -fno-exceptions -Wnested-externs -DGCC_HAS_VISIBILITY_ATTRIBUTE -S -o asm-offsets.s arm64/asm-offsets.c
<command-line>:0:0: error: "__OBJECT_FILE__" redefined [-Werror]
<command-line>:0:0: note: this is the location of the previous definition
cc1: all warnings being treated as errors


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

Does this patch work when cross compile for ARM64?

Thanks,
Peng.

>
>> 
>> 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@lists.xen.org
>http://lists.xen.org/xen-devel

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

  parent reply	other threads:[~2016-08-08 14:37 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-30 23:37 Build problems with xen 4.7 M A Young
2015-12-01 13:19 ` Jan Beulich
2015-12-01 14:36   ` Konrad Rzeszutek Wilk
2015-12-01 14:50     ` Marcos E. Matsunaga
2015-12-01 15:56     ` Jan Beulich
2015-12-01 15:59       ` Konrad Rzeszutek Wilk
2015-12-01 16:09         ` Jan Beulich
2015-12-01 18:47           ` M A Young
2015-12-01 19:40             ` Olaf Hering
2015-12-01 19:53               ` Andrew Cooper
2015-12-02 10:05             ` Jan Beulich
2016-05-13 13:49         ` Konrad Rzeszutek Wilk
2016-05-13 14:01           ` Jan Beulich
2016-05-13 14:25             ` M A Young
2016-05-13 15:23               ` Konrad Rzeszutek Wilk
2016-05-31 18:27                 ` George Dunlap
2016-05-31 20:57                   ` Konrad Rzeszutek Wilk
2016-06-03 11:20                     ` George Dunlap
2016-06-03 17:03                       ` Konrad Rzeszutek Wilk
2016-06-07 10:35                 ` George Dunlap
2016-06-07 10:42                   ` M A Young
2016-06-07 10:50                     ` George Dunlap
2016-06-07 11:33                     ` Doug Goldstein
2016-06-07 13:48                       ` George Dunlap
2016-06-07 14:00                     ` Olaf Hering
2016-06-07 14:04                       ` George Dunlap
2016-06-07 14:10                         ` Olaf Hering
2016-06-08 10:20                           ` George Dunlap
2016-06-07 10:43                   ` Jan Beulich
2016-06-07 10:52                     ` M A Young
2016-08-08 14:37                 ` Peng Fan [this message]
2016-08-08 19:22                   ` M A Young
2015-12-01 14:49   ` M A Young

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160808143732.GA6990@linux-7smt.suse \
    --to=van.freenix@gmail.com \
    --cc=JBeulich@suse.com \
    --cc=julien.grall@arm.com \
    --cc=konrad.wilk@oracle.com \
    --cc=m.a.young@durham.ac.uk \
    --cc=marcos.matsunaga@oracle.com \
    --cc=xen-devel@lists.xen.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).