All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] kbuild, LLVMLinux: Add -Werror to cc-option to support clang
@ 2017-03-31 20:38 Arnd Bergmann
  2017-03-31 23:59 ` Kees Cook
                   ` (2 more replies)
  0 siblings, 3 replies; 10+ messages in thread
From: Arnd Bergmann @ 2017-03-31 20:38 UTC (permalink / raw)
  To: Masahiro Yamada
  Cc: Mark Charlebois, Behan Webster, Arnd Bergmann, Michal Marek,
	Nicolas Pitre, Kees Cook, Emese Revfy, linux-kernel

From: Mark Charlebois <charlebm@gmail.com>

Clang will warn about unknown warnings but will not return false
unless -Werror is set. GCC will return false if an unknown
warning is passed.

Adding -Werror make both compiler behave the same.

[arnd: it turns out we need the same patch for testing whether -ffunction-sections
       works right with gcc. I've build tested extensively with this patch 
       applied, so let's just merge this one now.]

Signed-off-by: Mark Charlebois <charlebm@gmail.com>
Signed-off-by: Behan Webster <behanw@converseincode.com>
Reviewed-by: Jan-Simon Möller <dl9pf@gmx.de>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 scripts/Kbuild.include | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/scripts/Kbuild.include b/scripts/Kbuild.include
index d6ca649cb0e9..a70fd26204de 100644
--- a/scripts/Kbuild.include
+++ b/scripts/Kbuild.include
@@ -116,12 +116,12 @@ CC_OPTION_CFLAGS = $(filter-out $(GCC_PLUGINS_CFLAGS),$(KBUILD_CFLAGS))
 # Usage: cflags-y += $(call cc-option,-march=winchip-c6,-march=i586)
 
 cc-option = $(call try-run,\
-	$(CC) $(KBUILD_CPPFLAGS) $(CC_OPTION_CFLAGS) $(1) -c -x c /dev/null -o "$$TMP",$(1),$(2))
+	$(CC) -Werror $(KBUILD_CPPFLAGS) $(CC_OPTION_CFLAGS) $(1) -c -x c /dev/null -o "$$TMP",$(1),$(2))
 
 # cc-option-yn
 # Usage: flag := $(call cc-option-yn,-march=winchip-c6)
 cc-option-yn = $(call try-run,\
-	$(CC) $(KBUILD_CPPFLAGS) $(CC_OPTION_CFLAGS) $(1) -c -x c /dev/null -o "$$TMP",y,n)
+	$(CC) -Werror $(KBUILD_CPPFLAGS) $(CC_OPTION_CFLAGS) $(1) -c -x c /dev/null -o "$$TMP",y,n)
 
 # cc-option-align
 # Prefix align with either -falign or -malign
@@ -131,7 +131,7 @@ cc-option-align = $(subst -functions=0,,\
 # cc-disable-warning
 # Usage: cflags-y += $(call cc-disable-warning,unused-but-set-variable)
 cc-disable-warning = $(call try-run,\
-	$(CC) $(KBUILD_CPPFLAGS) $(CC_OPTION_CFLAGS) -W$(strip $(1)) -c -x c /dev/null -o "$$TMP",-Wno-$(strip $(1)))
+	$(CC) -Werror $(KBUILD_CPPFLAGS) $(CC_OPTION_CFLAGS) -W$(strip $(1)) -c -x c /dev/null -o "$$TMP",-Wno-$(strip $(1)))
 
 # cc-name
 # Expands to either gcc or clang
-- 
2.9.0

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

* Re: [PATCH] kbuild, LLVMLinux: Add -Werror to cc-option to support clang
  2017-03-31 20:38 [PATCH] kbuild, LLVMLinux: Add -Werror to cc-option to support clang Arnd Bergmann
