All of lore.kernel.org
 help / color / mirror / Atom feed
* [linux-yocto-3.2][PATCH] arm: Fix linking errors with binutils 2.23
@ 2012-08-22  9:28 Khem Raj
  2012-08-22 19:24 ` Bruce Ashfield
  0 siblings, 1 reply; 4+ messages in thread
From: Khem Raj @ 2012-08-22  9:28 UTC (permalink / raw)
  To: yocto

We end up with linking errors on arm using latest binutils
because we are linking asm generated objects which use -march=all
generating different attributes into object and use some c objects
e.g. misc.o which use different march therefore generating a
different set of attributes into object. When linking is done
the ld complains since it finds incompatible attributes and ends
up with errors like

error: DIV usage mismatch between arch/arm/boot/compressed/head.o and
output
error: DIV usage mismatch between arch/arm/boot/compressed/misc.o and
output
error: DIV usage mismatch between arch/arm/boot/compressed/decompress.o
and output
error: DIV usage mismatch between arch/arm/boot/compressed/lib1funcs.o
and output

This patch fixes it by providing correct march to assembly routines
which than matches with output of ld.

Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
 arch/arm/boot/compressed/Makefile |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/arm/boot/compressed/Makefile b/arch/arm/boot/compressed/Makefile
index 21f56ff..05d9cb3 100644
--- a/arch/arm/boot/compressed/Makefile
+++ b/arch/arm/boot/compressed/Makefile
@@ -5,7 +5,7 @@
 #
 
 OBJS		=
-
+plus_sec :=	$(call as-instr,.arch_extension sec,+sec)
 # Ensure that MMCIF loader code appears early in the image
 # to minimise that number of bocks that have to be read in
 # order to load it.
@@ -123,7 +123,7 @@ KBUILD_CFLAGS = $(subst -pg, , $(ORIG_CFLAGS))
 endif
 
 ccflags-y := -fpic -fno-builtin -I$(obj)
-asflags-y := -Wa,-march=all
+asflags-y := -Wa,-march=armv7-a$(plus_sec)
 
 # Supply kernel BSS size to the decompressor via a linker symbol.
 KBSS_SZ = $(shell size $(obj)/../../../../vmlinux | awk 'END{print $$3}')
-- 
1.7.9.5



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

* Re: [linux-yocto-3.2][PATCH] arm: Fix linking errors with binutils 2.23
  2012-08-22  9:28 [linux-yocto-3.2][PATCH] arm: Fix linking errors with binutils 2.23 Khem Raj
@ 2012-08-22 19:24 ` Bruce Ashfield
  2012-08-22 20:22   ` Khem Raj
  0 siblings, 1 reply; 4+ messages in thread
From: Bruce Ashfield @ 2012-08-22 19:24 UTC (permalink / raw)
  To: Khem Raj; +Cc: yocto

On 12-08-22 05:28 AM, Khem Raj wrote:
> We end up with linking errors on arm using latest binutils
> because we are linking asm generated objects which use -march=all
> generating different attributes into object and use some c objects
> e.g. misc.o which use different march therefore generating a
> different set of attributes into object. When linking is done
> the ld complains since it finds incompatible attributes and ends
> up with errors like
>
> error: DIV usage mismatch between arch/arm/boot/compressed/head.o and
> output
> error: DIV usage mismatch between arch/arm/boot/compressed/misc.o and
> output
> error: DIV usage mismatch between arch/arm/boot/compressed/decompress.o
> and output
> error: DIV usage mismatch between arch/arm/boot/compressed/lib1funcs.o
> and output
>
> This patch fixes it by providing correct march to assembly routines
> which than matches with output of ld.

Looks good to me. I'll queue it here with a few other fixes and do
a test build against my existing binutils.

I haven't looked yet, will 3.4+ need the same fix ?

Cheers,

Bruce

>
> Signed-off-by: Khem Raj<raj.khem@gmail.com>
> ---
>   arch/arm/boot/compressed/Makefile |    4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/arch/arm/boot/compressed/Makefile b/arch/arm/boot/compressed/Makefile
> index 21f56ff..05d9cb3 100644
> --- a/arch/arm/boot/compressed/Makefile
> +++ b/arch/arm/boot/compressed/Makefile
> @@ -5,7 +5,7 @@
>   #
>
>   OBJS		=
> -
> +plus_sec :=	$(call as-instr,.arch_extension sec,+sec)
>   # Ensure that MMCIF loader code appears early in the image
>   # to minimise that number of bocks that have to be read in
>   # order to load it.
> @@ -123,7 +123,7 @@ KBUILD_CFLAGS = $(subst -pg, , $(ORIG_CFLAGS))
>   endif
>
>   ccflags-y := -fpic -fno-builtin -I$(obj)
> -asflags-y := -Wa,-march=all
> +asflags-y := -Wa,-march=armv7-a$(plus_sec)
>
>   # Supply kernel BSS size to the decompressor via a linker symbol.
>   KBSS_SZ = $(shell size $(obj)/../../../../vmlinux | awk 'END{print $$3}')



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

* Re: [linux-yocto-3.2][PATCH] arm: Fix linking errors with binutils 2.23
  2012-08-22 19:24 ` Bruce Ashfield
@ 2012-08-22 20:22   ` Khem Raj
  2012-08-24 13:40     ` Bruce Ashfield
  0 siblings, 1 reply; 4+ messages in thread
From: Khem Raj @ 2012-08-22 20:22 UTC (permalink / raw)
  To: Bruce Ashfield; +Cc: yocto

On Wed, Aug 22, 2012 at 12:24 PM, Bruce Ashfield
<bruce.ashfield@windriver.com> wrote:
>
> I haven't looked yet, will 3.4+ need the same fix ?

yes looking at 3.4 code. But havent tried that yet


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

* Re: [linux-yocto-3.2][PATCH] arm: Fix linking errors with binutils 2.23
  2012-08-22 20:22   ` Khem Raj
@ 2012-08-24 13:40     ` Bruce Ashfield
  0 siblings, 0 replies; 4+ messages in thread
From: Bruce Ashfield @ 2012-08-24 13:40 UTC (permalink / raw)
  To: Khem Raj; +Cc: yocto

On 12-08-22 04:22 PM, Khem Raj wrote:
> On Wed, Aug 22, 2012 at 12:24 PM, Bruce Ashfield
> <bruce.ashfield@windriver.com>  wrote:
>>
>> I haven't looked yet, will 3.4+ need the same fix ?
>
> yes looking at 3.4 code. But havent tried that yet

I've merged this to the 3.2 tree and the 3.4 tree. I haven't
seen any build failures, but then again, I wasn't seeing any
before :)

It's pushed to the kernel trees, I'll send some SRCREV updates
later today.

Cheers,

Bruce


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

end of thread, other threads:[~2012-08-24 13:40 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-08-22  9:28 [linux-yocto-3.2][PATCH] arm: Fix linking errors with binutils 2.23 Khem Raj
2012-08-22 19:24 ` Bruce Ashfield
2012-08-22 20:22   ` Khem Raj
2012-08-24 13:40     ` Bruce Ashfield

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.