Received: by 10.223.185.116 with SMTP id b49csp4181922wrg; Mon, 26 Feb 2018 12:42:33 -0800 (PST) X-Google-Smtp-Source: AH8x226C95g3e3niAyMp4iJQb9dIyzWk0ibCpswR5t4bzLgrNEinjtJbmGB5MBaUrfzHl0ShsHtI X-Received: by 2002:a17:902:4d:: with SMTP id 71-v6mr11842813pla.341.1519677753418; Mon, 26 Feb 2018 12:42:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519677753; cv=none; d=google.com; s=arc-20160816; b=BdoVtiQMCStff1dZ06kpN4EOzrB47Pp3ZOqsNdLeARDgBCdq42Kw5QU5WSFQh5bOlg B2H7mMUxbdxrM78oXk45YPsEnNVA46wW1j7HuerK79/RUyhSKN+3jEmWNhVqvVADfA/0 i/YcbDaP1cxVNhieNM4mKz/XllYxIxUQw06+jB/ivHtuMKtR9qAWv/F+SElq7g1drLCZ dwpXV+tTVOrX+BiSvBLoAGGPDY6xJjxL3KmxKwm8ISIFtV2BhTDGo9ub/rNQrMq40yyD +LLI6mXOG0dlNgbXta/HIFRDOC0CIdltUM4Ci4eJCTbEfDjzW02ff9QPxyB39ZGrmqda EuHQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=ENn24/ai3tGEjVwgqk1fEDoraDTvhJai3Dz7jB7/4Go=; b=TzGxPnbtg913bIQE/gmixQxA6ZqSxODFyF5DLoK5IubNkAo5ZEg867SF57Y/2AY+u2 PsoPsdz6+gzgKAdPOzlem8GN7+ZAHZU8Qvn6Spk8nMSWf63hzqTWBZqzv4WSkcuN6jdn OcmVulG3u7HRIfgtvIpcw7k3R6rD/EhP9dAWvsrjJ0WowSQLXPqher3LjxEbfH1yu/4k +3whK3mKZnkpvxRyuh9tJoRp4LO2bUYLl2dZbgpKEC0CGsus/8xZ7OTQFjQokE6wthya zZKVySW4GJn9qMzR2X9eoxOH4o/PnQszIvQ85KyheJY1nxLaqiEzFdX3WrqfI2s030hy DtSg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p8si5971659pgn.272.2018.02.26.12.42.17; Mon, 26 Feb 2018 12:42:33 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753782AbeBZUlZ (ORCPT + 99 others); Mon, 26 Feb 2018 15:41:25 -0500 Received: from mail.linuxfoundation.org ([140.211.169.12]:36268 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753588AbeBZU1C (ORCPT ); Mon, 26 Feb 2018 15:27:02 -0500 Received: from localhost (clnet-b04-243.ikbnet.co.at [83.175.124.243]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id F216AD24; Mon, 26 Feb 2018 20:27:00 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Arnd Bergmann , Babu Moger , Andi Kleen , Masahiro Yamada , Nicolas Pitre , Peter Zijlstra , Thomas Gleixner , Will Deacon , Andrew Morton , Linus Torvalds Subject: [PATCH 4.15 26/64] Kbuild: always define endianess in kconfig.h Date: Mon, 26 Feb 2018 21:22:03 +0100 Message-Id: <20180226202154.578575708@linuxfoundation.org> X-Mailer: git-send-email 2.16.2 In-Reply-To: <20180226202153.453363333@linuxfoundation.org> References: <20180226202153.453363333@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.15-stable review patch. If anyone has any objections, please let me know. ------------------ From: Arnd Bergmann commit 101110f6271ce956a049250c907bc960030577f8 upstream. Build testing with LTO found a couple of files that get compiled differently depending on whether asm/byteorder.h gets included early enough or not. In particular, include/asm-generic/qrwlock_types.h is affected by this, but there are probably others as well. The symptom is a series of LTO link time warnings, including these: net/netlabel/netlabel_unlabeled.h:223: error: type of 'netlbl_unlhsh_add' does not match original declaration [-Werror=lto-type-mismatch] int netlbl_unlhsh_add(struct net *net, net/netlabel/netlabel_unlabeled.c:377: note: 'netlbl_unlhsh_add' was previously declared here include/net/ipv6.h:360: error: type of 'ipv6_renew_options_kern' does not match original declaration [-Werror=lto-type-mismatch] ipv6_renew_options_kern(struct sock *sk, net/ipv6/exthdrs.c:1162: note: 'ipv6_renew_options_kern' was previously declared here net/core/dev.c:761: note: 'dev_get_by_name_rcu' was previously declared here struct net_device *dev_get_by_name_rcu(struct net *net, const char *name) net/core/dev.c:761: note: code may be misoptimized unless -fno-strict-aliasing is used drivers/gpu/drm/i915/i915_drv.h:3377: error: type of 'i915_gem_object_set_to_wc_domain' does not match original declaration [-Werror=lto-type-mismatch] i915_gem_object_set_to_wc_domain(struct drm_i915_gem_object *obj, bool write); drivers/gpu/drm/i915/i915_gem.c:3639: note: 'i915_gem_object_set_to_wc_domain' was previously declared here include/linux/debugfs.h:92:9: error: type of 'debugfs_attr_read' does not match original declaration [-Werror=lto-type-mismatch] ssize_t debugfs_attr_read(struct file *file, char __user *buf, fs/debugfs/file.c:318: note: 'debugfs_attr_read' was previously declared here include/linux/rwlock_api_smp.h:30: error: type of '_raw_read_unlock' does not match original declaration [-Werror=lto-type-mismatch] void __lockfunc _raw_read_unlock(rwlock_t *lock) __releases(lock); kernel/locking/spinlock.c:246:26: note: '_raw_read_unlock' was previously declared here include/linux/fs.h:3308:5: error: type of 'simple_attr_open' does not match original declaration [-Werror=lto-type-mismatch] int simple_attr_open(struct inode *inode, struct file *file, fs/libfs.c:795: note: 'simple_attr_open' was previously declared here All of the above are caused by include/asm-generic/qrwlock_types.h failing to include asm/byteorder.h after commit e0d02285f16e ("locking/qrwlock: Use 'struct qrwlock' instead of 'struct __qrwlock'") in linux-4.15. Similar bugs may or may not exist in older kernels as well, but there is no easy way to test those with link-time optimizations, and kernels before 4.14 are harder to fix because they don't have Babu's patch series We had similar issues with CONFIG_ symbols in the past and ended up always including the configuration headers though linux/kconfig.h. This works around the issue through that same file, defining either __BIG_ENDIAN or __LITTLE_ENDIAN depending on CONFIG_CPU_BIG_ENDIAN, which is now always set on all architectures since commit 4c97a0c8fee3 ("arch: define CPU_BIG_ENDIAN for all fixed big endian archs"). Link: http://lkml.kernel.org/r/20180202154104.1522809-2-arnd@arndb.de Signed-off-by: Arnd Bergmann Cc: Babu Moger Cc: Andi Kleen Cc: Greg Kroah-Hartman Cc: Masahiro Yamada Cc: Nicolas Pitre Cc: Peter Zijlstra Cc: Thomas Gleixner Cc: Will Deacon Cc: Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds Signed-off-by: Greg Kroah-Hartman --- include/linux/kconfig.h | 6 ++++++ 1 file changed, 6 insertions(+) --- a/include/linux/kconfig.h +++ b/include/linux/kconfig.h @@ -4,6 +4,12 @@ #include +#ifdef CONFIG_CPU_BIG_ENDIAN +#define __BIG_ENDIAN 4321 +#else +#define __LITTLE_ENDIAN 1234 +#endif + #define __ARG_PLACEHOLDER_1 0, #define __take_second_arg(__ignored, val, ...) val