ARM: fix $(CROSS_COMPILE) prefix missing from size invocation
PATCH 1/1 ARM: fix $(CROSS_COMPILE) prefix missing from size invocation
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
--- arch/arm/boot/compressed/Makefile | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-)
arch/arm/boot/compressed/Makefile +2 -1
@@ -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)
Signature · 1 line
1.7.3.4
PATCH 1/1 ARM: fix $(CROSS_COMPILE) prefix missing from size invocation
Quoted 9 lines · Janusz Krzysztofik
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
LDarch/arm/boot/compressed/vmlinux
arm-angstrom-linux-uclibcgnueabi-ld:--defsym _kernel_bss_size=: syntax errorSigned-off-by Janusz Krzysztofik <[email protected]>
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 <[email protected]> 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 <[email protected]> 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.
arch/arm/boot/compressed/Makefile +3 -0
@@ -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
Quoted 19 lines
--- arch/arm/boot/compressed/Makefile | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-)arch/arm/boot/compressed/Makefile +2
-1@@ -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)
PATCH 1/1 ARM: fix $(CROSS_COMPILE) prefix missing from size invocation
Quoted 9 lines · Janusz Krzysztofik
Quoted 8 lines · Janusz Krzysztofik
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
LDarch/arm/boot/compressed/vmlinux
arm-angstrom-linux-uclibcgnueabi-ld:--defsym _kernel_bss_size=: syntax error
Quoted 7 lines
Quoted 1 line
Signed-off-by Janusz Krzysztofik <[email protected]>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
Quoted 67 lines
$ git log v3.1..v3.2-rc1 -Ssize -p arch/arm/boot/compressed/Makefile commit 5ffb04f6690d71fab241b3562ebf52b893ac4ff1 Author: Nicolas Pitre <[email protected]> Date: Sun Jun 12 01:07:33 2011 -0400ARM: 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 <[email protected]> for figuring out this issue.
While at it, let's clean up the code a bit so that the
wont_overwritesymbol 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 <[email protected]>Acked-by Tony Lindgren <[email protected]>Tested-by Shawn Guo <[email protected]>Tested-by Dave Martin <[email protected]>Tested-by Thomas Abraham <[email protected]>arch/arm/boot/compressed/Makefile +3
-0@@ -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,
JanuszQuoted 10 lines
--- arch/arm/boot/compressed/Makefile | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-)arch/arm/boot/compressed/Makefile +0
-0arch/arm/boot/compressed/Makefile ccflags-y := -fpic -fno-builtin -I$(obj) · line 133
Quoted 9 lines
arch/arm/boot/compressed/Makefile +2
-1@@ -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
PATCH 1/1 ARM: fix $(CROSS_COMPILE) prefix missing from size invocation
Quoted 18 lines · Tony Lindgren
Quoted 9 lines · Janusz Krzysztofik
Quoted 8 lines · Janusz Krzysztofik
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
LDarch/arm/boot/compressed/vmlinux
arm-angstrom-linux-uclibcgnueabi-ld:--defsym _kernel_bss_size=: syntax errorQuoted 7 lines
Quoted 1 line
Signed-off-by Janusz Krzysztofik <[email protected]>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:
Quoted 5 lines
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
PATCH 1/1 ARM: fix $(CROSS_COMPILE) prefix missing from size invocation
Quoted 19 lines · Janusz Krzysztofik
Quoted 18 lines · Tony Lindgren
Quoted 16 lines · Janusz Krzysztofik
Quoted 9 lines · Janusz Krzysztofik
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
LDarch/arm/boot/compressed/vmlinux
arm-angstrom-linux-uclibcgnueabi-ld:--defsym _kernel_bss_size=: syntax errorSigned-off-by Janusz Krzysztofik <[email protected]>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:
Quoted 7 lines
Quoted 5 lines
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?
Quoted 3 lines
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
A message that is not in the archive (sent off-list or not yet received): Message-ID: <[email protected]
PATCH 1/1 ARM: Fix cross compilation broken by failing size command
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.
---
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(-)
arch/arm/boot/compressed/Makefile +4 -1
@@ -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)
Signature · 1 line
1.7.3.4
Re: [PATCH] ARM: Fix cross compilation broken by failing size command
Quoted 21 lines · Janusz Krzysztofik
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-vxworksAs a consequence, the
KBSS_SZvariable 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 errorDon'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.
Quoted 5 lines
Created and tested against linux-3.2-rc5.
Signed-off-by Janusz Krzysztofik <[email protected]>Cc Russell King <[email protected]>Cc Nicolas Pitre <[email protected]>
This seems like a good solution to me:
Quoted 5 lines
---
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.
Quoted 9 lines
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
Quoted 26 lines
Thanks,
Januszarch/arm/boot/compressed/Makefile | 5 ++++- 1 files changed, 4 insertions(+), 1 deletions(-)arch/arm/boot/compressed/Makefile +4
-1@@ -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)Signature · 1 line
1.7.3.4
Re: [PATCH] ARM: Fix cross compilation broken by failing size command
In reply to Janusz KrzysztofikQuoted 4 lines · Janusz Krzysztofik
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.
Re: [PATCH] ARM: Fix cross compilation broken by failing size command
Quoted 11 lines · Russell King - ARM Linux
Quoted 4 lines · Janusz Krzysztofik
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.
Quoted 2 lines
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.
Quoted 2 lines
This is not a change to the
kernel,
but a change to a file in the kernel source tree. Isn't it the same?
Quoted 1 line
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.
Quoted 4 lines
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.
Quoted 4 lines
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.
Quoted 6 lines
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
Re: [PATCH] ARM: Fix cross compilation broken by failing size command
Quoted 18 lines · Janusz Krzysztofik
Quoted 11 lines · Russell King - ARM Linux
Quoted 4 lines · Janusz Krzysztofik
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.
Quoted 2 lines
which meant 'size'
no longer parses foreign ELF formats.
Quoted 7 lines
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 thatMakefile, 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
Re: [PATCH] ARM: Fix cross compilation broken by failing size command
Quoted 8 lines · Nicolas Pitre
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.
Re: [PATCH] ARM: Fix cross compilation broken by failing size command
In reply to Nicolas PitreQuoted 28 lines · Nicolas Pitre
Quoted 18 lines · Janusz Krzysztofik
Quoted 11 lines · Russell King - ARM Linux
Quoted 4 lines · Janusz Krzysztofik
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.
Quoted 2 lines
which meant 'size'
no longer parses foreign ELF formats.Quoted 7 lines
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 thatMakefile, 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.
Quoted 4 lines
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.
Quoted 5 lines
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.
Quoted 8 lines
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.
Quoted 11 lines
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
Makefilewhich 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
Re: [PATCH] ARM: Fix cross compilation broken by failing size command
In reply to Janusz KrzysztofikHi Janusz,
Quoted 21 lines · Janusz Krzysztofik
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-vxworksAs a consequence, the
KBSS_SZvariable 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 errorDon'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.
Quoted 6 lines
Created and tested against linux-3.2-rc5.
Signed-off-by Janusz Krzysztofik <[email protected]>Cc Russell King <[email protected]>Cc Nicolas Pitre <[email protected]>---
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.
Signature · 2 lines
Regards, Igor.