linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/4] [-next] Makefile: Do not call cc-option before including the arch's Makefile
@ 2012-05-12 20:39 Geert Uytterhoeven
  2012-05-12 20:39 ` [PATCH 2/4] m68k: Setup CROSS_COMPILE at the top Geert Uytterhoeven
                   ` (4 more replies)
  0 siblings, 5 replies; 15+ messages in thread
From: Geert Uytterhoeven @ 2012-05-12 20:39 UTC (permalink / raw)
  To: linux-kernel, linux-arch
  Cc: Geert Uytterhoeven, Andi Kleen, H. Peter Anvin, Michal Marek,
	linux-kbuild

On architectures that setup CROSS_COMPILE in their arch/*/Makefile
(blackfin, h8300, m68k, mips, parisc, score, sh, tile, unicore32, xtensa),
cc-option may check against the wrong compiler, causing errors like

cc1: error: unrecognized command line option "-fno-ipa-cp-clone"

if the host gcc supports -fno-ipa-cp-clone, while the cross compiler
doesn't support that option.

Move the CONFIG_READABLE_ASM section below the inclusion of the arch's
Makefile to fix this.

Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: Andi Kleen <ak@linux.intel.com>
Cc: H. Peter Anvin <hpa@zytor.com>
Cc: Michal Marek <mmarek@suse.cz>
Cc: linux-kbuild@vger.kernel.org
---
 Makefile |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/Makefile b/Makefile
index d17a616..77355ba 100644
--- a/Makefile
+++ b/Makefile
@@ -561,6 +561,8 @@ else
 KBUILD_CFLAGS	+= -O2
 endif
 
+include $(srctree)/arch/$(SRCARCH)/Makefile
+
 ifdef CONFIG_READABLE_ASM
 # Disable optimizations that make assembler listings hard to read.
 # reorder blocks reorders the control in the function
@@ -571,8 +573,6 @@ KBUILD_CFLAGS += $(call cc-option,-fno-reorder-blocks,) \
                  $(call cc-option,-fno-partial-inlining)
 endif
 
-include $(srctree)/arch/$(SRCARCH)/Makefile
-
 ifneq ($(CONFIG_FRAME_WARN),0)
 KBUILD_CFLAGS += $(call cc-option,-Wframe-larger-than=${CONFIG_FRAME_WARN})
 endif
-- 
1.7.0.4


^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [PATCH 2/4] m68k: Setup CROSS_COMPILE at the top
  2012-05-12 20:39 [PATCH 1/4] [-next] Makefile: Do not call cc-option before including the arch's Makefile Geert Uytterhoeven
@ 2012-05-12 20:39 ` Geert Uytterhoeven
  2012-05-13 11:38   ` Greg Ungerer
  2012-05-12 20:39 ` [PATCH 3/4] sh: " Geert Uytterhoeven
                   ` (3 subsequent siblings)
  4 siblings, 1 reply; 15+ messages in thread
From: Geert Uytterhoeven @ 2012-05-12 20:39 UTC (permalink / raw)
  To: linux-kernel, linux-arch; +Cc: Geert Uytterhoeven, Greg Ungerer, linux-m68k

CROSS_COMPILE must be setup before using e.g. cc-option (and a few other
as-*, cc-*, ld-* macros), else they will check against the wrong compiler
when cross-compiling, and may invoke the cross compiler with wrong or
suboptimal compiler options.

Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: Greg Ungerer <gerg@uclinux.org>
Cc: linux-m68k@lists.linux-m68k.org
---
 arch/m68k/Makefile |   13 +++++++------
 1 files changed, 7 insertions(+), 6 deletions(-)

diff --git a/arch/m68k/Makefile b/arch/m68k/Makefile
index 804f139..b7f2e2d 100644
--- a/arch/m68k/Makefile
+++ b/arch/m68k/Makefile
@@ -16,6 +16,13 @@
 
 KBUILD_DEFCONFIG := multi_defconfig
 
+ifneq ($(SUBARCH),$(ARCH))
+	ifeq ($(CROSS_COMPILE),)
+		CROSS_COMPILE := $(call cc-cross-prefix, \
+			m68k-linux-gnu- m68k-linux- m68k-unknown-linux-gnu-)
+	endif
+endif
+
 #
 #	Enable processor type. Ordering of these is important - we want to
 #	use the minimum processor type of the range we support. The logic
@@ -62,12 +69,6 @@ endif
 
 LDFLAGS := -m m68kelf
 KBUILD_LDFLAGS_MODULE += -T $(srctree)/arch/m68k/kernel/module.lds
-ifneq ($(SUBARCH),$(ARCH))
-	ifeq ($(CROSS_COMPILE),)
-		CROSS_COMPILE := $(call cc-cross-prefix, \
-			m68k-linux-gnu- m68k-linux- m68k-unknown-linux-gnu-)
-	endif
-endif
 
 ifdef CONFIG_SUN3
 LDFLAGS_vmlinux = -N
-- 
1.7.0.4


^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [PATCH 3/4] sh: Setup CROSS_COMPILE at the top
  2012-05-12 20:39 [PATCH 1/4] [-next] Makefile: Do not call cc-option before including the arch's Makefile Geert Uytterhoeven
  2012-05-12 20:39 ` [PATCH 2/4] m68k: Setup CROSS_COMPILE at the top Geert Uytterhoeven
@ 2012-05-12 20:39 ` Geert Uytterhoeven
  2012-05-12 20:39 ` [PATCH 4/4] xtensa: " Geert Uytterhoeven
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 15+ messages in thread
From: Geert Uytterhoeven @ 2012-05-12 20:39 UTC (permalink / raw)
  To: linux-kernel, linux-arch; +Cc: Geert Uytterhoeven, Paul Mundt, linux-sh

CROSS_COMPILE must be setup before using e.g. cc-option (and a few other
as-*, cc-*, ld-* macros), else they will check against the wrong compiler
when cross-compiling, and may invoke the cross compiler with wrong or
suboptimal compiler options.

Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: Paul Mundt <lethal@linux-sh.org>
Cc: linux-sh@vger.kernel.org
---
 arch/sh/Makefile |   12 ++++++------
 1 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/arch/sh/Makefile b/arch/sh/Makefile
index 46edf07..0d7bbaf 100644
--- a/arch/sh/Makefile
+++ b/arch/sh/Makefile
@@ -9,6 +9,12 @@
 # License.  See the file "COPYING" in the main directory of this archive
 # for more details.
 #
+ifneq ($(SUBARCH),$(ARCH))
+  ifeq ($(CROSS_COMPILE),)
+    CROSS_COMPILE := $(call cc-cross-prefix, $(UTS_MACHINE)-linux-  $(UTS_MACHINE)-linux-gnu-  $(UTS_MACHINE)-unknown-linux-gnu-)
+  endif
+endif
+
 isa-y					:= any
 isa-$(CONFIG_SH_DSP)			:= sh
 isa-$(CONFIG_CPU_SH2)			:= sh2
@@ -106,12 +112,6 @@ LDFLAGS_vmlinux		+= --defsym phys_stext=_stext-$(CONFIG_PAGE_OFFSET) \
 KBUILD_DEFCONFIG	:= cayman_defconfig
 endif
 
-ifneq ($(SUBARCH),$(ARCH))
-  ifeq ($(CROSS_COMPILE),)
-    CROSS_COMPILE := $(call cc-cross-prefix, $(UTS_MACHINE)-linux-  $(UTS_MACHINE)-linux-gnu-  $(UTS_MACHINE)-unknown-linux-gnu-)
-  endif
-endif
-
 ifdef CONFIG_CPU_LITTLE_ENDIAN
 ld-bfd			:= elf32-$(UTS_MACHINE)-linux
 LDFLAGS_vmlinux		+= --defsym 'jiffies=jiffies_64' --oformat $(ld-bfd)
-- 
1.7.0.4


^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [PATCH 4/4] xtensa: Setup CROSS_COMPILE at the top
  2012-05-12 20:39 [PATCH 1/4] [-next] Makefile: Do not call cc-option before including the arch's Makefile Geert Uytterhoeven
  2012-05-12 20:39 ` [PATCH 2/4] m68k: Setup CROSS_COMPILE at the top Geert Uytterhoeven
  2012-05-12 20:39 ` [PATCH 3/4] sh: " Geert Uytterhoeven
@ 2012-05-12 20:39 ` Geert Uytterhoeven
  2012-09-09  8:20   ` Geert Uytterhoeven
  2012-05-13  1:01 ` [PATCH 1/4] [-next] Makefile: Do not call cc-option before including the arch's Makefile Andi Kleen
  2012-05-20  9:27 ` Sam Ravnborg
  4 siblings, 1 reply; 15+ messages in thread
From: Geert Uytterhoeven @ 2012-05-12 20:39 UTC (permalink / raw)
  To: linux-kernel, linux-arch; +Cc: Geert Uytterhoeven, Chris Zankel

CROSS_COMPILE must be setup before using e.g. cc-option (and a few other
as-*, cc-*, ld-* macros), else they will check against the wrong compiler
when cross-compiling, and may invoke the cross compiler with wrong or
suboptimal compiler options.

Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: Chris Zankel <chris@zankel.net>
---
 arch/xtensa/Makefile |   24 ++++++++++++------------
 1 files changed, 12 insertions(+), 12 deletions(-)

diff --git a/arch/xtensa/Makefile b/arch/xtensa/Makefile
index 7608559..d41f9ed 100644
--- a/arch/xtensa/Makefile
+++ b/arch/xtensa/Makefile
@@ -21,6 +21,18 @@ variant-$(CONFIG_XTENSA_VARIANT_LINUX_CUSTOM)	:= custom
 VARIANT = $(variant-y)
 export VARIANT
 
+# Test for cross compiling
+
+ifneq ($(VARIANT),)
+  COMPILE_ARCH = $(shell uname -m)
+
+  ifneq ($(COMPILE_ARCH), xtensa)
+    ifndef CROSS_COMPILE
+      CROSS_COMPILE = xtensa_$(VARIANT)-
+    endif
+  endif
+endif
+
 # Platform configuration
 
 platform-$(CONFIG_XTENSA_PLATFORM_XT2000)	:= xt2000
@@ -54,18 +66,6 @@ KBUILD_DEFCONFIG := iss_defconfig
 
 core-$(CONFIG_EMBEDDED_RAMDISK)	+= arch/xtensa/boot/ramdisk/
 
-# Test for cross compiling
-
-ifneq ($(VARIANT),)
-  COMPILE_ARCH = $(shell uname -m)
-
-  ifneq ($(COMPILE_ARCH), xtensa)
-    ifndef CROSS_COMPILE
-      CROSS_COMPILE = xtensa_$(VARIANT)-
-    endif
-  endif
-endif
-
 # Only build variant and/or platform if it includes a Makefile
 
 buildvar := $(shell test -a $(srctree)/arch/xtensa/variants/$(VARIANT)/Makefile && echo arch/xtensa/variants/$(VARIANT)/)
-- 
1.7.0.4


^ permalink raw reply related	[flat|nested] 15+ messages in thread

* Re: [PATCH 1/4] [-next] Makefile: Do not call cc-option before including the arch's Makefile
  2012-05-12 20:39 [PATCH 1/4] [-next] Makefile: Do not call cc-option before including the arch's Makefile Geert Uytterhoeven
                   ` (2 preceding siblings ...)
  2012-05-12 20:39 ` [PATCH 4/4] xtensa: " Geert Uytterhoeven
@ 2012-05-13  1:01 ` Andi Kleen
  2012-05-20  9:27 ` Sam Ravnborg
  4 siblings, 0 replies; 15+ messages in thread
From: Andi Kleen @ 2012-05-13  1:01 UTC (permalink / raw)
  To: Geert Uytterhoeven
  Cc: linux-kernel, linux-arch, H. Peter Anvin, Michal Marek, linux-kbuild

On Sat, May 12, 2012 at 10:39:05PM +0200, Geert Uytterhoeven wrote:
> On architectures that setup CROSS_COMPILE in their arch/*/Makefile
> (blackfin, h8300, m68k, mips, parisc, score, sh, tile, unicore32, xtensa),
> cc-option may check against the wrong compiler, causing errors like
> 
> cc1: error: unrecognized command line option "-fno-ipa-cp-clone"
> 
> if the host gcc supports -fno-ipa-cp-clone, while the cross compiler
> doesn't support that option.
> 
> Move the CONFIG_READABLE_ASM section below the inclusion of the arch's
> Makefile to fix this.

Thanks Geert for tracking that down.

Michael, are the patches already in the queue or should I resubmit them?

-Andi

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH 2/4] m68k: Setup CROSS_COMPILE at the top
  2012-05-12 20:39 ` [PATCH 2/4] m68k: Setup CROSS_COMPILE at the top Geert Uytterhoeven
@ 2012-05-13 11:38   ` Greg Ungerer
  0 siblings, 0 replies; 15+ messages in thread
From: Greg Ungerer @ 2012-05-13 11:38 UTC (permalink / raw)
  To: Geert Uytterhoeven; +Cc: linux-kernel, linux-arch, Greg Ungerer, linux-m68k

On 05/13/2012 06:39 AM, Geert Uytterhoeven wrote:
> CROSS_COMPILE must be setup before using e.g. cc-option (and a few other
> as-*, cc-*, ld-* macros), else they will check against the wrong compiler
> when cross-compiling, and may invoke the cross compiler with wrong or
> suboptimal compiler options.
>
> Signed-off-by: Geert Uytterhoeven<geert@linux-m68k.org>
> Cc: Greg Ungerer<gerg@uclinux.org>

Acked-by: Greg Ungerer<gerg@uclinux.org>

Regards
Greg


> Cc: linux-m68k@lists.linux-m68k.org
> ---
>   arch/m68k/Makefile |   13 +++++++------
>   1 files changed, 7 insertions(+), 6 deletions(-)
>
> diff --git a/arch/m68k/Makefile b/arch/m68k/Makefile
> index 804f139..b7f2e2d 100644
> --- a/arch/m68k/Makefile
> +++ b/arch/m68k/Makefile
> @@ -16,6 +16,13 @@
>
>   KBUILD_DEFCONFIG := multi_defconfig
>
> +ifneq ($(SUBARCH),$(ARCH))
> +	ifeq ($(CROSS_COMPILE),)
> +		CROSS_COMPILE := $(call cc-cross-prefix, \
> +			m68k-linux-gnu- m68k-linux- m68k-unknown-linux-gnu-)
> +	endif
> +endif
> +
>   #
>   #	Enable processor type. Ordering of these is important - we want to
>   #	use the minimum processor type of the range we support. The logic
> @@ -62,12 +69,6 @@ endif
>
>   LDFLAGS := -m m68kelf
>   KBUILD_LDFLAGS_MODULE += -T $(srctree)/arch/m68k/kernel/module.lds
> -ifneq ($(SUBARCH),$(ARCH))
> -	ifeq ($(CROSS_COMPILE),)
> -		CROSS_COMPILE := $(call cc-cross-prefix, \
> -			m68k-linux-gnu- m68k-linux- m68k-unknown-linux-gnu-)
> -	endif
> -endif
>
>   ifdef CONFIG_SUN3
>   LDFLAGS_vmlinux = -N


-- 
------------------------------------------------------------------------
Greg Ungerer  --  Principal Engineer        EMAIL:     gerg@snapgear.com
SnapGear Group, McAfee                      PHONE:       +61 7 3435 2888
8 Gardner Close,                            FAX:         +61 7 3891 3630
Milton, QLD, 4064, Australia                WEB: http://www.SnapGear.com

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH 1/4] [-next] Makefile: Do not call cc-option before including the arch's Makefile
  2012-05-12 20:39 [PATCH 1/4] [-next] Makefile: Do not call cc-option before including the arch's Makefile Geert Uytterhoeven
                   ` (3 preceding siblings ...)
  2012-05-13  1:01 ` [PATCH 1/4] [-next] Makefile: Do not call cc-option before including the arch's Makefile Andi Kleen
@ 2012-05-20  9:27 ` Sam Ravnborg
  2012-05-25 12:29   ` Michal Marek
  4 siblings, 1 reply; 15+ messages in thread
From: Sam Ravnborg @ 2012-05-20  9:27 UTC (permalink / raw)
  To: Geert Uytterhoeven, Michal Marek
  Cc: linux-kernel, linux-arch, Andi Kleen, H. Peter Anvin,
	Michal Marek, linux-kbuild

On Sat, May 12, 2012 at 10:39:05PM +0200, Geert Uytterhoeven wrote:
> On architectures that setup CROSS_COMPILE in their arch/*/Makefile
> (blackfin, h8300, m68k, mips, parisc, score, sh, tile, unicore32, xtensa),
> cc-option may check against the wrong compiler, causing errors like
> 
> cc1: error: unrecognized command line option "-fno-ipa-cp-clone"
> 
> if the host gcc supports -fno-ipa-cp-clone, while the cross compiler
> doesn't support that option.
> 
> Move the CONFIG_READABLE_ASM section below the inclusion of the arch's
> Makefile to fix this.
> 
> Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
> Cc: Andi Kleen <ak@linux.intel.com>
> Cc: H. Peter Anvin <hpa@zytor.com>
> Cc: Michal Marek <mmarek@suse.cz>
> Cc: linux-kbuild@vger.kernel.org

Michal - was this serie ever applied to kbuild?

Acked-by: Sam Ravnborg <sam@ravnborg.org>

	Sam

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH 1/4] [-next] Makefile: Do not call cc-option before including the arch's Makefile
  2012-05-20  9:27 ` Sam Ravnborg
@ 2012-05-25 12:29   ` Michal Marek
  2012-05-25 20:29     ` Sam Ravnborg
  2012-05-25 20:32     ` H. Peter Anvin
  0 siblings, 2 replies; 15+ messages in thread
From: Michal Marek @ 2012-05-25 12:29 UTC (permalink / raw)
  To: Sam Ravnborg
  Cc: Geert Uytterhoeven, linux-kernel, linux-arch, Andi Kleen,
	H. Peter Anvin, linux-kbuild

Dne 20.5.2012 11:27, Sam Ravnborg napsal(a):
> On Sat, May 12, 2012 at 10:39:05PM +0200, Geert Uytterhoeven wrote:
>> On architectures that setup CROSS_COMPILE in their arch/*/Makefile
>> (blackfin, h8300, m68k, mips, parisc, score, sh, tile, unicore32, xtensa),
>> cc-option may check against the wrong compiler, causing errors like
>>
>> cc1: error: unrecognized command line option "-fno-ipa-cp-clone"
>>
>> if the host gcc supports -fno-ipa-cp-clone, while the cross compiler
>> doesn't support that option.
>>
>> Move the CONFIG_READABLE_ASM section below the inclusion of the arch's
>> Makefile to fix this.
>>
>> Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
>> Cc: Andi Kleen <ak@linux.intel.com>
>> Cc: H. Peter Anvin <hpa@zytor.com>
>> Cc: Michal Marek <mmarek@suse.cz>
>> Cc: linux-kbuild@vger.kernel.org
> 
> Michal - was this serie ever applied to kbuild?

