On Tue, Mar 13, 2007 at 08:25:29PM -0400, Daniel Kahn Gillmor wrote: > Subject: mkvmlinuz fails with undefined reference to zlib_inflate_blocks* > against 2.6.18-4-powerpc > Package: mkvmlinuz > Version: 32 > Severity: normal > > i'm not using mkvmlinuz as my sole bootloader: i am considering it as > an alternate. However, running it by hand with a stock kernel and an > initrd fails with linker errors:
This is due to building on a powermac, which usually uses yaboot for booting, i believe. This seems a strange error, because the same kernel is building nicely in the daily builds of d-i (but for chrp) : === Building for sub-architecture chrp. === Using kernel image file ./tmp/powerpc_netboot/vmlinux. === Using initrd image file ./tmp/powerpc_netboot/initrd.gz. === Release version seems to be 2.6.18-4-powerpc. === Using object files from ./tmp/powerpc_netboot/lib. === Building a bootable compressed kernel image in ./dest/powerpc/netboot/vmlinuz-chrp.initrd. === Doing build in /tmp/tmp.HCLCw14930. === Creating compressed initrd image initrd.gz... cp -p ./tmp/powerpc_netboot/initrd.gz /tmp/tmp.HCLCw14930/initrd.gz === Creating compressed kernel image vmlinux.gz... strip -s -R .comment ./tmp/powerpc_netboot/vmlinux -o /tmp/tmp.HCLCw14930/vmlinux gzip --force --best /tmp/tmp.HCLCw14930/vmlinux === Putting everything into ELF image file image.o... objcopy ./tmp/powerpc_netboot/lib/mkvmlinuz-kernel-vmlinux.strip.o /tmp/tmp.HCLCw14930/dummy_kernel.o --add-section=.kernel:vmlinux.strip=/tmp/tmp.HCLCw14930/vmlinux.gz --set-section-flags=.kernel:vmlinux.strip=contents,alloc,load,readonly,data objcopy ./tmp/powerpc_netboot/lib/mkvmlinuz-kernel-initrd.o /tmp/tmp.HCLCw14930/dummy_initrd.o --add-section=.kernel:initrd=/tmp/tmp.HCLCw14930/initrd.gz --set-section-flags=.kernel:initrd=contents,alloc,load,readonly,data === Creating bootable kernel image file vmlinuz.chrp... ld -m elf32ppc -T ./tmp/powerpc_netboot/lib/zImage.lds -o /tmp/tmp.HCLCw14930/vmlinuz.chrp ./tmp/powerpc_netboot/lib/crt0.o ./tmp/powerpc_netboot/lib/string.o ./tmp/powerpc_netboot/lib/prom.o ./tmp/powerpc_netboot/lib/stdio.o ./tmp/powerpc_netboot/lib/main.o ./tmp/powerpc_netboot/lib/div64.o ./tmp/powerpc_netboot/lib/inffast.o ./tmp/powerpc_netboot/lib/inflate.o ./tmp/powerpc_netboot/lib/inftrees.o /tmp/tmp.HCLCw14930/dummy_kernel.o /tmp/tmp.HCLCw14930/dummy_initrd.o ./tmp/powerpc_netboot/lib/addnote /tmp/tmp.HCLCw14930/vmlinuz.chrp === Moving bootable kernel image file to ./dest/powerpc/netboot/vmlinuz-chrp.initrd... === Cleaning up... I guess the pmac way of building is somehow broken for whatever reason, or there is another problem. I am afraid builds on pmac where rarely tested, and not since the big ARCH=powerpc changes. That said, it is true that the do_cmd needs a bit better error checking, the whole stuff needs a full reimplementation post-etch anyway, since it can now mostly just call the ARCH=powerpc new wrapper which does much of what mkvmlinuz does. Friendly, Sven Luther > 0 clam:/home/debirf# mkvmlinuz -o /foo.mkvmlinuz -k > /boot/vmlinux-2.6.18-4-powerpc -i /boot/initrd.img-2.6.18-4-powerpc -v -d > /usr/lib/mkvmlinuz 2>&1 > === Building for sub-architecture pmac. > === Using kernel image file /boot/vmlinux-2.6.18-4-powerpc. > === Using initrd image file /boot/initrd.img-2.6.18-4-powerpc. > === Release version seems to be 2.6.18-4-powerpc. > === Using object files from /usr/lib/mkvmlinuz. > === Building a bootable compressed kernel image in /foo.mkvmlinuz. > === Doing build in /tmp/tmp.AJsdy17607. > === Creating compressed initrd image initrd.gz... > cp -p /boot/initrd.img-2.6.18-4-powerpc /tmp/tmp.AJsdy17607/initrd.gz > === Creating compressed kernel image vmlinux.gz... > strip -s -R .comment /boot/vmlinux-2.6.18-4-powerpc -o > /tmp/tmp.AJsdy17607/vmlinux > gzip --force --best /tmp/tmp.AJsdy17607/vmlinux > === Putting everything into ELF image file image.o... > objcopy /usr/lib/mkvmlinuz/mkvmlinuz-kernel-vmlinux.strip.o > /tmp/tmp.AJsdy17607/dummy_kernel.o > --add-section=.kernel:vmlinux.strip=/tmp/tmp.AJsdy17607/vmlinux.gz > --set-section-flags=.kernel:vmlinux.strip=contents,alloc,load,readonly,data > objcopy /usr/lib/mkvmlinuz/mkvmlinuz-kernel-initrd.o > /tmp/tmp.AJsdy17607/dummy_initrd.o > --add-section=.kernel:initrd=/tmp/tmp.AJsdy17607/initrd.gz > --set-section-flags=.kernel:initrd=contents,alloc,load,readonly,data > === Creating bootable kernel image file vmlinuz.pmac... > ld -m elf32ppc -T /usr/lib/mkvmlinuz/zImage.lds -o > /tmp/tmp.AJsdy17607/vmlinuz.pmac /usr/lib/mkvmlinuz/crt0.o > /usr/lib/mkvmlinuz/string.o /usr/lib/mkvmlinuz/prom.o > /usr/lib/mkvmlinuz/stdio.o /usr/lib/mkvmlinuz/main.o > /usr/lib/mkvmlinuz/div64.o /usr/lib/mkvmlinuz/inffast.o > /usr/lib/mkvmlinuz/inflate.o /usr/lib/mkvmlinuz/inftrees.o > /tmp/tmp.AJsdy17607/dummy_kernel.o /tmp/tmp.AJsdy17607/dummy_initrd.o > /usr/lib/mkvmlinuz/inffast.o:(.got2+0x0): undefined reference to > `zlib_inflate_mask' > /usr/lib/mkvmlinuz/inflate.o: In function `zlib_inflate': > /home/sven/debian/kernel/trunk/utils/mkvmlinuz/32/mkvmlinuz-32/boot/inflate.c:188: > undefined reference to `zlib_inflate_blocks' > /home/sven/debian/kernel/trunk/utils/mkvmlinuz/32/mkvmlinuz-32/boot/inflate.c:202: > undefined reference to `zlib_inflate_blocks_reset' > /usr/lib/mkvmlinuz/inflate.o: In function `zlib_inflateReset': > /home/sven/debian/kernel/trunk/utils/mkvmlinuz/32/mkvmlinuz-32/boot/inflate.c:25: > undefined reference to `zlib_inflate_blocks_reset' > /usr/lib/mkvmlinuz/inflate.o: In function `zlib_inflateEnd': > /home/sven/debian/kernel/trunk/utils/mkvmlinuz/32/mkvmlinuz-32/boot/inflate.c:37: > undefined reference to `zlib_inflate_blocks_free' > /usr/lib/mkvmlinuz/inflate.o: In function `zlib_inflateInit2_': > /home/sven/debian/kernel/trunk/utils/mkvmlinuz/32/mkvmlinuz-32/boot/inflate.c:76: > undefined reference to `zlib_inflate_blocks_new' > /usr/lib/mkvmlinuz/addnote /tmp/tmp.AJsdy17607/vmlinuz.pmac > /tmp/tmp.AJsdy17607/vmlinuz.pmac: No such file or directory > === Cleaning up... > 0 clam:/home/debirf# > > Interestingly, the return code is 0. mkvmlinuz doesn't seem to > realize that the ld step has failed. > > when i run the different steps by hand, ld definitely returns 1, but > the do_cmd step in mkvmlinuz doesn't check the return value. > > I'm not sure what i'm supposed to do to get this to work. the kernel > in question is a stock debian 2.6.18-4-powerpc: > > [0 [EMAIL PROTECTED] tmp]$ grep CONFIG_ZLIB /boot/config-2.6.18-4-powerpc > CONFIG_ZLIB_INFLATE=y > CONFIG_ZLIB_DEFLATE=m > [0 [EMAIL PROTECTED] tmp]$ > > i'm happy to help debug more if i can. Please let me know if i'm just > confused. > > I've never used mkvmlinuz before, but i'm excited to get it working. > It looks like a very useful boot strategy. > > --dkg > > > -- System Information: > Debian Release: 4.0 > APT prefers testing > APT policy: (500, 'testing') > Architecture: powerpc (ppc) > Shell: /bin/sh linked to /bin/bash > Kernel: Linux 2.6.8-powerpc > Locale: LANG=en_US, LC_CTYPE=en_US (charmap=ISO-8859-1) > > Versions of packages mkvmlinuz depends on: > ii bash 3.1dfsg-8 The GNU Bourne Again SHell > ii binutils 2.17-3 The GNU assembler, linker and > bina > ii debconf [debconf-2.0] 1.5.11 Debian configuration management > sy > > mkvmlinuz recommends no packages. > > -- debconf information: > * mkvmlinuz/bootloaders: yaboot > > > -- > To UNSUBSCRIBE, email to [EMAIL PROTECTED] > with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED] > > --------------------------------------------------------------------------------------- > Orange vous informe que cet e-mail a ete controle par l'anti-virus mail. > Aucun virus connu a ce jour par nos services n'a ete detecte. > > -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]