All of lore.kernel.org
 help / color / mirror / Atom feed
* [peterz-queue:x86/entry 5/8] include/linux/compiler-gcc.h:153:5: note: in expansion of macro '__has_attribute'
@ 2020-06-15 19:48 kernel test robot
  2020-06-15 23:15   ` Marco Elver
  0 siblings, 1 reply; 11+ messages in thread
From: kernel test robot @ 2020-06-15 19:48 UTC (permalink / raw)
  To: kbuild-all

[-- Attachment #1: Type: text/plain, Size: 8637 bytes --]

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/peterz/queue.git x86/entry
head:   8e8bb06d199a5aa7a534aa3b3fc0abbbc11ca438
commit: 5144f8a8dfd7b3681f0a2b5bf599a210b2315018 [5/8] compiler_types.h: Add __no_sanitize_{address,undefined} to noinstr
config: i386-randconfig-a006-20200615 (attached as .config)
compiler: gcc-4.9 (Ubuntu 4.9.3-13ubuntu2) 4.9.3
reproduce (this is a W=1 build):
        git checkout 5144f8a8dfd7b3681f0a2b5bf599a210b2315018
        # save the attached .config to linux build tree
        make W=1 ARCH=i386 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>

All warnings (new ones prefixed by >>, old ones prefixed by <<):

In file included from include/linux/compiler_types.h:59:0,
from <command-line>:0:
>> include/linux/compiler_attributes.h:35:29: warning: "__GCC4_has_attribute___no_sanitize_undefined__" is not defined [-Wundef]
# define __has_attribute(x) __GCC4_has_attribute_##x
^
>> include/linux/compiler-gcc.h:153:5: note: in expansion of macro '__has_attribute'
#if __has_attribute(__no_sanitize_undefined__)
^
--
In file included from include/linux/compiler_types.h:59:0,
from <command-line>:0:
>> include/linux/compiler_attributes.h:35:29: warning: "__GCC4_has_attribute___no_sanitize_undefined__" is not defined [-Wundef]
# define __has_attribute(x) __GCC4_has_attribute_##x
^
>> include/linux/compiler-gcc.h:153:5: note: in expansion of macro '__has_attribute'
#if __has_attribute(__no_sanitize_undefined__)
^
drivers/xen/xenbus/xenbus_client.c: In function 'xenbus_va_dev_error':
drivers/xen/xenbus/xenbus_client.c:276:2: warning: function might be possible candidate for 'gnu_printf' format attribute [-Wsuggest-attribute=format]
vsnprintf(printf_buffer + len, PRINTF_BUFFER_SIZE - len, fmt, ap);
^
--
In file included from include/linux/compiler_types.h:59:0,
from <command-line>:0:
>> include/linux/compiler_attributes.h:35:29: warning: "__GCC4_has_attribute___no_sanitize_undefined__" is not defined [-Wundef]
# define __has_attribute(x) __GCC4_has_attribute_##x
^
>> include/linux/compiler-gcc.h:153:5: note: in expansion of macro '__has_attribute'
#if __has_attribute(__no_sanitize_undefined__)
^
lib/math/div64.c:29:32: warning: no previous prototype for '__div64_32' [-Wmissing-prototypes]
uint32_t __attribute__((weak)) __div64_32(uint64_t *n, uint32_t base)
^
--
In file included from include/linux/compiler_types.h:59:0,
from <command-line>:0:
>> include/linux/compiler_attributes.h:35:29: warning: "__GCC4_has_attribute___no_sanitize_undefined__" is not defined [-Wundef]
# define __has_attribute(x) __GCC4_has_attribute_##x
^
>> include/linux/compiler-gcc.h:153:5: note: in expansion of macro '__has_attribute'
#if __has_attribute(__no_sanitize_undefined__)
^
drivers/regulator/core.c:3805:5: warning: no previous prototype for 'regulator_suspend_enable' [-Wmissing-prototypes]
int regulator_suspend_enable(struct regulator_dev *rdev,
^
drivers/regulator/core.c:3812:5: warning: no previous prototype for 'regulator_suspend_disable' [-Wmissing-prototypes]
int regulator_suspend_disable(struct regulator_dev *rdev,
^
drivers/regulator/core.c:3851:5: warning: no previous prototype for 'regulator_set_suspend_voltage' [-Wmissing-prototypes]
int regulator_set_suspend_voltage(struct regulator *regulator, int min_uV,
^
--
In file included from include/linux/compiler_types.h:59:0,
from <command-line>:0:
>> include/linux/compiler_attributes.h:35:29: warning: "__GCC4_has_attribute___no_sanitize_undefined__" is not defined [-Wundef]
# define __has_attribute(x) __GCC4_has_attribute_##x
^
>> include/linux/compiler-gcc.h:153:5: note: in expansion of macro '__has_attribute'
#if __has_attribute(__no_sanitize_undefined__)
^
drivers/regulator/da9063-regulator.c:515:3: warning: initialized field overwritten [-Woverride-init]
.suspend = BFIELD(DA9063_REG_LDO9_CONT, DA9063_VLDO9_SEL),
^
drivers/regulator/da9063-regulator.c:515:3: warning: (near initialization for 'da9063_regulator_info[11].suspend') [-Woverride-init]
--
In file included from include/linux/compiler_types.h:59:0,
from <command-line>:0:
>> include/linux/compiler_attributes.h:35:29: warning: "__GCC4_has_attribute___no_sanitize_undefined__" is not defined [-Wundef]
# define __has_attribute(x) __GCC4_has_attribute_##x
^
>> include/linux/compiler-gcc.h:153:5: note: in expansion of macro '__has_attribute'
#if __has_attribute(__no_sanitize_undefined__)
^
drivers/regulator/tps65218-regulator.c: In function 'tps65218_pmic_set_suspend_enable':
drivers/regulator/tps65218-regulator.c:131:10: warning: comparison of unsigned expression < 0 is always false [-Wtype-limits]
if (rid < TPS65218_DCDC_1 || rid > TPS65218_LDO_1)
^
drivers/regulator/tps65218-regulator.c: In function 'tps65218_pmic_set_suspend_disable':
drivers/regulator/tps65218-regulator.c:144:10: warning: comparison of unsigned expression < 0 is always false [-Wtype-limits]
if (rid < TPS65218_DCDC_1 || rid > TPS65218_LDO_1)
^
--
In file included from include/linux/compiler_types.h:59:0,
from <command-line>:0:
>> include/linux/compiler_attributes.h:35:29: warning: "__GCC4_has_attribute___no_sanitize_undefined__" is not defined [-Wundef]
# define __has_attribute(x) __GCC4_has_attribute_##x
^
>> include/linux/compiler-gcc.h:153:5: note: in expansion of macro '__has_attribute'
#if __has_attribute(__no_sanitize_undefined__)
^
arch/x86/lib/cmdline.c:204:5: warning: no previous prototype for 'cmdline_find_option_bool' [-Wmissing-prototypes]
int cmdline_find_option_bool(const char *cmdline, const char *option)
^
arch/x86/lib/cmdline.c:209:5: warning: no previous prototype for 'cmdline_find_option' [-Wmissing-prototypes]
int cmdline_find_option(const char *cmdline, const char *option, char *buffer,
^
--
In file included from include/linux/compiler_types.h:59:0,
from <command-line>:0:
>> include/linux/compiler_attributes.h:35:29: warning: "__GCC4_has_attribute___no_sanitize_undefined__" is not defined [-Wundef]
# define __has_attribute(x) __GCC4_has_attribute_##x
^
>> include/linux/compiler-gcc.h:153:5: note: in expansion of macro '__has_attribute'
#if __has_attribute(__no_sanitize_undefined__)
^
arch/x86/lib/misc.c:7:5: warning: no previous prototype for 'num_digits' [-Wmissing-prototypes]
int num_digits(int val)
^
--
In file included from include/linux/compiler_types.h:59:0,
from <command-line>:0:
>> include/linux/compiler_attributes.h:35:29: warning: "__GCC4_has_attribute___no_sanitize_undefined__" is not defined [-Wundef]
# define __has_attribute(x) __GCC4_has_attribute_##x
^
>> include/linux/compiler-gcc.h:153:5: note: in expansion of macro '__has_attribute'
#if __has_attribute(__no_sanitize_undefined__)
^
arch/x86/lib/msr.c:39:5: warning: no previous prototype for 'msr_read' [-Wmissing-prototypes]
int msr_read(u32 msr, struct msr *m)
^
arch/x86/lib/msr.c:57:5: warning: no previous prototype for 'msr_write' [-Wmissing-prototypes]
int msr_write(u32 msr, struct msr *m)
^
--
In file included from include/linux/compiler_types.h:59:0,
from <command-line>:0:
>> include/linux/compiler_attributes.h:35:29: warning: "__GCC4_has_attribute___no_sanitize_undefined__" is not defined [-Wundef]
# define __has_attribute(x) __GCC4_has_attribute_##x
^
>> include/linux/compiler-gcc.h:153:5: note: in expansion of macro '__has_attribute'
#if __has_attribute(__no_sanitize_undefined__)
^
fs/ext4/super.c: In function 'ext4_remount':
fs/ext4/super.c:5384:6: warning: variable 'enable_quota' set but not used [-Wunused-but-set-variable]
int enable_quota = 0;
^
--
In file included from include/linux/compiler_types.h:59:0,
from <command-line>:0:
>> include/linux/compiler_attributes.h:35:29: warning: "__GCC4_has_attribute___no_sanitize_undefined__" is not defined [-Wundef]
# define __has_attribute(x) __GCC4_has_attribute_##x
^
>> include/linux/compiler-gcc.h:153:5: note: in expansion of macro '__has_attribute'
#if __has_attribute(__no_sanitize_undefined__)
^
drivers/tty/tty_ldisc.c:884:6: warning: no previous prototype for 'tty_sysctl_init' [-Wmissing-prototypes]
void tty_sysctl_init(void)
^
..

vim +/__has_attribute +153 include/linux/compiler-gcc.h

   152	
 > 153	#if __has_attribute(__no_sanitize_undefined__)
   154	#define __no_sanitize_undefined __attribute__((no_sanitize_undefined))
   155	#else
   156	#define __no_sanitize_undefined
   157	#endif
   158	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org

[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 42685 bytes --]

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [PATCH] compiler_attributes.h: Support no_sanitize_undefined check with GCC 4
  2020-06-15 19:48 [peterz-queue:x86/entry 5/8] include/linux/compiler-gcc.h:153:5: note: in expansion of macro '__has_attribute' kernel test robot
@ 2020-06-15 23:15   ` Marco Elver
  0 siblings, 0 replies; 11+ messages in thread