The first patch has to go to the tip tree, where the CONFIG_READABLE_ASM
option is introduced. The remaining patches can go to the individual
arch trees, I see Geert already pushed the m68k one.

Michal

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH 1/4] [-next] Makefile: Do not call cc-option before including the arch's Makefile
  2012-05-25 12:29   ` Michal Marek
@ 2012-05-25 20:29     ` Sam Ravnborg
  2012-06-06  9:49       ` Ingo Molnar
  2012-05-25 20:32     ` H. Peter Anvin
  1 sibling, 1 reply; 15+ messages in thread
From: Sam Ravnborg @ 2012-05-25 20:29 UTC (permalink / raw)
  To: Michal Marek, Ingo Molnar, H. Peter Anvin, Thomas Gleixner
  Cc: Geert Uytterhoeven, linux-kernel, linux-arch, Andi Kleen,
	H. Peter Anvin, linux-kbuild

On Fri, May 25, 2012 at 02:29:40PM +0200, Michal Marek wrote:
> Dne 20.5.2012 11:27, Sam Ravnborg napsal(a):
> > On Sat, May 12, 2012 at 10:39:05PM +0200, Geert Uytterhoeven wrote:
> >> On architectures that setup CROSS_COMPILE in their arch/*/Makefile
> >> (blackfin, h8300, m68k, mips, parisc, score, sh, tile, unicore32, xtensa),
> >> cc-option may check against the wrong compiler, causing errors like
> >>
> >> cc1: error: unrecognized command line option "-fno-ipa-cp-clone"
> >>
> >> if the host gcc supports -fno-ipa-cp-clone, while the cross compiler
> >> doesn't support that option.
> >>
> >> Move the CONFIG_READABLE_ASM section below the inclusion of the arch's
> >> Makefile to fix this.
> >>
> >> Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
> >> Cc: Andi Kleen <ak@linux.intel.com>
> >> Cc: H. Peter Anvin <hpa@zytor.com>
> >> Cc: Michal Marek <mmarek@suse.cz>
> >> Cc: linux-kbuild@vger.kernel.org
> > 
> > Michal - was this serie ever applied to kbuild?
> 
> The first patch has to go to the tip tree, where the CONFIG_READABLE_ASM
> option is introduced.
OK - I had not seen this.

So tip-folks - please apply this.

	Sam

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH 1/4] [-next] Makefile: Do not call cc-option before including the arch's Makefile
  2012-05-25 12:29   ` Michal Marek
  2012-05-25 20:29     ` Sam Ravnborg
@ 2012-05-25 20:32     ` H. Peter Anvin
  2012-05-26 10:41       ` Michal Marek
  1 sibling, 1 reply; 15+ messages in thread
From: H. Peter Anvin @ 2012-05-25 20:32 UTC (permalink / raw)
  To: Michal Marek
  Cc: Sam Ravnborg, Geert Uytterhoeven, linux-kernel, linux-arch,
	Andi Kleen, linux-kbuild

On 05/25/2012 05:29 AM, Michal Marek wrote:
>>
>> Michal - was this serie ever applied to kbuild?
> 
> The first patch has to go to the tip tree, where the CONFIG_READABLE_ASM
> option is introduced. The remaining patches can go to the individual
> arch trees, I see Geert already pushed the m68k one.
> 

OK, can you ack it, please?

	-hpa


^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH 1/4] [-next] Makefile: Do not call cc-option before including the arch's Makefile
  2012-05-25 20:32     ` H. Peter Anvin
@ 2012-05-26 10:41       ` Michal Marek
  0 siblings, 0 replies; 15+ messages in thread
From: Michal Marek @ 2012-05-26 10:41 UTC (permalink / raw)
  To: H. Peter Anvin
  Cc: Sam Ravnborg, Geert Uytterhoeven, linux-kernel, linux-arch,
	Andi Kleen, linux-kbuild

"H. Peter Anvin" <hpa@zytor.com> wrote:

>On 05/25/2012 05:29 AM, Michal Marek wrote:
>>>
>>> Michal - was this serie ever applied to kbuild?
>> 
>> The first patch has to go to the tip tree, where the
>CONFIG_READABLE_ASM
>> option is introduced. The remaining patches can go to the individual
>> arch trees, I see Geert already pushed the m68k one.
>> 
>
>OK, can you ack it, please?
>
>	-hpa

Acked-by: Michal Marek <mmarek@suse.cz>
-- 
Sent from my phone. Please excuse my brevity.

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH 1/4] [-next] Makefile: Do not call cc-option before including the arch's Makefile
  2012-05-25 20:29     ` Sam Ravnborg
@ 2012-06-06  9:49       ` Ingo Molnar
  2012-06-15 15:10         ` Michal Marek
  0 siblings, 1 reply; 15+ messages in thread
From: Ingo Molnar @ 2012-06-06  9:49 UTC (permalink / raw)
  To: Sam Ravnborg
  Cc: Michal Marek, Ingo Molnar, H. Peter Anvin, Thomas Gleixner,
	Geert Uytterhoeven, linux-kernel, linux-arch, Andi Kleen,
	linux-kbuild


* Sam Ravnborg <sam@ravnborg.org> wrote:

> On Fri, May 25, 2012 at 02:29:40PM +0200, Michal Marek wrote:
> > Dne 20.5.2012 11:27, Sam Ravnborg napsal(a):
> > > On Sat, May 12, 2012 at 10:39:05PM +0200, Geert Uytterhoeven wrote:
> > >> On architectures that setup CROSS_COMPILE in their arch/*/Makefile
> > >> (blackfin, h8300, m68k, mips, parisc, score, sh, tile, unicore32, xtensa),
> > >> cc-option may check against the wrong compiler, causing errors like
> > >>
> > >> cc1: error: unrecognized command line option "-fno-ipa-cp-clone"
> > >>
> > >> if the host gcc supports -fno-ipa-cp-clone, while the cross compiler
> > >> doesn't support that option.
> > >>
> > >> Move the CONFIG_READABLE_ASM section below the inclusion of the arch's
> > >> Makefile to fix this.
> > >>
> > >> Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
> > >> Cc: Andi Kleen <ak@linux.intel.com>
> > >> Cc: H. Peter Anvin <hpa@zytor.com>
> > >> Cc: Michal Marek <mmarek@suse.cz>
> > >> Cc: linux-kbuild@vger.kernel.org
> > > 
> > > Michal - was this serie ever applied to kbuild?
> > 
> > The first patch has to go to the tip tree, where the CONFIG_READABLE_ASM
> > option is introduced.
> OK - I had not seen this.
> 
> So tip-folks - please apply this.

it's now all upstream so you can route it via the kbuild tree I 
guess?

Thanks,

	Ingo

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH 1/4] [-next] Makefile: Do not call cc-option before including the arch's Makefile
  2012-06-06  9:49       ` Ingo Molnar
@ 2012-06-15 15:10         ` Michal Marek
  0 siblings, 0 replies; 15+ messages in thread
From: Michal Marek @ 2012-06-15 15:10 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: Sam Ravnborg, Ingo Molnar, H. Peter Anvin, Thomas Gleixner,
	Geert Uytterhoeven, linux-kernel, linux-arch, Andi Kleen,
	linux-kbuild

On 6.6.2012 11:49, Ingo Molnar wrote:
> 
> * Sam Ravnborg <sam@ravnborg.org> wrote:
> 
>> On Fri, May 25, 2012 at 02:29:40PM +0200, Michal Marek wrote:
>>> Dne 20.5.2012 11:27, Sam Ravnborg napsal(a):
>>>> On Sat, May 12, 2012 at 10:39:05PM +0200, Geert Uytterhoeven wrote:
>>>>> On architectures that setup CROSS_COMPILE in their arch/*/Makefile
>>>>> (blackfin, h8300, m68k, mips, parisc, score, sh, tile, unicore32, xtensa),
>>>>> cc-option may check against the wrong compiler, causing errors like
>>>>>
>>>>> cc1: error: unrecognized command line option "-fno-ipa-cp-clone"
>>>>>
>>>>> if the host gcc supports -fno-ipa-cp-clone, while the cross compiler
>>>>> doesn't support that option.
>>>>>
>>>>> Move the CONFIG_READABLE_ASM section below the inclusion of the arch's
>>>>> Makefile to fix this.
>>>>>
>>>>> Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
>>>>> Cc: Andi Kleen <ak@linux.intel.com>
>>>>> Cc: H. Peter Anvin <hpa@zytor.com>
>>>>> Cc: Michal Marek <mmarek@suse.cz>
>>>>> Cc: linux-kbuild@vger.kernel.org
>>>>
>>>> Michal - was this serie ever applied to kbuild?
>>>
>>> The first patch has to go to the tip tree, where the CONFIG_READABLE_ASM
>>> option is introduced.
>> OK - I had not seen this.
>>
>> So tip-folks - please apply this.
> 
> it's now all upstream so you can route it via the kbuild tree I 
> guess?

I applied it to kbuild.git#rc-fixes now.

Michal

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH 4/4] xtensa: Setup CROSS_COMPILE at the top
  2012-05-12 20:39 ` [PATCH 4/4] xtensa: " Geert Uytterhoeven
@ 2012-09-09  8:20   ` Geert Uytterhoeven
  2012-09-10 20:33     ` czankel
  0 siblings, 1 reply; 15+ messages in thread
From: Geert Uytterhoeven @ 2012-09-09  8:20 UTC (permalink / raw)
  To: linux-kernel, linux-arch, Andrew Morton; +Cc: Geert Uytterhoeven, Chris Zankel

On Sat, May 12, 2012 at 10:39 PM, Geert Uytterhoeven
<geert@linux-m68k.org> wrote:
> CROSS_COMPILE must be setup before using e.g. cc-option (and a few other
> as-*, cc-*, ld-* macros), else they will check against the wrong compiler
> when cross-compiling, and may invoke the cross compiler with wrong or
> suboptimal compiler options.
>
> Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
> Cc: Chris Zankel <chris@zankel.net>

Ping?

> ---
>  arch/xtensa/Makefile |   24 ++++++++++++------------
>  1 files changed, 12 insertions(+), 12 deletions(-)
>
> diff --git a/arch/xtensa/Makefile b/arch/xtensa/Makefile
> index 7608559..d41f9ed 100644
> --- a/arch/xtensa/Makefile
> +++ b/arch/xtensa/Makefile
> @@ -21,6 +21,18 @@ variant-$(CONFIG_XTENSA_VARIANT_LINUX_CUSTOM)        := custom
>  VARIANT = $(variant-y)
>  export VARIANT
>
> +# Test for cross compiling
> +
> +ifneq ($(VARIANT),)
> +  COMPILE_ARCH = $(shell uname -m)
> +
> +  ifneq ($(COMPILE_ARCH), xtensa)
> +    ifndef CROSS_COMPILE
> +      CROSS_COMPILE = xtensa_$(VARIANT)-
> +    endif
> +  endif
> +endif
> +
>  # Platform configuration
>
>  platform-$(CONFIG_XTENSA_PLATFORM_XT2000)      := xt2000
> @@ -54,18 +66,6 @@ KBUILD_DEFCONFIG := iss_defconfig
>
>  core-$(CONFIG_EMBEDDED_RAMDISK)        += arch/xtensa/boot/ramdisk/
>
> -# Test for cross compiling
> -
> -ifneq ($(VARIANT),)
> -  COMPILE_ARCH = $(shell uname -m)
> -
> -  ifneq ($(COMPILE_ARCH), xtensa)
> -    ifndef CROSS_COMPILE
> -      CROSS_COMPILE = xtensa_$(VARIANT)-
> -    endif
> -  endif
> -endif
> -
>  # Only build variant and/or platform if it includes a Makefile
>
>  buildvar := $(shell test -a $(srctree)/arch/xtensa/variants/$(VARIANT)/Makefile && echo arch/xtensa/variants/$(VARIANT)/)

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH 4/4] xtensa: Setup CROSS_COMPILE at the top
  2012-09-09  8:20   ` Geert Uytterhoeven
@ 2012-09-10 20:33     ` czankel
  0 siblings, 0 replies; 15+ messages in thread
From: czankel @ 2012-09-10 20:33 UTC (permalink / raw)
  To: Geert Uytterhoeven; +Cc: linux-kernel, linux-arch, Andrew Morton

On 9/9/12 10:20 AM, Geert Uytterhoeven wrote:
> On Sat, May 12, 2012 at 10:39 PM, Geert Uytterhoeven
> <geert@linux-m68k.org>  wrote:
>> CROSS_COMPILE must be setup before using e.g. cc-option (and a few other
>> as-*, cc-*, ld-* macros), else they will check against the wrong compiler
>> when cross-compiling, and may invoke the cross compiler with wrong or
>> suboptimal compiler options.
>>
>> Signed-off-by: Geert Uytterhoeven<geert@linux-m68k.org>
>> Cc: Chris Zankel<chris@zankel.net>
>>
>> Ping?
Acked-by: Chris Zankel <chris@zankel.net>


>>
>> ---
>>   arch/xtensa/Makefile |   24 ++++++++++++------------
>>   1 files changed, 12 insertions(+), 12 deletions(-)
>>
>> diff --git a/arch/xtensa/Makefile b/arch/xtensa/Makefile
>> index 7608559..d41f9ed 100644
>> --- a/arch/xtensa/Makefile
>> +++ b/arch/xtensa/Makefile
>> @@ -21,6 +21,18 @@ variant-$(CONFIG_XTENSA_VARIANT_LINUX_CUSTOM)        := custom
>>   VARIANT = $(variant-y)
>>   export VARIANT
>>
>> +# Test for cross compiling
>> +
>> +ifneq ($(VARIANT),)
>> +  COMPILE_ARCH = $(shell uname -m)
>> +
>> +  ifneq ($(COMPILE_ARCH), xtensa)
>> +    ifndef CROSS_COMPILE
>> +      CROSS_COMPILE = xtensa_$(VARIANT)-
>> +    endif
>> +  endif
>> +endif
>> +
>>   # Platform configuration
>>
>>   platform-$(CONFIG_XTENSA_PLATFORM_XT2000)      := xt2000
>> @@ -54,18 +66,6 @@ KBUILD_DEFCONFIG := iss_defconfig
>>
>>   core-$(CONFIG_EMBEDDED_RAMDISK)        += arch/xtensa/boot/ramdisk/
>>
>> -# Test for cross compiling
>> -
>> -ifneq ($(VARIANT),)
>> -  COMPILE_ARCH = $(shell uname -m)
>> -
>> -  ifneq ($(COMPILE_ARCH), xtensa)
>> -    ifndef CROSS_COMPILE
>> -      CROSS_COMPILE = xtensa_$(VARIANT)-
>> -    endif
>> -  endif
>> -endif
>> -
>>   # Only build variant and/or platform if it includes a Makefile
>>
>>   buildvar := $(shell test -a $(srctree)/arch/xtensa/variants/$(VARIANT)/Makefile&&  echo arch/xtensa/variants/$(VARIANT)/)
> Gr{oetje,eeting}s,
>
>                          Geert
>
> --
> Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
>
> In personal conversations with technical people, I call myself a hacker. But
> when I'm talking to journalists I just say "programmer" or something like that.
>                                  -- Linus Torvalds


^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2012-09-10 20:33 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-05-12 20:39 [PATCH 1/4] [-next] Makefile: Do not call cc-option before including the arch's Makefile Geert Uytterhoeven
2012-05-12 20:39 ` [PATCH 2/4] m68k: Setup CROSS_COMPILE at the top Geert Uytterhoeven
2012-05-13 11:38   ` Greg Ungerer
2012-05-12 20:39 ` [PATCH 3/4] sh: " Geert Uytterhoeven
2012-05-12 20:39 ` [PATCH 4/4] xtensa: " Geert Uytterhoeven
2012-09-09  8:20   ` Geert Uytterhoeven
2012-09-10 20:33     ` czankel
2012-05-13  1:01 ` [PATCH 1/4] [-next] Makefile: Do not call cc-option before including the arch's Makefile Andi Kleen
2012-05-20  9:27 ` Sam Ravnborg
2012-05-25 12:29   ` Michal Marek
2012-05-25 20:29     ` Sam Ravnborg
2012-06-06  9:49       ` Ingo Molnar
2012-06-15 15:10         ` Michal Marek
2012-05-25 20:32     ` H. Peter Anvin
2012-05-26 10:41       ` Michal Marek

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).