diff mbox

fix build with make 3.80 again

Message ID 53061D88020000780011DFD2@nat28.tlf.novell.com (mailing list archive)
State New, archived
Headers show

Commit Message

Jan Beulich Feb. 20, 2014, 2:21 p.m. UTC
According to Documentation/Changes, make 3.80 is still being supported
for building the kernel, hence make files must not make (unconditional)
use of features introduced only in newer versions. Commit 8779657d
("stackprotector: Introduce CONFIG_CC_STACKPROTECTOR_STRONG") however
introduced an "else ifdef" construct which make 3.80 doesn't understand.

Also correct a warning message still referencing the old config option
name.

Apart from that I question the use of "ifdef" here (but it was used
that way already prior to said commit): ifeq (,y) would seem more to
the point.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Cc: Kees Cook <keescook@chromium.org>
Cc: Ingo Molnar <mingo@kernel.org>
---
 Makefile |    6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)




--
To unsubscribe from this list: send the line "unsubscribe linux-kbuild" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Comments

Kees Cook Feb. 20, 2014, 9:33 p.m. UTC | #1
On Thu, Feb 20, 2014 at 6:21 AM, Jan Beulich <JBeulich@suse.com> wrote:
> According to Documentation/Changes, make 3.80 is still being supported
> for building the kernel, hence make files must not make (unconditional)
> use of features introduced only in newer versions. Commit 8779657d
> ("stackprotector: Introduce CONFIG_CC_STACKPROTECTOR_STRONG") however
> introduced an "else ifdef" construct which make 3.80 doesn't understand.

Sounds fine to me; there is no third block to use a final "else", so
ditching the "else ifdef" is okay by me. Thanks for the fix!

>
> Also correct a warning message still referencing the old config option
> name.
>
> Apart from that I question the use of "ifdef" here (but it was used
> that way already prior to said commit): ifeq (,y) would seem more to
> the point.
>
> Signed-off-by: Jan Beulich <jbeulich@suse.com>
> Cc: Kees Cook <keescook@chromium.org>
> Cc: Ingo Molnar <mingo@kernel.org>

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

> ---
>  Makefile |    6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
>
> --- 3.14-rc3/Makefile
> +++ 3.14-rc3-make-3.80/Makefile
> @@ -605,10 +605,11 @@ endif
>  ifdef CONFIG_CC_STACKPROTECTOR_REGULAR
>    stackp-flag := -fstack-protector
>    ifeq ($(call cc-option, $(stackp-flag)),)
> -    $(warning Cannot use CONFIG_CC_STACKPROTECTOR: \
> +    $(warning Cannot use CONFIG_CC_STACKPROTECTOR_REGULAR: \
>               -fstack-protector not supported by compiler))

merge note: this line got the double-closing-paren fixed in a separate
patch. There must be a version of "make" that doesn't mind it, since
it seems neither you nor I tripped over it. :)

>    endif
> -else ifdef CONFIG_CC_STACKPROTECTOR_STRONG
> +else
> +ifdef CONFIG_CC_STACKPROTECTOR_STRONG
>    stackp-flag := -fstack-protector-strong
>    ifeq ($(call cc-option, $(stackp-flag)),)
>      $(warning Cannot use CONFIG_CC_STACKPROTECTOR_STRONG: \
> @@ -618,6 +619,7 @@ else
>    # Force off for distro compilers that enable stack protector by default.
>    stackp-flag := $(call cc-option, -fno-stack-protector)
>  endif
> +endif
>  KBUILD_CFLAGS += $(stackp-flag)
>
>  # This warning generated too much noise in a regular build.

Thanks!

-Kees
diff mbox

Patch

--- 3.14-rc3/Makefile
+++ 3.14-rc3-make-3.80/Makefile
@@ -605,10 +605,11 @@  endif
 ifdef CONFIG_CC_STACKPROTECTOR_REGULAR
   stackp-flag := -fstack-protector
   ifeq ($(call cc-option, $(stackp-flag)),)
-    $(warning Cannot use CONFIG_CC_STACKPROTECTOR: \
+    $(warning Cannot use CONFIG_CC_STACKPROTECTOR_REGULAR: \
 	      -fstack-protector not supported by compiler))
   endif
-else ifdef CONFIG_CC_STACKPROTECTOR_STRONG
+else
+ifdef CONFIG_CC_STACKPROTECTOR_STRONG
   stackp-flag := -fstack-protector-strong
   ifeq ($(call cc-option, $(stackp-flag)),)
     $(warning Cannot use CONFIG_CC_STACKPROTECTOR_STRONG: \
@@ -618,6 +619,7 @@  else
   # Force off for distro compilers that enable stack protector by default.
   stackp-flag := $(call cc-option, -fno-stack-protector)
 endif
+endif
 KBUILD_CFLAGS += $(stackp-flag)
 
 # This warning generated too much noise in a regular build.