@ 2017-03-31 23:59 ` Kees Cook
  2017-04-02 21:46 ` Masahiro Yamada
  2017-04-11 19:38 ` Masahiro Yamada
  2 siblings, 0 replies; 10+ messages in thread
From: Kees Cook @ 2017-03-31 23:59 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: Masahiro Yamada, Mark Charlebois, Behan Webster, Michal Marek,
	Nicolas Pitre, Emese Revfy, LKML

On Fri, Mar 31, 2017 at 1:38 PM, Arnd Bergmann <arnd@arndb.de> wrote:
> From: Mark Charlebois <charlebm@gmail.com>
>
> Clang will warn about unknown warnings but will not return false
> unless -Werror is set. GCC will return false if an unknown
> warning is passed.
>
> Adding -Werror make both compiler behave the same.
>
> [arnd: it turns out we need the same patch for testing whether -ffunction-sections
>        works right with gcc. I've build tested extensively with this patch
>        applied, so let's just merge this one now.]
>
> Signed-off-by: Mark Charlebois <charlebm@gmail.com>
> Signed-off-by: Behan Webster <behanw@converseincode.com>
> Reviewed-by: Jan-Simon Möller <dl9pf@gmx.de>
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>

Acked-by: Kees Cook <keescook@chromium.org>

-Kees

> ---
>  scripts/Kbuild.include | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/scripts/Kbuild.include b/scripts/Kbuild.include
> index d6ca649cb0e9..a70fd26204de 100644
> --- a/scripts/Kbuild.include
> +++ b/scripts/Kbuild.include
> @@ -116,12 +116,12 @@ CC_OPTION_CFLAGS = $(filter-out $(GCC_PLUGINS_CFLAGS),$(KBUILD_CFLAGS))
>  # Usage: cflags-y += $(call cc-option,-march=winchip-c6,-march=i586)
>
>  cc-option = $(call try-run,\
> -       $(CC) $(KBUILD_CPPFLAGS) $(CC_OPTION_CFLAGS) $(1) -c -x c /dev/null -o "$$TMP",$(1),$(2))
> +       $(CC) -Werror $(KBUILD_CPPFLAGS) $(CC_OPTION_CFLAGS) $(1) -c -x c /dev/null -o "$$TMP",$(1),$(2))
>
>  # cc-option-yn
>  # Usage: flag := $(call cc-option-yn,-march=winchip-c6)
>  cc-option-yn = $(call try-run,\
> -       $(CC) $(KBUILD_CPPFLAGS) $(CC_OPTION_CFLAGS) $(1) -c -x c /dev/null -o "$$TMP",y,n)
> +       $(CC) -Werror $(KBUILD_CPPFLAGS) $(CC_OPTION_CFLAGS) $(1) -c -x c /dev/null -o "$$TMP",y,n)
>
>  # cc-option-align
>  # Prefix align with either -falign or -malign
> @@ -131,7 +131,7 @@ cc-option-align = $(subst -functions=0,,\
>  # cc-disable-warning
>  # Usage: cflags-y += $(call cc-disable-warning,unused-but-set-variable)
>  cc-disable-warning = $(call try-run,\
> -       $(CC) $(KBUILD_CPPFLAGS) $(CC_OPTION_CFLAGS) -W$(strip $(1)) -c -x c /dev/null -o "$$TMP",-Wno-$(strip $(1)))
> +       $(CC) -Werror $(KBUILD_CPPFLAGS) $(CC_OPTION_CFLAGS) -W$(strip $(1)) -c -x c /dev/null -o "$$TMP",-Wno-$(strip $(1)))
>
>  # cc-name
>  # Expands to either gcc or clang
> --
> 2.9.0
>



-- 
Kees Cook
Pixel Security

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

* Re: [PATCH] kbuild, LLVMLinux: Add -Werror to cc-option to support clang
  2017-03-31 20:38 [PATCH] kbuild, LLVMLinux: Add -Werror to cc-option to support clang Arnd Bergmann
  2017-03-31 23:59 ` Kees Cook
@ 2017-04-02 21:46 ` Masahiro Yamada
  2017-04-05 17:11   ` Masahiro Yamada
  2017-04-11 19:38 ` Masahiro Yamada
  2 siblings, 1 reply; 10+ messages in thread
From: Masahiro Yamada @ 2017-04-02 21:46 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: Mark Charlebois, Behan Webster, Michal Marek, Nicolas Pitre,
	Kees Cook, Emese Revfy, Linux Kernel Mailing List

Hi Arnd,


2017-04-01 5:38 GMT+09:00 Arnd Bergmann <arnd@arndb.de>:
> From: Mark Charlebois <charlebm@gmail.com>
>
> Clang will warn about unknown warnings but will not return false
> unless -Werror is set. GCC will return false if an unknown
> warning is passed.
>
> Adding -Werror make both compiler behave the same.
>
> [arnd: it turns out we need the same patch for testing whether -ffunction-sections
>        works right with gcc. I've build tested extensively with this patch
>        applied, so let's just merge this one now.]
>
> Signed-off-by: Mark Charlebois <charlebm@gmail.com>
> Signed-off-by: Behan Webster <behanw@converseincode.com>
> Reviewed-by: Jan-Simon Möller <dl9pf@gmx.de>
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>


Thank you for forwarding this patch.


The code diff looks good to me,
but I'd like to be sure about git-log before applying it.


As far as I tested, the statement
"Clang will warn about unknown warnings but will not
return false unless -Werror is set." does not seem true
on recent versions.



[1] When I use version 3.3

masahiro@grover:~$ clang --version
clang version 3.3 (tags/RELEASE_33/final)
Target: x86_64-unknown-linux-gnu
Thread model: posix
masahiro@grover:~$ clang  -foobar -c -x c /dev/null
clang: warning: argument unused during compilation: '-foobar'
masahiro@grover:~$ echo $?
0


[2] When I use version 3.4

masahiro@grover:~$ clang --version
clang version 3.4 (tags/RELEASE_34/final)
Target: x86_64-unknown-linux-gnu
Thread model: posix
masahiro@grover:~$ clang  -foobar -c -x c /dev/null
clang: error: unknown argument: '-foobar'
masahiro@grover:~$ echo $?
1




I agree we can apply this patch anyway
even if the original motivation is not true anymore.


Can you check it out,
and add a little more comments if you agree?


-- 
Best Regards
Masahiro Yamada

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

* Re: [PATCH] kbuild, LLVMLinux: Add -Werror to cc-option to support clang
  2017-04-02 21:46 ` Masahiro Yamada
@ 2017-04-05 17:11   ` Masahiro Yamada
  0 siblings, 0 replies; 10+ messages in thread
From: Masahiro Yamada @ 2017-04-05 17:11 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: Mark Charlebois, Behan Webster, Michal Marek, Nicolas Pitre,
	Kees Cook, Emese Revfy, Linux Kernel Mailing List, masahiroy

Hi Arnd,

2017-04-03 6:46 GMT+09:00 Masahiro Yamada <yamada.masahiro@socionext.com>:
> Hi Arnd,
>
>
> 2017-04-01 5:38 GMT+09:00 Arnd Bergmann <arnd@arndb.de>:
>> From: Mark Charlebois <charlebm@gmail.com>
>>
>> Clang will warn about unknown warnings but will not return false
>> unless -Werror is set. GCC will return false if an unknown
>> warning is passed.
>>
>> Adding -Werror make both compiler behave the same.
>>
>> [arnd: it turns out we need the same patch for testing whether -ffunction-sections
>>        works right with gcc. I've build tested extensively with this patch
>>        applied, so let's just merge this one now.]
>>
>> Signed-off-by: Mark Charlebois <charlebm@gmail.com>
>> Signed-off-by: Behan Webster <behanw@converseincode.com>
>> Reviewed-by: Jan-Simon Möller <dl9pf@gmx.de>
>> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
>
>
> Thank you for forwarding this patch.
>
>
> The code diff looks good to me,
> but I'd like to be sure about git-log before applying it.
>
>
> As far as I tested, the statement
> "Clang will warn about unknown warnings but will not
> return false unless -Werror is set." does not seem true
> on recent versions.
>
>
>
> [1] When I use version 3.3
>
> masahiro@grover:~$ clang --version
> clang version 3.3 (tags/RELEASE_33/final)
> Target: x86_64-unknown-linux-gnu
> Thread model: posix
> masahiro@grover:~$ clang  -foobar -c -x c /dev/null
> clang: warning: argument unused during compilation: '-foobar'
> masahiro@grover:~$ echo $?
> 0
>
>
> [2] When I use version 3.4
>
> masahiro@grover:~$ clang --version
> clang version 3.4 (tags/RELEASE_34/final)
> Target: x86_64-unknown-linux-gnu
> Thread model: posix
> masahiro@grover:~$ clang  -foobar -c -x c /dev/null
> clang: error: unknown argument: '-foobar'
> masahiro@grover:~$ echo $?
> 1
>
>
>
>
> I agree we can apply this patch anyway
> even if the original motivation is not true anymore.
>
>
> Can you check it out,
> and add a little more comments if you agree?


Sorry.  This was my misunderstanding.
You do not have to answer my question.

I found this patch is still useful for recent clang versions.

I will apply this patch shortly.  Thanks!




-- 
Best Regards
Masahiro Yamada

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

* Re: [PATCH] kbuild, LLVMLinux: Add -Werror to cc-option to support clang
  2017-03-31 20:38 [PATCH] kbuild, LLVMLinux: Add -Werror to cc-option to support clang Arnd Bergmann
  2017-03-31 23:59 ` Kees Cook
  2017-04-02 21:46 ` Masahiro Yamada
@ 2017-04-11 19:38 ` Masahiro Yamada
  2 siblings, 0 replies; 10+ messages in thread
From: Masahiro Yamada @ 2017-04-11 19:38 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: Mark Charlebois, Behan Webster, Michal Marek, Nicolas Pitre,
	Kees Cook, Emese Revfy, Linux Kernel Mailing List

2017-04-01 5:38 GMT+09:00 Arnd Bergmann <arnd@arndb.de>:
> From: Mark Charlebois <charlebm@gmail.com>
>
> Clang will warn about unknown warnings but will not return false
> unless -Werror is set. GCC will return false if an unknown
> warning is passed.
>
> Adding -Werror make both compiler behave the same.
>
> [arnd: it turns out we need the same patch for testing whether -ffunction-sections
>        works right with gcc. I've build tested extensively with this patch
>        applied, so let's just merge this one now.]
>
> Signed-off-by: Mark Charlebois <charlebm@gmail.com>
> Signed-off-by: Behan Webster <behanw@converseincode.com>
> Reviewed-by: Jan-Simon Möller <dl9pf@gmx.de>
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>

Applied to linux-kbuild/kbuild.
Thanks!




-- 
Best Regards
Masahiro Yamada

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

* Re: [PATCH] kbuild, LLVMLinux: Add -Werror to cc-option to support clang
  2014-09-25 13:34     ` Michal Marek
@ 2014-09-26  0:48       ` Behan Webster
  0 siblings, 0 replies; 10+ messages in thread
From: Behan Webster @ 2014-09-26  0:48 UTC (permalink / raw)
  To: Michal Marek; +Cc: ak, yamada.m, hpa, linux-kernel, sam, Mark Charlebois

On 09/25/14 06:34, Michal Marek wrote:
> On 2014-09-24 20:50, Behan Webster wrote:
>> Getting clang to error on unused flags wasn't trivial (this change broke
>> a lot of builds apparently). Fortunately we weren't the only ones who
>> wanted it to behave like gcc in this case. I think it's going to be
>> *much* harder to do the same for warnings. The argument given by
>> supporters of the current situation is that if a warning isn't
>> supported, why break the build? *sigh*
> I guess the reason to accept unknown warnings opentions is compatibility
> with Makefiles with hardcoded gcc-isms. BTW, GCC at some point started
> to ignore unknown -Wno-* options, for everyone's good of course. That's
> why we ended up with the cc-disable-warning function. If -W* options for
> clang need special care, then it might be a good idea to introduce
> cc-warning with the conditional -Werror for clang. There are not that
> many places where we add warnings, so the patch would be still short.
> That way, the possible silent failure is limited only to warning options
> with clang, which is not such a big deal.
I'll try this approach.

Thanks,

Behan

-- 
Behan Webster
behanw@converseincode.com


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

* Re: [PATCH] kbuild, LLVMLinux: Add -Werror to cc-option to support clang
  2014-09-24 18:50   ` Behan Webster
@ 2014-09-25 13:34     ` Michal Marek
  2014-09-26  0:48       ` Behan Webster
  0 siblings, 1 reply; 10+ messages in thread
From: Michal Marek @ 2014-09-25 13:34 UTC (permalink / raw)
  To: Behan Webster; +Cc: ak, yamada.m, hpa, linux-kernel, sam, Mark Charlebois

On 2014-09-24 20:50, Behan Webster wrote:
> On 09/24/14 05:07, Michal Marek wrote:
>> On 2014-09-23 21:28, behanw@converseincode.com wrote:
>>> From: Mark Charlebois <charlebm@gmail.com>
>>>
>>> Clang will warn about unknown warnings but will not return false
>> You mean unknown options, right?
> 2 kinds of options: flags and warnings. clang used to merely warn about 
> unused/unsupported flags/warnings. It now returns errors for unknown 
> flags, but not warnings (unless you specify -Werror).

Ah, unknown warning options. Now I understand.


> Getting clang to error on unused flags wasn't trivial (this change broke 
> a lot of builds apparently). Fortunately we weren't the only ones who 
> wanted it to behave like gcc in this case. I think it's going to be 
> *much* harder to do the same for warnings. The argument given by 
> supporters of the current situation is that if a warning isn't 
> supported, why break the build? *sigh*

I guess the reason to accept unknown warnings opentions is compatibility
with Makefiles with hardcoded gcc-isms. BTW, GCC at some point started
to ignore unknown -Wno-* options, for everyone's good of course. That's
why we ended up with the cc-disable-warning function. If -W* options for
clang need special care, then it might be a good idea to introduce
cc-warning with the conditional -Werror for clang. There are not that
many places where we add warnings, so the patch would be still short.
That way, the possible silent failure is limited only to warning options
with clang, which is not such a big deal.

Michal

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

* Re: [PATCH] kbuild, LLVMLinux: Add -Werror to cc-option to support clang
  2014-09-24 12:07 ` Michal Marek
@ 2014-09-24 18:50   ` Behan Webster
  2014-09-25 13:34     ` Michal Marek
  0 siblings, 1 reply; 10+ messages in thread
From: Behan Webster @ 2014-09-24 18:50 UTC (permalink / raw)
  To: Michal Marek; +Cc: ak, yamada.m, hpa, linux-kernel, sam, Mark Charlebois

On 09/24/14 05:07, Michal Marek wrote:
> On 2014-09-23 21:28, behanw@converseincode.com wrote:
>> From: Mark Charlebois <charlebm@gmail.com>
>>
>> Clang will warn about unknown warnings but will not return false
> You mean unknown options, right?
2 kinds of options: flags and warnings. clang used to merely warn about 
unused/unsupported flags/warnings. It now returns errors for unknown 
flags, but not warnings (unless you specify -Werror).

The issue is that a lot of existing projects which use clang expect the 
former behaviour (I agree that makes no sense, but there you go).

>> unless -Werror is set. GCC will return false if an unknown
>> warning is passed.
>>
>> Adding -Werror make both compiler behave the same.
> Can you please limit it to the clang case? Add an internal variable that
> either contains -Werror or nothing, depending on the compiler.
I can do that. Will fix.

>   What I
> fear is that if we use -Werror unconditionally and the user (or some
> automated build system) decides to add some silly option to KCFLAGS, we
> will get silent failures in the cc-option tests.
A valid concern for sure.

> BTW, is there a chance that this would be fixed in some later clang
> version? Accepting unknown commandline options is a rather unusual
> behavior. How are all the ./configure scripts going to cope with it?
Again, clang does error out on unknown compiler flags (as opposed to 
warnings).

Getting clang to error on unused flags wasn't trivial (this change broke 
a lot of builds apparently). Fortunately we weren't the only ones who 
wanted it to behave like gcc in this case. I think it's going to be 
*much* harder to do the same for warnings. The argument given by 
supporters of the current situation is that if a warning isn't 
supported, why break the build? *sigh*

The LLVMLinux project is pushing hard to fix these sorts of things in 
clang, but some changes are more likely than others.

Thanks,

Behan

-- 
Behan Webster
behanw@converseincode.com


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

* Re: [PATCH] kbuild, LLVMLinux: Add -Werror to cc-option to support clang
  2014-09-23 19:28 behanw
@ 2014-09-24 12:07 ` Michal Marek
  2014-09-24 18:50   ` Behan Webster
  0 siblings, 1 reply; 10+ messages in thread
From: Michal Marek @ 2014-09-24 12:07 UTC (permalink / raw)
  To: behanw; +Cc: ak, yamada.m, hpa, linux-kernel, sam, Mark Charlebois

On 2014-09-23 21:28, behanw@converseincode.com wrote:
> From: Mark Charlebois <charlebm@gmail.com>
> 
> Clang will warn about unknown warnings but will not return false

You mean unknown options, right?


> unless -Werror is set. GCC will return false if an unknown
> warning is passed.
> 
> Adding -Werror make both compiler behave the same.

