Skip to contentSkip to conversation

pbl: fix IMAGE_COMPRESSION_LZO-enabled build on MIPS

PATCH Applied Antony Pavlov 2 participants 5 messages Feb 4, 2013 – Feb 5, 2013 Library code

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 pbl: fix IMAGE_COMPRESSION_LZO-enabled build on MIPS

Here's the error message:

LD arch/mips/pbl/zbarebox
pbl/built-in-pbl.o: In function `decompress_unlzo':
/home/antony/barebox.git.rebased.isp/pbl/decomp.c:35: undefined reference to free' pbl/built-in-pbl.o: In function pbl_barebox_uncompress':
(.text.pbl_barebox_uncompress+0x6d0): relocation truncated to fit: R_MIPS_26 against free' pbl/built-in-pbl.o: In function pbl_barebox_uncompress':
(.text.pbl_barebox_uncompress+0x6e0): undefined reference to free' pbl/built-in-pbl.o: In function pbl_barebox_uncompress':
(.text.pbl_barebox_uncompress+0x6e0): relocation truncated to fit: R_MIPS_26 against `free' make[1]: *** [arch/mips/pbl/zbarebox] Error 1
make: *** [zbarebox.bin] Error 2

---
 lib/decompress_unlzo.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
lib/decompress_unlzo.c +3 -1
index 776719c..1b2dc9d 100644
@@ -26,14 +26,16 @@
  */
 
 #include <common.h>
-#include <malloc.h>
 #include <linux/types.h>
 #include <errno.h>
 #include <fs.h>
 #include <xfuncs.h>
 
 #ifdef STATIC
+#include <linux/decompress/mm.h>
 #include "lzo/lzo1x_decompress.c"
+#else
+#include <malloc.h>
 #endif
 
 #include <lzo.h>
Signature · 7 lines
1.7.10.4


_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
#1 lore raw

PATCH 2/2 pbl: factorise linux/decompress/mm.h inclusion

---
 lib/decompress_inflate.c |    1 -
 lib/decompress_unlzo.c   |    1 -
 pbl/decomp.c             |    2 ++
 3 files changed, 2 insertions(+), 2 deletions(-)
lib/decompress_inflate.c +0 -1
index 5c1ebb6..526d6a1 100644
@@ -4,7 +4,6 @@
 /* prevent inclusion of _LINUX_KERNEL_H in pre-boot environment: lots
  * errors about console_printk etc... on ARM */
 #define _LINUX_KERNEL_H
-#include <linux/decompress/mm.h>
 
 #include "zlib_inflate/inftrees.c"
 #include "zlib_inflate/inffast.c"
lib/decompress_unlzo.c +0 -1
index 1b2dc9d..2b0fbed 100644
@@ -32,7 +32,6 @@
 #include <xfuncs.h>
 
 #ifdef STATIC
-#include <linux/decompress/mm.h>
 #include "lzo/lzo1x_decompress.c"
 #else
 #include <malloc.h>
pbl/decomp.c +2 -0
index aa6a31e..17fc01e 100644
@@ -10,6 +10,8 @@
 
 #define STATIC static
 
+#include <linux/decompress/mm.h>
+
 #ifdef CONFIG_IMAGE_COMPRESSION_LZO
 #include "../../../lib/decompress_unlzo.c"
 #endif
Signature · 7 lines
1.7.10.4


_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
#2 lore raw

Re: [PATCH 2/2] pbl: factorise linux/decompress/mm.h inclusion

Quoted 36 lines · Antony Pavlov
---
 lib/decompress_inflate.c |    1 -
 lib/decompress_unlzo.c   |    1 -
 pbl/decomp.c             |    2 ++
 3 files changed, 2 insertions(+), 2 deletions(-)
lib/decompress_inflate.c +0 -1
index 5c1ebb6..526d6a1 100644
@@ -4,7 +4,6 @@
 /* prevent inclusion of _LINUX_KERNEL_H in pre-boot environment: lots
  * errors about console_printk etc... on ARM */
 #define _LINUX_KERNEL_H
-#include <linux/decompress/mm.h>
 
 #include "zlib_inflate/inftrees.c"
 #include "zlib_inflate/inffast.c"
lib/decompress_unlzo.c +0 -1
index 1b2dc9d..2b0fbed 100644
@@ -32,7 +32,6 @@
 #include <xfuncs.h>
 
 #ifdef STATIC
