diff mbox series

[XEN,v3,25/25] tools: Remove -Werror everywhere else

Message ID 20220624160422.53457-26-anthony.perard@citrix.com (mailing list archive)
State Superseded
Headers show
Series Toolstack build system improvement, toward non-recursive makefiles | expand

Commit Message

Anthony PERARD June 24, 2022, 4:04 p.m. UTC
Patch "tools: Add -Werror by default to all tools/" have added
"-Werror" to CFLAGS in tools/Rules.mk, remove it from every other
makefiles as it is now duplicated.

Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
---
 tools/console/client/Makefile   | 1 -
 tools/console/daemon/Makefile   | 1 -
 tools/debugger/kdd/Makefile     | 1 -
 tools/flask/utils/Makefile      | 1 -
 tools/fuzz/cpu-policy/Makefile  | 2 +-
 tools/misc/Makefile             | 1 -
 tools/tests/cpu-policy/Makefile | 2 +-
 tools/tests/depriv/Makefile     | 2 +-
 tools/tests/resource/Makefile   | 1 -
 tools/tests/tsx/Makefile        | 1 -
 tools/tests/xenstore/Makefile   | 1 -
 tools/xcutils/Makefile          | 2 --
 tools/xenmon/Makefile           | 1 -
 tools/xenpaging/Makefile        | 1 -
 tools/xenpmd/Makefile           | 1 -
 tools/xentop/Makefile           | 2 +-
 tools/xentrace/Makefile         | 2 --
 tools/xl/Makefile               | 2 +-
 tools/debugger/gdbsx/Rules.mk   | 2 +-
 tools/firmware/Rules.mk         | 2 --
 tools/libfsimage/common.mk      | 2 +-
 tools/libs/libs.mk              | 2 +-
 tools/ocaml/common.make         | 2 +-
 tools/xenstore/Makefile.common  | 1 -
 24 files changed, 9 insertions(+), 27 deletions(-)

Comments

Luca Fancellu June 29, 2022, 8:59 a.m. UTC | #1
+ CC: Stefano Stabellini

> On 24 Jun 2022, at 17:04, Anthony PERARD <anthony.perard@citrix.com> wrote:
> 
> Patch "tools: Add -Werror by default to all tools/" have added
> "-Werror" to CFLAGS in tools/Rules.mk, remove it from every other
> makefiles as it is now duplicated.
> 
> Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>

Hi Anthony,

I will try to review the serie when I manage to have some time, in the mean time I can say the whole
serie builds fine in my Yocto setup on arm64 and x86_64, I’ve tried also the tool stack to
create/destroy/console guests and no problem so far.

The only problem I have is building for arm32 because, I think, this patch does a great job and it
discovers a problem here:

arm-poky-linux-gnueabi-gcc  -mthumb -mfpu=neon -mfloat-abi=hard -mcpu=cortex-a15  --sysroot=/data_sdc1/lucfan01/test_kirkstone_xen/build/xtp-qemu-arm32/tmp/work/cortexa15t2hf-neon-poky-linux-gnueabi/xen-tools/4.17+git1-r0/recipe-sysroot   -marm -DBUILD_ID -fno-strict-aliasing -std=gnu99 -Wall -Wstrict-prototypes -Wdeclaration-after-statement -Wno-unused-but-set-variable -Wno-unused-local-typedefs   -Werror -O2 -fomit-frame-pointer -D__XEN_INTERFACE_VERSION__=__XEN_LATEST_INTERFACE_VERSION__ -MMD -MP -MF .init-dom0less.o.d -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE  -mthumb -mfpu=neon -mfloat-abi=hard -mcpu=cortex-a15 -fstack-protector-strong  -O2 -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security -Werror=format-security  -O2 -pipe -g -feliminate-unused-debug-types -fmacro-prefix-map=/data_sdc1/lucfan01/test_kirkstone_xen/build/xtp-qemu-arm32/tmp/work/cortexa15t2hf-neon-poky-linux-gnueabi/xen-tools/4.17+git1-r0=/usr/src/debug/xen-tools/4.17+git1-r0                      -fdebug-prefix-map=/data_sdc1/lucfan01/test_kirkstone_xen/build/xtp-qemu-arm32/tmp/work/cortexa15t2hf-neon-poky-linux-gnueabi/xen-tools/4.17+git1-r0=/usr/src/debug/xen-tools/4.17+git1-r0                      -fdebug-prefix-map=/data_sdc1/lucfan01/test_kirkstone_xen/build/xtp-qemu-arm32/tmp/work/cortexa15t2hf-neon-poky-linux-gnueabi/xen-tools/4.17+git1-r0/recipe-sysroot=                      -fdebug-prefix-map=/data_sdc1/lucfan01/test_kirkstone_xen/build/xtp-qemu-arm32/tmp/work/cortexa15t2hf-neon-poky-linux-gnueabi/xen-tools/4.17+git1-r0/recipe-sysroot-native=  -I/data_sdc1/lucfan01/test_kirkstone_xen/build/xtp-qemu-arm32/tmp/work/cortexa15t2hf-neon-poky-linux-gnueabi/xen-tools/4.17+git1-r0/local-xen/xen/tools/helpers/../../tools/include -I/data_sdc1/lucfan01/test_kirkstone_xen/build/xtp-qemu-arm32/tmp/work/cortexa15t2hf-neon-poky-linux-gnueabi/xen-tools/4.17+git1-r0/local-xen/xen/tools/helpers/../../tools/include -I/data_sdc1/lucfan01/test_kirkstone_xen/build/xtp-qemu-arm32/tmp/work/cortexa15t2hf-neon-poky-linux-gnueabi/xen-tools/4.17+git1-r0/local-xen/xen/tools/helpers/../../tools/include -I/data_sdc1/lucfan01/test_kirkstone_xen/build/xtp-qemu-arm32/tmp/work/cortexa15t2hf-neon-poky-linux-gnueabi/xen-tools/4.17+git1-r0/local-xen/xen/tools/helpers/../../tools/include -D__XEN_TOOLS__ -I/data_sdc1/lucfan01/test_kirkstone_xen/build/xtp-qemu-arm32/tmp/work/cortexa15t2hf-neon-poky-linux-gnueabi/xen-tools/4.17+git1-r0/local-xen/xen/tools/helpers/../../tools/include -D__XEN_TOOLS__ -I/data_sdc1/lucfan01/test_kirkstone_xen/build/xtp-qemu-arm32/tmp/work/cortexa15t2hf-neon-poky-linux-gnueabi/xen-tools/4.17+git1-r0/local-xen/xen/tools/helpers/../../tools/include  -c -o init-dom0less.o init-dom0less.c 
init-dom0less.c: In function 'create_xenstore':
init-dom0less.c:141:53: error: format '%lu' expects argument of type 'long unsigned int', but argument 4 has type 'uint64_t' {aka 'long long unsigned int'} [-Werror=format=]
  141 |     rc = snprintf(max_memkb_str, STR_MAX_LENGTH, "%lu", info->max_memkb);
      |                                                   ~~^   ~~~~~~~~~~~~~~~
      |                                                     |       |
      |                                                     |       uint64_t {aka long long unsigned int}
      |                                                     long unsigned int
      |                                                   %llu
init-dom0less.c:144:56: error: format '%lu' expects argument of type 'long unsigned int', but argument 4 has type 'uint64_t' {aka 'long long unsigned int'} [-Werror=format=]
  144 |     rc = snprintf(target_memkb_str, STR_MAX_LENGTH, "%lu", info->current_memkb);
      |                                                      ~~^   ~~~~~~~~~~~~~~~~~~~
      |                                                        |       |
      |                                                        |       uint64_t {aka long long unsigned int}
      |                                                        long unsigned int
      |                                                      %llu
      

Won’t be too difficult to fix, if I have time I will do it, otherwise if someone wants to do it’s fine for me.

Cheers,
Luca
Jürgen Groß June 29, 2022, 10:31 a.m. UTC | #2
On 24.06.22 18:04, Anthony PERARD wrote:
> Patch "tools: Add -Werror by default to all tools/" have added
> "-Werror" to CFLAGS in tools/Rules.mk, remove it from every other
> makefiles as it is now duplicated.
> 
> Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>

Reviewed-by: Juergen Gross <jgross@suse.com>


Juergen
Stefano Stabellini June 29, 2022, 5:22 p.m. UTC | #3
On Wed, 29 Jun 2022, Luca Fancellu wrote:
> + CC: Stefano Stabellini
> 
> > On 24 Jun 2022, at 17:04, Anthony PERARD <anthony.perard@citrix.com> wrote:
> > 
> > Patch "tools: Add -Werror by default to all tools/" have added
> > "-Werror" to CFLAGS in tools/Rules.mk, remove it from every other
> > makefiles as it is now duplicated.
> > 
> > Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
> 
> Hi Anthony,
> 
> I will try to review the serie when I manage to have some time, in the mean time I can say the whole
> serie builds fine in my Yocto setup on arm64 and x86_64, I’ve tried also the tool stack to
> create/destroy/console guests and no problem so far.
> 
> The only problem I have is building for arm32 because, I think, this patch does a great job and it
> discovers a problem here:

That reminds me that we only have arm32 Xen hypervisor builds in
gitlab-ci, we don't have any arm32 Xen tools builds. I'll add it to my
TODO but if someone (not necessarily Luca) has some spare time it could
be a nice project. It could be done with Yocto by adding a Yocto build
container to automation/build/.
Bertrand Marquis June 30, 2022, 7:33 a.m. UTC | #4
Hi Stefano,

