2009-07-23 18:57:54

by Frans Pop

[permalink] [raw]
Subject: [PATCH] um: minor Makefile simplification through use of cc-ifversion

Signed-off-by: Frans Pop <[email protected]>
---

Change was suggested by Sam Ravnborg; see http://lkml.org/lkml/2009/7/18/15.
Untested, but a similar patch for x86 was tested to work.

diff --git a/arch/um/Makefile-i386 b/arch/um/Makefile-i386
index 302cbe5..2c3e658 100644
--- a/arch/um/Makefile-i386
+++ b/arch/um/Makefile-i386
@@ -35,8 +35,9 @@ cflags-y += -ffreestanding
# Disable unit-at-a-time mode on pre-gcc-4.0 compilers, it makes gcc use
# a lot more stack due to the lack of sharing of stacklots. Also, gcc
# 4.3.0 needs -funit-at-a-time for extern inline functions.
-KBUILD_CFLAGS += $(shell if [ $(call cc-version) -lt 0400 ] ; then \
- echo $(call cc-option,-fno-unit-at-a-time); \
- else echo $(call cc-option,-funit-at-a-time); fi ;)
+KBUILD_CFLAGS += $(call cc-ifversion, -lt, 0400, \
+ $(call cc-option,-fno-unit-at-a-time))
+KBUILD_CFLAGS += $(call cc-ifversion, -ge, 0400, \
+ $(call cc-option,-funit-at-a-time))

KBUILD_CFLAGS += $(cflags-y)


2009-07-23 21:30:04

by Sam Ravnborg

[permalink] [raw]
Subject: Re: [PATCH] um: minor Makefile simplification through use of cc-ifversion

On Thu, Jul 23, 2009 at 08:57:51PM +0200, Frans Pop wrote:
> Signed-off-by: Frans Pop <[email protected]>
Acked-by: Sam Ravnborg <[email protected]>

If this patch is not pisked up by anyone else I will take it in kbuild.git.

Sam

2009-07-24 08:57:36

by Cong Wang

[permalink] [raw]
Subject: Re: [PATCH] um: minor Makefile simplification through use of cc-ifversion

On Thu, Jul 23, 2009 at 11:30:02PM +0200, Sam Ravnborg wrote:
>On Thu, Jul 23, 2009 at 08:57:51PM +0200, Frans Pop wrote:
>> Signed-off-by: Frans Pop <[email protected]>
>Acked-by: Sam Ravnborg <[email protected]>

Acked-by: WANG Cong <[email protected]>

>
>If this patch is not pisked up by anyone else I will take it in kbuild.git.

Thanks.

2009-11-03 19:55:34

by Frans Pop

[permalink] [raw]
Subject: Re: [PATCH] um: minor Makefile simplification through use of cc-ifversion

Hi Sam,

You planned to take any of these patches not picked up by arch maintainers
in kbuild.git. This looks to be the only one not yet included in mainline.

Cheers,
FJP

On Thursday 23 July 2009, Frans Pop wrote:
> Signed-off-by: Frans Pop <[email protected]>
> ---
>
> Change was suggested by Sam Ravnborg; see
> http://lkml.org/lkml/2009/7/18/15. Untested, but a similar patch for x86
> was tested to work.
>
> diff --git a/arch/um/Makefile-i386 b/arch/um/Makefile-i386
> index 302cbe5..2c3e658 100644
> --- a/arch/um/Makefile-i386
> +++ b/arch/um/Makefile-i386
> @@ -35,8 +35,9 @@ cflags-y += -ffreestanding
> # Disable unit-at-a-time mode on pre-gcc-4.0 compilers, it makes gcc
> use # a lot more stack due to the lack of sharing of stacklots. Also,
> gcc # 4.3.0 needs -funit-at-a-time for extern inline functions.
> -KBUILD_CFLAGS += $(shell if [ $(call cc-version) -lt 0400 ] ; then \
> - echo $(call cc-option,-fno-unit-at-a-time); \
> - else echo $(call cc-option,-funit-at-a-time); fi ;)
> +KBUILD_CFLAGS += $(call cc-ifversion, -lt, 0400, \
> + $(call cc-option,-fno-unit-at-a-time))
> +KBUILD_CFLAGS += $(call cc-ifversion, -ge, 0400, \
> + $(call cc-option,-funit-at-a-time))
>
> KBUILD_CFLAGS += $(cflags-y)