diff mbox

x86: LLVMLinux: Wrap -mno-80387 with cc-option

Message ID 1398145227-25053-1-git-send-email-behanw@converseincode.com
State Accepted
Commit 8f2dd677bec68fb55904799a82674c9e64b23be3
Headers show

Commit Message

Behan Webster April 22, 2014, 5:40 a.m. UTC
From: Behan Webster <behanw@converseincode.com>

Wrap -mno-80387 gcc options with cc-option so they don't break clang.

Signed-off-by: Behan Webster <behanw@converseincode.com>
---
 arch/x86/Makefile | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

Comments

Ingo Molnar April 22, 2014, 6:05 a.m. UTC | #1
* behanw@converseincode.com <behanw@converseincode.com> wrote:

> From: Behan Webster <behanw@converseincode.com>
> 
> Wrap -mno-80387 gcc options with cc-option so they don't break clang.
> 
> Signed-off-by: Behan Webster <behanw@converseincode.com>
> ---
>  arch/x86/Makefile | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/arch/x86/Makefile b/arch/x86/Makefile
> index d1b7c37..ce6ad7e 100644
> --- a/arch/x86/Makefile
> +++ b/arch/x86/Makefile
> @@ -83,7 +83,9 @@ else
>          KBUILD_CFLAGS += -m64
>  
>          # Don't autogenerate traditional x87, MMX or SSE instructions
> -        KBUILD_CFLAGS += -mno-mmx -mno-sse -mno-80387 -mno-fp-ret-in-387
> +        KBUILD_CFLAGS += -mno-mmx -mno-sse
> +        KBUILD_CFLAGS += $(call cc-option,-mno-80387)
> +        KBUILD_CFLAGS += $(call cc-option,-mno-fp-ret-in-387)

Is there a clang equivalent option that inhibits all things FPU opcode 
generation by the compiler?

That's the general purpose of -no-80387.

Thanks,

	Ingo
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/
Behan Webster April 22, 2014, 6:23 a.m. UTC | #2
On 04/21/14 23:05, Ingo Molnar wrote:
> * behanw@converseincode.com <behanw@converseincode.com> wrote:
>
>> From: Behan Webster <behanw@converseincode.com>
>>
>> Wrap -mno-80387 gcc options with cc-option so they don't break clang.
>>
>> Signed-off-by: Behan Webster <behanw@converseincode.com>
>> ---
>>   arch/x86/Makefile | 4 +++-
>>   1 file changed, 3 insertions(+), 1 deletion(-)
>>
>> diff --git a/arch/x86/Makefile b/arch/x86/Makefile
>> index d1b7c37..ce6ad7e 100644
>> --- a/arch/x86/Makefile
>> +++ b/arch/x86/Makefile
>> @@ -83,7 +83,9 @@ else
>>           KBUILD_CFLAGS += -m64
>>   
>>           # Don't autogenerate traditional x87, MMX or SSE instructions
>> -        KBUILD_CFLAGS += -mno-mmx -mno-sse -mno-80387 -mno-fp-ret-in-387
>> +        KBUILD_CFLAGS += -mno-mmx -mno-sse
>> +        KBUILD_CFLAGS += $(call cc-option,-mno-80387)
>> +        KBUILD_CFLAGS += $(call cc-option,-mno-fp-ret-in-387)
> Is there a clang equivalent option that inhibits all things FPU opcode
> generation by the compiler?
Not that I've found yet. Still investigating.

> That's the general purpose of -no-80387.
Yes, I understand what this is trying to accomplish. At this point I'd 
just like this new code not to break the use of clang with v3.15.

I will submit another patch which adds similar functionality when 
compiled with clang once I have that answer.

Behan
Ingo Molnar April 22, 2014, 9:42 a.m. UTC | #3
* Behan Webster <behanw@converseincode.com> wrote:

> On 04/21/14 23:05, Ingo Molnar wrote:
> >* behanw@converseincode.com <behanw@converseincode.com> wrote:
> >
> >>From: Behan Webster <behanw@converseincode.com>
> >>
> >>Wrap -mno-80387 gcc options with cc-option so they don't break clang.
> >>
> >>Signed-off-by: Behan Webster <behanw@converseincode.com>
> >>---
> >>  arch/x86/Makefile | 4 +++-
> >>  1 file changed, 3 insertions(+), 1 deletion(-)
> >>
> >>diff --git a/arch/x86/Makefile b/arch/x86/Makefile
> >>index d1b7c37..ce6ad7e 100644
> >>--- a/arch/x86/Makefile
> >>+++ b/arch/x86/Makefile
> >>@@ -83,7 +83,9 @@ else
> >>          KBUILD_CFLAGS += -m64
> >>          # Don't autogenerate traditional x87, MMX or SSE instructions
> >>-        KBUILD_CFLAGS += -mno-mmx -mno-sse -mno-80387 -mno-fp-ret-in-387
> >>+        KBUILD_CFLAGS += -mno-mmx -mno-sse
> >>+        KBUILD_CFLAGS += $(call cc-option,-mno-80387)
> >>+        KBUILD_CFLAGS += $(call cc-option,-mno-fp-ret-in-387)
> >Is there a clang equivalent option that inhibits all things FPU opcode
> >generation by the compiler?
> Not that I've found yet. Still investigating.
> 
> >That's the general purpose of -no-80387.
> Yes, I understand what this is trying to accomplish. At this point
> I'd just like this new code not to break the use of clang with
> v3.15.

Agreed.

> I will submit another patch which adds similar functionality when
> compiled with clang once I have that answer.

Thanks!

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

Patch

diff --git a/arch/x86/Makefile b/arch/x86/Makefile
index d1b7c37..ce6ad7e 100644
--- a/arch/x86/Makefile
+++ b/arch/x86/Makefile
@@ -83,7 +83,9 @@  else
         KBUILD_CFLAGS += -m64
 
         # Don't autogenerate traditional x87, MMX or SSE instructions
-        KBUILD_CFLAGS += -mno-mmx -mno-sse -mno-80387 -mno-fp-ret-in-387
+        KBUILD_CFLAGS += -mno-mmx -mno-sse
+        KBUILD_CFLAGS += $(call cc-option,-mno-80387)
+        KBUILD_CFLAGS += $(call cc-option,-mno-fp-ret-in-387)
 
 	# Use -mpreferred-stack-boundary=3 if supported.
 	KBUILD_CFLAGS += $(call cc-option,-mpreferred-stack-boundary=3)