> On 29 Jun 2022, at 18:22, Stefano Stabellini <sstabellini@kernel.org> wrote:
> 
> On Wed, 29 Jun 2022, Luca Fancellu wrote:
>> + CC: Stefano Stabellini
>> 
>>> On 24 Jun 2022, at 17:04, Anthony PERARD <anthony.perard@citrix.com> wrote:
>>> 
>>> Patch "tools: Add -Werror by default to all tools/" have added
>>> "-Werror" to CFLAGS in tools/Rules.mk, remove it from every other
>>> makefiles as it is now duplicated.
>>> 
>>> Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
>> 
>> Hi Anthony,
>> 
>> I will try to review the serie when I manage to have some time, in the mean time I can say the whole
>> serie builds fine in my Yocto setup on arm64 and x86_64, I’ve tried also the tool stack to
>> create/destroy/console guests and no problem so far.
>> 
>> The only problem I have is building for arm32 because, I think, this patch does a great job and it
>> discovers a problem here:
> 
> That reminds me that we only have arm32 Xen hypervisor builds in
> gitlab-ci, we don't have any arm32 Xen tools builds. I'll add it to my
> TODO but if someone (not necessarily Luca) has some spare time it could
> be a nice project. It could be done with Yocto by adding a Yocto build
> container to automation/build/.

We have now a way to build and run xen for arm32 on qemu using Yocto.
We are using this internally and also will test Xen with guests on arm32 using this soon.

I am upstreaming to meta-virtualisation all the fixes needed for that so it should be fairly straight forward do reproduce this in Yocto build in a container.

Please tell me what you need and I will try to provide you a set of scripts or instructions do reproduce that on gitlab.

Cheers
Bertrand
Stefano Stabellini June 30, 2022, 9:03 p.m. UTC | #5
On Thu, 30 Jun 2022, Bertrand Marquis wrote:
> > On 29 Jun 2022, at 18:22, Stefano Stabellini <sstabellini@kernel.org> wrote:
> > 
> > On Wed, 29 Jun 2022, Luca Fancellu wrote:
> >> + CC: Stefano Stabellini
> >> 
> >>> On 24 Jun 2022, at 17:04, Anthony PERARD <anthony.perard@citrix.com> wrote:
> >>> 
> >>> Patch "tools: Add -Werror by default to all tools/" have added
> >>> "-Werror" to CFLAGS in tools/Rules.mk, remove it from every other
> >>> makefiles as it is now duplicated.
> >>> 
> >>> Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
> >> 
> >> Hi Anthony,
> >> 
> >> I will try to review the serie when I manage to have some time, in the mean time I can say the whole
> >> serie builds fine in my Yocto setup on arm64 and x86_64, I’ve tried also the tool stack to
> >> create/destroy/console guests and no problem so far.
> >> 
> >> The only problem I have is building for arm32 because, I think, this patch does a great job and it
> >> discovers a problem here:
> > 
> > That reminds me that we only have arm32 Xen hypervisor builds in
> > gitlab-ci, we don't have any arm32 Xen tools builds. I'll add it to my
> > TODO but if someone (not necessarily Luca) has some spare time it could
> > be a nice project. It could be done with Yocto by adding a Yocto build
> > container to automation/build/.
> 
> We have now a way to build and run xen for arm32 on qemu using Yocto.
> We are using this internally and also will test Xen with guests on arm32 using this soon.
> 
> I am upstreaming to meta-virtualisation all the fixes needed for that so it should be fairly straight forward do reproduce this in Yocto build in a container.
> 
> Please tell me what you need and I will try to provide you a set of scripts or instructions do reproduce that on gitlab.

That would be great!

We need two things:

- a Yocto build container
- a build script


The build container would be something like:
automation/build/debian/unstable-arm64v8.dockerfile. It is a Dockerfile
to create a container with Yocto and all required dependencies. It could
be based on Debian arm64. The build container is only built once and
pushed to the gitlab registry, but it is executed every time a gitlab
pipeline is started.

We probably want the meta layers to be pulled as part of the build
container build (git clone from the Dockerfile) because otherwise we
would end up git cloining them every time we run a gitlab-ci pipeline,
slowing everything down.


The build script is the script executed in the build container for every
pipeline.

Imagine you have a container "yocto-arm32", basically we want to do:

# docker run yocto-arm32 build.script

where build.script is the script that actually triggers the Xen build
and produces the binary output.

The current build script is automation/scripts/build; it is used for all
build containers (all of them, from Debian to Fedora and Alpine) but it
is probably not suitable to be used for Yocto.  It simply calls
./configure; make; make install. It is more for normal distros.

I imagine that the build script for Yocto would call bitbake.


With the build container Dockerfile and the build script it becomes
very simple to add Yocto arm32 to gitlab-ci.

