ARM: SAMSUNG: Fix build after "ARM: Eliminate decompressor -Dstatic= PIC hack"
Subsystems (2)
PATCH 1/1 ARM: SAMSUNG: Fix build after "ARM: Eliminate decompressor -Dstatic= PIC hack"
Commit 5de813b6 (ARM: Eliminate decompressor -Dstatic= PIC hack) among other things changed the declared type of the error() function to an extern, conflicting with the forward declartion in the Samsung plat/uncompress.h which appears to have been relying on the static being defined away, causing build failures since error() ends up with a GOT relocation but the linker script discards all GOT relocated data and functions:
arch/arm/boot/compressed/decompress.o: In function `gunzip':/home/broonie/git/linux-2.6/arch/arm/boot/compressed/../../../../lib/decompress_inflate.c:68: undefined reference to `error'
and so on. Fix this with minimal invasiveness by fixing the plat/uncompress.h declaration.
--- arch/arm/plat-samsung/include/plat/uncompress.h | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
arch/arm/plat-samsung/include/plat/uncompress.h +1 -1
@@ -140,7 +140,7 @@ static void arch_decomp_error(const char *x)#define arch_error arch_decomp_error#endif -static void error (char *err); +extern void error (char *err);#ifdef CONFIG_S3C_BOOT_UART_FORCE_FIFO static inline void arch_enable_uart_fifo (void )
Signature · 1 line
1.7.0
PATCH 1/1 ARM: SAMSUNG: Fix build after "ARM: Eliminate decompressor -Dstatic= PIC hack"
Quoted 3 lines · Mark Brown
Commit
5de813b6(ARM: Eliminate decompressor -Dstatic= PIC hack) among other things changed the declared type of theerror()function to an extern, conflicting with the forward declartion in the Samsung
declaration --------------------------------^
Quoted 38 lines
plat/uncompress.hwhich appears to have been relying on the static being defined away, causing build failures sinceerror()ends up with a GOT relocation but the linker script discards all GOT relocated data and functions:
arch/arm/boot/compressed/decompress.o: In function `gunzip':/home/broonie/git/linux-2.6/arch/arm/boot/compressed/../../../../lib/decompress_inflate.c:68: undefined reference to `error'and so on. Fix this with minimal invasiveness by fixing the
plat/uncompress.hdeclaration.Signed-off-by Mark Brown <[email protected]>--- arch/arm/plat-samsung/include/plat/uncompress.h | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)arch/arm/plat-samsung/include/plat/uncompress.h +1
-1@@ -140,7 +140,7 @@ static void arch_decomp_error(const char *x)#define arch_error arch_decomp_error#endif -static void error (char *err); +extern void error (char *err);#ifdef CONFIG_S3C_BOOT_UART_FORCE_FIFO static inline void arch_enable_uart_fifo (void )Signature · 7 lines
1.7.0 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel at lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Signature · 2 lines
Pengutronix e.K. | Uwe Kleine-K?nig | Industrial Linux Solutions | http://www.pengutronix.de/ |
PATCH 1/1 ARM: SAMSUNG: Fix build after "ARM: Eliminate decompressor -Dstatic= PIC hack"
In reply to Mark BrownQuoted 7 lines · Mark Brown
Commit
5de813b6(ARM: Eliminate decompressor -Dstatic= PIC hack) among other things changed the declared type of theerror()function to an extern, conflicting with the forward declartion in the Samsungplat/uncompress.hwhich appears to have been relying on the static being defined away, causing build failures sinceerror()ends up with a GOT relocation but the linker script discards all GOT relocated data and functions:
This is now required in mainline (2.6.34-rc1 fails to build) - given the severity and lack of response I'm just going to go ahead and send it to the patch tracker, hope that's OK.
PATCH 1/1 ARM: SAMSUNG: Fix build after "ARM: Eliminate decompressor -Dstatic= PIC hack"
Quoted 9 lines · Mark Brown
Quoted 7 lines · Mark Brown
Commit
5de813b6(ARM: Eliminate decompressor -Dstatic= PIC hack) among other things changed the declared type of theerror()function to an extern, conflicting with the forward declartion in the Samsungplat/uncompress.hwhich appears to have been relying on the static being defined away, causing build failures sinceerror()ends up with a GOT relocation but the linker script discards all GOT relocated data and functions:
Quoted 3 lines
This is now required in mainline (2.6.34-rc1 fails to build) - given the severity and lack of response I'm just going to go ahead and send it to the patch tracker, hope that's OK.
Why is error() being declared in this header file?
PATCH 1/1 ARM: SAMSUNG: Fix build after "ARM: Eliminate decompressor -Dstatic= PIC hack"
Quoted 7 lines · Russell King - ARM Linux
Quoted 3 lines · Mark Brown
This is now required in mainline (2.6.34-rc1 fails to build) - given the severity and lack of response I'm just going to go ahead and send it to the patch tracker, hope that's OK.
Why is
error()being declared in this header file?
IIRC (it's a little while since I grovelled through) it's being used by some of the S3C specific code for error reporting as well and the declaration/definition from the generic code wasn't visible at the point that code was built. Clearly not having this second, platform specific declaration would be a better approach but due to the urgency and closeness to release I went with a minimally invasive one line edit in order to reduce the risk of possible side effects.
PATCH 1/1 ARM: SAMSUNG: Fix build after "ARM: Eliminate decompressor -Dstatic= PIC hack"
Quoted 9 lines · Mark Brown
Quoted 7 lines · Russell King - ARM Linux
Quoted 3 lines · Mark Brown
This is now required in mainline (2.6.34-rc1 fails to build) - given the severity and lack of response I'm just going to go ahead and send it to the patch tracker, hope that's OK.
Why is
error()being declared in this header file?
Quoted 7 lines
IIRC (it's a little while since I grovelled through) it's being used by some of the S3C specific code for error reporting as well and the declaration/definition from the generic code wasn't visible at the point that code was built. Clearly not having this second, platform specific declaration would be a better approach but due to the urgency and closeness to release I went with a minimally invasive one line edit in order to reduce the risk of possible side effects.
Let's do the job properly this time then and put a declaration in compressed/misc.c
PATCH 1/1 ARM: SAMSUNG: Fix build after "ARM: Eliminate decompressor -Dstatic= PIC hack"
Quoted 2 lines · Russell King - ARM Linux
Let's do the job properly this time then and put a declaration in
compressed/misc.c
I agree that that's best, I guess I'll try to take a look. I'd be much more comfortable doing that in .35 than .34, though.
PATCH 1/1 ARM: SAMSUNG: Fix build after "ARM: Eliminate decompressor -Dstatic= PIC hack"
Quoted 7 lines · Mark Brown
Quoted 2 lines · Russell King - ARM Linux
Let's do the job properly this time then and put a declaration in
compressed/misc.cI agree that that's best, I guess I'll try to take a look. I'd be much more comfortable doing that in .35 than .34, though.
Since this isn't even in for .34 yet, that isn't a concern.
PATCH 1/1 ARM: SAMSUNG: Fix build after "ARM: Eliminate decompressor -Dstatic= PIC hack"
Quoted 6 lines · Russell King - ARM Linux
Quoted 2 lines · Mark Brown
I agree that that's best, I guess I'll try to take a look. I'd be much more comfortable doing that in .35 than .34, though.
Since this isn't even in for .34 yet, that isn't a concern.
Oh, I think I'm missing something here or we're talking at cross purposes. The generic change is in Linus' tree since ac0f6f92 and I'm seeing build failures with -rc1.
PATCH 1/1 ARM: Fix Samsung build after "ARM: Eliminate decompressor -Dstatic= PIC hack"
In reply to Mark BrownCommit 5de813b6 (ARM: Eliminate decompressor -Dstatic= PIC hack) among other things changed the declared type of the error() function to an extern, conflicting with the forward declartion in the Samsung plat/uncompress.h which appears to have been relying on the static being defined away, causing build failures since error() ends up with a GOT relocation but the linker script discards all GOT relocated data and functions:
arch/arm/boot/compressed/decompress.o: In function `gunzip':/home/broonie/git/linux-2.6/arch/arm/boot/compressed/../../../../lib/decompress_ +inflate.c:68: undefined reference to `error'
and so on. Fix this by moving the declaration into uncompress/misc.c where it is shared with the rest of the code, correcting the definition as we go.
---
OK, that seemed to be a lot easier than I'd been expecting - I'd been looking for a header file to place this in when I originally ran into this.
arch/arm/boot/compressed/misc.c | 1 + arch/arm/plat-s3c/include/plat/uncompress.h | 2 -- 2 files changed, 1 insertions(+), 2 deletions(-)
arch/arm/boot/compressed/misc.c +1 -0
@@ -33,6 +33,7 @@ unsigned int __machine_arch_type;#else static void putstr (const char *ptr); +extern void error (char *x);#include <mach/uncompress.h>
arch/arm/plat-s3c/include/plat/uncompress.h +0 -2
@@ -140,8 +140,6 @@ static void arch_decomp_error(const char *x)#define arch_error arch_decomp_error#endif -static void error (char *err); -#ifdef CONFIG_S3C_BOOT_UART_FORCE_FIFO static inline void arch_enable_uart_fifo (void ) {
Signature · 1 line
1.7.0