2021-07-14 15:04:50

by Marco Elver

[permalink] [raw]
Subject: [PATCH] compiler_attributes: fix __has_attribute(__no_sanitize_coverage__) for gcc 4

Fix __has_attribute(__no_sanitize_coverage__) for GCC 4 by defining
__GCC4_has_attribute___no_sanitize_coverage__.

Fixes: 540540d06e9d ("kcov: add __no_sanitize_coverage to fix noinstr for all architectures")
Reported-by: Geert Uytterhoeven <[email protected]>
Signed-off-by: Marco Elver <[email protected]>
---
include/linux/compiler_attributes.h | 1 +
1 file changed, 1 insertion(+)

diff --git a/include/linux/compiler_attributes.h b/include/linux/compiler_attributes.h
index 2487be0e7199..67c5667f8042 100644
--- a/include/linux/compiler_attributes.h
+++ b/include/linux/compiler_attributes.h
@@ -37,6 +37,7 @@
# define __GCC4_has_attribute___nonstring__ 0
# define __GCC4_has_attribute___no_sanitize_address__ 1
# define __GCC4_has_attribute___no_sanitize_undefined__ 1
+# define __GCC4_has_attribute___no_sanitize_coverage__ 0
# define __GCC4_has_attribute___fallthrough__ 0
#endif

--
2.32.0.93.g670b81a890-goog


2021-07-14 17:07:19

by Miguel Ojeda

[permalink] [raw]
Subject: Re: [PATCH] compiler_attributes: fix __has_attribute(__no_sanitize_coverage__) for gcc 4

On Wed, Jul 14, 2021 at 5:02 PM Marco Elver <[email protected]> wrote:
>
> Fix __has_attribute(__no_sanitize_coverage__) for GCC 4 by defining
> __GCC4_has_attribute___no_sanitize_coverage__.
>
> Fixes: 540540d06e9d ("kcov: add __no_sanitize_coverage to fix noinstr for all architectures")
> Reported-by: Geert Uytterhoeven <[email protected]>
> Signed-off-by: Marco Elver <[email protected]>

Looks good, thanks -- I will pick it up tomorrow.

Cheers,
Miguel

2021-07-15 23:16:19

by Miguel Ojeda

[permalink] [raw]
Subject: Re: [PATCH] compiler_attributes: fix __has_attribute(__no_sanitize_coverage__) for gcc 4

On Wed, Jul 14, 2021 at 7:05 PM Miguel Ojeda
<[email protected]> wrote:
>
> Looks good, thanks -- I will pick it up tomorrow.

Queued.

Cheers,
Miguel