I realize that the actual build could be done on both arm64 or x86.
Currently the arm32 hypervisor-only cross-build is done on x86. See
automation/build/debian/unstable-arm32-gcc.dockerfile. Either way is OK.
Bertrand Marquis July 1, 2022, 1:26 p.m. UTC | #6
Hi Stefano,

> On 30 Jun 2022, at 22:03, Stefano Stabellini <sstabellini@kernel.org> wrote:
> 
> On Thu, 30 Jun 2022, Bertrand Marquis wrote:
>>> On 29 Jun 2022, at 18:22, Stefano Stabellini <sstabellini@kernel.org> wrote:
>>> 
>>> On Wed, 29 Jun 2022, Luca Fancellu wrote:
>>>> + CC: Stefano Stabellini
>>>> 
>>>>> On 24 Jun 2022, at 17:04, Anthony PERARD <anthony.perard@citrix.com> wrote:
>>>>> 
>>>>> Patch "tools: Add -Werror by default to all tools/" have added
>>>>> "-Werror" to CFLAGS in tools/Rules.mk, remove it from every other
>>>>> makefiles as it is now duplicated.
>>>>> 
>>>>> Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
>>>> 
>>>> Hi Anthony,
>>>> 
>>>> I will try to review the serie when I manage to have some time, in the mean time I can say the whole
>>>> serie builds fine in my Yocto setup on arm64 and x86_64, I’ve tried also the tool stack to
>>>> create/destroy/console guests and no problem so far.
>>>> 
>>>> The only problem I have is building for arm32 because, I think, this patch does a great job and it
>>>> discovers a problem here:
>>> 
>>> That reminds me that we only have arm32 Xen hypervisor builds in
>>> gitlab-ci, we don't have any arm32 Xen tools builds. I'll add it to my
>>> TODO but if someone (not necessarily Luca) has some spare time it could
>>> be a nice project. It could be done with Yocto by adding a Yocto build
>>> container to automation/build/.
>> 
>> We have now a way to build and run xen for arm32 on qemu using Yocto.
>> We are using this internally and also will test Xen with guests on arm32 using this soon.
>> 
>> I am upstreaming to meta-virtualisation all the fixes needed for that so it should be fairly straight forward do reproduce this in Yocto build in a container.
>> 
>> Please tell me what you need and I will try to provide you a set of scripts or instructions do reproduce that on gitlab.
> 
> That would be great!
> 
> We need two things:
> 
> - a Yocto build container
> - a build script
> 
> 
> The build container would be something like:
> automation/build/debian/unstable-arm64v8.dockerfile. It is a Dockerfile
> to create a container with Yocto and all required dependencies. It could
> be based on Debian arm64. The build container is only built once and
> pushed to the gitlab registry, but it is executed every time a gitlab
> pipeline is started.
> 
> We probably want the meta layers to be pulled as part of the build
> container build (git clone from the Dockerfile) because otherwise we
> would end up git cloining them every time we run a gitlab-ci pipeline,
> slowing everything down.
> 
> 
> The build script is the script executed in the build container for every
> pipeline.
> 
> Imagine you have a container "yocto-arm32", basically we want to do:
> 
> # docker run yocto-arm32 build.script
> 
> where build.script is the script that actually triggers the Xen build
> and produces the binary output.
> 
> The current build script is automation/scripts/build; it is used for all
> build containers (all of them, from Debian to Fedora and Alpine) but it
> is probably not suitable to be used for Yocto.  It simply calls
> ./configure; make; make install. It is more for normal distros.
> 
> I imagine that the build script for Yocto would call bitbake.
> 
> 
> With the build container Dockerfile and the build script it becomes
> very simple to add Yocto arm32 to gitlab-ci.
> 
> I realize that the actual build could be done on both arm64 or x86.
> Currently the arm32 hypervisor-only cross-build is done on x86. See
> automation/build/debian/unstable-arm32-gcc.dockerfile. Either way is OK.

I will work on that and I think we can take this discussion offline as there are some elements missing right now (like where is the xen tree to test).

