* [PATCH] ARM: fix $(CROSS_COMPILE) prefix missing from size invocation @ 2011-11-25 1:58 Janusz Krzysztofik 2011-12-13 23:21 ` Janusz Krzysztofik 0 siblings, 1 reply; 13+ messages in thread From: Janusz Krzysztofik @ 2011-11-25 1:58 UTC (permalink / raw) To: linux-arm-kernel Otherwise, cross compilation may fail 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 LD arch/arm/boot/compressed/vmlinux arm-angstrom-linux-uclibcgnueabi-ld:--defsym _kernel_bss_size=: syntax error Signed-off-by: Janusz Krzysztofik <jkrzyszt@tis.icnet.pl> --- arch/arm/boot/compressed/Makefile | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/arch/arm/boot/compressed/Makefile b/arch/arm/boot/compressed/Makefile index 21f56ff..cf0a64c 100644 --- a/arch/arm/boot/compressed/Makefile +++ b/arch/arm/boot/compressed/Makefile @@ -126,7 +126,8 @@ 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 $(CROSS_COMPILE)size $(obj)/../../../../vmlinux | \ + awk 'END{print $$3}') LDFLAGS_vmlinux = --defsym _kernel_bss_size=$(KBSS_SZ) # Supply ZRELADDR to the decompressor via a linker symbol. ifneq ($(CONFIG_AUTO_ZRELADDR),y) -- 1.7.3.4 ^ permalink raw reply related [flat|nested] 13+ messages in thread
* [PATCH] ARM: fix $(CROSS_COMPILE) prefix missing from size invocation 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 0 siblings, 1 reply; 13+ messages in thread From: Janusz Krzysztofik @ 2011-12-13 23:21 UTC (permalink / raw) To: linux-arm-kernel On Friday 25 of November 2011 at 02:58:58, Janusz Krzysztofik wrote: > Otherwise, cross compilation may fail 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 > LD arch/arm/boot/compressed/vmlinux > arm-angstrom-linux-uclibcgnueabi-ld:--defsym _kernel_bss_size=: syntax error > > Signed-off-by: Janusz Krzysztofik <jkrzyszt@tis.icnet.pl> Trying to guess why this patch is still sitting in the Incoming queue in the Russell's patch system (7184/1) while others have found their way to the Applied queue meanwhile, I wonder if this is because I didn't mention explicitly that it is a fix to a regression introduced into 3.2-rc with the following commit: $ git log v3.1..v3.2-rc1 -Ssize -p arch/arm/boot/compressed/Makefile commit 5ffb04f6690d71fab241b3562ebf52b893ac4ff1 Author: Nicolas Pitre <nicolas.pitre@linaro.org> Date: Sun Jun 12 01:07:33 2011 -0400 ARM: zImage: make sure appended DTB doesn't get overwritten by kernel .bss The appended DTB gets relocated with the decompressor code to get out of the way of the decompressed kernel. However the kernel's .bss section may be larger than the relocated code and data, and then the DTB gets overwritten. Let's make sure the relocation takes care of moving zImage far enough so no such conflict with .bss occurs. Thanks to Tony Lindgren <tony@atomide.com> for figuring out this issue. While at it, let's clean up the code a bit so that the wont_overwrite symbol is used while determining if a conflict exists, making the above change more precise as well as eliminating some ARM/THUMB alternates. Signed-off-by: Nicolas Pitre <nicolas.pitre@linaro.org> Acked-by: Tony Lindgren <tony@atomide.com> Tested-by: Shawn Guo <shawn.guo@linaro.org> Tested-by: Dave Martin <dave.martin@linaro.org> Tested-by: Thomas Abraham <thomas.abraham@linaro.org> diff --git a/arch/arm/boot/compressed/Makefile b/arch/arm/boot/compressed/Makefile index 0c74a6f..4867647 100644 --- a/arch/arm/boot/compressed/Makefile +++ b/arch/arm/boot/compressed/Makefile @@ -104,6 +104,9 @@ endif ccflags-y := -fpic -fno-builtin 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}') +LDFLAGS_vmlinux = --defsym _kernel_bss_size=$(KBSS_SZ) # Supply ZRELADDR to the decompressor via a linker symbol. ifneq ($(CONFIG_AUTO_ZRELADDR),y) LDFLAGS_vmlinux += --defsym zreladdr=$(ZRELADDR) Thanks, Janusz > --- > arch/arm/boot/compressed/Makefile | 3 ++- > 1 files changed, 2 insertions(+), 1 deletions(-) > > diff --git a/arch/arm/boot/compressed/Makefile b/arch/arm/boot/compressed/Makefile > index 21f56ff..cf0a64c 100644 > --- a/arch/arm/boot/compressed/Makefile > +++ b/arch/arm/boot/compressed/Makefile > @@ -126,7 +126,8 @@ 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 $(CROSS_COMPILE)size $(obj)/../../../../vmlinux | \ > + awk 'END{print $$3}') > LDFLAGS_vmlinux = --defsym _kernel_bss_size=$(KBSS_SZ) > # Supply ZRELADDR to the decompressor via a linker symbol. > ifneq ($(CONFIG_AUTO_ZRELADDR),y) > ^ permalink raw reply related [flat|nested] 13+ messages in thread
* [PATCH] ARM: fix $(CROSS_COMPILE) prefix missing from size invocation 2011-12-13 23:21 ` Janusz Krzysztofik @ 2011-12-14 21:58 ` Tony Lindgren 2011-12-15 1:28 ` Janusz Krzysztofik 0 siblings, 1 reply; 13+ messages in thread From: Tony Lindgren @ 2011-12-14 21:58 UTC (permalink / raw) To: linux-arm-kernel * Janusz Krzysztofik <jkrzyszt@tis.icnet.pl> [111213 14:55]: > On Friday 25 of November 2011 at 02:58:58, Janusz Krzysztofik wrote: > > Otherwise, cross compilation may fail 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 > > LD arch/arm/boot/compressed/vmlinux > > arm-angstrom-linux-uclibcgnueabi-ld:--defsym _kernel_bss_size=: syntax error > > > > Signed-off-by: Janusz Krzysztofik <jkrzyszt@tis.icnet.pl> > > Trying to guess why this patch is still sitting in the Incoming queue in > the Russell's patch system (7184/1) while others have found their way to > the Applied queue meanwhile, I wonder if this is because I didn't > mention explicitly that it is a fix to a regression introduced into > 3.2-rc with the following commit: It's because not all cross compiler in use have $(CROSS_COMPILE)size available, so it would have to be symlinked to host size to keep things compiling. So it's probably best to rather take the warning and keep things compiling rather than fix the warning and break compile for many people. Regards, Tony > $ git log v3.1..v3.2-rc1 -Ssize -p arch/arm/boot/compressed/Makefile > commit 5ffb04f6690d71fab241b3562ebf52b893ac4ff1 > Author: Nicolas Pitre <nicolas.pitre@linaro.org> > Date: Sun Jun 12 01:07:33 2011 -0400 > > ARM: zImage: make sure appended DTB doesn't get overwritten by kernel .bss > > The appended DTB gets relocated with the decompressor code to get out > of the way of the decompressed kernel. However the kernel's .bss section > may be larger than the relocated code and data, and then the DTB gets > overwritten. Let's make sure the relocation takes care of moving zImage > far enough so no such conflict with .bss occurs. > > Thanks to Tony Lindgren <tony@atomide.com> for figuring out this issue. > > While at it, let's clean up the code a bit so that the wont_overwrite > symbol is used while determining if a conflict exists, making the above > change more precise as well as eliminating some ARM/THUMB alternates. > > Signed-off-by: Nicolas Pitre <nicolas.pitre@linaro.org> > Acked-by: Tony Lindgren <tony@atomide.com> > Tested-by: Shawn Guo <shawn.guo@linaro.org> > Tested-by: Dave Martin <dave.martin@linaro.org> > Tested-by: Thomas Abraham <thomas.abraham@linaro.org> > > diff --git a/arch/arm/boot/compressed/Makefile b/arch/arm/boot/compressed/Makefile > index 0c74a6f..4867647 100644 > --- a/arch/arm/boot/compressed/Makefile > +++ b/arch/arm/boot/compressed/Makefile > @@ -104,6 +104,9 @@ endif > ccflags-y := -fpic -fno-builtin > 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}') > +LDFLAGS_vmlinux = --defsym _kernel_bss_size=$(KBSS_SZ) > # Supply ZRELADDR to the decompressor via a linker symbol. > ifneq ($(CONFIG_AUTO_ZRELADDR),y) > LDFLAGS_vmlinux += --defsym zreladdr=$(ZRELADDR) > > Thanks, > Janusz > > > --- > > arch/arm/boot/compressed/Makefile | 3 ++- > > 1 files changed, 2 insertions(+), 1 deletions(-) > > > > diff --git a/arch/arm/boot/compressed/Makefile b/arch/arm/boot/compressed/Makefile > > index 21f56ff..cf0a64c 100644 > > --- a/arch/arm/boot/compressed/Makefile > > +++ b/arch/arm/boot/compressed/Makefile > > @@ -126,7 +126,8 @@ 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 $(CROSS_COMPILE)size $(obj)/../../../../vmlinux | \ > > + awk 'END{print $$3}') > > LDFLAGS_vmlinux = --defsym _kernel_bss_size=$(KBSS_SZ) > > # Supply ZRELADDR to the decompressor via a linker symbol. > > ifneq ($(CONFIG_AUTO_ZRELADDR),y) > > > > _______________________________________________ > linux-arm-kernel mailing list > linux-arm-kernel at lists.infradead.org > http://lists.infradead.org/mailman/listinfo/linux-arm-kernel ^ permalink raw reply [flat|nested] 13+ messages in thread
* [PATCH] ARM: fix $(CROSS_COMPILE) prefix missing from size invocation 2011-12-14 21:58 ` Tony Lindgren @ 2011-12-15 1:28 ` Janusz Krzysztofik 2011-12-15 22:14 ` Tony Lindgren 0 siblings, 1 reply; 13+ messages in thread From: Janusz Krzysztofik @ 2011-12-15 1:28 UTC (permalink / raw) To: linux-arm-kernel On Wednesday 14 of December 2011 at 22:58:15, Tony Lindgren wrote: > * Janusz Krzysztofik <jkrzyszt@tis.icnet.pl> [111213 14:55]: > > On Friday 25 of November 2011 at 02:58:58, Janusz Krzysztofik wrote: > > > Otherwise, cross compilation may fail 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 > > > LD arch/arm/boot/compressed/vmlinux > > > arm-angstrom-linux-uclibcgnueabi-ld:--defsym _kernel_bss_size=: syntax error > > > > > > Signed-off-by: Janusz Krzysztofik <jkrzyszt@tis.icnet.pl> > > > > Trying to guess why this patch is still sitting in the Incoming queue in > > the Russell's patch system (7184/1) while others have found their way to > > the Applied queue meanwhile, I wonder if this is because I didn't > > mention explicitly that it is a fix to a regression introduced into > > 3.2-rc with the following commit: > > It's because not all cross compiler in use have $(CROSS_COMPILE)size > available, so it would have to be symlinked to host size to keep things > compiling. So it's probably best to rather take the warning and keep > things compiling rather than fix the warning and break compile for > many people. First of all, thanks for someone finally commenting the patch. It's really hard for me to guess if a patch is OK or not if I hear nothing. Once I hear from someone what is wrong with my patch, I'm always willing to enhance it. But I feel more and more like an intruder on the linux-arm-kernel list. Back to the merit: I would take that warning, as you suggest, if things were compiling for me, but it's not the case. Compilation fails, as I tried to state in the commit message. The patch was not about fixing the warning, but fixing the compilation broken. Since things worked for me before, I find it a regression. Sorry if I was not clear enough in the commit message. I'll prepare v2 which will call $(CROSS_COMPILE)size if size fails, OK? Thanks, Janusz ^ permalink raw reply [flat|nested] 13+ messages in thread
* [PATCH] ARM: fix $(CROSS_COMPILE) prefix missing from size invocation 2011-12-15 1:28 ` Janusz Krzysztofik @ 2011-12-15 22:14 ` Tony Lindgren 0 siblings, 0 replies; 13+ messages in thread From: Tony Lindgren @ 2011-12-15 22:14 UTC (permalink / raw) To: linux-arm-kernel * Janusz Krzysztofik <jkrzyszt@tis.icnet.pl> [111214 16:59]: > On Wednesday 14 of December 2011 at 22:58:15, Tony Lindgren wrote: > > * Janusz Krzysztofik <jkrzyszt@tis.icnet.pl> [111213 14:55]: > > > On Friday 25 of November 2011 at 02:58:58, Janusz Krzysztofik wrote: > > > > Otherwise, cross compilation may fail 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 > > > > LD arch/arm/boot/compressed/vmlinux > > > > arm-angstrom-linux-uclibcgnueabi-ld:--defsym _kernel_bss_size=: syntax error > > > > > > > > Signed-off-by: Janusz Krzysztofik <jkrzyszt@tis.icnet.pl> > > > > > > Trying to guess why this patch is still sitting in the Incoming queue in > > > the Russell's patch system (7184/1) while others have found their way to > > > the Applied queue meanwhile, I wonder if this is because I didn't > > > mention explicitly that it is a fix to a regression introduced into > > > 3.2-rc with the following commit: > > > > It's because not all cross compiler in use have $(CROSS_COMPILE)size > > available, so it would have to be symlinked to host size to keep things > > compiling. So it's probably best to rather take the warning and keep > > things compiling rather than fix the warning and break compile for > > many people. > > First of all, thanks for someone finally commenting the patch. It's really hard for me to guess if a patch is OK or not if I hear nothing. Once I hear from someone what is wrong with my patch, I'm always willing to enhance it. But I feel more and more like an intruder on the linux-arm-kernel list. I thought this was already discussed a while back on the LAKML list? > Back to the merit: I would take that warning, as you suggest, if things were compiling for me, but it's not the case. Compilation fails, as I tried to state in the commit message. The patch was not about fixing the warning, but fixing the compilation broken. Since things worked for me before, I find it a regression. Sorry if I was not clear enough in the commit message. > > I'll prepare v2 which will call $(CROSS_COMPILE)size if size fails, OK? Sounds good :) Tony ^ permalink raw reply [flat|nested] 13+ messages in thread
[parent not found: <Message-ID: <20111214215815.GP32251@atomide.com>]
* [PATCH] ARM: Fix cross compilation broken by failing size command [not found] <Message-ID: <20111214215815.GP32251@atomide.com> @ 2011-12-16 10:42 ` Janusz Krzysztofik 2011-12-17 0:30 ` Tony Lindgren ` (2 more replies) 0 siblings, 3 replies; 13+ messages in thread From: Janusz Krzysztofik @ 2011-12-16 10:42 UTC (permalink / raw) To: linux-arm-kernel 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 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. 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 ^ permalink raw reply related [flat|nested] 13+ messages in thread
* [PATCH] ARM: Fix cross compilation broken by failing size command 2011-12-16 10:42 ` [PATCH] ARM: Fix cross compilation broken by failing size command Janusz Krzysztofik @ 2011-12-17 0:30 ` Tony Lindgren 2011-12-17 10:57 ` Russell King - ARM Linux 2011-12-19 8:27 ` Igor Grinberg 2 siblings, 0 replies; 13+ messages in thread From: Tony Lindgren @ 2011-12-17 0:30 UTC (permalink / raw) To: linux-arm-kernel * 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 > ^ permalink raw reply [flat|nested] 13+ messages in thread
* [PATCH] ARM: Fix cross compilation broken by failing size command 2011-12-16 10:42 ` [PATCH] ARM: Fix cross compilation broken by failing size command Janusz Krzysztofik 2011-12-17 0:30 ` Tony Lindgren @ 2011-12-17 10:57 ` Russell King - ARM Linux 2011-12-17 13:01 ` Janusz Krzysztofik 2011-12-19 8:27 ` Igor Grinberg 2 siblings, 1 reply; 13+ messages in thread From: Russell King - ARM Linux @ 2011-12-17 10:57 UTC (permalink / raw) To: linux-arm-kernel On Fri, Dec 16, 2011 at 11:42:26AM +0100, Janusz Krzysztofik wrote: > 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 I'll disagree with you there: this is not a regression fix. A regression fix implies that it was something that worked before, a change happened to the kernel, and now it's broken. That is not the case: a change happened to binutils which meant 'size' no longer parses foreign ELF formats. This is not a change to the kernel, and therefore it is not a kernel regression. Therefore, I consider it lower priority than true kernel regression fixes, and also lower priority than normal bug fixes to the kernel: it's actually a feature change - changing the kernel to work with a new toolchain. Since the original proposed change causes _me_ problems (I'm missing an arm-linux-size for some unknown reason - which I've yet to resolve one way or other) I've not yet considered the change any further than noting that fact. If it turns out that older versions of binutils do not supply a 'size' command, then we need something like your v2 patch. If it's the case that for some reason it never got transferred when I changed machines, then your v1 patch is appropriate and I need to fix that. But that requires investigation on my side, and I've not been able to do that yet. ^ permalink raw reply [flat|nested] 13+ messages in thread
* [PATCH] ARM: Fix cross compilation broken by failing size command 2011-12-17 10:57 ` Russell King - ARM Linux @ 2011-12-17 13:01 ` Janusz Krzysztofik 2011-12-17 16:38 ` Nicolas Pitre 0 siblings, 1 reply; 13+ messages in thread From: Janusz Krzysztofik @ 2011-12-17 13:01 UTC (permalink / raw) To: linux-arm-kernel On Saturday 17 of December 2011 at 11:57:37, Russell King - ARM Linux wrote: > On Fri, Dec 16, 2011 at 11:42:26AM +0100, Janusz Krzysztofik wrote: > > 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 > > I'll disagree with you there: this is not a regression fix. A regression > fix implies that it was something that worked before, a change happened > to the kernel, and now it's broken. > > That is not the case: a change happened to binutils Not to mine, I'm still using the same version as before. > which meant 'size' > no longer parses foreign ELF formats. But 'size' was not there before v3.2-rc1! The problem has arised because arch/arm/boot/compress/Makefile, which belongs to the kernel sources, not to binutils you're trying to blame, was changed. The 'size' call was introduced into that Makefile, i.e. the file that belongs to the kernel sources, whithout taking care of what can happen if that command fails. And I was just lucky enough to find out it may fail in certains build environments, like mine. > This is not a change to the > kernel, but a change to a file in the kernel source tree. Isn't it the same? > and therefore it is not a kernel regression. Than, you say that if a kernel Makefile is broken, effectively breaking the kernel compilation in certain build environments, then it's not a kernel regression and can be released as is? Funny. > Therefore, I consider it lower priority than true kernel regression > fixes, and also lower priority than normal bug fixes to the kernel: > it's actually a feature change - changing the kernel to work with a > new toolchain. I repeat: I haven't changed my toolchain. A file that belongs to the kernel sources was changed. > Since the original proposed change causes _me_ problems (I'm missing > an arm-linux-size for some unknown reason - which I've yet to resolve > one way or other) I've not yet considered the change any further than > noting that fact. If you were so kind to share your findings once discovered, you would give me a chance to correct that problem with missing $(CROSS_COMPILE)size tool already several weeks ago. Fortunately, Tony was kind enough to comment, better late than never. > If it turns out that older versions of binutils do not supply a 'size' > command, then we need something like your v2 patch. If it's the case > that for some reason it never got transferred when I changed machines, > then your v1 patch is appropriate and I need to fix that. But that > requires investigation on my side, and I've not been able to do that > yet. Thanks to Tony's help, you now have two versions of the patch to choose from, the initial one, with its own issue, and the corrected one, with Tony's Ack. If you are sure this is not a regression and can wait while the stable kernel version is released with that issue not corrected - your choice. You are the ARM port maintainer, not me, and I respect your rights to manage things the way you like. I only disagree with your opinion about this issue not being a regression. I'm not representing any third party interests, only my own (and public to some extent, I thought), and even if not happy, I'm willing to handle that issue myslef in my build environment as long as it exists in the official kernel sources, in order to be able to still help solving other kernel issues I happen to find out from time to time. Thanks, Janusz ^ permalink raw reply [flat|nested] 13+ messages in thread
* [PATCH] ARM: Fix cross compilation broken by failing size command 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 0 siblings, 2 replies; 13+ messages in thread From: Nicolas Pitre @ 2011-12-17 16:38 UTC (permalink / raw) To: linux-arm-kernel On Sat, 17 Dec 2011, Janusz Krzysztofik wrote: > On Saturday 17 of December 2011 at 11:57:37, Russell King - ARM Linux wrote: > > On Fri, Dec 16, 2011 at 11:42:26AM +0100, Janusz Krzysztofik wrote: > > > 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 > > > > I'll disagree with you there: this is not a regression fix. A regression > > fix implies that it was something that worked before, a change happened > > to the kernel, and now it's broken. > > > > That is not the case: a change happened to binutils > > Not to mine, I'm still using the same version as before. > > > which meant 'size' > > no longer parses foreign ELF formats. > > But 'size' was not there before v3.2-rc1! The problem has arised because > arch/arm/boot/compress/Makefile, which belongs to the kernel sources, > not to binutils you're trying to blame, was changed. The 'size' call was > introduced into that Makefile, i.e. the file that belongs to the kernel > sources, whithout taking care of what can happen if that command fails. > And I was just lucky enough to find out it may fail in certains build > environments, like mine. OK let's stop arguing in circles please. I introduced the call to 'size' so by definition I'm the one who broke the build for you. However I don't have any problem using the native 'size' command with a foreign architecture binary. My binutils version is 2.21.51.0.6 on X86-64. And clearly I'm not alone in that situation otherwise we would have been overwhelmed by complaints from a much bigger crowd by now. So your installation must be "special". OTOH all cross-compiler installations I've seen had $(CROSS_COMPILE)size available. It is therefore well possible that Russell's cross compiler installation is also "special". Given that the build works for the vast majority of people now, there is a risk that applying your first patch might break the build for more people (currently only one known) than the number of people for whom this is an improvement (currently only one known). I suggested a simple fix for Russell's installation already: ln -s size arm-linux-size I don't know what is special about yours though, and maybe it is worth investigating given that, as I said, you appear to be alone so far having problems with the current Makefile which is rather intriguing. If it is clear with references to facts (binutils release notes, etc.) that the problem is something that will persist in the future then we have a more solid basis for choosing either of your solutions. Otherwise we can't call it a "regression" just yet. Nicolas ^ permalink raw reply [flat|nested] 13+ messages in thread
* [PATCH] ARM: Fix cross compilation broken by failing size command 2011-12-17 16:38 ` Nicolas Pitre @ 2011-12-17 17:15 ` Russell King - ARM Linux 2011-12-17 18:57 ` Janusz Krzysztofik 1 sibling, 0 replies; 13+ messages in thread From: Russell King - ARM Linux @ 2011-12-17 17:15 UTC (permalink / raw) To: linux-arm-kernel On Sat, Dec 17, 2011 at 11:38:34AM -0500, Nicolas Pitre wrote: > Given that the build works for the vast majority of people now, there is > a risk that applying your first patch might break the build for more > people (currently only one known) than the number of people for whom > this is an improvement (currently only one known). > > I suggested a simple fix for Russell's installation already: > > ln -s size arm-linux-size One which I've refused to do until I've investigated _why_ I don't have this command. And I've now done that (having waited the half-hour for the fsck of the old machine to complete.) It appears that several of the binutils commands weren't transferred to the new machine from the old machine. That's now fixed - and it suggests that there isn't a version of binutils which missed out on this command, so I think we can go with the original patch. ^ permalink raw reply [flat|nested] 13+ messages in thread
* [PATCH] ARM: Fix cross compilation broken by failing size command 2011-12-17 16:38 ` Nicolas Pitre 2011-12-17 17:15 ` Russell King - ARM Linux @ 2011-12-17 18:57 ` Janusz Krzysztofik 1 sibling, 0 replies; 13+ messages in thread From: Janusz Krzysztofik @ 2011-12-17 18:57 UTC (permalink / raw) To: linux-arm-kernel On Saturday 17 of December 2011 at 17:38:34, Nicolas Pitre wrote: > On Sat, 17 Dec 2011, Janusz Krzysztofik wrote: > > > On Saturday 17 of December 2011 at 11:57:37, Russell King - ARM Linux wrote: > > > On Fri, Dec 16, 2011 at 11:42:26AM +0100, Janusz Krzysztofik wrote: > > > > 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 > > > > > > I'll disagree with you there: this is not a regression fix. A regression > > > fix implies that it was something that worked before, a change happened > > > to the kernel, and now it's broken. > > > > > > That is not the case: a change happened to binutils > > > > Not to mine, I'm still using the same version as before. > > > > > which meant 'size' > > > no longer parses foreign ELF formats. > > > > But 'size' was not there before v3.2-rc1! The problem has arised because > > arch/arm/boot/compress/Makefile, which belongs to the kernel sources, > > not to binutils you're trying to blame, was changed. The 'size' call was > > introduced into that Makefile, i.e. the file that belongs to the kernel > > sources, whithout taking care of what can happen if that command fails. > > And I was just lucky enough to find out it may fail in certains build > > environments, like mine. > > OK let's stop arguing in circles please. > > I introduced the call to 'size' so by definition I'm the one who broke > the build for you. I don't care who broke it, this might happen to anyone, including me. Now I see my fault was not examining the linux-arm-kernel archives a few months deep before submitting my patch, which was apparently a (independently developed) duplicate for the one already submitted by Thomas Weber 6 weeks earlier. > However I don't have any problem using the native 'size' command with a > foreign architecture binary. My binutils version is 2.21.51.0.6 on > X86-64. And clearly I'm not alone in that situation otherwise we would > have been overwhelmed by complaints from a much bigger crowd by now. So > your installation must be "special". 2.20.1.20100303 on X86-64 here, built with --enable-targets=all for a reason I'm not able to recall now. > OTOH all cross-compiler installations I've seen had $(CROSS_COMPILE)size > available. It is therefore well possible that Russell's cross compiler > installation is also "special". > > Given that the build works for the vast majority of people now, there is > a risk that applying your first patch might break the build for more > people (currently only one known) than the number of people for whom > this is an improvement (currently only one known). Tony already told me the same, and I came out with v2 as a solution. > I suggested a simple fix for Russell's installation already: > > ln -s size arm-linux-size > > I don't know what is special about yours though, and maybe it is worth > investigating given that, as I said, you appear to be alone so far > having problems with the current Makefile which is rather intriguing. > If it is clear with references to facts (binutils release notes, etc.) > that the problem is something that will persist in the future then we > have a more solid basis for choosing either of your solutions. > Otherwise we can't call it a "regression" just yet. After Tony's comments I changed my approach in that the core regression here was not calling the native 'size', but passing an additional argument to the linker without checking for its correctness first. The core problem was not a broken 'size', but a broken linker command after all. Broken 'size' consequences should be limited to at most making the change your patch was about ineffective, but not the whole compilation broken. That's what my v2 was about in the first place. YMMV. Thanks, Janusz ^ permalink raw reply [flat|nested] 13+ messages in thread
* [PATCH] ARM: Fix cross compilation broken by failing size command 2011-12-16 10:42 ` [PATCH] ARM: Fix cross compilation broken by failing size command Janusz Krzysztofik 2011-12-17 0:30 ` Tony Lindgren 2011-12-17 10:57 ` Russell King - ARM Linux @ 2011-12-19 8:27 ` Igor Grinberg 2 siblings, 0 replies; 13+ messages in thread From: Igor Grinberg @ 2011-12-19 8:27 UTC (permalink / raw) To: linux-arm-kernel Hi Janusz, On 12/16/11 12:42, Janusz Krzysztofik wrote: > 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> > --- Tested-by: Igor Grinberg <grinberg@compulab.co.il> Thanks for the patch, it fixes the build for me, so you are not the only one having this issue... I currently, use CodeSourcery 2010q1, but have multiple cross tool chains installed. -- Regards, Igor. ^ permalink raw reply [flat|nested] 13+ messages in thread
end of thread, other threads:[~2011-12-19 8:27 UTC | newest]
Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
[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
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
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).