From patchwork Fri Feb 2 15:40:45 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 126736 Delivered-To: patch@linaro.org Received: by 10.46.124.24 with SMTP id x24csp753933ljc; Fri, 2 Feb 2018 07:42:10 -0800 (PST) X-Google-Smtp-Source: AH8x224c3vYafE6CWsmSqkdI+PNiDYy6W/4HdDcNq/YDyXdS1u1vlOxfNggAF/1BimNXQ3mpVX4E X-Received: by 10.101.101.200 with SMTP id y8mr32533064pgv.0.1517586130715; Fri, 02 Feb 2018 07:42:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517586130; cv=none; d=google.com; s=arc-20160816; b=pCJYunvovwcrMGRomAF5OdydMJdZ2z0KB6Xp+6//4Nz1r8DUrxlDkQM6mSNHj/P9Lg I1GrsuYEtUitl3mTQ+voOPdoIdOHe4exaA2piqt5EpNfwa6EGccowginQPLBGD4sPhso h48JOwphXRHI14PVeP8nPSz7D1/HnYig+r2zSiCU9C23UxFWZeS42UxRFs+7WJ2o4lwy +cKNpqdo53Jciar4pd3adt50aWRLQhH7ehKQIaPVKB1ZfpDq3XTYHYZh0GEct+AjC6ju 8wWBpijqFaENyuk0mpNeEl2M2GMhuvtmMpmItCHPW8uFlH+qOXSBAN13LhIxYDb+tiHU J6vA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=Q7DjYA3e3CjwJf1VpamycqG0KMYW5FaKeHvV4QX2AuU=; b=ICSsQjKLL9q+YZa1oHiBA8kP6bj9jD23j6Dr5Z8lr5iyRmyRbJ5ZrkMOXUGk1L7DgU XnF6U05qz22CZPnWBVweRTIh88kcjH8ajSgzohqDlf8FhAie+t0F7H9FKwXsYhvsCbso UOIi0cr8pCh4ct9xqNoghwIr3H77Gfs/cpFRN3aMrYGq/4VclGPsjXAhvqc/c1UUXIDj bVQkFOlgj6+sIc3rJaOw1urrUHTVkygUq52gmvuGVJHWST7M8f9/RRYLUwcGNO2JUjxG +1HIwmj/h7o4Oelr4GodbcZm4yJTfOUs5zGwXbfD8y1MqOFQs5bhfLu0PbGBoiYZbPqh GWKg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-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 m1-v6si2053092plb.83.2018.02.02.07.42.10; Fri, 02 Feb 2018 07:42:10 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of stable-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 stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752022AbeBBPmJ (ORCPT + 10 others); Fri, 2 Feb 2018 10:42:09 -0500 Received: from mout.kundenserver.de ([212.227.17.24]:42725 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752056AbeBBPmE (ORCPT ); Fri, 2 Feb 2018 10:42:04 -0500 Received: from wuerfel.lan ([95.208.111.237]) by mrelayeu.kundenserver.de (mreue103 [212.227.15.145]) with ESMTPA (Nemesis) id 0LcFAj-1f76Nr1PPx-00jc4r; Fri, 02 Feb 2018 16:41:38 +0100 From: Arnd Bergmann To: Andrew Morton Cc: Nicolas Pitre , Andi Kleen , Babu Moger , Will Deacon , Arnd Bergmann , stable@vger.kernel.org, Greg Kroah-Hartman , Thomas Gleixner , Masahiro Yamada , linux-kernel@vger.kernel.org Subject: [PATCH 2/2] Kbuild: always define endianess in kconfig.h Date: Fri, 2 Feb 2018 16:40:45 +0100 Message-Id: <20180202154104.1522809-2-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 In-Reply-To: <20180202154104.1522809-1-arnd@arndb.de> References: <20180202154104.1522809-1-arnd@arndb.de> X-Provags-ID: V03:K0:X/7eTYrqugOU9bM6mqNY6K6nTSV0VVsJLJvlKxDwf/GMH+O5eZM uGGA6McIsDzR50W6IlS2105k5VchDJ37lQrR0QThfvlbLZU2QMXBy5P5syD0Ziu22jB4Y9b gRYMnhY7IyRgtH3ctscVZNfOgkBwX2oMMv9KwiWTjgZbQI3idtc77ItvM1hTT4h1HtXuh2i +RD+MQMLXKpG6Y0Jvea4g== X-UI-Out-Filterresults: notjunk:1; V01:K0:TkctaYAntAw=:aItG1zBQgbC4UwTNCfWfpN KwyWoHFue/HJHgNLPMTh8ujHAWZAsSY07ELeFNwIvejHl+0J7Fue3BqtpJjU7WPtNpN3af3pe dOzzyNqsglC9q4TrXHcRtmzuBbiXLhdZdy/f5+KlgedVq4ps4SBbJrbYr6G7/1QMsVjWWd6BD 12DLY6ZTTkfypRXfzKEYsItsSTJuYNOstAphhQWuUWiIFE0lN/dNb/x4suQab6DxHhwKX8deH +AP6g/UsMHStX/w2n145huqbehLD6pqoym5h+51UbxpjrGsZXoA2esOA3MNmJSIbgxv8NH/v+ STpwhrm2sp3fq8VsIG1leelVz00aXnHT41EjVS+N7p/a3fqal6KvXua1YIh8Jj15TyDqvoSWz AXzU3ItJu1ZKqmWZg6kUxS1stVRq2I1GTbKZkhO7V4NQ4uCBTTob8xNBUR9yBCEffE51JMdP1 kuH4+bu0Fupq4A8lbHnlk4mCgquYzk2LHY/whpwYfjbYzWBGM0fcbH1igPsMeiS2/s2+8LoRe vC2Ae4OjugyrgDv+Wk4eqll0EyUHDbHPATDAworyhEb1hWADdV8/ncq7A7qA533KKk5eZ7CSf eDMgSO1l+FGlv9VznZx5p49Gt+klgt14OytfikXYySVOvvB0v52KdUDv8rN9YVftsOW6oNXHc mHDSZ1eS4D0/9Ea/r++gNZUIS+YTTQk9frUSpm0mUVTjLushwPIh7aG/IX1mak2VSiPNR+hdr s0YVp7TaGawLbEQiWXGO/6XkXZ8on1XtzSDU+A== Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org 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"). Cc: stable@vger.kernel.org Cc: Babu Moger Signed-off-by: Arnd Bergmann --- include/linux/kconfig.h | 6 ++++++ 1 file changed, 6 insertions(+) -- 2.9.0 diff --git a/include/linux/kconfig.h b/include/linux/kconfig.h index fec5076eda91..cc8fa109cfa3 100644 --- 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