Cheers
Bertrand
Stefano Stabellini July 1, 2022, 5:47 p.m. UTC | #7
On Fri, 1 Jul 2022, Bertrand Marquis wrote:
> > On 30 Jun 2022, at 22:03, Stefano Stabellini <sstabellini@kernel.org> wrote:
> > 
> > On Thu, 30 Jun 2022, Bertrand Marquis wrote:
> >>> On 29 Jun 2022, at 18:22, Stefano Stabellini <sstabellini@kernel.org> wrote:
> >>> 
> >>> On Wed, 29 Jun 2022, Luca Fancellu wrote:
> >>>> + CC: Stefano Stabellini
> >>>> 
> >>>>> On 24 Jun 2022, at 17:04, Anthony PERARD <anthony.perard@citrix.com> wrote:
> >>>>> 
> >>>>> Patch "tools: Add -Werror by default to all tools/" have added
> >>>>> "-Werror" to CFLAGS in tools/Rules.mk, remove it from every other
> >>>>> makefiles as it is now duplicated.
> >>>>> 
> >>>>> Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
> >>>> 
> >>>> Hi Anthony,
> >>>> 
> >>>> I will try to review the serie when I manage to have some time, in the mean time I can say the whole
> >>>> serie builds fine in my Yocto setup on arm64 and x86_64, I’ve tried also the tool stack to
> >>>> create/destroy/console guests and no problem so far.
> >>>> 
> >>>> The only problem I have is building for arm32 because, I think, this patch does a great job and it
> >>>> discovers a problem here:
> >>> 
> >>> That reminds me that we only have arm32 Xen hypervisor builds in
> >>> gitlab-ci, we don't have any arm32 Xen tools builds. I'll add it to my
> >>> TODO but if someone (not necessarily Luca) has some spare time it could
> >>> be a nice project. It could be done with Yocto by adding a Yocto build
> >>> container to automation/build/.
> >> 
> >> We have now a way to build and run xen for arm32 on qemu using Yocto.
> >> We are using this internally and also will test Xen with guests on arm32 using this soon.
> >> 
> >> I am upstreaming to meta-virtualisation all the fixes needed for that so it should be fairly straight forward do reproduce this in Yocto build in a container.
> >> 
> >> Please tell me what you need and I will try to provide you a set of scripts or instructions do reproduce that on gitlab.
> > 
> > That would be great!
> > 
> > We need two things:
> > 
> > - a Yocto build container
> > - a build script
> > 
> > 
> > The build container would be something like:
> > automation/build/debian/unstable-arm64v8.dockerfile. It is a Dockerfile
> > to create a container with Yocto and all required dependencies. It could
> > be based on Debian arm64. The build container is only built once and
> > pushed to the gitlab registry, but it is executed every time a gitlab
> > pipeline is started.
> > 
> > We probably want the meta layers to be pulled as part of the build
> > container build (git clone from the Dockerfile) because otherwise we
> > would end up git cloining them every time we run a gitlab-ci pipeline,
> > slowing everything down.
> > 
> > 
> > The build script is the script executed in the build container for every
> > pipeline.
> > 
> > Imagine you have a container "yocto-arm32", basically we want to do:
> > 
> > # docker run yocto-arm32 build.script
> > 
> > where build.script is the script that actually triggers the Xen build
> > and produces the binary output.
> > 
> > The current build script is automation/scripts/build; it is used for all
> > build containers (all of them, from Debian to Fedora and Alpine) but it
> > is probably not suitable to be used for Yocto.  It simply calls
> > ./configure; make; make install. It is more for normal distros.
> > 
> > I imagine that the build script for Yocto would call bitbake.
> > 
> > 
> > With the build container Dockerfile and the build script it becomes
> > very simple to add Yocto arm32 to gitlab-ci.
> > 
> > I realize that the actual build could be done on both arm64 or x86.
> > Currently the arm32 hypervisor-only cross-build is done on x86. See
> > automation/build/debian/unstable-arm32-gcc.dockerfile. Either way is OK.
> 
> I will work on that and I think we can take this discussion offline as there are some elements missing right now (like where is the xen tree to test).

No problem, I am happy to help offline as well. The Xen tree is given to
you automatically by gitlab-ci (because it is the repository with the
.gitlab* yaml files.) The build container starts execution with the Xen
repository to test ready inside.
diff mbox series

Patch

diff --git a/tools/console/client/Makefile b/tools/console/client/Makefile
index e2f2554f92..62d89fdeb9 100644
--- a/tools/console/client/Makefile
+++ b/tools/console/client/Makefile
@@ -1,7 +1,6 @@ 
 XEN_ROOT=$(CURDIR)/../../..
 include $(XEN_ROOT)/tools/Rules.mk
 
-CFLAGS += -Werror
 CFLAGS += $(CFLAGS_libxenctrl)
 CFLAGS += $(CFLAGS_libxenstore)
 CFLAGS += -include $(XEN_ROOT)/tools/config.h
diff --git a/tools/console/daemon/Makefile b/tools/console/daemon/Makefile
index 99bb33b6a2..9fc3b6711f 100644
--- a/tools/console/daemon/Makefile
+++ b/tools/console/daemon/Makefile
@@ -1,7 +1,6 @@ 
 XEN_ROOT=$(CURDIR)/../../..
 include $(XEN_ROOT)/tools/Rules.mk
 
-CFLAGS += -Werror
 CFLAGS += $(CFLAGS_libxenctrl)
 CFLAGS += $(CFLAGS_libxenstore)
 CFLAGS += $(CFLAGS_libxenevtchn)
diff --git a/tools/debugger/kdd/Makefile b/tools/debugger/kdd/Makefile
index 26116949d4..a72ad3b1e0 100644
--- a/tools/debugger/kdd/Makefile
+++ b/tools/debugger/kdd/Makefile
@@ -1,7 +1,6 @@ 
 XEN_ROOT = $(CURDIR)/../../..
 include $(XEN_ROOT)/tools/Rules.mk
 