From: Marco Elver @ 2020-06-15 23:15 UTC (permalink / raw)
  To: Peter Zijlstra; +Cc: kernel test robot, kbuild-all, Miguel Ojeda, linux-kernel

UBSAN is supported since GCC 4.9, which unfortunately did not yet have
__has_attribute(). To work around, the __GCC4_has_attribute workaround
requires defining which compiler version supports the given attribute.

In the case of no_sanitize_undefined, it is the first version that
supports UBSAN, which is GCC 4.9.

Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Marco Elver <elver@google.com>
---

Doing a 'make W=1' with GCC 4.9 and the provided config fixes the build
robot's report.

Peter: Feel free to either squash this patch into the one adding
__no_sanitize_undefined or apply on top.

Although at this point we don't have any users of
__no_sanitize_undefined anymore since objtool resolved the noinstr
problem for UBSAN differently. We should probably keep the attribute
around because eventually somebody will need it.

Thanks,
-- Marco

---
 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 cdf016596659..c8f03d2969df 100644
--- a/include/linux/compiler_attributes.h
+++ b/include/linux/compiler_attributes.h
@@ -40,6 +40,7 @@
 # define __GCC4_has_attribute___noclone__             1
 # define __GCC4_has_attribute___nonstring__           0
 # define __GCC4_has_attribute___no_sanitize_address__ (__GNUC_MINOR__ >= 8)
