Upgrading mtd-utils in uClinux.
Linux-mtd,
I am attempting to compile the latest mtd-utils into uClinux's distribution dated 2006-08-03. After some unsuccessful attempts I found the new mtd-utils needed an updated zlib. I successfully upgraded to zlib version 1.2.3 inside uClinux-dist/lib/zlib. I now have that compiling and still am not getting anywhere with compiling the mtd-utils. I dropped the latest mtd-utils code into the directory uClinux-dist/user/mtd-utils. I have observed the Makefiles between the new updated mtd-utils and the old uClinux-dist/user/mtd-utils/Makefile are VERY different. I tried to use the old Makefile as a template to build the new code and it still is not compiling. What is the correct method of upgrading mtd-utils? It shouldn't be as difficult to upgrade some code in user space as I am making it. I feel like I must be going about this the wrong way. Are there any pointers, tips, or recommendations to get me going in the right direction?
Thanks,
Glen Johnson
Quoted 1 line · Glen Johnson
I am attempting to compile the latest mtd-utils into uClinux's distribution dated 2006-08-03. After some unsuccessful attempts I found the new mtd-utils needed an updated zlib. I successfully upgraded to zlib version 1.2.3 inside uClinux-dist/lib/zlib. I now have that compiling and still am not getting anywhere with compiling the mtd-utils. I dropped the latest mtd-utils code into the directory uClinux-dist/user/mtd-utils. I have observed the Makefiles between the new updated mtd-utils and the old uClinux-dist/user/mtd-utils/Makefile are VERY different. I tried to use the old
Makefileas a template to build the new code and it still is not compiling. What is the correct method of upgrading mtd-utils? It shouldn't be as difficult to upgrade some code in user space as I am making it. I feel like I must be going about this the wrong way. Are there any pointers, tips, or recommendations to get me going in the right direction?
Unless someone here has had this specific problem, some form of output from the compilation indicating what is going wrong would be helpful.
/Ricard
--
Ricard Wolf Wanderlöf ricardw(at)axis.com
Axis Communications AB, Lund, Sweden www.axis.com
Phone +46 46 272 2016 Fax +46 46 13 61 30
Quoted 4 lines · Ricard Wanderlof
Unless someone here has had this specific problem, some form of output from the compilation indicating what is going wrong would be helpful.
Yes, of course. I have a couple more direct question. First, I found the mtd-utils code is not properly using zlib.
m68k-elf-gcc -Wl,--fatal-warnings -Wl,-elf2flt -Wl,-move-rodata -msep-data -o mkfs.jffs2 crc32.o compr_rtime.o mkfs.jffs2.o compr_zlib.o compr.o -L/home/glen/src/c/linux/uClinux-dist-20060803/lib/zlib
warning: .rodata section contains relocations
mkfs.jffs2.elf2flt: In function `jffs2_zlib_decompress':/home/glen/src/c/linux/uClinux-dist-20060803/user/mtd-utils/compr_zlib.c:118:
undefined reference to `inflateInit_' /home/glen/src/c/linux/uClinux-dist-20060803/user/mtd-utils/compr_zlib.c:127:
undefined reference to `inflate' /home/glen/src/c/linux/uClinux-dist-20060803/user/mtd-utils/compr_zlib.c:132:
undefined reference to `inflateEnd'
mkfs.jffs2.elf2flt: In function `jffs2_zlib_compress':/home/glen/src/c/linux/uClinux-dist-20060803/user/mtd-utils/compr_zlib.c:73:
undefined reference to `deflateInit_' /home/glen/src/c/linux/uClinux-dist-20060803/user/mtd-utils/compr_zlib.c:80:
undefined reference to `deflate' /home/glen/src/c/linux/uClinux-dist-20060803/user/mtd-utils/compr_zlib.c:87:
undefined reference to `deflateEnd' /home/glen/src/c/linux/uClinux-dist-20060803/user/mtd-utils/compr_zlib.c:98:
undefined reference to `deflateEnd'
collect2: ld returned 1 exit status
make[3]: *** [mkfs.jffs2] Error 1
The warning: .rodata section contains relocations is printed and it appears all other attempts to use libz.a are dropped. I Googled this warning and there were a couple of places where it mentioned configure.in. Is this the real problem? If so how can it be fixed, not familiar with autoconf)?
Secondly, once I get the code to compile it appears I still need to add a section to the Makefile to install the files into the romfs image. Can I just pull this out of the old mtd-utils/Makefile or what? Suggestion's/recommendations?
Thanks,
Glen Johnson
Quoted 11 lines · Glen Johnson
Quoted 4 lines · Ricard Wanderlof
Unless someone here has had this specific problem, some form of output from the compilation indicating what is going wrong would be helpful.
Yes, of course. I have a couple more direct question. First, I found the mtd-utils code is not properly using zlib.
m68k-elf-gcc -Wl,--fatal-warnings -Wl,-elf2flt -Wl,-move-rodata -msep-data -o mkfs.jffs2 crc32.o compr_rtime.o mkfs.jffs2.o compr_zlib.o compr.o -L/home/glen/src/c/linux/uClinux-dist-20060803/lib/zlib
No '-lz' on this command line -- you're not actually asking it to link against zlib. Thus is doesn't find any of zlib's symbols.
Quoted 1 line
warning: .rodata section contains relocations
I've no idea what this is about. Perhaps the function pointers in the jffs2_zlib_comp compressor structure?
mkfs.jffs2 builds fine for me for FR-V uClinux, although that's ELF-FDPIC not flat. Are the relocations in .rodata actually a problem? Doesn't m68k have ELF-FDPIC yet?
Quoted 4 lines
Secondly, once I get the code to compile it appears I still need to add a section to the
Makefileto install the files into the romfs image. Can I just pull this out of the old mtd-utils/Makefile or what? Suggestion's/recommendations?
Something wrong with 'make DESTDIR=/foo install' ?
Signature · 1 line
dwmw2
Quoted 6 lines · David Woodhouse
On Thu, 2006-11-30 at 07:58 -0500, Glen Johnson wrote:
mkfs.jffs2 builds fine for me for FR-V uClinux, although that's ELF-FDPIC not flat. Are the relocations in .rodata actually a problem?
Yes, it appears to. When I try to execute mkfs.jffs2 on the host system I get the following error.BINFMT_FLAT: reloc outside program 0x54e20000 (0 - 0xf57f4/0x11ec0), killing mkfs.jffs2!
SIGSEGV
Quoted 2 lines
Doesn't m68k have ELF-FDPIC yet?
I have the uClinux distribution dated 2006-08-03. I did a grep -r ELF-FDPID ./ and found it mentioned in the code for the Fujitsu FRV processor and nothing else. Someone told me he thought it did. But I do not see it in the code. The compiler does appear to have elf support according to this line in the output of make, ARCH=m68knommu CROSS_COMPILE=m68k-elf- this however is Not ELF-FDPIC.
Is there a better way to tell if m68knommu supports ELF-FDPIC?