-CFLAGS  += -Werror
 CFLAGS  += $(CFLAGS_libxenctrl)
 CFLAGS  += -DXC_WANT_COMPAT_MAP_FOREIGN_API
 LDLIBS  += $(LDLIBS_libxenctrl)
diff --git a/tools/flask/utils/Makefile b/tools/flask/utils/Makefile
index 6be134142a..88d7edb6b1 100644
--- a/tools/flask/utils/Makefile
+++ b/tools/flask/utils/Makefile
@@ -1,7 +1,6 @@ 
 XEN_ROOT=$(CURDIR)/../../..
 include $(XEN_ROOT)/tools/Rules.mk
 
-CFLAGS += -Werror
 CFLAGS += $(CFLAGS_libxenctrl)
 
 TARGETS := flask-loadpolicy flask-setenforce flask-getenforce flask-label-pci flask-get-bool flask-set-bool
diff --git a/tools/fuzz/cpu-policy/Makefile b/tools/fuzz/cpu-policy/Makefile
index 41a2230408..6e7743e0aa 100644
--- a/tools/fuzz/cpu-policy/Makefile
+++ b/tools/fuzz/cpu-policy/Makefile
@@ -17,7 +17,7 @@  install: all
 
 .PHONY: uninstall
 
-CFLAGS += -Werror $(CFLAGS_xeninclude) -D__XEN_TOOLS__
+CFLAGS += $(CFLAGS_xeninclude) -D__XEN_TOOLS__
 CFLAGS += $(APPEND_CFLAGS) -Og
 
 vpath %.c ../../../xen/lib/x86
diff --git a/tools/misc/Makefile b/tools/misc/Makefile
index 0e02401227..1c6e1d6a04 100644
--- a/tools/misc/Makefile
+++ b/tools/misc/Makefile
@@ -1,7 +1,6 @@ 
 XEN_ROOT=$(CURDIR)/../..
 include $(XEN_ROOT)/tools/Rules.mk
 
-CFLAGS += -Werror
 # Include configure output (config.h)
 CFLAGS += -include $(XEN_ROOT)/tools/config.h
 CFLAGS += $(CFLAGS_libxenevtchn)
diff --git a/tools/tests/cpu-policy/Makefile b/tools/tests/cpu-policy/Makefile
index 93af9d76fa..c5b81afc71 100644
--- a/tools/tests/cpu-policy/Makefile
+++ b/tools/tests/cpu-policy/Makefile
@@ -36,7 +36,7 @@  install: all
 uninstall:
 	$(RM) -- $(addprefix $(DESTDIR)$(LIBEXEC_BIN)/,$(TARGETS))
 
-CFLAGS += -Werror -D__XEN_TOOLS__
+CFLAGS += -D__XEN_TOOLS__
 CFLAGS += $(CFLAGS_xeninclude)
 CFLAGS += $(APPEND_CFLAGS)
 
diff --git a/tools/tests/depriv/Makefile b/tools/tests/depriv/Makefile
index 3cba28da25..7d9e3b01bb 100644
--- a/tools/tests/depriv/Makefile
+++ b/tools/tests/depriv/Makefile
@@ -1,7 +1,7 @@ 
 XEN_ROOT=$(CURDIR)/../../..
 include $(XEN_ROOT)/tools/Rules.mk
 
-CFLAGS += -Werror -Wno-declaration-after-statement
+CFLAGS += -Wno-declaration-after-statement
 
 CFLAGS += $(CFLAGS_xeninclude)
 CFLAGS += $(CFLAGS_libxenctrl)
diff --git a/tools/tests/resource/Makefile b/tools/tests/resource/Makefile
index b3cd70c06d..a5856bf095 100644
--- a/tools/tests/resource/Makefile
+++ b/tools/tests/resource/Makefile
@@ -27,7 +27,6 @@  install: all
 uninstall:
 	$(RM) -- $(DESTDIR)$(LIBEXEC_BIN)/$(TARGET)
 
-CFLAGS += -Werror
 CFLAGS += $(CFLAGS_xeninclude)
 CFLAGS += $(CFLAGS_libxenctrl)
 CFLAGS += $(CFLAGS_libxenforeginmemory)
diff --git a/tools/tests/tsx/Makefile b/tools/tests/tsx/Makefile
index d7d2a5d95e..a4f516b725 100644
--- a/tools/tests/tsx/Makefile
+++ b/tools/tests/tsx/Makefile
@@ -26,7 +26,6 @@  uninstall:
 .PHONY: uninstall
 uninstall:
 
-CFLAGS += -Werror
 CFLAGS += -I$(XEN_ROOT)/tools/libs/ctrl -I$(XEN_ROOT)/tools/libs/guest
 CFLAGS += $(CFLAGS_xeninclude)
 CFLAGS += $(CFLAGS_libxenctrl)
