Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp5849167imm; Tue, 12 Jun 2018 14:32:59 -0700 (PDT) X-Google-Smtp-Source: ADUXVKK2Sfko2ZkeatH2Ip0H9LYhUJjEDa3fQb7Rgx+B90qkgxktdzaTRt/44iVuXisGhfSVcJAO X-Received: by 2002:a17:902:23:: with SMTP id 32-v6mr2207923pla.252.1528839179862; Tue, 12 Jun 2018 14:32:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528839179; cv=none; d=google.com; s=arc-20160816; b=Ktzg/mHnhl3aHkKoS0tzTxu6s6moCBnJMPhebxVmhWINikjC8OyXFYN2E+zp3BBe+L rUryzMSHlFka2Zi3PhnjhvriF9akx+FPKcYJaqQ5N6Gi5tCu3abWR30thnb6UqNpwcnJ 9Bv7SGjBLA3mBTxX/qHN/56dHJjCzX/nq+lyIFa/HcSS/6wQlGkvT+bnmAhlceEAGvEz WAxuY++/zBsU70QaUXZTvf6rywZyrGHmEcHsOIldip0b2auWqNGe4t8/LOiupQ1Tj+Na jZ7BxrA4d6X6OsIoXTtAZuYapWwjVeWnOl/sfQYOjfWY+/N78sC2aGooVaEuOv+tsJkG 2f7A== 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 :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:arc-authentication-results; bh=iyCTBlYUjL/akMba8ANrPulWs9ZU6LwicO9o2FvEsLk=; b=FgokIKSOC9LMlar0KdEdurVDSSfQdq49/RmfEA9S2sNr+ZZP8Q655wJ5x4YOQhTTmz SNzto3XpbpOLnoPs64Jxs/lpULWK14UPReN86UfkwLCIMWZq4d3DyozVr9bIpqVpQ/s3 py2mOq3nX/LLZB1viQmukDiVmFkQYaznvwUOCLHhER3MabboUL6eXQq18FBIDyDrhLKV OOSg0gbVlpZK3ey2s2iItOuUvxqDX9VRA0ADaaGi80nHMuc9DNx2PWbAi8lqCgp77Om8 MlVjA4OijMrmo/Ohl4Xun5ELc0vRSplZbdVqluNFcSoCaM3nacBKRah2bNXC56izSzXW rEKw== 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 c3-v6si999815pld.87.2018.06.12.14.32.45; Tue, 12 Jun 2018 14:32:59 -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 S934141AbeFLVby (ORCPT + 99 others); Tue, 12 Jun 2018 17:31:54 -0400 Received: from terminus.zytor.com ([198.137.202.136]:45821 "EHLO mail.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933533AbeFLVbw (ORCPT ); Tue, 12 Jun 2018 17:31:52 -0400 Received: from hanvin-mobl2.amr.corp.intel.com (jfdmzpr04-ext.jf.intel.com [134.134.139.73]) (authenticated bits=0) by mail.zytor.com (8.15.2/8.15.2) with ESMTPSA id w5CLV8LT178792 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NO); Tue, 12 Jun 2018 14:31:09 -0700 Subject: Re: [PATCH v4 1/3] compiler-gcc.h: add gnu_inline to all inline declarations To: Nick Desaulniers Cc: sedat.dilek@gmail.com, Arnd Bergmann , Andrew Morton , mingo@redhat.com, Thomas Gleixner , linux-efi@vger.kernel.org, LKML , x86@kernel.org, virtualization@lists.linux-foundation.org, Alistair Strachan , Manoj Gupta , Greg Hackmann , tstellar@redhat.com, Kees Cook , Masahiro Yamada , Michal Marek , Linux Kbuild mailing list , geert@linux-m68k.org, Will Deacon , mawilcox@microsoft.com, David Rientjes , acme@redhat.com, Philippe Ombredanne , Andrey Ryabinin , Kate Stewart , boris.ostrovsky@oracle.com, "J. Kiszka" , rostedt@goodmis.org, kirill.shutemov@linux.intel.com, Ard Biesheuvel , akataria@vmware.com, brijesh.singh@amd.com References: <20180607204927.219329-1-ndesaulniers@google.com> <20180607204927.219329-2-ndesaulniers@google.com> <201806121851.w5CIpTY7134381@mail.zytor.com> From: "H. Peter Anvin" Message-ID: <7e375fab-f8ad-705a-dd04-f7e18952bd0c@zytor.com> Date: Tue, 12 Jun 2018 14:31:08 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.8.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 06/12/18 13:19, Nick Desaulniers wrote: > > Oh, by [0] __GCC_STDC_INLINE__ is indeed actually the correct symbol > to check for. Clang does support that, so nothing to fix there. > >> By the way, you should check clang against gcc's predefined macros by doing: >> >> gcc [options] -x c -Wp,-dM -E /dev/null | sort >> >> Options can change the predefined macros substantially, especially the, -std=, arch and -O options. -x c can be replaced with e.g. -x c++, objective-c, assembler-with-cpp etc. > > Neat, I'll have to bookmark that incantation. I can s/gcc/clang/ to > get a similar list (which is how I know it supports > __GCC_STDC_INLINE__).> I bet that if you add -fgnu89-inlines then it *does* define __GNUC_GNU_INLINE__. > > Patch now becomes something like: > > #ifdef __GNUC_GNU_INLINE__ > #define __gnu_inline __attribute__((gnu_inline)) > #else > #define __gnu_inline > #endif > > #define inline inline __attribute__((always_inline, unused)) notrace > __gnu_inline > ... > > Issues with that approach? > s/__GNUC_GNU_INLINE__/__GNUC_STDC_INLINE__/ -hpa