[XEN PATCH for-4.17] tools: Workaround wrong use of tools/Rules.mk by qemu-trad

Anthony PERARD posted 1 patch 1 year, 6 months ago
Test gitlab-ci failed
Patches applied successfully (tree, apply log)
git fetch https://gitlab.com/xen-project/patchew/xen tags/patchew/20221017103403.63218-1-anthony.perard@citrix.com
tools/Makefile | 1 +
tools/Rules.mk | 3 +++
2 files changed, 4 insertions(+)
[XEN PATCH for-4.17] tools: Workaround wrong use of tools/Rules.mk by qemu-trad
Posted by Anthony PERARD 1 year, 6 months ago
qemu-trad build system, when built from xen.git, will make use of
Rules.mk (setup via qemu-trad.git/xen-setup). This mean that changes
to Rules.mk will have an impact our ability to build qemu-trad.

Recent commit e4f5949c4466 ("tools: Add -Werror by default to all
tools/") have added "-Werror" to the CFLAGS and qemu-trad start to use
it. But this fails and there's lots of warning that are now turned
into error.

We should teach qemu-trad and xen.git to not have to use Rules.mk when
building qemu-trad, but for now, avoid adding -Werror to CFLAGS when
building qemu-trad.

Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
---

Notes:
    for 4.17:
        - fix the build, as detected by the push-gate

 tools/Makefile | 1 +
 tools/Rules.mk | 3 +++
 2 files changed, 4 insertions(+)

diff --git a/tools/Makefile b/tools/Makefile
index 0c1d8b64a4..9e28027835 100644
--- a/tools/Makefile
+++ b/tools/Makefile
@@ -159,6 +159,7 @@ qemu-traditional-recurse = \
 	set -e; \
 		$(buildmakevars2shellvars); \
 		export CONFIG_BLKTAP1=n; \
+		export BUILDING_QEMU_TRAD=y; \
 		cd qemu-xen-traditional-dir; \
 		$(1)
 
diff --git a/tools/Rules.mk b/tools/Rules.mk
index 34d495fff7..6e135387bd 100644
--- a/tools/Rules.mk
+++ b/tools/Rules.mk
@@ -141,9 +141,12 @@ endif
 
 CFLAGS_libxenlight += $(CFLAGS_libxenctrl)
 
+# Don't add -Werror if we are used by qemu-trad build system.
+ifndef BUILDING_QEMU_TRAD
 ifeq ($(CONFIG_WERROR),y)
 CFLAGS += -Werror
 endif
+endif
 
 ifeq ($(debug),y)
 # Use -Og if available, -O0 otherwise
-- 
Anthony PERARD
Re: [XEN PATCH for-4.17] tools: Workaround wrong use of tools/Rules.mk by qemu-trad
Posted by Andrew Cooper 1 year, 6 months ago
On 17/10/2022 11:34, Anthony PERARD wrote:
> qemu-trad build system, when built from xen.git, will make use of
> Rules.mk (setup via qemu-trad.git/xen-setup). This mean that changes
> to Rules.mk will have an impact our ability to build qemu-trad.
>
> Recent commit e4f5949c4466 ("tools: Add -Werror by default to all
> tools/") have added "-Werror" to the CFLAGS and qemu-trad start to use
> it. But this fails and there's lots of warning that are now turned
> into error.
>
> We should teach qemu-trad and xen.git to not have to use Rules.mk when
> building qemu-trad, but for now, avoid adding -Werror to CFLAGS when
> building qemu-trad.
>
> Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>

Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>

qemu-trad is a very obsolete codebase.  We don't want to have to be
fixing it up to compile with new compilers.
RE: [XEN PATCH for-4.17] tools: Workaround wrong use of tools/Rules.mk by qemu-trad
Posted by Henry Wang 1 year, 6 months ago
Hi,

> -----Original Message-----
> From: Andrew Cooper <Andrew.Cooper3@citrix.com>
> Subject: Re: [XEN PATCH for-4.17] tools: Workaround wrong use of
> tools/Rules.mk by qemu-trad
> 
> On 17/10/2022 11:34, Anthony PERARD wrote:
> > qemu-trad build system, when built from xen.git, will make use of
> > Rules.mk (setup via qemu-trad.git/xen-setup). This mean that changes
> > to Rules.mk will have an impact our ability to build qemu-trad.
> >
> > Recent commit e4f5949c4466 ("tools: Add -Werror by default to all
> > tools/") have added "-Werror" to the CFLAGS and qemu-trad start to use
> > it. But this fails and there's lots of warning that are now turned
> > into error.
> >
> > We should teach qemu-trad and xen.git to not have to use Rules.mk when
> > building qemu-trad, but for now, avoid adding -Werror to CFLAGS when
> > building qemu-trad.
> >
> > Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
> 
> Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>

Release-acked-by: Henry Wang <Henry.Wang@arm.com>

Kind regards,
Henry


> 
> qemu-trad is a very obsolete codebase.  We don't want to have to be
> fixing it up to compile with new compilers.