diff --git a/tools/tests/xenstore/Makefile b/tools/tests/xenstore/Makefile
index 239e1dce47..202dda0d3c 100644
--- a/tools/tests/xenstore/Makefile
+++ b/tools/tests/xenstore/Makefile
@@ -27,7 +27,6 @@  install: all
 uninstall:
 	$(RM) -- $(addprefix $(DESTDIR)$(LIBEXEC_BIN)/,$(TARGETS))
 
-CFLAGS += -Werror
 CFLAGS += $(CFLAGS_libxenstore)
 CFLAGS += $(APPEND_CFLAGS)
 
diff --git a/tools/xcutils/Makefile b/tools/xcutils/Makefile
index e40a2c4bfa..3687f6cd8f 100644
--- a/tools/xcutils/Makefile
+++ b/tools/xcutils/Makefile
@@ -13,8 +13,6 @@  include $(XEN_ROOT)/tools/Rules.mk
 
 TARGETS := readnotes lsevtchn
 
-CFLAGS += -Werror
-
 CFLAGS_readnotes.o  := $(CFLAGS_libxenevtchn) $(CFLAGS_libxenctrl) $(CFLAGS_libxenguest)
 CFLAGS_lsevtchn.o   := $(CFLAGS_libxenevtchn) $(CFLAGS_libxenctrl)
 
diff --git a/tools/xenmon/Makefile b/tools/xenmon/Makefile
index 3e150b0659..679c4b41a3 100644
--- a/tools/xenmon/Makefile
+++ b/tools/xenmon/Makefile
@@ -13,7 +13,6 @@ 
 XEN_ROOT=$(CURDIR)/../..
 include $(XEN_ROOT)/tools/Rules.mk
 
-CFLAGS  += -Werror
 CFLAGS  += $(CFLAGS_libxenevtchn)
 CFLAGS  += $(CFLAGS_libxenctrl)
 LDLIBS  += $(LDLIBS_libxenctrl)
diff --git a/tools/xenpaging/Makefile b/tools/xenpaging/Makefile
index e2ed9eaa3f..835cf2b965 100644
--- a/tools/xenpaging/Makefile
+++ b/tools/xenpaging/Makefile
@@ -12,7 +12,6 @@  OBJS-y   += xenpaging.o
 OBJS-y   += policy_$(POLICY).o
 OBJS-y   += pagein.o
 
-CFLAGS   += -Werror
 CFLAGS   += -Wno-unused
 
 TARGETS := xenpaging
diff --git a/tools/xenpmd/Makefile b/tools/xenpmd/Makefile
index e0d3f06ab2..8da20510b5 100644
--- a/tools/xenpmd/Makefile
+++ b/tools/xenpmd/Makefile
@@ -1,7 +1,6 @@ 
 XEN_ROOT=$(CURDIR)/../..
 include $(XEN_ROOT)/tools/Rules.mk
 
-CFLAGS += -Werror
 CFLAGS += $(CFLAGS_libxenstore)
 
 LDLIBS += $(LDLIBS_libxenstore)
diff --git a/tools/xentop/Makefile b/tools/xentop/Makefile
index 7bd96f34d5..70cc2211c5 100644
--- a/tools/xentop/Makefile
+++ b/tools/xentop/Makefile
@@ -13,7 +13,7 @@ 
 XEN_ROOT=$(CURDIR)/../..
 include $(XEN_ROOT)/tools/Rules.mk
 
-CFLAGS += -DGCC_PRINTF -Werror $(CFLAGS_libxenstat)
+CFLAGS += -DGCC_PRINTF $(CFLAGS_libxenstat)
 LDLIBS += $(LDLIBS_libxenstat) $(CURSES_LIBS) $(TINFO_LIBS) $(SOCKET_LIBS) -lm
 CFLAGS += -DHOST_$(XEN_OS)
 
diff --git a/tools/xentrace/Makefile b/tools/xentrace/Makefile
index 0995fa9203..b188ba70d6 100644
--- a/tools/xentrace/Makefile
+++ b/tools/xentrace/Makefile
@@ -1,8 +1,6 @@ 
 XEN_ROOT=$(CURDIR)/../..
 include $(XEN_ROOT)/tools/Rules.mk
 
-CFLAGS += -Werror
-
 CFLAGS += $(CFLAGS_libxenevtchn)
 CFLAGS += $(CFLAGS_libxenctrl)
 LDLIBS += $(LDLIBS_libxenevtchn)
diff --git a/tools/xl/Makefile b/tools/xl/Makefile
index b7f439121a..5f7aa5f46c 100644
--- a/tools/xl/Makefile
+++ b/tools/xl/Makefile
@@ -5,7 +5,7 @@ 
 XEN_ROOT = $(CURDIR)/../..
 include $(XEN_ROOT)/tools/Rules.mk
 
-CFLAGS += -Werror -Wno-format-zero-length -Wmissing-declarations \
+CFLAGS += -Wno-format-zero-length -Wmissing-declarations \
 	-Wno-declaration-after-statement -Wformat-nonliteral
 CFLAGS += -fPIC
 
diff --git a/tools/debugger/gdbsx/Rules.mk b/tools/debugger/gdbsx/Rules.mk
index 920f1c87fb..0610db873b 100644
--- a/tools/debugger/gdbsx/Rules.mk
+++ b/tools/debugger/gdbsx/Rules.mk
@@ -1,6 +1,6 @@ 
 include $(XEN_ROOT)/tools/Rules.mk
 
-CFLAGS   += -Werror -Wmissing-prototypes 
+CFLAGS   += -Wmissing-prototypes 
 # (gcc 4.3x and later)   -Wconversion -Wno-sign-conversion
 
 CFLAGS-$(clang) += -Wno-ignored-attributes
diff --git a/tools/firmware/Rules.mk b/tools/firmware/Rules.mk
index 278cca01e4..d3482c9ec4 100644
--- a/tools/firmware/Rules.mk
+++ b/tools/firmware/Rules.mk
@@ -11,8 +11,6 @@  ifneq ($(debug),y)
 CFLAGS += -DNDEBUG
 endif
 
-CFLAGS += -Werror
-
 $(call cc-options-add,CFLAGS,CC,$(EMBEDDED_EXTRA_CFLAGS))
 
 $(call cc-option-add,CFLAGS,CC,-fcf-protection=none)
diff --git a/tools/libfsimage/common.mk b/tools/libfsimage/common.mk
index 77bc957f27..4fc8c66795 100644
--- a/tools/libfsimage/common.mk
+++ b/tools/libfsimage/common.mk
@@ -2,7 +2,7 @@  include $(XEN_ROOT)/tools/Rules.mk
 
 FSDIR := $(libdir)/xenfsimage
 CFLAGS += -Wno-unknown-pragmas -I$(XEN_ROOT)/tools/libfsimage/common/ -DFSIMAGE_FSDIR=\"$(FSDIR)\"
-CFLAGS += -Werror -D_GNU_SOURCE
+CFLAGS += -D_GNU_SOURCE
 LDFLAGS += -L../common/
 
 PIC_OBJS = $(patsubst %.c,%.opic,$(LIB_SRCS-y))
diff --git a/tools/libs/libs.mk b/tools/libs/libs.mk
index 2b8e7a6128..e47fb30ed4 100644
--- a/tools/libs/libs.mk
+++ b/tools/libs/libs.mk
@@ -14,7 +14,7 @@  MINOR ?= 0
 
 SHLIB_LDFLAGS += -Wl,--version-script=libxen$(LIBNAME).map
 
-CFLAGS   += -Werror -Wmissing-prototypes
+CFLAGS   += -Wmissing-prototypes
 CFLAGS   += $(CFLAGS_xeninclude)
 CFLAGS   += $(foreach lib, $(USELIBS_$(LIBNAME)), $(CFLAGS_libxen$(lib)))
 
diff --git a/tools/ocaml/common.make b/tools/ocaml/common.make
index d5478f626f..0c8a597d5b 100644
--- a/tools/ocaml/common.make
+++ b/tools/ocaml/common.make
@@ -9,7 +9,7 @@  OCAMLLEX ?= ocamllex
 OCAMLYACC ?= ocamlyacc
 OCAMLFIND ?= ocamlfind
 
-CFLAGS += -fPIC -Werror -I$(shell ocamlc -where)
+CFLAGS += -fPIC -I$(shell ocamlc -where)
 
 OCAMLOPTFLAG_G := $(shell $(OCAMLOPT) -h 2>&1 | sed -n 's/^  *\(-g\) .*/\1/p')
 OCAMLOPTFLAGS = $(OCAMLOPTFLAG_G) -ccopt "$(LDFLAGS)" -dtypes $(OCAMLINCLUDE) -cc $(CC) -w F -warn-error F
diff --git a/tools/xenstore/Makefile.common b/tools/xenstore/Makefile.common
index 21b78b0538..ddbac052ac 100644
--- a/tools/xenstore/Makefile.common
+++ b/tools/xenstore/Makefile.common
@@ -9,7 +9,6 @@  XENSTORED_OBJS-$(CONFIG_NetBSD) += xenstored_posix.o
 XENSTORED_OBJS-$(CONFIG_FreeBSD) += xenstored_posix.o
 XENSTORED_OBJS-$(CONFIG_MiniOS) += xenstored_minios.o
 
-CFLAGS += -Werror
 # Include configure output (config.h)
 CFLAGS += -include $(XEN_ROOT)/tools/config.h
 CFLAGS += -I./include