Modify

Opened 7 years ago

Closed 6 years ago

Last modified 2 years ago

#5832 closed defect (worksforme)

UML build fails, can't find libutil

Reported by: brianp Owned by: nico
Priority: normal Milestone: Barrier Breaker 14.07
Component: packages Version: Trunk
Keywords: Cc:

Description

On Fedora Core 11, r17571 fails to compile a UML image with the errors below (it can't find libutil while linking vmlinux). Hacking the Makefile to skip -lutil, it then fails to find libc. The same kernel rev (2.6.30.6) from kernel.org (plus the 005 patch from r17525) builds a working UML kernel just fine on this system.

make[4]: Entering directory `/home/brianp/src/openwrt-trunk/trunk/target/linux/uml'
/home/brianp/src/openwrt-trunk/trunk/scripts/kconfig.pl + /home/brianp/src/openwrt-trunk/trunk/target/linux/generic-2.6/config-2.6.30 /home/brianp/src/openwrt-trunk/trunk/target/linux/uml/config/i386 > /home/brianp/src/openwrt-trunk/trunk/build_dir/linux-uml/linux-2.6.30.6/.config.target
echo "# CONFIG_KALLSYMS is not set" >> /home/brianp/src/openwrt-trunk/trunk/build_dir/linux-uml/linux-2.6.30.6/.config.target
echo "# CONFIG_PROFILING is not set" >> /home/brianp/src/openwrt-trunk/trunk/build_dir/linux-uml/linux-2.6.30.6/.config.target
echo "CONFIG_DEBUG_FS=y" >> /home/brianp/src/openwrt-trunk/trunk/build_dir/linux-uml/linux-2.6.30.6/.config.target
echo "# CONFIG_KALLSYMS_EXTRA_PASS is not set" >> /home/brianp/src/openwrt-trunk/trunk/build_dir/linux-uml/linux-2.6.30.6/.config.target
echo "# CONFIG_KALLSYMS_ALL is not set" >> /home/brianp/src/openwrt-trunk/trunk/build_dir/linux-uml/linux-2.6.30.6/.config.target
echo "# CONFIG_KPROBES is not set" >> /home/brianp/src/openwrt-trunk/trunk/build_dir/linux-uml/linux-2.6.30.6/.config.target
/home/brianp/src/openwrt-trunk/trunk/staging_dir/host/bin/sed -i -e 's,.*CONFIG_AEABI.*,# CONFIG_AEABI is not set,' /home/brianp/src/openwrt-trunk/trunk/build_dir/linux-uml/linux-2.6.30.6/.config.target
/home/brianp/src/openwrt-trunk/trunk/scripts/metadata.pl kconfig /home/brianp/src/openwrt-trunk/trunk/tmp/.packageinfo /home/brianp/src/openwrt-trunk/trunk/.config > /home/brianp/src/openwrt-trunk/trunk/build_dir/linux-uml/linux-2.6.30.6/.config.override
/home/brianp/src/openwrt-trunk/trunk/scripts/kconfig.pl 'm+' /home/brianp/src/openwrt-trunk/trunk/build_dir/linux-uml/linux-2.6.30.6/.config.target /home/brianp/src/openwrt-trunk/trunk/build_dir/linux-uml/linux-2.6.30.6/.config.override > /home/brianp/src/openwrt-trunk/trunk/build_dir/linux-uml/linux-2.6.30.6/.config
mv /home/brianp/src/openwrt-trunk/trunk/build_dir/linux-uml/linux-2.6.30.6/.config /home/brianp/src/openwrt-trunk/trunk/build_dir/linux-uml/linux-2.6.30.6/.config.old
grep -v INITRAMFS /home/brianp/src/openwrt-trunk/trunk/build_dir/linux-uml/linux-2.6.30.6/.config.old > /home/brianp/src/openwrt-trunk/trunk/build_dir/linux-uml/linux-2.6.30.6/.config
echo 'CONFIG_INITRAMFS_SOURCE=""' >> /home/brianp/src/openwrt-trunk/trunk/build_dir/linux-uml/linux-2.6.30.6/.config
export MAKEFLAGS= ;make -C /home/brianp/src/openwrt-trunk/trunk/build_dir/linux-uml/linux-2.6.30.6 CROSS_COMPILE="" ARCH="um" KBUILD_HAVE_NLS=no CONFIG_SHELL="/bin/bash" CC="gcc" oldconfig prepare scripts
make[5]: Entering directory `/home/brianp/src/openwrt-trunk/trunk/build_dir/linux-uml/linux-2.6.30.6'
scripts/kconfig/conf -o arch/um/Kconfig.x86
#
# configuration written to .config
#
scripts/kconfig/conf -s arch/um/Kconfig.x86
make[7]: `arch/um/sys-i386/user-offsets.s' is up to date.
  CHK     include/linux/version.h
  CHK     include/linux/utsrelease.h
  SYMLINK include/asm -> include/asm-um
  CALL    scripts/checksyscalls.sh
make[5]: Leaving directory `/home/brianp/src/openwrt-trunk/trunk/build_dir/linux-uml/linux-2.6.30.6'
rm -rf /home/brianp/src/openwrt-trunk/trunk/build_dir/linux-uml/modules
touch /home/brianp/src/openwrt-trunk/trunk/build_dir/linux-uml/linux-2.6.30.6/.configured
rm -f /home/brianp/src/openwrt-trunk/trunk/build_dir/target-i386_glibc-2.7/root-uml/init
make -C /home/brianp/src/openwrt-trunk/trunk/build_dir/linux-uml/linux-2.6.30.6 CROSS_COMPILE="" ARCH="um" KBUILD_HAVE_NLS=no CONFIG_SHELL="/bin/bash" CC="gcc" 
make[5]: Entering directory `/home/brianp/src/openwrt-trunk/trunk/build_dir/linux-uml/linux-2.6.30.6'
make[6]: `arch/um/sys-i386/user-offsets.s' is up to date.
  CHK     include/linux/version.h
  CHK     include/linux/utsrelease.h
  SYMLINK include/asm -> include/asm-um
  CALL    scripts/checksyscalls.sh
  CHK     include/linux/compile.h
  QUOTE   arch/um/kernel/config.tmp
  QUOTE   arch/um/kernel/config.c
  CC      arch/um/kernel/config.o
  LD      arch/um/kernel/built-in.o
  LD      vmlinux.o
  MODPOST vmlinux.o
  GEN     .version
  CHK     include/linux/compile.h
  UPD     include/linux/compile.h
  CC      init/version.o
  LD      init/built-in.o
  LD      .tmp_vmlinux1
/usr/bin/ld: cannot find -lutil
collect2: ld returned 1 exit status
  KSYM    .tmp_kallsyms1.S
nm: '.tmp_vmlinux1': No such file
No valid symbol.
make[5]: *** [.tmp_kallsyms1.S] Error 1
make[5]: Leaving directory `/home/brianp/src/openwrt-trunk/trunk/build_dir/linux-uml/linux-2.6.30.6'

Attachments (1)

uml-target-cross.patch (631 bytes) - added by brianp 7 years ago.
Adding patch to use the target cross toolchain to build the kernel.

Download all attachments as: .zip

Change History (6)

comment:1 Changed 7 years ago by brianp

Does anyone have any objections to building the UML kernel with the same cross tools used to build the UML application ipks? Currently it builds the UML kernel with the native toolchain and the apps with the gcc and libs in staging_dir/. FC11 hasn't really given me any .a files (including for libutil and libc), so ld is unable to statically link the kernel. The toolchain in staging_dir appears to have everything I would need, and I'd rather modify the UML build to use that than try to flesh out my native toolchain. If I change the kernel config to not statically link, it builds just fine.

Changed 7 years ago by brianp

Adding patch to use the target cross toolchain to build the kernel.

comment:2 Changed 7 years ago by anonymous

Using the target cross toolchain seems like a more reliable approach to me. But, uClibc isn't an option, then. Sort of a long-standing bug, it appears: http://lists.uclibc.org/pipermail/uclibc/2009-January/041760.html

glibc works fine.

comment:3 Changed 6 years ago by nico

  • Owner changed from developers to nico
  • Status changed from new to accepted

The UML kernel binary is designed to run on the host system as a process with whatever C library is installed there, that's why we're using the host compile to build it. Using the target cross toolchain makes no sense and is not an option.

Regarding your issue with libutil.a, i'd say you're probably missing some packages on your build system, can you check you have the glibc-static rpm package installed and try again ?

comment:4 Changed 6 years ago by nico

  • Resolution set to worksforme
  • Status changed from accepted to closed
  • Version set to Trunk

Works for me after installing glibc-static on Fedora 12.

comment:5 Changed 2 years ago by jow

  • Milestone changed from Attitude Adjustment 12.09 to Barrier Breaker 14.07

Milestone Attitude Adjustment 12.09 deleted

Add Comment

Modify Ticket

Action
as closed .
The resolution will be deleted. Next status will be 'reopened'.
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.