-#include <linux/decompress/mm.h>
 #include "lzo/lzo1x_decompress.c"
 #else
 #include <malloc.h>
pbl/decomp.c +0 -0
index aa6a31e..17fc01e 100644

pbl/decomp.c line 14

Quoted 5 lines
pbl/decomp.c +2 -0
@@ -10,6 +10,8 @@
 
 #define STATIC static
 
+#include <linux/decompress/mm.h>
+

Any special reason for this patch? Normally the #include is in the file requiring the declarations from the file. In this case decompress_* need linux/decompress/mm.h, not pbl/decomp.c.

Sascha

Signature · 9 lines
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
#3 lore raw

Re: [PATCH 2/2] pbl: factorise linux/decompress/mm.h inclusion

Quoted 38 lines · Sascha Hauer
Quoted 37 lines · Antony Pavlov
---
 lib/decompress_inflate.c |    1 -
 lib/decompress_unlzo.c   |    1 -
 pbl/decomp.c             |    2 ++
 3 files changed, 2 insertions(+), 2 deletions(-)
lib/decompress_inflate.c +0 -1
index 5c1ebb6..526d6a1 100644
@@ -4,7 +4,6 @@
 /* prevent inclusion of _LINUX_KERNEL_H in pre-boot environment: lots
  * errors about console_printk etc... on ARM */
 #define _LINUX_KERNEL_H
-#include <linux/decompress/mm.h>
 
 #include "zlib_inflate/inftrees.c"
 #include "zlib_inflate/inffast.c"
lib/decompress_unlzo.c +0 -1
index 1b2dc9d..2b0fbed 100644
@@ -32,7 +32,6 @@
 #include <xfuncs.h>
 
 #ifdef STATIC
-#include <linux/decompress/mm.h>
 #include "lzo/lzo1x_decompress.c"
 #else
 #include <malloc.h>
pbl/decomp.c +0 -0
index aa6a31e..17fc01e 100644
@@ -10,6 +10,8 @@
 
Quoted 8 lines

pbl/decomp.c line 14

Quoted 4 lines
pbl/decomp.c +2 -0
 #define STATIC static
 
+#include <linux/decompress/mm.h>
+

Any special reason for this patch? Normally the #include is in the file requiring the declarations from the file. In this case decompress_* need linux/decompress/mm.h, not pbl/decomp.c.

There is no special reason for this patch, just factorisation. If you don't like this type of factorisation you can drop this patch :)

Signature · 7 lines
Best regards,
  Antony Pavlov

_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
Applied
#4 lore raw
In reply to Antony Pavlov
Quoted 14 lines · Antony Pavlov

Here's the error message:

LD arch/mips/pbl/zbarebox
pbl/built-in-pbl.o: In function `decompress_unlzo':
/home/antony/barebox.git.rebased.isp/pbl/decomp.c:35: undefined reference to free' pbl/built-in-pbl.o: In function pbl_barebox_uncompress':
(.text.pbl_barebox_uncompress+0x6d0): relocation truncated to fit: R_MIPS_26 against free' pbl/built-in-pbl.o: In function pbl_barebox_uncompress':
(.text.pbl_barebox_uncompress+0x6e0): undefined reference to free' pbl/built-in-pbl.o: In function pbl_barebox_uncompress':
(.text.pbl_barebox_uncompress+0x6e0): relocation truncated to fit: R_MIPS_26 against `free' make[1]: *** [arch/mips/pbl/zbarebox] Error 1
make: *** [zbarebox.bin] Error 2

Quoted 1 line

Applied, thanks

Sascha

Quoted 35 lines
---
 lib/decompress_unlzo.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
lib/decompress_unlzo.c +3 -1
index 776719c..1b2dc9d 100644
@@ -26,14 +26,16 @@
  */
 
 #include <common.h>
-#include <malloc.h>
 #include <linux/types.h>
 #include <errno.h>
 #include <fs.h>
 #include <xfuncs.h>
 
 #ifdef STATIC
+#include <linux/decompress/mm.h>
 #include "lzo/lzo1x_decompress.c"
+#else
+#include <malloc.h>
 #endif
 
 #include <lzo.h>
Signature · 7 lines
1.7.10.4


_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
Signature · 9 lines
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox