doc: use KCFLAGS instead of EXTRA_CFLAGS to pass flags from command line
authorMasahiro Yamada <masahiroy@kernel.org>
Sun, 21 Feb 2021 15:25:24 +0000 (00:25 +0900)
committerJonathan Corbet <corbet@lwn.net>
Mon, 22 Feb 2021 20:59:10 +0000 (13:59 -0700)
You should use KCFLAGS to pass additional compiler flags from the
command line. Using EXTRA_CFLAGS is wrong.

EXTRA_CFLAGS is supposed to specify flags applied only to the current
Makefile (and now deprecated in favor of ccflags-y).

It is still used in arch/mips/kvm/Makefile (and possibly in external
modules too). Passing EXTRA_CFLAGS from the command line overwrites
it and breaks the build.

I also fixed drivers/gpu/drm/tilcdc/Makefile because commit 816175dd1fd7
("drivers/gpu/drm/tilcdc: Makefile, only -Werror when no -W* in
EXTRA_CFLAGS") was based on the same misunderstanding.

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
Reviewed-by: Alex Shi <alex.shi@linux.alibaba.com>
Acked-by: Federico Vaga <federico.vaga@vaga.pv.it>
Link: https://lore.kernel.org/r/20210221152524.197693-1-masahiroy@kernel.org
Signed-off-by: Jonathan Corbet <corbet@lwn.net>
Documentation/process/4.Coding.rst
Documentation/process/submit-checklist.rst
Documentation/translations/it_IT/process/4.Coding.rst
Documentation/translations/it_IT/process/submit-checklist.rst
Documentation/translations/zh_CN/process/4.Coding.rst
drivers/gpu/drm/tilcdc/Makefile

index 0825dc496f22d7e75de88ec700704fa81f302972..1f0d81f44e14b25981dbb8c65c972fa9f20b55ce 100644 (file)
@@ -242,7 +242,7 @@ and try to avoid "fixes" which make the warning go away without addressing
 its cause.
 
 Note that not all compiler warnings are enabled by default.  Build the
-kernel with "make EXTRA_CFLAGS=-W" to get the full set.
+kernel with "make KCFLAGS=-W" to get the full set.
 
 The kernel provides several configuration options which turn on debugging
 features; most of these are found in the "kernel hacking" submenu.  Several
index f709beaf02c9cdf2e8424b02fe07865de2c4c64d..b1bc2d37bd0a1d46df5e3f2c6be973ec3daa5469 100644 (file)
@@ -96,7 +96,7 @@ and elsewhere regarding submitting Linux kernel patches.
     injection might be appropriate.
 
 20) Newly-added code has been compiled with ``gcc -W`` (use
-    ``make EXTRA_CFLAGS=-W``).  This will generate lots of noise, but is good
+    ``make KCFLAGS=-W``).  This will generate lots of noise, but is good
     for finding bugs like "warning: comparison between signed and unsigned".
 
 21) Tested after it has been merged into the -mm patchset to make sure
index a5e36aa60448c17ec3502a738b59a73fbaae59ca..8012fe9497aea50b94978a8d9a7678f7684d608f 100644 (file)
@@ -256,7 +256,7 @@ e cercate di evitare le "riparazioni" che fan sparire l'avvertimento senza
 però averne trovato la causa.
 
 Tenete a mente che non tutti gli avvertimenti sono disabilitati di default.
-Costruite il kernel con "make EXTRA_CFLAGS=-W" per ottenerli tutti.
+Costruite il kernel con "make KCFLAGS=-W" per ottenerli tutti.
 
 Il kernel fornisce differenti opzioni che abilitano funzionalità di debugging;
 molti di queste sono trovano all'interno del sotto menu "kernel hacking".
index 3e575502690fa1f1f019e841acbf42e282a30f62..614fc17d90869a87aa3443841fc9937eea66a6ec 100644 (file)
@@ -104,7 +104,7 @@ sottomissione delle patch, in particolare
     l'iniezione di fallimenti specifici per il sottosistema.
 
 22) Il nuovo codice è stato compilato con ``gcc -W`` (usate
-    ``make EXTRA_CFLAGS=-W``).  Questo genererà molti avvisi, ma è ottimo
+    ``make KCFLAGS=-W``).  Questo genererà molti avvisi, ma è ottimo
     per scovare bachi come  "warning: comparison between signed and unsigned".
 
 23) La patch è stata verificata dopo essere stata inclusa nella serie di patch
index 959a06ba025c1dca461c674150b79e7b0e019126..66cd8ee076062b8d0e94db86ce915ebab6550b56 100644 (file)
@@ -165,7 +165,7 @@ Linus对这个问题给出了最佳答案:
 通常,这些警告都指向真正的问题。提交以供审阅的代码通常不会产生任何编译器警告。
 在消除警告时,注意了解真正的原因,并尽量避免“修复”,使警告消失而不解决其原因。
 
-请注意,并非所有编译器警告都默认启用。使用“make EXTRA_CFLAGS=-W”构建内核以
+请注意,并非所有编译器警告都默认启用。使用“make KCFLAGS=-W”构建内核以
 获得完整集合。
 
 内核提供了几个配置选项,可以打开调试功能;大多数配置选项位于“kernel hacking”
index 662bf3a348c9926b3668e0bcec219f5d5e5eeeb4..f5190477de721b0203f3357e86a2fd64976d7c98 100644 (file)
@@ -1,5 +1,5 @@
 # SPDX-License-Identifier: GPL-2.0
-ifeq (, $(findstring -W,$(EXTRA_CFLAGS)))
+ifeq (, $(findstring -W,$(KCFLAGS)))
        ccflags-y += -Werror
 endif