[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CA+icZUUz1Zb1e0LbeccY-3=HY02txe4BiNwhN0vqW_RkQpfLCw@mail.gmail.com>
Date: Fri, 8 Jun 2018 16:34:50 +0200
From: Sedat Dilek <sedat.dilek@...il.com>
To: hpa@...or.com
Cc: Joe Perches <joe@...ches.com>,
Nick Desaulniers <ndesaulniers@...gle.com>,
akpm@...ux-foundation.org, ard.biesheuvel@...aro.org,
aryabinin@...tuozzo.com, akataria@...are.com,
boris.ostrovsky@...cle.com, brijesh.singh@....com,
caoj.fnst@...fujitsu.com, gregkh@...uxfoundation.org,
jan.kiszka@...mens.com, jarkko.sakkinen@...ux.intel.com,
jgross@...e.com, jpoimboe@...hat.com,
kirill.shutemov@...ux.intel.com, mingo@...hat.com,
mjg59@...gle.com, mka@...omium.org, pombredanne@...b.com,
rostedt@...dmis.org, tglx@...utronix.de, thomas.lendacky@....com,
tweek@...gle.com, linux-efi@...r.kernel.org,
linux-kernel@...r.kernel.org, x86@...nel.org,
virtualization@...ts.linux-foundation.org, astrachan@...gle.com,
manojgupta@...gle.com, ghackmann@...gle.com, tstellar@...hat.com,
keescook@...gle.com, yamada.masahiro@...ionext.com,
michal.lkml@...kovi.net, linux-kbuild@...r.kernel.org,
geert@...ux-m68k.org, will.deacon@....com, mawilcox@...rosoft.com,
Arnd Bergmann <arnd@...db.de>, rientjes@...gle.com
Subject: Re: [PATCH v2 1/2] compiler-gcc.h: add gnu_inline to all inline declarations
On Wed, Jun 6, 2018 at 6:39 PM, <hpa@...or.com> wrote:
...
>>Beyond this, a general question: Can someone explain why all these
>>inline defines are in compiler-gcc.h (as there exists compiler.h and
>>compiler-clang.h)?
>>
>>Thanks.
>>
>>Regards,
>>- Sedat -
>
> Because gcc itself also supports both GNU89-style and C99-style inlines, but the kernel was built with the former, and it is not necessarily a trivial modification, except for "static inline" which is the same for both.
>
> The other option is to pass -fgnu89-inline on the command line, which is supported by both gcc and clang. The two methods are fully equivalent.
>
We have...
$ ls include/linux/compiler*
include/linux/compiler-clang.h include/linux/compiler-gcc.h
include/linux/compiler.h include/linux/compiler-intel.h
include/linux/compiler_types.h
include/linux/compiler_types.h says...
#ifdef __GNUC__
#include <linux/compiler-gcc.h>
#endif
...
/* Intel compiler defines __GNUC__. So we will overwrite implementations
* coming from above header files here
*/
#ifdef __INTEL_COMPILER
# include <linux/compiler-intel.h>
#endif
/* Clang compiler defines __GNUC__. So we will overwrite implementations
* coming from above header files here
*/
#ifdef __clang__
#include <linux/compiler-clang.h>
#endif
/*
* Generic compiler-dependent macros required for kernel
* build go below this comment. Actual compiler/compiler version
* specific implementations come from the above header files
*/
...
include/linux/compiler-clang.h says...
#ifndef __LINUX_COMPILER_TYPES_H
#error "Please don't include <linux/compiler-clang.h> directly,
include <linux/compiler.h> instead."
#endif
So, compiler-clang.h uses defines etc. from compiler-gcc.h but might
overwrite it.
Correct?
I would have expected inline defines in compiler.h as I thought there
is the place for generic stuff.
Maybe you can clarify on the roles of especially compiler.h and
compiler_types.h.
Thanks.
- sed@ -
Powered by blists - more mailing lists