Other macros that define shorthands for attributes in e.g.
`compiler_attributes.h` and elsewhere use underscores.
Signed-off-by: Miguel Ojeda <[email protected]>
---
include/linux/compiler-gcc.h | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/include/linux/compiler-gcc.h b/include/linux/compiler-gcc.h
index f55a37efdb97..b9530d3515ac 100644
--- a/include/linux/compiler-gcc.h
+++ b/include/linux/compiler-gcc.h
@@ -83,25 +83,25 @@
#endif
#if __has_attribute(__no_sanitize_address__)
-#define __no_sanitize_address __attribute__((no_sanitize_address))
+#define __no_sanitize_address __attribute__((__no_sanitize_address__))
#else
#define __no_sanitize_address
#endif
#if defined(__SANITIZE_THREAD__) && __has_attribute(__no_sanitize_thread__)
-#define __no_sanitize_thread __attribute__((no_sanitize_thread))
+#define __no_sanitize_thread __attribute__((__no_sanitize_thread__))
#else
#define __no_sanitize_thread
#endif
#if __has_attribute(__no_sanitize_undefined__)
-#define __no_sanitize_undefined __attribute__((no_sanitize_undefined))
+#define __no_sanitize_undefined __attribute__((__no_sanitize_undefined__))
#else
#define __no_sanitize_undefined
#endif
#if defined(CONFIG_KCOV) && __has_attribute(__no_sanitize_coverage__)
-#define __no_sanitize_coverage __attribute__((no_sanitize_coverage))
+#define __no_sanitize_coverage __attribute__((__no_sanitize_coverage__))
#else
#define __no_sanitize_coverage
#endif
base-commit: 9abf2313adc1ca1b6180c508c25f22f9395cc780
--
2.38.1
The attribute was added in GCC 5.1, which matches the minimum GCC version
supported by the kernel.
Therefore, remove the check.
Link: https://godbolt.org/z/vbxKejxbx
Signed-off-by: Miguel Ojeda <[email protected]>
---
include/linux/compiler-gcc.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/include/linux/compiler-gcc.h b/include/linux/compiler-gcc.h
index bfce7f4d0978..ba207deb77ca 100644
--- a/include/linux/compiler-gcc.h
+++ b/include/linux/compiler-gcc.h
@@ -84,7 +84,7 @@
#define __no_sanitize_address __attribute__((__no_sanitize_address__))
-#if defined(__SANITIZE_THREAD__) && __has_attribute(__no_sanitize_thread__)
+#if defined(__SANITIZE_THREAD__)
#define __no_sanitize_thread __attribute__((__no_sanitize_thread__))
#else
#define __no_sanitize_thread
--
2.38.1
The attribute was added in GCC 12.1.
This will simplify future cleanups, and is closer to what we do
in `compiler_attributes.h`.
Link: https://godbolt.org/z/MGbT76j6G
Signed-off-by: Miguel Ojeda <[email protected]>
---
include/linux/compiler-gcc.h | 3 +++
1 file changed, 3 insertions(+)
diff --git a/include/linux/compiler-gcc.h b/include/linux/compiler-gcc.h
index 7f2c2bb73815..7af9e34ec261 100644
--- a/include/linux/compiler-gcc.h
+++ b/include/linux/compiler-gcc.h
@@ -92,6 +92,9 @@
#define __no_sanitize_undefined __attribute__((__no_sanitize_undefined__))
+/*
+ * Only supported since gcc >= 12
+ */
#if defined(CONFIG_KCOV) && __has_attribute(__no_sanitize_coverage__)
#define __no_sanitize_coverage __attribute__((__no_sanitize_coverage__))
#else
--
2.38.1
The attribute was added in GCC 4.9, while the minimum GCC version
supported by the kernel is GCC 5.1.
Therefore, remove the check.
Link: https://godbolt.org/z/GrMeo6fYr
Signed-off-by: Miguel Ojeda <[email protected]>
---
include/linux/compiler-gcc.h | 4 ----
1 file changed, 4 deletions(-)
diff --git a/include/linux/compiler-gcc.h b/include/linux/compiler-gcc.h
index ba207deb77ca..7f2c2bb73815 100644
--- a/include/linux/compiler-gcc.h
+++ b/include/linux/compiler-gcc.h
@@ -90,11 +90,7 @@
#define __no_sanitize_thread
#endif
-#if __has_attribute(__no_sanitize_undefined__)
#define __no_sanitize_undefined __attribute__((__no_sanitize_undefined__))
-#else
-#define __no_sanitize_undefined
-#endif
#if defined(CONFIG_KCOV) && __has_attribute(__no_sanitize_coverage__)
#define __no_sanitize_coverage __attribute__((__no_sanitize_coverage__))
--
2.38.1
On Fri, 21 Oct 2022 at 05:00, Miguel Ojeda <[email protected]> wrote:
>
> The attribute was added in GCC 5.1, which matches the minimum GCC version
> supported by the kernel.
>
> Therefore, remove the check.
>
> Link: https://godbolt.org/z/vbxKejxbx
> Signed-off-by: Miguel Ojeda <[email protected]>
Acked-by: Marco Elver <[email protected]>
> ---
> include/linux/compiler-gcc.h | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/include/linux/compiler-gcc.h b/include/linux/compiler-gcc.h
> index bfce7f4d0978..ba207deb77ca 100644
> --- a/include/linux/compiler-gcc.h
> +++ b/include/linux/compiler-gcc.h
> @@ -84,7 +84,7 @@
>
> #define __no_sanitize_address __attribute__((__no_sanitize_address__))
>
> -#if defined(__SANITIZE_THREAD__) && __has_attribute(__no_sanitize_thread__)
> +#if defined(__SANITIZE_THREAD__)
> #define __no_sanitize_thread __attribute__((__no_sanitize_thread__))
> #else
> #define __no_sanitize_thread
> --
> 2.38.1
>
On Fri, 21 Oct 2022 at 05:00, Miguel Ojeda <[email protected]> wrote:
>
> The attribute was added in GCC 12.1.
>
> This will simplify future cleanups, and is closer to what we do
> in `compiler_attributes.h`.
>
> Link: https://godbolt.org/z/MGbT76j6G
> Signed-off-by: Miguel Ojeda <[email protected]>
Acked-by: Marco Elver <[email protected]>
> ---
> include/linux/compiler-gcc.h | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/include/linux/compiler-gcc.h b/include/linux/compiler-gcc.h
> index 7f2c2bb73815..7af9e34ec261 100644
> --- a/include/linux/compiler-gcc.h
> +++ b/include/linux/compiler-gcc.h
> @@ -92,6 +92,9 @@
>
> #define __no_sanitize_undefined __attribute__((__no_sanitize_undefined__))
>
> +/*
> + * Only supported since gcc >= 12
> + */
> #if defined(CONFIG_KCOV) && __has_attribute(__no_sanitize_coverage__)
> #define __no_sanitize_coverage __attribute__((__no_sanitize_coverage__))
> #else
> --
> 2.38.1
>
On Fri, Oct 21, 2022 at 01:59:55PM +0200, Miguel Ojeda wrote:
> The attribute was added in GCC 4.9, while the minimum GCC version
> supported by the kernel is GCC 5.1.
>
> Therefore, remove the check.
>
> Link: https://godbolt.org/z/GrMeo6fYr
> Signed-off-by: Miguel Ojeda <[email protected]>
Reviewed-by: Kees Cook <[email protected]>
--
Kees Cook
On Fri, Oct 21, 2022 at 01:59:54PM +0200, Miguel Ojeda wrote:
> The attribute was added in GCC 5.1, which matches the minimum GCC version
> supported by the kernel.
>
> Therefore, remove the check.
>
> Link: https://godbolt.org/z/vbxKejxbx
> Signed-off-by: Miguel Ojeda <[email protected]>
Reviewed-by: Kees Cook <[email protected]>
--
Kees Cook
On Fri, Oct 21, 2022 at 01:59:52PM +0200, Miguel Ojeda wrote:
> Other macros that define shorthands for attributes in e.g.
> `compiler_attributes.h` and elsewhere use underscores.
>
> Signed-off-by: Miguel Ojeda <[email protected]>
Reviewed-by: Kees Cook <[email protected]>
--
Kees Cook
On Fri, Oct 21, 2022 at 01:59:56PM +0200, Miguel Ojeda wrote:
> The attribute was added in GCC 12.1.
>
> This will simplify future cleanups, and is closer to what we do
> in `compiler_attributes.h`.
>
> Link: https://godbolt.org/z/MGbT76j6G
> Signed-off-by: Miguel Ojeda <[email protected]>
Reviewed-by: Kees Cook <[email protected]>
--
Kees Cook
On Fri, Oct 21, 2022 at 01:59:55PM +0200, Miguel Ojeda wrote:
> The attribute was added in GCC 4.9, while the minimum GCC version
> supported by the kernel is GCC 5.1.
>
> Therefore, remove the check.
>
> Link: https://godbolt.org/z/GrMeo6fYr
> Signed-off-by: Miguel Ojeda <[email protected]>
Reviewed-by: Nathan Chancellor <[email protected]>
> ---
> include/linux/compiler-gcc.h | 4 ----
> 1 file changed, 4 deletions(-)
>
> diff --git a/include/linux/compiler-gcc.h b/include/linux/compiler-gcc.h
> index ba207deb77ca..7f2c2bb73815 100644
> --- a/include/linux/compiler-gcc.h
> +++ b/include/linux/compiler-gcc.h
> @@ -90,11 +90,7 @@
> #define __no_sanitize_thread
> #endif
>
> -#if __has_attribute(__no_sanitize_undefined__)
> #define __no_sanitize_undefined __attribute__((__no_sanitize_undefined__))
> -#else
> -#define __no_sanitize_undefined
> -#endif
>
> #if defined(CONFIG_KCOV) && __has_attribute(__no_sanitize_coverage__)
> #define __no_sanitize_coverage __attribute__((__no_sanitize_coverage__))
> --
> 2.38.1
>
>
On Fri, Oct 21, 2022 at 01:59:56PM +0200, Miguel Ojeda wrote:
> The attribute was added in GCC 12.1.
>
> This will simplify future cleanups, and is closer to what we do
> in `compiler_attributes.h`.
>
> Link: https://godbolt.org/z/MGbT76j6G
> Signed-off-by: Miguel Ojeda <[email protected]>
Reviewed-by: Nathan Chancellor <[email protected]>
> ---
> include/linux/compiler-gcc.h | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/include/linux/compiler-gcc.h b/include/linux/compiler-gcc.h
> index 7f2c2bb73815..7af9e34ec261 100644
> --- a/include/linux/compiler-gcc.h
> +++ b/include/linux/compiler-gcc.h
> @@ -92,6 +92,9 @@
>
> #define __no_sanitize_undefined __attribute__((__no_sanitize_undefined__))
>
> +/*
> + * Only supported since gcc >= 12
> + */
> #if defined(CONFIG_KCOV) && __has_attribute(__no_sanitize_coverage__)
> #define __no_sanitize_coverage __attribute__((__no_sanitize_coverage__))
> #else
> --
> 2.38.1
>
>
On Fri, Oct 21, 2022 at 01:59:52PM +0200, Miguel Ojeda wrote:
> Other macros that define shorthands for attributes in e.g.
> `compiler_attributes.h` and elsewhere use underscores.
>
> Signed-off-by: Miguel Ojeda <[email protected]>
Reviewed-by: Nathan Chancellor <[email protected]>
> ---
> include/linux/compiler-gcc.h | 8 ++++----
> 1 file changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/include/linux/compiler-gcc.h b/include/linux/compiler-gcc.h
> index f55a37efdb97..b9530d3515ac 100644
> --- a/include/linux/compiler-gcc.h
> +++ b/include/linux/compiler-gcc.h
> @@ -83,25 +83,25 @@
> #endif
>
> #if __has_attribute(__no_sanitize_address__)
> -#define __no_sanitize_address __attribute__((no_sanitize_address))
> +#define __no_sanitize_address __attribute__((__no_sanitize_address__))
> #else
> #define __no_sanitize_address
> #endif
>
> #if defined(__SANITIZE_THREAD__) && __has_attribute(__no_sanitize_thread__)
> -#define __no_sanitize_thread __attribute__((no_sanitize_thread))
> +#define __no_sanitize_thread __attribute__((__no_sanitize_thread__))
> #else
> #define __no_sanitize_thread
> #endif
>
> #if __has_attribute(__no_sanitize_undefined__)
> -#define __no_sanitize_undefined __attribute__((no_sanitize_undefined))
> +#define __no_sanitize_undefined __attribute__((__no_sanitize_undefined__))
> #else
> #define __no_sanitize_undefined
> #endif
>
> #if defined(CONFIG_KCOV) && __has_attribute(__no_sanitize_coverage__)
> -#define __no_sanitize_coverage __attribute__((no_sanitize_coverage))
> +#define __no_sanitize_coverage __attribute__((__no_sanitize_coverage__))
> #else
> #define __no_sanitize_coverage
> #endif
>
> base-commit: 9abf2313adc1ca1b6180c508c25f22f9395cc780
> --
> 2.38.1
>
>
On Fri, Oct 21, 2022 at 01:59:54PM +0200, Miguel Ojeda wrote:
> The attribute was added in GCC 5.1, which matches the minimum GCC version
> supported by the kernel.
>
> Therefore, remove the check.
>
> Link: https://godbolt.org/z/vbxKejxbx
> Signed-off-by: Miguel Ojeda <[email protected]>
Reviewed-by: Nathan Chancellor <[email protected]>
> ---
> include/linux/compiler-gcc.h | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/include/linux/compiler-gcc.h b/include/linux/compiler-gcc.h
> index bfce7f4d0978..ba207deb77ca 100644
> --- a/include/linux/compiler-gcc.h
> +++ b/include/linux/compiler-gcc.h
> @@ -84,7 +84,7 @@
>
> #define __no_sanitize_address __attribute__((__no_sanitize_address__))
>
> -#if defined(__SANITIZE_THREAD__) && __has_attribute(__no_sanitize_thread__)
> +#if defined(__SANITIZE_THREAD__)
> #define __no_sanitize_thread __attribute__((__no_sanitize_thread__))
> #else
> #define __no_sanitize_thread
> --
> 2.38.1
>
>