Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp5853631imm; Tue, 12 Jun 2018 14:38:33 -0700 (PDT) X-Google-Smtp-Source: ADUXVKJmUwWSf/J7zfM+IqCBrj+l1wJHIvCc5NcIFnc+Qxl70xZc4aSMyLO5pTSyYQjxSRQllXzD X-Received: by 2002:a17:902:bd05:: with SMTP id p5-v6mr2263259pls.32.1528839513750; Tue, 12 Jun 2018 14:38:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528839513; cv=none; d=google.com; s=arc-20160816; b=xTfFMYuAH0yXNCIg1K/clx0PD8JYCtXXPXRyoRHsSTBBCNVO93YJG4G2JNm8a8Erfz wgE4gcBVr9cYK6PWTnQ/70CQ5TjsIZn7zS4RdQtACET2NWTFKawzVDEOX6JGeUwxGBbW OF8qTyeHmKURJ7I2HPr2uyJnGPUYbyytt31M0ywZkeSgO4s8ZqQAESheX3lrOVvMZbFP grkRrWxdDSz6nR4iaWW9zuhQtEKel97BCBLNFc20Q/4AhLW7ODHVoVbz/jPEDx6tt37t /3F8hvsY/JBRp9KhY3IDAE9jtL+x36XLlXalejH+5wI52+WW65lHqtJPTNLTG+OvdzRU g9/Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature :arc-authentication-results; bh=YZeE5rcQ+KFwR0PMw1LbUIdqpuYh0fOsY0HLm1tPdRw=; b=Zh9/jDfvG2sa163s0KLLAZyYlNzxIp23w+pSFwzim38TzZbSuP/4igQH1T9AmQvstZ eZ/vv4mdBULbJXkj7yASii+kbqFIvhvnB32ACDIltIM2bM3KxyTQm1SH0gdTKHiAOBZ+ 2B8iDL2b4LAiXEIUmXNFfsyQARyjFxyzJ72ai5GQp/UL64hYl2dwdQEZBp6k0p/zK8De 51aQMb01WibcRdxvfaqTl3L7z37IRJtP/egotuk0+sIqrJesoC3dv6XyDyrZ4RQUp0kw FCLUl+21SbYxtSYoMMqJQlHIY548F/gIMaoGv2g81c/pm8yFjZoUZU5LwxyJLGFe+6VG XVtw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=eCm1uRHN; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 63-v6si1073140pfx.61.2018.06.12.14.38.19; Tue, 12 Jun 2018 14:38:33 -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; dkim=pass header.i=@google.com header.s=20161025 header.b=eCm1uRHN; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934429AbeFLVge (ORCPT + 99 others); Tue, 12 Jun 2018 17:36:34 -0400 Received: from mail-pl0-f68.google.com ([209.85.160.68]:45148 "EHLO mail-pl0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933696AbeFLVgc (ORCPT ); Tue, 12 Jun 2018 17:36:32 -0400 Received: by mail-pl0-f68.google.com with SMTP id c23-v6so216345plz.12 for ; Tue, 12 Jun 2018 14:36:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=YZeE5rcQ+KFwR0PMw1LbUIdqpuYh0fOsY0HLm1tPdRw=; b=eCm1uRHNdV9uyItVGDi0VNemBkAKtBsSXlvuHy9F6eEoIL3FT0Z3KcfR2BDM/B71o7 gqxxGkUSuVFmB6eb6RF+GN/Xb+geEFMFXgzij+K3xFTcPmcZsBqGgg7e/aTDtpDRF4vd tvCnTrmrIv7+g309nm1z3Qh0q+pIr54Brl0vVk35KuV1yOiunMfzYYvHa8yITEahVXfe CoiGLBw7R4sdlhmlSo829fxHo8eJA8sr/QeHRT/5nvaM2eBp1JMyh29PkuWzRHRQe93N S74rFc+Yzn2jH1CbCTkCzEezZZXp/339Obk/vKIBcAFr60tDmgqNcR2fyZ6sE6OIiS1j 1XWg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=YZeE5rcQ+KFwR0PMw1LbUIdqpuYh0fOsY0HLm1tPdRw=; b=kO9ZEPn3dDRkwCEEP661I385sOkJ5Yx540xf5pAuSSSCAOimKmFjtdHqcZqvm+oCBz I8xj26O6k6Rw4lF/bdJus/OsqtXlp0lBt8qNf6uwT0ggBfZxOndIXen10k08CEJ3kllo rPDHqNPTo/rYLpCyjHJwAQrve1L0iXyqgZBzpU6FbHhsx+x9zW3fcFPg+bQnpeeQEZeS yMtTbmgFGUEELkClw7L/ZhDLztf0alwJcB8qAo7Q3+ibYpOQmlmMh/hPK4buFNgYK01V Z5PsCtx2NqMu7F9s6LPHHXeuvRblxd0KMb1pv6MUCTIQ3UBMbfHGzBa2lrJDIp3WoeQR oKxQ== X-Gm-Message-State: APt69E2QZEhDO4f127J1OgVZg/+wNMu42U7ZSb4n+ZjNqiVMka3aAlNr gMrkWwY/NX7ydasfWoCSzTruGu0LLdAgHq87huAbAA== X-Received: by 2002:a17:902:8d8b:: with SMTP id v11-v6mr2262392plo.20.1528839391498; Tue, 12 Jun 2018 14:36:31 -0700 (PDT) MIME-Version: 1.0 References: <20180607204927.219329-1-ndesaulniers@google.com> <20180607204927.219329-2-ndesaulniers@google.com> <201806121851.w5CIpTY7134381@mail.zytor.com> <7e375fab-f8ad-705a-dd04-f7e18952bd0c@zytor.com> In-Reply-To: <7e375fab-f8ad-705a-dd04-f7e18952bd0c@zytor.com> From: Nick Desaulniers Date: Tue, 12 Jun 2018 14:36:19 -0700 Message-ID: Subject: Re: [PATCH v4 1/3] compiler-gcc.h: add gnu_inline to all inline declarations To: hpa@zytor.com 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 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 On Tue, Jun 12, 2018 at 2:31 PM H. Peter Anvin wrote: > > 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__. Indeed! I see what you mean about [options] changing the predefined symbol list. > > 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__/ Oops, sorry, yes good catch. -- Thanks, ~Nick Desaulniers