libraries needed for the minimum linux system

Mike Majors
Sat Sep 17 01:11:00 GMT 2005

I took a look at crosstool-0.38/, and tried to figure out how to
build my own rootfs that only contained the absolute minumum needed to
boot up to a bash shell on an i686 system.  I think this covers it:

  # Build i686 toolchain using crosstool
  export GCC_LANGUAGES="c,c++"
  mkdir -p $RESULT_TOP
  eval `cat i686.dat gcc-4.1-20050716-glibc-2.3.2-hdrs-` sh --notest --testlinux

  # Create a rootfs directory and install crosstool's libraries into it
  export ROOTFS=$PREFIX/rootfs
  mkdir -p $ROOTFS
  for lib in \
   ld libBrokenLocale libSegFault libanl libc libcrypt libdl libgcc_s libgcc_s_nof libm \
   libmemusage libnsl libnss_compat libnss_dns libnss_files libnss_hesiod libnss_nis \
   libnss_nisplus libpcprofile libpthread libresolv librt libstdc++ libthread_db libutil; do
          ls     lib/$lib[-.]*so* || true
          ls usr/lib/$lib[-.]*so* || true
  done 2> /dev/null | cpio -pvm $ROOTFS

  # Install bash into the rootfs and link it to /linuxrc
  cd /tmp
  tar xvjf bash-3.0.tar.bz2
  cd bash-3.0
  export CC=$PREFIX/bin/$TARGET-gcc
  export CXX=$PREFIX/bin/$TARGET-g++
  export LD=$PREFIX/bin/$TARGET-ld
  ./configure --prefix=$ROOTFS
  make install
  ln -s bin/bash $ROOTFS/linuxrc

Is this really all I need to run cramfs on to generate a rootfs image
that I can burn on the target?  Will the libraries generated by
crosstool suffice as runtime libraries for the target?  Will setting
CC, CXX, and LD to my cross compiler be sufficient for building a bash
that will run on the target?


Want more information?  See the CrossGCC FAQ,
Want to unsubscribe? Send a note to

More information about the crossgcc mailing list