+# define __GCC4_has_attribute___no_sanitize_undefined__ (__GNUC_MINOR__ >= 9)
 # define __GCC4_has_attribute___fallthrough__         0
 #endif
 
-- 
2.27.0.290.gba653c62da-goog

^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [PATCH] compiler_attributes.h: Support no_sanitize_undefined check with GCC 4
@ 2020-06-15 23:15   ` Marco Elver
  0 siblings, 0 replies; 11+ messages in thread
From: Marco Elver @ 2020-06-15 23:15 UTC (permalink / raw)
  To: kbuild-all

[-- Attachment #1: Type: text/plain, Size: 1583 bytes --]

UBSAN is supported since GCC 4.9, which unfortunately did not yet have
__has_attribute(). To work around, the __GCC4_has_attribute workaround
requires defining which compiler version supports the given attribute.

In the case of no_sanitize_undefined, it is the first version that
supports UBSAN, which is GCC 4.9.

Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Marco Elver <elver@google.com>
---

Doing a 'make W=1' with GCC 4.9 and the provided config fixes the build
robot's report.

Peter: Feel free to either squash this patch into the one adding
__no_sanitize_undefined or apply on top.

Although at this point we don't have any users of
__no_sanitize_undefined anymore since objtool resolved the noinstr
problem for UBSAN differently. We should probably keep the attribute
around because eventually somebody will need it.

Thanks,
-- Marco

---
 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 cdf016596659..c8f03d2969df 100644
--- a/include/linux/compiler_attributes.h
+++ b/include/linux/compiler_attributes.h
@@ -40,6 +40,7 @@
 # define __GCC4_has_attribute___noclone__             1
 # define __GCC4_has_attribute___nonstring__           0
 # define __GCC4_has_attribute___no_sanitize_address__ (__GNUC_MINOR__ >= 8)
+# define __GCC4_has_attribute___no_sanitize_undefined__ (__GNUC_MINOR__ >= 9)
 # define __GCC4_has_attribute___fallthrough__         0
 #endif
 
-- 
2.27.0.290.gba653c62da-goog

^ permalink raw reply related	[flat|nested] 11+ messages in thread

* Re: [PATCH] compiler_attributes.h: Support no_sanitize_undefined check with GCC 4
  2020-06-15 23:15   ` Marco Elver
  (?)
