Re: [PATCH 5/5] x86 kbuild: LLVMLinux: More cc-options added for clang

2014-02-25 Thread Behan Webster

On 02/25/14 17:32, H. Peter Anvin wrote:

On 02/25/2014 05:08 PM, beh...@converseincode.com wrote:
  
+# enforce no-sse for clang

+ifneq ($(COMPILER),clang)
+KBUILD_CFLAGS += $(call cc-option,-mno-sse)
+KBUILD_CFLAGS += $(call cc-option,-mpreferred-stack-boundary=3)
+endif
+

I'm *very* confused.  You're doing ifneq here but you're talking about
it as if you are *adding* them for Clang, also these options are already
added elsewhere (lines 57, 64, 86, 89) so why add them here?
Because when David Woodhouse's recent .code16 changes made it upstream 
(which invalidated most of our original patch) it seems I didn't remove 
this properly from our patch as well. :)


Thanks David for your patches. Thanks Peter for your sharp eyes!

Another example of why reviewing code on the mailing list works so well.

I will fix and resend.

Behan

--
Behan Webster
beh...@converseincode.com

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 5/5] x86 kbuild: LLVMLinux: More cc-options added for clang

2014-02-25 Thread H. Peter Anvin
On 02/25/2014 05:08 PM, beh...@converseincode.com wrote:
>  
> +# enforce no-sse for clang
> +ifneq ($(COMPILER),clang)
> +KBUILD_CFLAGS += $(call cc-option,-mno-sse)
> +KBUILD_CFLAGS += $(call cc-option,-mpreferred-stack-boundary=3)
> +endif
> +

I'm *very* confused.  You're doing ifneq here but you're talking about
it as if you are *adding* them for Clang, also these options are already
added elsewhere (lines 57, 64, 86, 89) so why add them here?

-hpa

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 5/5] x86 kbuild: LLVMLinux: More cc-options added for clang

2014-02-25 Thread behanw
From: Jan-Simon Möller 

Protect more options for x86 with cc-option so that we don't get errors when
using clang instead of gcc.  Add more or different options when using clang as
well. Also need to enforce that SSE is off for clang and the stack is 8-byte
aligned.

Signed-off-by: Jan-Simon Möller 
Signed-off-by: Behan Webster 
Signed-off-by: Mark Charlebois 
---
 arch/x86/Makefile | 8 +++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/arch/x86/Makefile b/arch/x86/Makefile
index eeda43a..852d8f0 100644
--- a/arch/x86/Makefile
+++ b/arch/x86/Makefile
@@ -108,7 +108,7 @@ else
 
 # this works around some issues with generating unwind tables in older 
gccs
 # newer gccs do it by default
-KBUILD_CFLAGS += -maccumulate-outgoing-args
+KBUILD_CFLAGS += $(call cc-option,-maccumulate-outgoing-args)
 endif
 
 # Make sure compiler does not have buggy stack-protector support.
@@ -144,6 +144,12 @@ endif
 sp-$(CONFIG_X86_32) := esp
 sp-$(CONFIG_X86_64) := rsp
 
+# enforce no-sse for clang
+ifneq ($(COMPILER),clang)
+KBUILD_CFLAGS += $(call cc-option,-mno-sse)
+KBUILD_CFLAGS += $(call cc-option,-mpreferred-stack-boundary=3)
+endif
+
 # do binutils support CFI?
 cfi := $(call as-instr,.cfi_startproc\n.cfi_rel_offset 
$(sp-y)$(comma)0\n.cfi_endproc,-DCONFIG_AS_CFI=1)
 # is .cfi_signal_frame supported too?
-- 
1.8.3.2

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 5/5] x86 kbuild: LLVMLinux: More cc-options added for clang

2014-02-25 Thread behanw
From: Jan-Simon Möller dl...@gmx.de

Protect more options for x86 with cc-option so that we don't get errors when
using clang instead of gcc.  Add more or different options when using clang as
well. Also need to enforce that SSE is off for clang and the stack is 8-byte
aligned.

Signed-off-by: Jan-Simon Möller dl...@gmx.de
Signed-off-by: Behan Webster beh...@converseincode.com
Signed-off-by: Mark Charlebois charl...@gmail.com
---
 arch/x86/Makefile | 8 +++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/arch/x86/Makefile b/arch/x86/Makefile
index eeda43a..852d8f0 100644
--- a/arch/x86/Makefile
+++ b/arch/x86/Makefile
@@ -108,7 +108,7 @@ else
 
 # this works around some issues with generating unwind tables in older 
gccs
 # newer gccs do it by default
-KBUILD_CFLAGS += -maccumulate-outgoing-args
+KBUILD_CFLAGS += $(call cc-option,-maccumulate-outgoing-args)
 endif
 
 # Make sure compiler does not have buggy stack-protector support.
@@ -144,6 +144,12 @@ endif
 sp-$(CONFIG_X86_32) := esp
 sp-$(CONFIG_X86_64) := rsp
 
+# enforce no-sse for clang
+ifneq ($(COMPILER),clang)
+KBUILD_CFLAGS += $(call cc-option,-mno-sse)
+KBUILD_CFLAGS += $(call cc-option,-mpreferred-stack-boundary=3)
+endif
+
 # do binutils support CFI?
 cfi := $(call as-instr,.cfi_startproc\n.cfi_rel_offset 
$(sp-y)$(comma)0\n.cfi_endproc,-DCONFIG_AS_CFI=1)
 # is .cfi_signal_frame supported too?
-- 
1.8.3.2

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 5/5] x86 kbuild: LLVMLinux: More cc-options added for clang

2014-02-25 Thread H. Peter Anvin
On 02/25/2014 05:08 PM, beh...@converseincode.com wrote:
  
 +# enforce no-sse for clang
 +ifneq ($(COMPILER),clang)
 +KBUILD_CFLAGS += $(call cc-option,-mno-sse)
 +KBUILD_CFLAGS += $(call cc-option,-mpreferred-stack-boundary=3)
 +endif
 +

I'm *very* confused.  You're doing ifneq here but you're talking about
it as if you are *adding* them for Clang, also these options are already
added elsewhere (lines 57, 64, 86, 89) so why add them here?

-hpa

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 5/5] x86 kbuild: LLVMLinux: More cc-options added for clang

2014-02-25 Thread Behan Webster

On 02/25/14 17:32, H. Peter Anvin wrote:

On 02/25/2014 05:08 PM, beh...@converseincode.com wrote:
  
+# enforce no-sse for clang

+ifneq ($(COMPILER),clang)
+KBUILD_CFLAGS += $(call cc-option,-mno-sse)
+KBUILD_CFLAGS += $(call cc-option,-mpreferred-stack-boundary=3)
+endif
+

I'm *very* confused.  You're doing ifneq here but you're talking about
it as if you are *adding* them for Clang, also these options are already
added elsewhere (lines 57, 64, 86, 89) so why add them here?
Because when David Woodhouse's recent .code16 changes made it upstream 
(which invalidated most of our original patch) it seems I didn't remove 
this properly from our patch as well. :)


Thanks David for your patches. Thanks Peter for your sharp eyes!

Another example of why reviewing code on the mailing list works so well.

I will fix and resend.

Behan

--
Behan Webster
beh...@converseincode.com

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/