Can you please limit it to the clang case? Add an internal variable that
either contains -Werror or nothing, depending on the compiler. What I
fear is that if we use -Werror unconditionally and the user (or some
automated build system) decides to add some silly option to KCFLAGS, we
will get silent failures in the cc-option tests. Of course, the same can
happen with clang, but there seems to be no way around it.

BTW, is there a chance that this would be fixed in some later clang
version? Accepting unknown commandline options is a rather unusual
behavior. How are all the ./configure scripts going to cope with it?

Thanks,
Michal

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

* [PATCH] kbuild, LLVMLinux: Add -Werror to cc-option to support clang
@ 2014-09-23 19:28 behanw
  2014-09-24 12:07 ` Michal Marek
  0 siblings, 1 reply; 10+ messages in thread
From: behanw @ 2014-09-23 19:28 UTC (permalink / raw)
  To: ak, mmarek, yamada.m
  Cc: hpa, linux-kernel, sam, Mark Charlebois, Behan Webster

From: Mark Charlebois <charlebm@gmail.com>

Clang will warn about unknown warnings but will not return false
unless -Werror is set. GCC will return false if an unknown
warning is passed.

Adding -Werror make both compiler behave the same.

Signed-off-by: Mark Charlebois <charlebm@gmail.com>
Signed-off-by: Behan Webster <behanw@converseincode.com>
Reviewed-by: Jan-Simon Möller <dl9pf@gmx.de>
---
 scripts/Kbuild.include | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/scripts/Kbuild.include b/scripts/Kbuild.include
index 8a9a4e1..e37ca5c 100644
--- a/scripts/Kbuild.include
+++ b/scripts/Kbuild.include
@@ -111,12 +111,12 @@ as-instr = $(call try-run,\
 # Usage: cflags-y += $(call cc-option,-march=winchip-c6,-march=i586)
 
 cc-option = $(call try-run,\
-	$(CC) $(KBUILD_CPPFLAGS) $(KBUILD_CFLAGS) $(1) -c -x c /dev/null -o "$$TMP",$(1),$(2))
+	$(CC) -Werror $(KBUILD_CPPFLAGS) $(KBUILD_CFLAGS) $(1) -c -x c /dev/null -o "$$TMP",$(1),$(2))
 
 # cc-option-yn
 # Usage: flag := $(call cc-option-yn,-march=winchip-c6)
 cc-option-yn = $(call try-run,\
-	$(CC) $(KBUILD_CPPFLAGS) $(KBUILD_CFLAGS) $(1) -c -x c /dev/null -o "$$TMP",y,n)
+	$(CC) -Werror $(KBUILD_CPPFLAGS) $(KBUILD_CFLAGS) $(1) -c -x c /dev/null -o "$$TMP",y,n)
 
 # cc-option-align
 # Prefix align with either -falign or -malign
@@ -126,7 +126,7 @@ cc-option-align = $(subst -functions=0,,\
 # cc-disable-warning
 # Usage: cflags-y += $(call cc-disable-warning,unused-but-set-variable)
 cc-disable-warning = $(call try-run,\
-	$(CC) $(KBUILD_CPPFLAGS) $(KBUILD_CFLAGS) -W$(strip $(1)) -c -x c /dev/null -o "$$TMP",-Wno-$(strip $(1)))
+	$(CC) -Werror $(KBUILD_CPPFLAGS) $(KBUILD_CFLAGS) -W$(strip $(1)) -c -x c /dev/null -o "$$TMP",-Wno-$(strip $(1)))
 
 # cc-version
 # Usage gcc-ver := $(call cc-version)
-- 
1.9.1


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

end of thread, other threads:[~2017-04-11 19:39 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-03-31 20:38 [PATCH] kbuild, LLVMLinux: Add -Werror to cc-option to support clang Arnd Bergmann
2017-03-31 23:59 ` Kees Cook
2017-04-02 21:46 ` Masahiro Yamada
2017-04-05 17:11   ` Masahiro Yamada
2017-04-11 19:38 ` Masahiro Yamada
  -- strict thread matches above, loose matches on Subject: below --
2014-09-23 19:28 behanw
2014-09-24 12:07 ` Michal Marek
2014-09-24 18:50   ` Behan Webster
2014-09-25 13:34     ` Michal Marek
2014-09-26  0:48       ` Behan Webster

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.