All of lore.kernel.org
 help / color / mirror / Atom feed
* [meta-fsl-ppc][PATCH] linux: fix 64bit kernel builds with binutils 2.24
@ 2014-06-25  9:09 ting.liu
  2014-06-25 16:07 ` Otavio Salvador
  0 siblings, 1 reply; 3+ messages in thread
From: ting.liu @ 2014-06-25  9:09 UTC (permalink / raw)
  To: meta-freescale; +Cc: b41700

From: Ting Liu <ting.liu@freescale.com>

backported from:
http://permalink.gmane.org/gmane.linux.ports.ppc.embedded/70273

Signed-off-by: Ting Liu <ting.liu@freescale.com>
---
 ...erpc-Fix-64-bit-builds-with-binutils-2.24.patch | 84 ++++++++++++++++++++++
 recipes-kernel/linux/linux-qoriq-sdk.inc           |  4 +-
 2 files changed, 87 insertions(+), 1 deletion(-)
 create mode 100644 recipes-kernel/linux/files/powerpc-Fix-64-bit-builds-with-binutils-2.24.patch

diff --git a/recipes-kernel/linux/files/powerpc-Fix-64-bit-builds-with-binutils-2.24.patch b/recipes-kernel/linux/files/powerpc-Fix-64-bit-builds-with-binutils-2.24.patch
new file mode 100644
index 0000000..b55f66b
--- /dev/null
+++ b/recipes-kernel/linux/files/powerpc-Fix-64-bit-builds-with-binutils-2.24.patch
@@ -0,0 +1,84 @@
+From 7092c1143fc10d748bb124624568848409338d89 Mon Sep 17 00:00:00 2001
+From: Guenter Roeck <linux@roeck-us.net>
+Date: Thu, 15 May 2014 09:33:42 -0700
+Subject: [PATCH] powerpc: Fix 64 bit builds with binutils 2.24
+
+commit 7998eb3dc700aaf499f93f50b3d77da834ef9e1d upstream.
+
+With binutils 2.24, various 64 bit builds fail with relocation errors
+such as
+
+arch/powerpc/kernel/built-in.o: In function `exc_debug_crit_book3e':
+	(.text+0x165ee): relocation truncated to fit: R_PPC64_ADDR16_HI
+	against symbol `interrupt_base_book3e' defined in .text section
+	in arch/powerpc/kernel/built-in.o
+arch/powerpc/kernel/built-in.o: In function `exc_debug_crit_book3e':
+	(.text+0x16602): relocation truncated to fit: R_PPC64_ADDR16_HI
+	against symbol `interrupt_end_book3e' defined in .text section
+	in arch/powerpc/kernel/built-in.o
+
+The assembler maintainer says:
+
+ I changed the ABI, something that had to be done but unfortunately
+ happens to break the booke kernel code.  When building up a 64-bit
+ value with lis, ori, shl, oris, ori or similar sequences, you now
+ should use @high and @higha in place of @h and @ha.  @h and @ha
+ (and their associated relocs R_PPC64_ADDR16_HI and R_PPC64_ADDR16_HA)
+ now report overflow if the value is out of 32-bit signed range.
+ ie. @h and @ha assume you're building a 32-bit value. This is needed
+ to report out-of-range -mcmodel=medium toc pointer offsets in @toc@h
+ and @toc@ha expressions, and for consistency I did the same for all
+ other @h and @ha relocs.
+
+Replacing @h with @high in one strategic location fixes the relocation
+errors. This has to be done conditionally since the assembler either
+supports @h or @high but not both.
+
+Signed-off-by: Guenter Roeck <linux@roeck-us.net>
+Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
+Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
+---
+ arch/powerpc/Makefile              | 4 +++-
+ arch/powerpc/include/asm/ppc_asm.h | 7 ++++++-
+ 2 files changed, 9 insertions(+), 2 deletions(-)
+
+diff --git a/arch/powerpc/Makefile b/arch/powerpc/Makefile
+index 1893fb9..df0cd0c 100644
+--- a/arch/powerpc/Makefile
++++ b/arch/powerpc/Makefile
+@@ -100,7 +100,9 @@ CFLAGS-$(CONFIG_POWER7_CPU) += $(call cc-option,-mcpu=power7)
+ 
+ CFLAGS-$(CONFIG_TUNE_CELL) += $(call cc-option,-mtune=cell)
+ 
+-KBUILD_CPPFLAGS	+= -Iarch/$(ARCH)
++asinstr := $(call as-instr,lis 9$(comma)foo@high,-DHAVE_AS_ATHIGH=1)
++
++KBUILD_CPPFLAGS	+= -Iarch/$(ARCH) $(asinstr)
+ KBUILD_AFLAGS	+= -msoft-float -Iarch/$(ARCH)
+ KBUILD_CFLAGS	+= -msoft-float -pipe -Iarch/$(ARCH) $(CFLAGS-y)
+ CPP		= $(CC) -E $(KBUILD_CFLAGS)
+diff --git a/arch/powerpc/include/asm/ppc_asm.h b/arch/powerpc/include/asm/ppc_asm.h
+index 3a853ae..b3205e6 100644
+--- a/arch/powerpc/include/asm/ppc_asm.h
++++ b/arch/powerpc/include/asm/ppc_asm.h
+@@ -309,11 +309,16 @@ n:
+  *      ld	rY,ADDROFF(name)(rX)
+  */
+ #ifdef __powerpc64__
++#ifdef HAVE_AS_ATHIGH
++#define __AS_ATHIGH high
++#else
++#define __AS_ATHIGH h
++#endif
+ #define LOAD_REG_IMMEDIATE(reg,expr)		\
+ 	lis     reg,(expr)@highest;		\
+ 	ori     reg,reg,(expr)@higher;	\
+ 	rldicr  reg,reg,32,31;		\
+-	oris    reg,reg,(expr)@h;		\
++	oris    reg,reg,(expr)@__AS_ATHIGH;		\
+ 	ori     reg,reg,(expr)@l;
+ 
+ #define LOAD_REG_ADDR(reg,name)			\
+-- 
+1.7.9.5
+
diff --git a/recipes-kernel/linux/linux-qoriq-sdk.inc b/recipes-kernel/linux/linux-qoriq-sdk.inc
index 83c632e..e6831a3 100644
--- a/recipes-kernel/linux/linux-qoriq-sdk.inc
+++ b/recipes-kernel/linux/linux-qoriq-sdk.inc
@@ -3,7 +3,9 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=d7810fab7487fb0aad327b76f1be7cd7"
 PV = "3.8"
 INC_PR = "r11"
 
-SRC_URI = "git://git.freescale.com/ppc/sdk/linux.git;nobranch=1"
+SRC_URI = "git://git.freescale.com/ppc/sdk/linux.git;nobranch=1 \
+           file://powerpc-Fix-64-bit-builds-with-binutils-2.24.patch \
+"
 SRCREV = "3edd71eeb4e4ae27baf539e0a5f0c8e8261bf65b"
 SRCREV_t2080qds = "47914f6cf77197921c648c6ea8977974fa54d03a"
 SRCREV_t2080qds-64b = "47914f6cf77197921c648c6ea8977974fa54d03a"
-- 
1.8.3.2



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

* Re: [meta-fsl-ppc][PATCH] linux: fix 64bit kernel builds with binutils 2.24
  2014-06-25  9:09 [meta-fsl-ppc][PATCH] linux: fix 64bit kernel builds with binutils 2.24 ting.liu
@ 2014-06-25 16:07 ` Otavio Salvador
  2014-07-02  3:07   ` ting.liu
  0 siblings, 1 reply; 3+ messages in thread
From: Otavio Salvador @ 2014-06-25 16:07 UTC (permalink / raw)
  To: Liu Ting-B28495; +Cc: meta-freescale, b41700

On Wed, Jun 25, 2014 at 6:09 AM,  <ting.liu@freescale.com> wrote:
> From: Ting Liu <ting.liu@freescale.com>
>
> backported from:
> http://permalink.gmane.org/gmane.linux.ports.ppc.embedded/70273
>
> Signed-off-by: Ting Liu <ting.liu@freescale.com>

Please add the upstream status field in the patch file.

-- 
Otavio Salvador                             O.S. Systems
http://www.ossystems.com.br        http://code.ossystems.com.br
Mobile: +55 (53) 9981-7854            Mobile: +1 (347) 903-9750


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

* Re: [meta-fsl-ppc][PATCH] linux: fix 64bit kernel builds with binutils 2.24
  2014-06-25 16:07 ` Otavio Salvador
@ 2014-07-02  3:07   ` ting.liu
  0 siblings, 0 replies; 3+ messages in thread
From: ting.liu @ 2014-07-02  3:07 UTC (permalink / raw)
  To: Otavio Salvador; +Cc: meta-freescale, alexandru.sardan

> -----Original Message-----
> From: otavio.salvador@gmail.com [mailto:otavio.salvador@gmail.com] On Behalf
> Of Otavio Salvador
> Sent: Thursday, June 26, 2014 12:08 AM
> To: Liu Ting-B28495
> Cc: meta-freescale@yoctoproject.org; Sardan Alexandru Cezar-B41700
> Subject: Re: [meta-freescale] [meta-fsl-ppc][PATCH] linux: fix 64bit kernel
> builds with binutils 2.24
> 
> On Wed, Jun 25, 2014 at 6:09 AM,  <ting.liu@freescale.com> wrote:
> > From: Ting Liu <ting.liu@freescale.com>
> >
> > backported from:
> > http://permalink.gmane.org/gmane.linux.ports.ppc.embedded/70273
> >
> > Signed-off-by: Ting Liu <ting.liu@freescale.com>
> 
> Please add the upstream status field in the patch file.
> 

Resent the updated patch. Thanks.

> --
> Otavio Salvador                             O.S. Systems
> http://www.ossystems.com.br        http://code.ossystems.com.br
> Mobile: +55 (53) 9981-7854            Mobile: +1 (347) 903-9750

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

end of thread, other threads:[~2014-07-02  3:08 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-06-25  9:09 [meta-fsl-ppc][PATCH] linux: fix 64bit kernel builds with binutils 2.24 ting.liu
2014-06-25 16:07 ` Otavio Salvador
2014-07-02  3:07   ` ting.liu

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.