From patchwork Wed Jul 26 13:36:23 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 9864855 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 5481760382 for ; Wed, 26 Jul 2017 13:38:13 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5C77728687 for ; Wed, 26 Jul 2017 13:38:13 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 516D528769; Wed, 26 Jul 2017 13:38:13 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.4 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EDF6528687 for ; Wed, 26 Jul 2017 13:38:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751109AbdGZNhU (ORCPT ); Wed, 26 Jul 2017 09:37:20 -0400 Received: from mout.kundenserver.de ([212.227.126.130]:56119 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750989AbdGZNhT (ORCPT ); Wed, 26 Jul 2017 09:37:19 -0400 Received: from wuerfel.lan ([5.56.224.194]) by mrelayeu.kundenserver.de (mreue005 [212.227.15.129]) with ESMTPA (Nemesis) id 0M36tX-1dtor54BFP-00syET; Wed, 26 Jul 2017 15:37:01 +0200 From: Arnd Bergmann To: Andrew Morton , Masahiro Yamada , Michal Marek , Boris Ostrovsky , Juergen Gross Cc: Arnd Bergmann , David Vrabel , linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org, xen-devel@lists.xenproject.org Subject: [PATCH v2] Kbuild: use -fshort-wchar globally Date: Wed, 26 Jul 2017 15:36:23 +0200 Message-Id: <20170726133655.2137437-1-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 X-Provags-ID: V03:K0:ScL5PYR8QVDPoRvmKNSvkXMY3o6MZtRRX/EpzTLtS0tUY0KIvSX aEmesN7KDkPjjDBnIm9HpXtvZPAYFZv4LV0HNQLnRerzkU+vVHN6vtKiqpxhgdA7I3uiCIr F4aVZvPNWiYNKv9uPnZdsbWSs1Mt1qtiWtG/yOxPsYrNJ5b6/RVuHkSKQ/H1MrFyaFpyaFc ckhHOtGCfXnbIPPdooCBA== X-UI-Out-Filterresults: notjunk:1; V01:K0:xbN5uHg7d7A=:JmsBsyNMFivS05LrEM35U/ 92wnsyuYgHgSEonR8+eRkVwLJxhbtgVZYJQmPl1Lw2dXxTuSwwGScynLt7vJC1B6KLsJJyFmd 2qQygZ0mQ3Pwv6j7myMAjadppiYt73IT3sdOBQZYbsr+1PJbZ0ZLPkT8QElazXKo1YYG0hrva LhV1Bg4amqHPTsh84sp4MD15J/v4TrZDDa1KuWzUTnneUMFVf2yGBdW94gMeE0STHGpqvh9aT dOaZV0d2GLdDQmHjTsgt4ImxuvY5VvVzsqAiWI+/nI8Yq0ytPIeViYr2dcoJj7wY43UBL5wHS vIiZ0qhTO4J6kfEddbmq/TC+Qwr5a024VfYJsMseNPmQ6ODL9iT1WwubDNpb5lqYu2HI/wKld yaY2i0UfS4eoWD0iDWvTf+PHv6vEdCNMxewgxzV9OVxyEMRzxoklkhBg9VuuLrfqyJ/UOflX1 7+uramquZtKfsdt1BTwdZ5M1k8s1nYUgY/9bj3Bq2LfFxTzSbqii4ihki/7OGEjCOfnFA8hh4 SL8Ci9cYoWlgGCZYvUBSzrHFjmlw512NsCyrZcp73yN4auHSRV/GkUiod08cibrDb493+FxDZ Acxufb2yDJJ6wd7RBg9TLUV7lu0PlVoLLlUiOrohOY3xCNjhlsPkIoidPplSPh6V8o74q1kpu DyjAn9QgypExtbTs/OGlEZqqqbGYcAjHYLohDRhQTrMqi17OECDxFYa8bfzYG97m6V+l2BqgD mcGUlSvMT/PQLcoByrDoqivtxYweHXoFqthJfw== Sender: linux-kbuild-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kbuild@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP A previous patch added the --no-wchar-size-warning to the Makefile to avoid this harmless warning: arm-linux-gnueabi-ld: warning: drivers/xen/efi.o uses 2-byte wchar_t yet the output is to use 4-byte wchar_t; use of wchar_t values across objects may fail Changing kbuild to use thin archives instead of recursive linking unfortunately brings the same warning back during the final link. The kernel does not use wchar_t string literals at this point, and xen does not use wchar_t at all (only efi_char16_t), so the flag has no effect, but as pointed out by Jan Beulich, adding a wchar_t string literal would be bad here. Since wchar_t is always defined as u16, independent of the toolchain default, always passing -fshort-wchar is correct and lets us remove the Xen specific hack along with fixing the warning. Signed-off-by: Arnd Bergmann Fixes: 971a69db7dc0 ("Xen: don't warn about 2-byte wchar_t in efi") Acked-by: David Vrabel Link: https://patchwork.kernel.org/patch/9275217/ --- I submitted an earlier patch in August 2016, simply removing the flag in xen, but there seems to be no harm in enabling it globally --- Makefile | 2 +- drivers/xen/Makefile | 3 --- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/Makefile b/Makefile index f1533423094f..0fe63a47fd52 100644 --- a/Makefile +++ b/Makefile @@ -396,7 +396,7 @@ LINUXINCLUDE := \ KBUILD_CPPFLAGS := -D__KERNEL__ KBUILD_CFLAGS := -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs \ - -fno-strict-aliasing -fno-common \ + -fno-strict-aliasing -fno-common -fshort-wchar \ -Werror-implicit-function-declaration \ -Wno-format-security \ -std=gnu89 $(call cc-option,-fno-PIE) diff --git a/drivers/xen/Makefile b/drivers/xen/Makefile index 8feab810aed9..7f188b8d0c67 100644 --- a/drivers/xen/Makefile +++ b/drivers/xen/Makefile @@ -7,9 +7,6 @@ obj-y += xenbus/ nostackp := $(call cc-option, -fno-stack-protector) CFLAGS_features.o := $(nostackp) -CFLAGS_efi.o += -fshort-wchar -LDFLAGS += $(call ld-option, --no-wchar-size-warning) - dom0-$(CONFIG_ARM64) += arm-device.o dom0-$(CONFIG_PCI) += pci.o dom0-$(CONFIG_USB_SUPPORT) += dbgp.o