@ 2020-06-16 13:09   ` Miguel Ojeda
  -1 siblings, 0 replies; 11+ messages in thread
From: Miguel Ojeda @ 2020-06-16 13:09 UTC (permalink / raw)
  To: Marco Elver; +Cc: Peter Zijlstra, kernel test robot, kbuild-all, linux-kernel

Hi Marco,

On Tue, Jun 16, 2020 at 1:15 AM Marco Elver <elver@google.com> wrote:
>
> UBSAN is supported since GCC 4.9, which unfortunately did not yet have
> __has_attribute(). To work around, the __GCC4_has_attribute workaround
> requires defining which compiler version supports the given attribute.
>
> In the case of no_sanitize_undefined, it is the first version that
> supports UBSAN, which is GCC 4.9.
>
> Reported-by: kernel test robot <lkp@intel.com>
> Signed-off-by: Marco Elver <elver@google.com>
> ---

I am happy to see the `__GCC4_has_attribute` workaround is useful
outside the file, too (originally the list was meant to be used inside
the file itself, but I see it is good to reuse it).

Reviewed-by: Miguel Ojeda <miguel.ojeda.sandonis@gmail.com>

Cheers,
Miguel

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH] compiler_attributes.h: Support no_sanitize_undefined check with GCC 4
  2020-06-15 23:15   ` Marco Elver
@ 2020-06-16 13:19     ` Peter Zijlstra
  -1 siblings, 0 replies; 11+ messages in thread
From: Peter Zijlstra @ 2020-06-16 13:19 UTC (permalink / raw)
  To: Marco Elver
  Cc: kernel test robot, kbuild-all, Miguel Ojeda, linux-kernel,
	Thomas Gleixner

On Tue, Jun 16, 2020 at 01:15:29AM +0200, Marco Elver wrote:
> UBSAN is supported since GCC 4.9, which unfortunately did not yet have
> __has_attribute(). To work around, the __GCC4_has_attribute workaround
> requires defining which compiler version supports the given attribute.
> 
> In the case of no_sanitize_undefined, it is the first version that
> supports UBSAN, which is GCC 4.9.
> 
> Reported-by: kernel test robot <lkp@intel.com>
> Signed-off-by: Marco Elver <elver@google.com>
> ---
> 
> Doing a 'make W=1' with GCC 4.9 and the provided config fixes the build
> robot's report.
> 
> Peter: Feel free to either squash this patch into the one adding
> __no_sanitize_undefined or apply on top.

Yeah, argh! So I only saw this thread now, even though I'd already
pushed out x86/entry to tip last night due to getting:

301805 N + Jun 16 kernel test rob (5.8K) [peterz-queue:x86/entry] BUILD SUCCESS 8e8bb06d199a5aa7a534aa3b3fc0abbbc11ca438

Why that thing is claiming SUCCESS when it introduces a build error I
don't know.

Anyway, let me go push this thing on top.

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH] compiler_attributes.h: Support no_sanitize_undefined check with GCC 4
@ 2020-06-16 13:19     ` Peter Zijlstra
  0 siblings, 0 replies; 11+ messages in thread
From: Peter Zijlstra @ 2020-06-16 13:19 UTC (permalink / raw)
  To: kbuild-all

[-- Attachment #1: Type: text/plain, Size: 1098 bytes --]

On Tue, Jun 16, 2020 at 01:15:29AM +0200, Marco Elver wrote:
> UBSAN is supported since GCC 4.9, which unfortunately did not yet have
> __has_attribute(). To work around, the __GCC4_has_attribute workaround
> requires defining which compiler version supports the given attribute.
> 
> In the case of no_sanitize_undefined, it is the first version that
> supports UBSAN, which is GCC 4.9.
> 
> Reported-by: kernel test robot <lkp@intel.com>
> Signed-off-by: Marco Elver <elver@google.com>
> ---
> 
> Doing a 'make W=1' with GCC 4.9 and the provided config fixes the build
> robot's report.
> 
> Peter: Feel free to either squash this patch into the one adding
> __no_sanitize_undefined or apply on top.

Yeah, argh! So I only saw this thread now, even though I'd already
pushed out x86/entry to tip last night due to getting:

301805 N + Jun 16 kernel test rob (5.8K) [peterz-queue:x86/entry] BUILD SUCCESS 8e8bb06d199a5aa7a534aa3b3fc0abbbc11ca438

Why that thing is claiming SUCCESS when it introduces a build error I
don't know.

Anyway, let me go push this thing on top.

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [kbuild-all] Re: [PATCH] compiler_attributes.h: Support no_sanitize_undefined check with GCC 4
  2020-06-16 13:19     ` Peter Zijlstra
@ 2020-06-17  1:00       ` Rong Chen
  -1 siblings, 0 replies; 11+ messages in thread
From: Rong Chen @ 2020-06-17  1:00 UTC (permalink / raw)
  To: Peter Zijlstra
  Cc: Marco Elver, kernel test robot, kbuild-all, Miguel Ojeda,
	linux-kernel, Thomas Gleixner

On Tue, Jun 16, 2020 at 03:19:21PM +0200, Peter Zijlstra wrote:
> On Tue, Jun 16, 2020 at 01:15:29AM +0200, Marco Elver wrote:
> > UBSAN is supported since GCC 4.9, which unfortunately did not yet have
> > __has_attribute(). To work around, the __GCC4_has_attribute workaround
> > requires defining which compiler version supports the given attribute.
> > 
> > In the case of no_sanitize_undefined, it is the first version that
> > supports UBSAN, which is GCC 4.9.
> > 
> > Reported-by: kernel test robot <lkp@intel.com>
> > Signed-off-by: Marco Elver <elver@google.com>
> > ---
> > 
> > Doing a 'make W=1' with GCC 4.9 and the provided config fixes the build
> > robot's report.
> > 
> > Peter: Feel free to either squash this patch into the one adding
> > __no_sanitize_undefined or apply on top.
> 
> Yeah, argh! So I only saw this thread now, even though I'd already
> pushed out x86/entry to tip last night due to getting:
> 
> 301805 N + Jun 16 kernel test rob (5.8K) [peterz-queue:x86/entry] BUILD SUCCESS 8e8bb06d199a5aa7a534aa3b3fc0abbbc11ca438
> 
> Why that thing is claiming SUCCESS when it introduces a build error I
> don't know.
> 


Hi Peter,

Sorry for the misunderstanding, some folks complained that it's too
noisy when there're only new warnings in a "BUILD REGRESSION" report,
so we changed to use "BUILD SUCCESS" if there's no new build error. To
avoid misunderstanding, we'll change build complete report title to
"BUILD SUCCESS WITH WARNING" for new warnings.

Best Regards,
Rong Chen

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH] compiler_attributes.h: Support no_sanitize_undefined check with GCC 4
@ 2020-06-17  1:00       ` Rong Chen
  0 siblings, 0 replies; 11+ messages in thread
From: Rong Chen @ 2020-06-17  1:00 UTC (permalink / raw)
  To: kbuild-all

[-- Attachment #1: Type: text/plain, Size: 1546 bytes --]

On Tue, Jun 16, 2020 at 03:19:21PM +0200, Peter Zijlstra wrote:
> On Tue, Jun 16, 2020 at 01:15:29AM +0200, Marco Elver wrote:
> > UBSAN is supported since GCC 4.9, which unfortunately did not yet have
> > __has_attribute(). To work around, the __GCC4_has_attribute workaround
> > requires defining which compiler version supports the given attribute.
> > 
> > In the case of no_sanitize_undefined, it is the first version that
> > supports UBSAN, which is GCC 4.9.
> > 
> > Reported-by: kernel test robot <lkp@intel.com>
> > Signed-off-by: Marco Elver <elver@google.com>
> > ---
> > 
> > Doing a 'make W=1' with GCC 4.9 and the provided config fixes the build
> > robot's report.
> > 
> > Peter: Feel free to either squash this patch into the one adding
> > __no_sanitize_undefined or apply on top.
> 
> Yeah, argh! So I only saw this thread now, even though I'd already
> pushed out x86/entry to tip last night due to getting:
> 
> 301805 N + Jun 16 kernel test rob (5.8K) [peterz-queue:x86/entry] BUILD SUCCESS 8e8bb06d199a5aa7a534aa3b3fc0abbbc11ca438
> 
> Why that thing is claiming SUCCESS when it introduces a build error I
> don't know.
> 


Hi Peter,

Sorry for the misunderstanding, some folks complained that it's too
noisy when there're only new warnings in a "BUILD REGRESSION" report,
so we changed to use "BUILD SUCCESS" if there's no new build error. To
avoid misunderstanding, we'll change build complete report title to
"BUILD SUCCESS WITH WARNING" for new warnings.

Best Regards,
Rong Chen

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [tip: x86/entry] compiler_attributes.h: Support no_sanitize_undefined check with GCC 4
  2020-06-15 23:15   ` Marco Elver
                     ` (2 preceding siblings ...)
  (?)
@ 2020-06-17  8:30   ` tip-bot2 for Marco Elver
  -1 siblings, 0 replies; 11+ messages in thread
From: tip-bot2 for Marco Elver @ 2020-06-17  8:30 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: kernel test robot, Marco Elver, Peter Zijlstra (Intel),
	Miguel Ojeda, x86, LKML

The following commit has been merged into the x86/entry branch of tip:

Commit-ID:     33aea07f30c261eff7ba229f19fd1b161e0fb851
Gitweb:        https://git.kernel.org/tip/33aea07f30c261eff7ba229f19fd1b161e0fb851
Author:        Marco Elver <elver@google.com>
AuthorDate:    Tue, 16 Jun 2020 01:15:29 +02:00
Committer:     Peter Zijlstra <peterz@infradead.org>
CommitterDate: Tue, 16 Jun 2020 15:35:02 +02:00

compiler_attributes.h: Support no_sanitize_undefined check with GCC 4

UBSAN is supported since GCC 4.9, which unfortunately did not yet have
__has_attribute(). To work around, the __GCC4_has_attribute workaround
requires defining which compiler version supports the given attribute.

In the case of no_sanitize_undefined, it is the first version that
supports UBSAN, which is GCC 4.9.

Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Marco Elver <elver@google.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Reviewed-by: Miguel Ojeda <miguel.ojeda.sandonis@gmail.com>
Link: https://lkml.kernel.org/r/20200615231529.GA119644@google.com
---
 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 cdf0165..c8f03d2 100644
