mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Alexander Lobakin <alexandr.lobakin@intel.com>
To: cgel.zte@gmail.com
Cc: Alexander Lobakin <alexandr.lobakin@intel.com>,
	torvalds@linux-foundation.org, nathan@kernel.org,
	ndesaulniers@google.com, keescook@chromium.org,
	wang.yong12@zte.com.cn, xu.xin16@zte.com.cn,
	linux-kernel@vger.kernel.org, llvm@lists.linux.dev,
	Zeal Robot <zealci@zte.com.cn>
Subject: Re: [PATCH linux-next] tools: compiler-gcc.h: Keep compatible with older GCC versions
Date: Mon,  3 Jan 2022 15:46:35 +0100	[thread overview]
Message-ID: <20220103144635.5952-1-alexandr.lobakin@intel.com> (raw)
In-Reply-To: <20220102120201.594408-1-xu.xin16@zte.com.cn>

From: cgel.zte@gmail.com
Date: Sun,  2 Jan 2022 12:02:01 +0000

> From: xu xin <xu.xin16@zte.com.cn>
> 
> When HOST CC = gcc (GCC) 4.8.5, we found that there is an error occurring:
                           ^^^^^

From [0]:

Program  Minimal version
GNU C    5.1

This applies to both HOSTCC and CC.

> Undefined __has_attribute as we built the whole kernel and tools.
> 
> To solve this, this patch is given to keep the compatibility with older
> GCC versions.
> 
> Reported-by: Zeal Robot <zealci@zte.com.cn>
> Co-developed-by: wangyong <wang.yong12@zte.com.cn>
> Signed-off-by: xu xin <xu.xin16@zte.com.cn>
> ---
>  tools/include/linux/compiler-gcc.h | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/tools/include/linux/compiler-gcc.h b/tools/include/linux/compiler-gcc.h
> index 8816f06fc6c7..333ed16b3b12 100644
> --- a/tools/include/linux/compiler-gcc.h
> +++ b/tools/include/linux/compiler-gcc.h
> @@ -16,6 +16,10 @@
>  # define __fallthrough __attribute__ ((fallthrough))
>  #endif
>  
> +#ifndef __has_attribute
> +# define __has_attribute(x) 0  /* Compatibility with GCC versions < 5.x */
> +#endif
> +
>  #if __has_attribute(__error__)
>  # define __compiletime_error(message) __attribute__((error(message)))
>  #endif
> -- 
> 2.25.1

[0] https://elixir.bootlin.com/linux/v5.16-rc8/source/Documentation/process/changes.rst#L32

Al

  reply	other threads:[~2022-01-03 14:47 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-02 12:02 cgel.zte
2022-01-03 14:46 ` Alexander Lobakin [this message]
2022-01-06  6:25   ` xu xin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220103144635.5952-1-alexandr.lobakin@intel.com \
    --to=alexandr.lobakin@intel.com \
    --cc=cgel.zte@gmail.com \
    --cc=keescook@chromium.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=llvm@lists.linux.dev \
    --cc=nathan@kernel.org \
    --cc=ndesaulniers@google.com \
    --cc=torvalds@linux-foundation.org \
    --cc=wang.yong12@zte.com.cn \
    --cc=xu.xin16@zte.com.cn \
    --cc=zealci@zte.com.cn \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome