From: tony@atomide.com (Tony Lindgren)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] ARM: Fix cross compilation broken by failing size command
Date: Fri, 16 Dec 2011 16:30:05 -0800 [thread overview]
Message-ID: <20111217003005.GC6464@atomide.com> (raw)
In-Reply-To: <1324032146-723-1-git-send-email-jkrzyszt@tis.icnet.pl>
* Janusz Krzysztofik <jkrzyszt@tis.icnet.pl> [111216 02:12]:
> Since commit 5ffb04f6690d71fab241b3562ebf52b893ac4ff1, "ARM: zImage:
> make sure appended DTB doesn't get overwritten by kernel .bss", the
> native 'size' command, which is now always used for calculation of the
> kernel bss size, may break in selected cross compilation environments
> with error messages like:
>
> size: arch/arm/boot/compressed/../../../../vmlinux: File format is ambiguous
> size: Matching formats: elf32-littlearm elf32-littlearm-symbian elf32-littlearm-vxworks
>
> As a consequence, the KBSS_SZ variable extracted from the size output is
> empty, and the the final linker command, provided with incorrectly
> formatted arguments, also fails:
>
> LD arch/arm/boot/compressed/vmlinux
> arm-angstrom-linux-uclibcgnueabi-ld:--defsym _kernel_bss_size=: syntax error
>
> Don't append the '_kernel_bss_size=$(KBSS_SZ)' argument to the linker
> command line if that variable is empty because of the failing size
> command. Moreover, use $(CROSS_COMPILE)size if available instead of
> native size.
>
> Created and tested against linux-3.2-rc5.
>
> Signed-off-by: Janusz Krzysztofik <jkrzyszt@tis.icnet.pl>
> Cc: Russell King <linux@arm.linux.org.uk>
> Cc: Nicolas Pitre <nicolas.pitre@linaro.org>
This seems like a good solution to me:
Acked-by: Tony Lindgren <tony@atomide.com>
> ---
> This patch supersedes my previously submitted "ARM: fix $(CROSS_COMPILE)
> prefix missing from size invocation". Thanks to Tony Lindgren for his
> comments on $(CROSS_COMPILE)size limited availability.
>
> Unfortunately, I've already pushed that old version to the patch system
> at http://www.arm.linux.org.uk/developer/patches/, which I know is not
> a review system. Apparently, I was not patient enough, not waiting more
> than a week with that regression fix for a single reply to my initial
> submission to Russell King, the ARM PORT maintainer, Cc: Nicolas Pitre,
> the regression introducing commit author, and the linux-arm-kernel list.
> Sorry for that, please drop the old version from the Incoming queue, and
> I'll not be pushing anything to that patch system without prior positive
> review response any more.
Heh :) The patch system is pretty arcane.. You can move the
patch there to superseded yourself btw.
Tony
> Thanks,
> Janusz
>
> arch/arm/boot/compressed/Makefile | 5 ++++-
> 1 files changed, 4 insertions(+), 1 deletions(-)
>
> diff --git a/arch/arm/boot/compressed/Makefile b/arch/arm/boot/compressed/Makefile
> index 21f56ff..17972e9 100644
> --- a/arch/arm/boot/compressed/Makefile
> +++ b/arch/arm/boot/compressed/Makefile
> @@ -126,8 +126,11 @@ ccflags-y := -fpic -fno-builtin -I$(obj)
> asflags-y := -Wa,-march=all
>
> # Supply kernel BSS size to the decompressor via a linker symbol.
> -KBSS_SZ = $(shell size $(obj)/../../../../vmlinux | awk 'END{print $$3}')
> +KBSS_SZ = $(shell if $(CROSS_COMPILE)size $(obj)/../../../../vmlinux; then :; \
> + else size $(obj)/../../../../vmlinux; fi | awk 'END{print $$3}')
> +ifneq ($(KBSS_SZ),)
> LDFLAGS_vmlinux = --defsym _kernel_bss_size=$(KBSS_SZ)
> +endif
> # Supply ZRELADDR to the decompressor via a linker symbol.
> ifneq ($(CONFIG_AUTO_ZRELADDR),y)
> LDFLAGS_vmlinux += --defsym zreladdr=$(ZRELADDR)
> --
> 1.7.3.4
>
next prev parent reply other threads:[~2011-12-17 0:30 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <Message-ID: <20111214215815.GP32251@atomide.com>
2011-12-16 10:42 ` [PATCH] ARM: Fix cross compilation broken by failing size command Janusz Krzysztofik
2011-12-17 0:30 ` Tony Lindgren [this message]
2011-12-17 10:57 ` Russell King - ARM Linux
2011-12-17 13:01 ` Janusz Krzysztofik
2011-12-17 16:38 ` Nicolas Pitre
2011-12-17 17:15 ` Russell King - ARM Linux
2011-12-17 18:57 ` Janusz Krzysztofik
2011-12-19 8:27 ` Igor Grinberg
2011-11-25 1:58 [PATCH] ARM: fix $(CROSS_COMPILE) prefix missing from size invocation Janusz Krzysztofik
2011-12-13 23:21 ` Janusz Krzysztofik
2011-12-14 21:58 ` Tony Lindgren
2011-12-15 1:28 ` Janusz Krzysztofik
2011-12-15 22:14 ` Tony Lindgren
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20111217003005.GC6464@atomide.com \
--to=tony@atomide.com \
--cc=linux-arm-kernel@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).