[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAKwvOdksGzdeFOAiYRNahFqxRoYoTMGkTeprfP4oZPzdF94WLA@mail.gmail.com>
Date: Tue, 12 Jun 2018 14:36:19 -0700
From: Nick Desaulniers <ndesaulniers@...gle.com>
To: hpa@...or.com
Cc: sedat.dilek@...il.com, Arnd Bergmann <arnd@...db.de>,
Andrew Morton <akpm@...ux-foundation.org>, mingo@...hat.com,
Thomas Gleixner <tglx@...utronix.de>,
linux-efi@...r.kernel.org, LKML <linux-kernel@...r.kernel.org>,
x86@...nel.org, virtualization@...ts.linux-foundation.org,
Alistair Strachan <astrachan@...gle.com>,
Manoj Gupta <manojgupta@...gle.com>,
Greg Hackmann <ghackmann@...gle.com>, tstellar@...hat.com,
Kees Cook <keescook@...gle.com>,
Masahiro Yamada <yamada.masahiro@...ionext.com>,
Michal Marek <michal.lkml@...kovi.net>,
Linux Kbuild mailing list <linux-kbuild@...r.kernel.org>,
geert@...ux-m68k.org, Will Deacon <will.deacon@....com>,
mawilcox@...rosoft.com, David Rientjes <rientjes@...gle.com>,
acme@...hat.com, Philippe Ombredanne <pombredanne@...b.com>,
Andrey Ryabinin <aryabinin@...tuozzo.com>,
Kate Stewart <kstewart@...uxfoundation.org>,
boris.ostrovsky@...cle.com, "J. Kiszka" <jan.kiszka@...mens.com>,
rostedt@...dmis.org, kirill.shutemov@...ux.intel.com,
Ard Biesheuvel <ard.biesheuvel@...aro.org>,
akataria@...are.com, brijesh.singh@....com
Subject: Re: [PATCH v4 1/3] compiler-gcc.h: add gnu_inline to all inline declarations
On Tue, Jun 12, 2018 at 2:31 PM H. Peter Anvin <hpa@...or.com> 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
Powered by blists - more mailing lists