Skip to contentSkip to conversation

2.4.18-rmk7 + CVS jffs2 ld error (zlib)

DISCUSSION Michael Palme 3 participants 5 messages Aug 29, 2002 Memory technology devices (MTD)

lore
Share & tools
lore
#0 lore raw

hello...

i know this was discussed some times ago in the list but i'read the old threads but no success.
i have kernel 2.4.18-rmk7 and i would like to build it with jffs2 from latest CVS. i have patched /patches/patchin.sh with patch from Henrik Nordstrom posted today, and applied on the kernel sources. on building i get lots of errors at the final linking:

arm/tools/chain/bin/arm-uclibc-ld -p -X -T arch/arm/vmlinux.lds arch/arm/kernel/head-armv.o arch/arm/kernel/init_task.o init/main.o init/version.o --start-group arch/arm/kernel/kernel.o arch/arm/mm/mm.o arch/arm/mach-sa1100/sa1100.o kernel/kernel.o mm/mm.o fs/fs.o ipc/ipc.o drivers/serial/serial.o drivers/char/char.o drivers/block/block.o drivers/misc/misc.o drivers/net/net.o drivers/media/media.o drivers/mtd/mtdlink.o net/network.o arch/arm/nwfpe/math-emu.o arch/arm/lib/lib.a /usr/arm/krnl-2.4.18-rmk7/lib/lib.a --end-group -o vmlinux

fs/fs.o: In function `jffs2_zlib_compress':
fs/fs.o(.text+0x2ab58): undefined reference to zlib_deflateInit_' fs/fs.o(.text+0x2abb0): undefined reference to zlib_deflate' fs/fs.o(.text+0x2abbc): undefined reference to zlib_deflateEnd' fs/fs.o(.text+0x2ac3c): undefined reference to zlib_deflate' fs/fs.o(.text+0x2ac78): undefined reference to zlib_deflateEnd' fs/fs.o: In function jffs2_zlib_decompress':
fs/fs.o(.text+0x2ad4c): undefined reference to zlib_inflateInit_' fs/fs.o(.text+0x2ad78): undefined reference to zlib_inflate' fs/fs.o(.text+0x2ad98): undefined reference to zlib_inflateEnd' fs/fs.o: In function jffs2_garbage_collect_thread':
fs/fs.o(.text+0x363a0): undefined reference to set_user_nice' fs/fs.o: In function jffs2_zlib_init':
fs/fs.o(.text.init+0x16b8): undefined reference to zlib_deflate_workspacesize' fs/fs.o(.text.init+0x16d8): undefined reference to zlib_inflate_workspacesize' fs/fs.o(.text.init+0x1700): undefined reference to zlib_inflate_workspacesize' fs/fs.o(.text.init+0x1720): undefined reference to zlib_deflate_workspacesize'
make: *** [vmlinux] Error 1

so i grepped around in the list archive and found a possible solution to remove compr_zlib.o from COMPR_OBJS in jffs2/Makefile. Now after rebuilding i get:

/arm/tools/chain/bin/arm-uclibc-ld -p -X -T arch/arm/vmlinux.lds arch/arm/kernel/head-armv.o arch/arm/kernel/init_task.o init/main.o init/version.o --start-group arch/arm/kernel/kernel.o arch/arm/mm/mm.o arch/arm/mach-sa1100/sa1100.o kernel/kernel.o mm/mm.o fs/fs.o ipc/ipc.o drivers/serial/serial.o drivers/char/char.o drivers/block/block.o drivers/misc/misc.o drivers/net/net.o drivers/media/media.o drivers/mtd/mtdlink.o net/network.o arch/arm/nwfpe/math-emu.o arch/arm/lib/lib.a /usr/arm/krnl-2.4.18-rmk7/lib/lib.a --end-group -o vmlinux

fs/fs.o: In function `jffs2_compress':
fs/fs.o(.text+0x29fac): undefined reference to jffs2_zlib_compress' fs/fs.o: In function jffs2_decompress':
fs/fs.o(.text+0x2a0b4): undefined reference to jffs2_zlib_decompress' fs/fs.o: In function jffs2_garbage_collect_thread':
fs/fs.o(.text+0x36040): undefined reference to set_user_nice' fs/fs.o: In function init_jffs2_fs':
fs/fs.o(.text.init+0x1868): undefined reference to jffs2_zlib_init' fs/fs.o(.text.init+0x18a4): undefined reference to jffs2_zlib_exit'
make: *** [vmlinux] Error 1

i tried also to apply the patches from ftp://ftp.kernel.org/pub/linux/kernel/people/dwmw2/shared-zlib on top of my kernel but this is something tricky...

so i would like to know if someone has a fast workaround ???

thanks in advance ... Michael Palme

#2 lore raw

thanks fot the answer.
but there is still one problem left:

background.c:92: warning: implicit declaration of function set_user_nice' fs/fs.o(.text+0x363a0): undefined reference to set_user_nice'

the only place i've found this is <linux/mtd/compatmac.h> (link to the mtd-cvs):

#if LINUX_VERSION_CODE < KERNEL_VERSION(2,4,0)
        /* Is this right? */

#define set_user_nice(tsk, n) do { (tsk)->priority = 20-(n); } while(0) #elif LINUX_VERSION_CODE < KERNEL_VERSION(2,4,18)
#define set_user_nice(tsk, n) do { (tsk)->nice = n; } while(0) #endif

so in 2.4.18 there is nothing related....

what should i do??? (i think of #elif LINUX_VERSION_CODE < KERNEL_VERSION(2,4,19) )

thanks in advance ... Michael Palme

Quoted 16 lines · David Woodhouse
Quoted 3 lines · [email protected] said:

so i grepped around in the list archive and found a possible solution to remove compr_zlib.o from COMPR_OBJS in jffs2/Makefile. Now after rebuilding i get:

Don't do that. Apply

http://ftp.kernel.org/pub/linux/kernel/people/dwmw2/shared-zlib/linux-2.4.19-pre10-shared-zlib.gz

--
dwmw2

#3 lore raw
Quoted 3 lines · [email protected] said:

background.c:92: warning: implicit declaration of function
set_user_nice' fs/fs.o(.text+0x363a0): undefined reference to set_user_nice'

Just comment out the offending line in background.c

--
dwmw2