Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp1017185imm; Wed, 22 Aug 2018 17:22:45 -0700 (PDT) X-Google-Smtp-Source: AA+uWPyIX8XDiWbzmegC5Oi8y2IKj3SwnrS/6/xRY+LQcAn2QdaJ8s+3l0q4rhGMO6ZvK7GrUXZ2 X-Received: by 2002:a62:455b:: with SMTP id s88-v6mr59614876pfa.203.1534983765801; Wed, 22 Aug 2018 17:22:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1534983765; cv=none; d=google.com; s=arc-20160816; b=YHkAAeYwVg5VrPHLtLff8CHhGFEPw7Pc2oM95oKYPR3ZiIRZzYrCNsbbcB1a1MmJQX ZjUrjs225XHuXAs+/AwQm0DlfQJfE3TwWVxalzYgFbqV3gf0a3F2Dm8EkTFjMguRIrq8 HiCOaxM6nbBdj7l0dxq1z7juhqnBY00tRV2MbCI69WW5GQkfZNOWIADWf0LgU202kUC+ 37PRGj9wTStogC6oBfkTFys7mO8L4CYQuoMXnk+ll2vSAjEkp/6KmJRk8gazvG4jpTTK uog12BOuheeiE/RKrUz5e2VmvFyHayc86nAVUpdKr2LDDGEnAioOlGymH2AM8zBeoOAa 2IXw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:date:cc:to:from:subject:message-id :arc-authentication-results; bh=AQf/QXoAsaKFyCRkaZugY2y9l1Ieg8sxSRsuIUVifME=; b=w+up8CC7neO1pJAi5Wmzw7VmgJcFXSQaxyEENMFFLXouP0v0VAUBssGDcnSvFKCfbX KNR4OmaK+tqYGM4lwcNN51cPwaI69k6hlXwWBS395F7NkM+xXkMkdJtYDAhsV4ynFd4h 4dg0Mqgwpy2XNe7uBG1PIKfbVfaOyq8cNURRdqJp8Vzoi3/4GtCog++pd9xU+KPs4i14 StaCN6+d/8U8FnhI6Ti+JN7jaT+/AdfACZWqHHFIZNHchx6Txe+jacENd5FnPguKDNgJ VRagRGEcTg+0373iaHmZYim7HsdQoZtjukwthktMBWzJDH2TaqTd6LvuDEvfbsNes1m5 nqQA== 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 198-v6si1557612pfz.119.2018.08.22.17.22.30; Wed, 22 Aug 2018 17:22:45 -0700 (PDT) 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 S1727642AbeHWDrb (ORCPT + 99 others); Wed, 22 Aug 2018 23:47:31 -0400 Received: from smtprelay0183.hostedemail.com ([216.40.44.183]:50489 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726800AbeHWDrb (ORCPT ); Wed, 22 Aug 2018 23:47:31 -0400 Received: from filter.hostedemail.com (clb03-v110.bra.tucows.net [216.40.38.60]) by smtprelay06.hostedemail.com (Postfix) with ESMTP id 5954718224510; Thu, 23 Aug 2018 00:20:30 +0000 (UTC) X-Session-Marker: 6A6F6540706572636865732E636F6D X-Spam-Summary: 2,0,0,,d41d8cd98f00b204,joe@perches.com,:::::::::::::::::::::::::::::::,RULES_HIT:41:334:355:368:369:379:541:599:960:973:988:989:1260:1277:1311:1313:1314:1345:1359:1437:1515:1516:1518:1534:1543:1593:1594:1711:1730:1747:1777:1792:2393:2559:2562:2828:2902:3138:3139:3140:3141:3142:3355:3622:3865:3866:3867:3868:3870:3871:3872:3874:4321:5007:6119:6238:6742:7903:10004:10400:10848:11026:11232:11473:11658:11914:12043:12295:12296:12438:12555:12740:12760:12895:13141:13230:13439:14659:14721:21080:21324:21451:21627:21740:21795:30051:30054:30089:30091,0,RBL:47.151.153.53:@perches.com:.lbl8.mailshell.net-62.8.0.100 64.201.201.201,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:fn,MSBL:0,DNSBL:neutral,Custom_rules:0:0:0,LFtime:26,LUA_SUMMARY:none X-HE-Tag: face35_5b5bab9fa5a49 X-Filterd-Recvd-Size: 4274 Received: from XPS-9350.home (unknown [47.151.153.53]) (Authenticated sender: joe@perches.com) by omf07.hostedemail.com (Postfix) with ESMTPA; Thu, 23 Aug 2018 00:20:27 +0000 (UTC) Message-ID: Subject: Re: [PATCH] include/linux/compiler*.h: make compiler-*.h mutually exclusive From: Joe Perches To: Nick Desaulniers , torvalds@linux-foundation.org Cc: keescook@chromium.org, corbet@lwn.net, yamada.masahiro@socionext.com, arnd@arndb.de, dwmw@amazon.co.uk, linux-kernel@vger.kernel.org, tglx@linutronix.de, will.deacon@arm.com, geert@linux-m68k.org, mingo@kernel.org, akpm@linux-foundation.org, asmadeus@codewreck.org, daniel@iogearbox.net, hpa@zytor.com Date: Wed, 22 Aug 2018 17:20:26 -0700 In-Reply-To: <20180822233724.110454-1-ndesaulniers@google.com> References: <20180822233724.110454-1-ndesaulniers@google.com> Content-Type: text/plain; charset="ISO-8859-1" X-Mailer: Evolution 3.28.1-2 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 2018-08-22 at 16:37 -0700, Nick Desaulniers wrote: > Commit cafa0010cd51 ("Raise the minimum required gcc version to 4.6") > recently exposed a brittle part of the build for supporting non-gcc > compilers. style trivia: > diff --git a/include/linux/compiler_types.h b/include/linux/compiler_types.h [] > @@ -54,32 +54,20 @@ extern void __chk_io_ptr(const volatile void __iomem *); [] > +/* Compiler specific macros. */ > #ifdef __clang__ > #include probably better as #if defined(__clang) to match the style of the #elif defined()s below it > +#elif defined(__INTEL_COMPILER) > +#include > +#elif defined(__GNUC__) [] > @@ -272,4 +174,92 @@ struct ftrace_likely_data { [] > +#ifdef __GNUC_STDC_INLINE__ > +# define __gnu_inline __attribute__((gnu_inline)) > +#else > +# define __gnu_inline > +#endif Perhaps __gnu_inline should be in compiler-gcc and this should use #ifndef __gnu_inline #define __gnu_inline #endif > + > +/* > + * Force always-inline if the user requests it so via the .config. > + * GCC does not warn about unused static inline functions for > + * -Wunused-function. This turns out to avoid the need for complex #ifdef > + * directives. Suppress the warning in clang as well by using "unused" > + * function attribute, which is redundant but not harmful for gcc. > + * Prefer gnu_inline, so that extern inline functions do not emit an > + * externally visible function. This makes extern inline behave as per gnu89 > + * semantics rather than c99. This prevents multiple symbol definition errors > + * of extern inline functions at link time. > + * A lot of inline functions can cause havoc with function tracing. > + */ > +#if !defined(CONFIG_ARCH_SUPPORTS_OPTIMIZED_INLINING) || \ > + !defined(CONFIG_OPTIMIZE_INLINING) > +#define inline \ > + inline __attribute__((always_inline, unused)) notrace __gnu_inline > +#else > +#define inline inline __attribute__((unused)) notrace __gnu_inline > +#endif This bit might be better adding another __ attribute like: #if defined(CONFIG_ARCH_SUPPORTS_OPTIMIZED_INLINING) && defined(CONFIG_OPTIMIZE_INLINING) #define __optimized_inline __unused #else #define __optimized_inline __unused __attribute__((always_inline)) #endif #define inline inline __optimized_inline notrace __gnu_inline > + > +#define __inline__ inline > +#define __inline inline > +#define noinline __attribute__((noinline)) > + > +#ifndef __always_inline > +#define __always_inline inline __attribute__((always_inline)) > +#endif [] > diff --git a/mm/migrate.c b/mm/migrate.c [] > @@ -1131,7 +1131,8 @@ static int __unmap_and_move(struct page *page, struct page *newpage, > * gcc 4.7 and 4.8 on arm get an ICEs when inlining unmap_and_move(). Work > * around it. > */ > -#if (GCC_VERSION >= 40700 && GCC_VERSION < 40900) && defined(CONFIG_ARM) > +#if defined(CONFIG_ARM) && \ > + defined(GCC_VERSION) && GCC_VERSION < 40900 && GCC_VERSION >= 40700 I find the reversed version tests a bit odd to read > #define ICE_noinline noinline > #else > #define ICE_noinline