--- a/include/linux/compiler_attributes.h
+++ b/include/linux/compiler_attributes.h
@@ -40,6 +40,7 @@
 # define __GCC4_has_attribute___noclone__             1
 # define __GCC4_has_attribute___nonstring__           0
 # define __GCC4_has_attribute___no_sanitize_address__ (__GNUC_MINOR__ >= 8)
+# define __GCC4_has_attribute___no_sanitize_undefined__ (__GNUC_MINOR__ >= 9)
 # define __GCC4_has_attribute___fallthrough__         0
 #endif
 

^ permalink raw reply related	[flat|nested] 11+ messages in thread

* Re: [kbuild-all] Re: [PATCH] compiler_attributes.h: Support no_sanitize_undefined check with GCC 4
  2020-06-17  1:00       ` Rong Chen
@ 2020-06-17  8:30         ` Peter Zijlstra
  -1 siblings, 0 replies; 11+ messages in thread
From: Peter Zijlstra @ 2020-06-17  8:30 UTC (permalink / raw)
  To: Rong Chen
  Cc: Marco Elver, kernel test robot, kbuild-all, Miguel Ojeda,
	linux-kernel, Thomas Gleixner

On Wed, Jun 17, 2020 at 09:00:51AM +0800, Rong Chen wrote:
> On Tue, Jun 16, 2020 at 03:19:21PM +0200, Peter Zijlstra wrote:

> > 301805 N + Jun 16 kernel test rob (5.8K) [peterz-queue:x86/entry] BUILD SUCCESS 8e8bb06d199a5aa7a534aa3b3fc0abbbc11ca438
> > 
> > Why that thing is claiming SUCCESS when it introduces a build error I
> > don't know.

> Sorry for the misunderstanding, some folks complained that it's too
> noisy when there're only new warnings in a "BUILD REGRESSION" report,
> so we changed to use "BUILD SUCCESS" if there's no new build error. To
> avoid misunderstanding, we'll change build complete report title to
> "BUILD SUCCESS WITH WARNING" for new warnings.

Thanks Rong!

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH] compiler_attributes.h: Support no_sanitize_undefined check with GCC 4
@ 2020-06-17  8:30         ` Peter Zijlstra
  0 siblings, 0 replies; 11+ messages in thread
From: Peter Zijlstra @ 2020-06-17  8:30 UTC (permalink / raw)
  To: kbuild-all

[-- Attachment #1: Type: text/plain, Size: 708 bytes --]

On Wed, Jun 17, 2020 at 09:00:51AM +0800, Rong Chen wrote:
> On Tue, Jun 16, 2020 at 03:19:21PM +0200, Peter Zijlstra wrote:

> > 301805 N + Jun 16 kernel test rob (5.8K) [peterz-queue:x86/entry] BUILD SUCCESS 8e8bb06d199a5aa7a534aa3b3fc0abbbc11ca438
> > 
> > Why that thing is claiming SUCCESS when it introduces a build error I
> > don't know.

> Sorry for the misunderstanding, some folks complained that it's too
> noisy when there're only new warnings in a "BUILD REGRESSION" report,
> so we changed to use "BUILD SUCCESS" if there's no new build error. To
> avoid misunderstanding, we'll change build complete report title to
> "BUILD SUCCESS WITH WARNING" for new warnings.

Thanks Rong!

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2020-06-17  8:31 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-15 19:48 [peterz-queue:x86/entry 5/8] include/linux/compiler-gcc.h:153:5: note: in expansion of macro '__has_attribute' kernel test robot
2020-06-15 23:15 ` [PATCH] compiler_attributes.h: Support no_sanitize_undefined check with GCC 4 Marco Elver
2020-06-15 23:15   ` Marco Elver
2020-06-16 13:09   ` Miguel Ojeda
2020-06-16 13:19   ` Peter Zijlstra
2020-06-16 13:19     ` Peter Zijlstra
2020-06-17  1:00     ` [kbuild-all] " Rong Chen
2020-06-17  1:00       ` Rong Chen
2020-06-17  8:30       ` [kbuild-all] " Peter Zijlstra
2020-06-17  8:30         ` Peter Zijlstra
2020-06-17  8:30   ` [tip: x86/entry] " tip-bot2 for Marco Elver

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.