From patchwork Thu Oct 13 13:05:00 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anthony PERARD X-Patchwork-Id: 13005951 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 15F6DC43217 for ; Thu, 13 Oct 2022 13:05:44 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.422020.667812 (Exim 4.92) (envelope-from ) id 1oixty-0002Aq-S1; Thu, 13 Oct 2022 13:05:30 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 422020.667812; Thu, 13 Oct 2022 13:05:30 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1oixty-0002Aj-Ow; Thu, 13 Oct 2022 13:05:30 +0000 Received: by outflank-mailman (input) for mailman id 422020; Thu, 13 Oct 2022 13:05:29 +0000 Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50] helo=se1-gles-flk1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1oixtx-0001tl-1N for xen-devel@lists.xenproject.org; Thu, 13 Oct 2022 13:05:29 +0000 Received: from esa2.hc3370-68.iphmx.com (esa2.hc3370-68.iphmx.com [216.71.145.153]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id a7653bf6-4af7-11ed-8fd0-01056ac49cbb; Thu, 13 Oct 2022 15:05:06 +0200 (CEST) X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: a7653bf6-4af7-11ed-8fd0-01056ac49cbb DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=citrix.com; s=securemail; t=1665666327; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=uMtbT9OvCCyn0S146BCICiBUUfTxeCiBwu/GDB4z7hw=; b=Lssi63DSGjkrj0ROCCgtI1fB7YmXSPxdlFhArEI47GMJ9O3jgn9t02sb 9sUTB2jAbJDhKtBxBFoD0/ineNElZk24qYITcOrLJbI8MWGSUa6ZYu0JE eicBxXlbB5G3OQ+QZTJdOHoqJkRmhvoIO9BAr3x7uFmuB00FXqDKwIrXm M=; Authentication-Results: esa2.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none X-SBRS: 2.7 X-MesageID: 82660695 X-Ironport-Server: esa2.hc3370-68.iphmx.com X-Remote-IP: 162.221.156.83 X-Policy: $RELAYED IronPort-Data: A9a23:LkY9Va7I9QmVYQHL/35oAAxR2vbMJQZQLiYv29bIXmNSXhzvzPLM5wBkF31ARqiwpsLxTDuk2K5y4Fltw4rHtUhMcdOLQjwCbf3UD1utrioGJcIt4OZ/tjYNCi4ujkJMXCU9cPX3Q4OgGBMQFJQAlSrNy4hwQvVPWB7Uzo4IImWWayClEksCRdi/DUdPCvCpCfAc403pIYIdttpLONV2N3mmN8/cWy26ntknqBcy/B1vtszfsWR/SfRGHYyHBNlXrldqDpDzSPa/1cgcP4PnefU7Ee3D4eyjPzdc/eGRDowRIxyVcl+Vn0nY+PzCBs/JEBnOLiJgfa2bjfEJfNaqRSj3eoX6ehEQntN1XeRD6YFsMOie1hj0KmOCh2YdEVM/5jcg+YMARNIzC5LTR0sv2AdYFYZuf7EdjfMoV7KJQPaXVGmO+ddxBIweSIl3KD2BvzSDa9g69ij9bHEvgRUWMR2F9jYXKOEhKVgj/rBDSIL5QicT5J5q9RUWm7THJHov8CUlxSVEzC5uKaLok41jrHS5gaye/MmG/I/pitUNOG55Lc03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-IronPort-AV: E=Sophos;i="5.95,180,1661832000"; d="scan'208";a="82660695" From: Anthony PERARD To: CC: Anthony PERARD , Luca Fancellu , Wei Liu Subject: [XEN PATCH for-4.17 v5 04/17] tools: Add -Werror by default to all tools/ Date: Thu, 13 Oct 2022 14:05:00 +0100 Message-ID: <20221013130513.52440-5-anthony.perard@citrix.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20221013130513.52440-1-anthony.perard@citrix.com> References: <20221013130513.52440-1-anthony.perard@citrix.com> MIME-Version: 1.0 And provide an option to ./configure to disable it. A follow-up patch will remove -Werror from every other Makefile in tools/. ("tools: Remove -Werror everywhere else") Signed-off-by: Anthony PERARD Reviewed-by: Luca Fancellu --- tools/configure.ac | 1 + tools/Rules.mk | 4 ++++ config/Tools.mk.in | 1 + tools/configure | 26 ++++++++++++++++++++++++++ 4 files changed, 32 insertions(+) diff --git a/tools/configure.ac b/tools/configure.ac index 32cbe6bd3c..09059bc569 100644 --- a/tools/configure.ac +++ b/tools/configure.ac @@ -81,6 +81,7 @@ m4_include([../m4/header.m4]) AX_XEN_EXPAND_CONFIG() # Enable/disable options +AX_ARG_DEFAULT_ENABLE([werror], [Build tools without -Werror]) AX_ARG_DEFAULT_DISABLE([rpath], [Build tools with -Wl,-rpath,LIBDIR]) AX_ARG_DEFAULT_DISABLE([githttp], [Download GIT repositories via HTTP]) AX_ARG_DEFAULT_ENABLE([monitors], [Disable xenstat and xentop monitoring tools]) diff --git a/tools/Rules.mk b/tools/Rules.mk index 26958b2948..a165dc4bda 100644 --- a/tools/Rules.mk +++ b/tools/Rules.mk @@ -133,6 +133,10 @@ endif CFLAGS_libxenlight += $(CFLAGS_libxenctrl) +ifeq ($(CONFIG_WERROR),y) +CFLAGS += -Werror +endif + ifeq ($(debug),y) # Use -Og if available, -O0 otherwise dbg_opt_level := $(call cc-option,$(CC),-Og,-O0) diff --git a/config/Tools.mk.in b/config/Tools.mk.in index 6c1a0a676f..d0d460f922 100644 --- a/config/Tools.mk.in +++ b/config/Tools.mk.in @@ -1,5 +1,6 @@ -include $(XEN_ROOT)/config/Paths.mk +CONFIG_WERROR := @werror@ CONFIG_RUMP := @CONFIG_RUMP@ ifeq ($(CONFIG_RUMP),y) XEN_OS := NetBSDRump diff --git a/tools/configure b/tools/configure index 41deb7fb96..acd9a04c3b 100755 --- a/tools/configure +++ b/tools/configure @@ -716,6 +716,7 @@ ocamltools monitors githttp rpath +werror DEBUG_DIR XEN_DUMP_DIR XEN_PAGING_DIR @@ -805,6 +806,7 @@ with_xen_scriptdir with_xen_dumpdir with_rundir with_debugdir +enable_werror enable_rpath enable_githttp enable_monitors @@ -1490,6 +1492,7 @@ Optional Features: --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --enable-FEATURE[=ARG] include FEATURE [ARG=yes] --disable-largefile omit support for large files + --disable-werror Build tools without -Werror (default is ENABLED) --enable-rpath Build tools with -Wl,-rpath,LIBDIR (default is DISABLED) --enable-githttp Download GIT repositories via HTTP (default is @@ -4111,6 +4114,29 @@ DEBUG_DIR=$debugdir_path # Enable/disable options +# Check whether --enable-werror was given. +if test "${enable_werror+set}" = set; then : + enableval=$enable_werror; +fi + + +if test "x$enable_werror" = "xno"; then : + + ax_cv_werror="n" + +elif test "x$enable_werror" = "xyes"; then : + + ax_cv_werror="y" + +elif test -z $ax_cv_werror; then : + + ax_cv_werror="y" + +fi +werror=$ax_cv_werror + + + # Check whether --enable-rpath was given. if test "${enable_rpath+set}" = set; then : enableval=$enable_rpath;