[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v1] compiler.h: define CONFIG_GCC_VERSION


  • To: Olaf Hering <olaf@xxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Fri, 9 Jul 2021 08:54:48 +0200
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=4VIVQKKSJaH8pLHfH4nQaEpWHQQMqchVtwdLoMY9bxA=; b=AXCaxeVZUExbbC9xJywoIXTGytlinWZ9q2xxcKZfLny4dc/MGA1uwhArUztCHFQJ/XXpD4lpeWZVMfQpifln7lYYLqqKeHW0qlLjj3BuhBbBZs01Yxq3Iebtf1JdElJWjyVcRJSYuTvKMFKCa7yIWf50275WG8JiM1PsPhgdQWFeAsm6zeIbpPzIEwNKqhM5LThOHshn0XzrydH7bQ9T44REwNywv0ocsdQRJtEuqhhwkVsHVRaX/JOyNH4dU7v9wDbkhBtnNXLfp4El6UbrsyKG6/D8gswEeq8CL5/yv8m9ca9J7JKlMhxwtu4jzYjziWX2JADmnuQlG48fSPO8CQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Dt+vsjdkV96nWDlqu2/1g7cyf5FaLnDACTdZY+cxfigHttHQRG5qDRqbr9R2f4pvXmZbNdKwi8XBDwXXPZubtniSt3vlGBVVIwyI+CxwPsBmsfow+87+nxfNKLlASolKsAGlFrmsHGgyLe5l1tkuOvmuOJ+xXmUkM+qqDqUMkpoXqTK5qgWVWJSjYDHucVn7YshTKLZrDMluO0r52lu76F/lK99VfbUJqnH2/6kvSAgWkYucjEPEg74xB/haitJbuZljseVOk5jXf3YvuVVh9wlE2bA78oczfdcIitbTv3mkr24fP97ZeV0Ks5jQjE+qBGa6OAWvSBCudARqkpt7ig==
  • Authentication-results: lists.xenproject.org; dkim=none (message not signed) header.d=none;lists.xenproject.org; dmarc=none action=none header.from=suse.com;
  • Cc: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, George Dunlap <George.Dunlap@xxxxxxxxxxxxx>, Ian Jackson <ian.jackson@xxxxxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Konrad Rzeszutek Wilk <konrad.wilk@xxxxxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx
  • Delivery-date: Fri, 09 Jul 2021 06:55:03 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 18.06.2021 18:42, Olaf Hering wrote:
> --- a/xen/include/xen/compiler.h
> +++ b/xen/include/xen/compiler.h
> @@ -99,6 +99,13 @@
>      __asm__ ("" : "=r"(__ptr) : "0"(ptr));      \
>      (typeof(ptr)) (__ptr + (off)); })
>  
> +#ifndef CONFIG_GCC_VERSION
> +# ifdef __GNUC__
> +#  define CONFIG_GCC_VERSION (__GNUC__ * 10000           \
> +                              + __GNUC_MINOR__ * 100     \
> +                              + __GNUC_PATCHLEVEL__)
> +# endif
> +#endif
>  #if CONFIG_GCC_VERSION >= 110000 /* See gcc bug 100680. */
>  # define gcc11_wrap(x) RELOC_HIDE(x, 0)
>  #else

Having thought about it, this feels like the wrong solution to
me: I'd rather not see us introduce further CONFIG_* which don't
really come from Kconfig. The more when we have an even simpler
alternative:

there's no CONFIG_GCC_VERSION

This was introduced in 4.14 only.

Reported-by: Olaf Hering <olaf@xxxxxxxxx>
Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>

--- a/xen/include/xen/compiler.h
+++ b/xen/include/xen/compiler.h
@@ -99,7 +99,7 @@
     __asm__ ("" : "=r"(__ptr) : "0"(ptr));      \
     (typeof(ptr)) (__ptr + (off)); })
 
-#if CONFIG_GCC_VERSION >= 110000 /* See gcc bug 100680. */
+#if __GNUC__ >= 11 /* See gcc bug 100680. */
 # define gcc11_wrap(x) RELOC_HIDE(x, 0)
 #else
 # define gcc11_wrap(x) (x)

I'll also adjust the original backport itself before putting it
on the 4.12 branch (where I think we want both this and the other
gcc 11 fixes).

Jan




 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.