Setting Up An ARM Cross Compiler

From Omnifi Wiki

Jump to: navigation, search
Quick Links
Linux-Inside.jpg
Related topics
  • Find Something
    • To Put Here

edit

There are a couple of crosscompiler environments we can setup (crosstools & buildroot). The CROSSTOOL environment is the de-facto cross compiler toolchain used by Andy Poling to build the Openfi MP3 player for the DMP. (Note: I now use the uClibc compiler from buildroot -Andy)

An alternate environment called BUILDROOT can be used to build a tool chain that uses uClibc ("myu-See-Libe-See") to build a crosscompiler that produces a much smaller binary output, particularly when building files statically. It also is an environment that closely resembles the DMP1's environment (which uses uClibc and BusyBox in a cramfs, which is exactly what this BUILDROOT produces). The challenge here is somehow building a BUILDROOT environment that uses exactly the same gcc, uClibc, binutils, etc. as the DMP1 so that the shared libraries can be dynamically linked. I have not yet been able to do this--but I'm just an average Lum and know nothing about these complex configure and Makefiles. I did manage to make a working rsync for the DMP1 using BUILDROOT, however.

Contents

CROSSTOOL Cross Compiler Environment Setup

This section is broken down into several sections, depending on the Operating System you're using. The basic steps, however, are the same.

CYGWIN (Windows OS)

Basic Setup:

  1. Download and install CYGWIN from here CYGWIN Web Installer. Ensure that the following packages are selected / enabled for your CYGWIN (in addition to the BASE install): <P/>
    Archive ->tar1.15.1-2+
    Devel ->flex2.5.4a-3+
    Devel->gcc-core3.4.4-1+
    Devel->binutils20050610-1+
    Devel->libiconv1.9.2-1+
    Devel->libncurses5.4.2+
    Devel->make3.80-1+
    Devel->patchutils0.2.30-1+
    Interpret->perl5.8.7-4+
    Lib->libbz2_11.0.3-1+
    Lib->libcharset1.9.2-1+
    Lib->libiconv1.9.2-1+
    Lib->libiconv21.9.2-1+
    Lib->zlib1.2.3-1+
    Shell->ash20040127-3+
    Shell->bash3.0-11+
    Utils->bzip21.0.3-1+
    Utils->cygutils1.2.9-1+
    Utils->patch2.5.8-8+
    Web ->wget1.9.1-2+


    Many of these options will be automatically set when you select certain items (such as gcc-core or bzip2). Ensure at least the above mentioned ones are selected, and accept any other selections.

    These packages will be used by the cross-compiler build program to download the necessary files from the Internet as it's building your project.
  2. Download the cross compiler build from this site Kegel.com: scroll down to the Downloads section and obtain the tarball Currently at v 0.38. You would most likely use your browser to download this file. Copy this file from the downloads directory and put it into C:\cygwin\home\<userid>\ directory (for now).
  3. Open up the Cygwin shell. You should be sitting at a colorized bash prompt. Type in:
  4. $ cd ~
    $ gunzip crosstool-0.38.tar.gz
    $ tar xf crosstool-1.38.tar
    $ cd crosstool-0.38
    $ ./demo-arm-softfloat.sh
    

    And go fix yourself a sandwich. It'll begin to download the new kernel, gcc, glibc, binutils, etc. and build them all. The resultant compiler will reside at C:\cygwin\opt\crosstool\gcc-3.4.1-glibc-2.3.3\arm-softfloat-linux-gnu\bin\ Actually, from inside Cygwin, it'll be /opt/crosstool/gcc-3.4.1-glibc-2.3.3/arm-softfloat-linux-gnu/bin/</P>

    Note: If you get errors on this step regarding an incorrect number of arguments, try the following:

    $ printenv HOME
    /cygdrive/c/Documents and Settings/<userid>
    $ HOME=/cygdrive/c/DOCUME~1/<userid>
    $ ./demo-arm-softfloat.sh
    

LINUX (Non-Windows)

Basic Setup:

  1. Ensure that you have at least the following installed on your machine before proceeding: <P/>
    Devel->gcc-core
    Devel->binutils
    Devel->libiconv
    Devel->libncurses
    Devel->make
    Devel->patchutils
    Lib->libbz2_1
    Lib->libcharset
    Lib->libiconv
    Lib->libiconv2
    Lib->zlib
    Utils->bzip2
    Utils->patch
    Utils->flex (or lexx)
    Web ->wget


    These packages will be used by the cross-compiler build program to download the necessary files from the Internet as it's building your project.
  2. Download the cross compiler build from this site Kegel.com: scroll down to the Downloads section and obtain the tarball Currently at v 0.38. You would most likely use your shell prompt to get this file.
  3. Open up shell prompt as root. Type in:
  4. Now comes the tricky part. The build process warns you that you should not build this as root. However, it creates the toolchain into the /opt directory that is owned by root. So as root, do the following before su'ing to a non-root user:


    # cd /opt
    # mkdir crosstool
    # chmod 777 crosstool
    # su - lumkichi
    $ cd ~
    $ wget http://kegel.com/crosstool/crosstool-0.38.tar.gz
    03:16:00 (626.99 KB/s) - `crosstool-0.38.tar.gz' saved [3828943/3828943]
    $ gunzip crosstool-0.38.tar.gz
    $ tar xf crosstool-1.38.tar
    $ bzip2 crosstool-0.38.tar
    $ cd crosstool-0.38
    $ ./demo-arm-softfloat.sh
    

    And go fix yourself a sandwich. It'll begin to download the new kernel, gcc, glibc, binutils, etc. and build them all. The resultant compiler will reside at /opt/crosstool/gcc-3.4.1-glibc-2.3.3/arm-softfloat-linux-gnu/bin/ It'll probably run for several hours, if not half a day!</P>

    Alternately, if you have a version of tar that can unzip tarballs on the fly, then use the following:

    # cd /opt
    # mkdir crosstool
    # chmod 777 crosstool
    # su - lumkichi
    $ cd ~
    $ wget http://kegel.com/crosstool/crosstool-0.38.tar.gz
    03:16:00 (626.99 KB/s) - `crosstool-0.38.tar.gz' saved [3828943/3828943]
    $ tar xf crosstool-1.38.tar.gz
    $ cd crosstool-0.38
    $ ./demo-arm-softfloat.sh
    

    If the build ever comes across a package that is not installed (such as patch or flex), it'll tell you what it needs and aborts. Simply go find those packages, install them, and re-run ./demo-arm-softfloat.sh. It'll usually pick up where it left off and continue to build your toolchain.

  5. A Small Problem Might Occur
  6. Occasionally, on some platforms, you might experience the following message (in red). Do not be overly alarmed because I've encountered this many times, and my programs still compile and run just fine on the DMP1.

    + gcc fix-embedded-paths.c -o /opt/crosstool/gcc-3.4.1-glibc-2.3.3/arm-softfloat-linux-gnu/bin/fix-embedded-paths
    + echo Cross-toolchain build complete. Result in /opt/crosstool/gcc-3.4.1-glibc-2.3.3/arm-softfloat-linux-gnu.Cross-toolchain build complete. Result in /opt/crosstool/gcc-3.4.1-glibc-2.3.3/arm-softfloat-linux-gnu.
    + exit 0
    + cd /home/lumkichi/crosstool-0.38
    + sh testhello.sh
    + cd /opt/crosstool/gcc-3.4.1-glibc-2.3.3/arm-softfloat-linux-gnu
    + test '!' -d tmp
    + mkdir tmp
    + cd tmp
    + test x '!=' x
    + cat
    + /opt/crosstool/gcc-3.4.1-glibc-2.3.3/arm-softfloat-linux-gnu/bin/arm-softfloat-linux-gnu-gcc -static hello.c -o arm-softfloat-linux-gnu-hello-static
    hello.c: In function `main':
    hello.c:4: error: `PATH_MAX' undeclared (first use in this function)
    hello.c:4: error: (Each undeclared identifier is reported only once
    hello.c:4: error: for each function it appears in.)
    $ _ 
    

    This just means that the compiler couldn't compile the test program which uses PATH_MAX parameter in one of the header files. It seems to be a matter of where the compiler is looking for this value. If you remove the line with PATH_MAX out of the hello.c file, it'll compile just fine. And of course, your openfi_app will compile just fine.


  7. On Newer Linux Systems Another Small Problem Might Occur
  8. If you get an error something like this:

    HOSTCC  scripts/kconfig/mconf.o
    scripts/kconfig/mconf.c:91: error: static declaration of  ‘current_menu’ follows non-static declaration
    scripts/kconfig/lkc.h:63: error: previous declaration of ‘current_menu’ was here
    make[1]: *** [scripts/kconfig/mconf.o] Error 1
    make: *** [oldconfig] Error 2
    

    Simply add the --nounpack flag to your demo-arm-softfloat.sh " eval `cat arm-softfloat.dat gcc-3.4.1-glibc-2.3.3.dat` sh all.sh --notest --nounpack"

    edit build/arm-softfloat-linux-gnu/gcc-3.4.1-glibc-2.3.3/linux-2.6.8/scripts/kconfig/mconf.c

    Change line 91 from

    static struct menu *current_menu;

    to

    struct menu *current_menu;

    then rerun ./demo-arm-softfloat.sh

    Found the solution here: http://wiki.phathack.com/Compile_for_the_PhatBox%20build/arm-softfloat-linux-gnu/gcc-3.4.1-glibc-2.3.3/linux-2.6.8/scripts/kconfig


Congratulations, you're the proud owner of a brand new crosstools compiler toolchain!

BUILDROOT Cross Compiler Environment Setup

LINUX (Non-Windows) ONLY

I have not been successful in building a buildroot on CYGWIN. Also, I've tried to build with the and older version of buildroot (that closely resembles the DMP1 version) but could not build for it because it lacked the necessary patches. For the purposes of this exercise, I've located the newest version in hopes that it will still work for the DMP1.

# wget http://buildroot.uclibc.org/downloads/snapshots/buildroot-20050906.tar.bz2
22:24:16 (238.38 KB/s) - `buildroot-20050906.tar.bz2' saved [1606116/1606116]
# tar xf buildroot-20050906.tar.bz2 
# cd buildroot
# make menuconfig
<blah, blah, blah...>

Then you'll get the screen:

 lqqqqqqqqqqqqqqqqqqqqqqqqqqqqq Buildroot Configuration qqqqqqqqqqqqqqqqqqqqqqqqqqqqqk
 x  Arrow keys navigate the menu.  <Enter> selects submenus --->.  Highlighted       x
 x  letters are hotkeys.  Pressing <Y> selectes a feature, while <N> will exclude a  x
 x  feature.  Press <Esc><Esc> to exit, <?> for Help, </> for Search.  Legend: [*]   x
 x  feature is selected  [ ] feature is excluded                                     x
 x lqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqk x
 x x                    Target Architecture (i386)  --->                           x x
 x x                    Target Architecture Variant (i686)  --->                   x x
 x x                    Build options  --->                                        x x
 x x                    Toolchain Options  --->                                    x x
 x x                    Package Selection for the target  --->                     x x
 x x                    Target Options  --->                                       x x
 x x                    Board Support Options  --->                                x x
 x x                ---                                                            x x
 x x                Load an Alternate Configuration File                           x x
 x x                Save Configuration to an Alternate File                        x x
 x x                                                                               x x
 x x                                                                               x x
 x mqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqj x
 tqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqu
 x                         <Select>    < Exit >    < Help >                          x
 mqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqj


Alternately (and preferably) you could type in:

# wget http://buildroot.uclibc.org/downloads/snapshots/buildroot-20051007.tar.bz2
22:24:16 (238.38 KB/s) - `buildroot-20051007.tar.bz2' saved [1638177/1638177]
# tar xf buildroot-20051007.tar.bz2 
# cd buildroot
# make config or make oldconfig
<blah, blah, blah...>

And get the following instead:

*
* Buildroot Configuration
*
Target Architecture
  1. arm (BR2_arm)
  2. armeb (BR2_armeb)
  3. cris (BR2_cris)
> 4. i386 (BR2_i386)
  5. m68k (BR2_m68k)
  6. mips (BR2_mips)
  7. mipsel (BR2_mipsel)
  8. powerpc (BR2_powerpc)
  9. sh (BR2_sh)
  10. sparc (BR2_sparc)
choice[1-10?]: _

Now I'm going to choose some arbitrary values to get this thing built. Others may jump in here to refine this step-by-step to build something that'll closely resemble the cramfs environment of the DMP1. You'll also notice that I do not opt to build the busybox and the commands that are associated with it--this is for a reason; I'm not trying to build a replacement busybox. I'm trying to build a gcc compiler for the ARM! Mebbe later...

*
* Buildroot Configuration
*
Target Architecture
  1. arm (BR2_arm)
  2. armeb (BR2_armeb)
  3. cris (BR2_cris)
> 4. i386 (BR2_i386)
  5. m68k (BR2_m68k)
  6. mips (BR2_mips)
  7. mipsel (BR2_mipsel)
  8. powerpc (BR2_powerpc)
  9. sh (BR2_sh)
  10. sparc (BR2_sparc)
choice[1-10?]: 1
*
* Build options
*
Wget command (BR2_WGET) [wget --passive-ftp] Enter
Subversion (svn) checkout command (BR2_SVN) [svn co] (NEW) Enter
Tar verbose (BR2_TAR_VERBOSITY) [N/y] (NEW) Enter
Sourceforge mirror site (BR2_SOURCEFORGE_MIRROR) [easynews] (NEW) Enter
Toolchain and header file location? (BR2_STAGING_DIR) [$(BUILD_DIR)/staging_dir] (NEW) Enter
Number of jobs to run simultaneously (BR2_JLEVEL) [1] (NEW) Enter
*
* Toolchain Options
*
*
* Kernel Header Options
*
Kernel Headers
  1. Linux 2.4.25 kernel headers (BR2_KERNEL_HEADERS_2_4_25) (NEW)
  2. Linux 2.4.27 kernel headers (BR2_KERNEL_HEADERS_2_4_27) (NEW)
  3. Linux 2.4.29 kernel headers (BR2_KERNEL_HEADERS_2_4_29) (NEW)
> 4. Linux 2.4.31 kernel headers (BR2_KERNEL_HEADERS_2_4_31) (NEW)
  5. Linux 2.6.11 kernel headers (BR2_KERNEL_HEADERS_2_6_11) (NEW)
  6. Linux 2.6.12 kernel headers (BR2_KERNEL_HEADERS_2_6_12) (NEW)
choice[1-6?]: Enter
*
* uClibc Options
*
Use a daily snapshot of uClibc? (BR2_UCLIBC_VERSION_SNAPSHOT) [Y/n/?] Enter
  Date (yyyymmdd) of snapshot or 'snapshot' for latest (BR2_USE_UCLIBC_SNAPSHOT) [snapshot] Enter
Enable locale/gettext/i18n support? (BR2_ENABLE_LOCALE) [N/y/?] Enter
Enable Native POSIX Threading (NPTL) support? (BR2_PTHREADS_NATIVE) [N/y/?] (NEW) Y
*
* Binutils Options
*
Binutils Version
  1. binutils 2.14.90.0.8 (BR2_BINUTILS_VERSION_2_14_90_0_8)
  2. binutils 2.15 (BR2_BINUTILS_VERSION_2_15)
  3. binutils 2.15.94.0.2.2 (BR2_BINUTILS_VERSION_2_15_94_0_2_2) (NEW)
  4. binutils 2.15.97 (BR2_BINUTILS_VERSION_2_15_97) (NEW)
  5. binutils 2.16 (BR2_BINUTILS_VERSION_2_16) (NEW)
> 6. binutils 2.16.1 (BR2_BINUTILS_VERSION_2_16_1) (NEW)
  7. binutils 2.16.90.0.3 (BR2_BINUTILS_VERSION_2_16_90_0_3) (NEW)
  8. binutils 2.16.91.0.2 (BR2_BINUTILS_VERSION_2_16_91_0_2) (NEW)
  9. binutils 2.16.91.0.3 (BR2_BINUTILS_VERSION_2_16_91_0_3) (NEW)
choice[1-9?]: Enter
*
* Gcc Options
*
GCC compiler Version
  1. gcc 3.3.5 (BR2_GCC_VERSION_3_3_5) (NEW)
  2. gcc 3.3.6 (BR2_GCC_VERSION_3_3_6) (NEW)
> 3. gcc 3.4.2 (BR2_GCC_VERSION_3_4_2)
  4. gcc 3.4.3 (BR2_GCC_VERSION_3_4_3) (NEW)
  5. gcc 3.4.4 (BR2_GCC_VERSION_3_4_4) (NEW)
  6. gcc 4.0.0 (BR2_GCC_VERSION_4_0_0) (NEW)
  7. gcc 4.0.1 (BR2_GCC_VERSION_4_0_1) (NEW)
  8. gcc 4.1.0 (BR2_GCC_VERSION_4_1_0) (NEW)
choice[1-8?]: Enter
Enable setjmp/longjmp exceptions? (BR2_GCC_USE_SJLJ_EXCEPTIONS) [N/y/?] (NEW) Enter
Additional gcc options (BR2_EXTRA_GCC_CONFIG_OPTIONS) [] Enter
Build/install c++ compiler and libstdc++? (BR2_INSTALL_LIBSTDCPP) [N/y/?] Enter
Build/install Objective-C compiler and runtime? (BR2_INSTALL_OBJC) [N/y/?] (NEW) Enter
*
* Ccache Options
*
Enable ccache support? (BR2_CCACHE) [Y/n/?] (NEW) Enter
*
* Gdb Options
*
Build gdb debugger for the Target (BR2_PACKAGE_GDB) [N/y/?] Enter
Build gdb server for the Target (BR2_PACKAGE_GDB_SERVER) [N/y/?] Enter
Build gdb client for the Host (BR2_PACKAGE_GDB_CLIENT) [N/y/?] (NEW) Enter
Install sstrip for the target system (BR2_PACKAGE_SSTRIP_TARGET) [N/y/?] (NEW) Enter
Install sstrip for the host/build system (BR2_PACKAGE_SSTRIP_HOST) [N/y/?] (NEW) Enter
*
* Common Toolchain Options
*
Enable multilib support? (BR2_ENABLE_MULTILIB) [Y/n/?] Enter
Enable large file (files > 2 GB) support? (BR2_LARGEFILE) [Y/n/?] Enter
Use software floating point by default (BR2_SOFT_FLOAT) [N/y/?] (NEW) Y
Target Optimizations (BR2_TARGET_OPTIMIZATION) [-Os -pipe] Enter
Include target utils in cross toolchain (BR2_CROSS_TOOLCHAIN_TARGET_UTILS) [Y/n/?] (NEW) Enter
*
* Package Selection for the target
*
*
* The default minimal system
*
BusyBox (BR2_PACKAGE_BUSYBOX) [Y/n/?] (NEW) N
*
* The minimum needed to build a uClibc development system
*
bash (BR2_PACKAGE_BASH) [N/y/?] (NEW) Enter
bzip2 (BR2_PACKAGE_BZIP2) [N/y/?] (NEW) Enter
coreutils (BR2_PACKAGE_COREUTILS) [N/y/?] (NEW) Enter
diffutils (BR2_PACKAGE_DIFFUTILS) [N/y/?] (NEW) Enter
ed (BR2_PACKAGE_ED) [N/y/?] (NEW) Enter
findutils (BR2_PACKAGE_FINDUTILS) [N/y/?] (NEW) Enter
flex (BR2_PACKAGE_FLEX) [N/y/?] (NEW) Enter
gawk (BR2_PACKAGE_GAWK) [N/y/?] (NEW) Enter
native toolchain in the target filesystem (BR2_PACKAGE_GCC_TARGET) [N/y/?] (NEW) Enter
ccache support in the target filesystem (BR2_PACKAGE_CCACHE_TARGET) [N/y/?] (NEW) Enter
grep (BR2_PACKAGE_GREP) [N/y/?] (NEW) Enter
make (BR2_PACKAGE_MAKE) [N/y/?] (NEW) Enter
patch (BR2_PACKAGE_PATCH) [N/y/?] (NEW) Enter
sed (BR2_PACKAGE_SED) [N/y/?] (NEW) Enter
tar (BR2_PACKAGE_TAR) [N/y/?] (NEW) Enter
*
* Other stuff
*
acpid (BR2_PACKAGE_ACPID) [N/y/?] (NEW) Enter
autoconf (BR2_PACKAGE_AUTOCONF) [N/y/?] (NEW) Enter
automake (BR2_PACKAGE_AUTOMAKE) [N/y/?] (NEW) Enter
berkeleydb (BR2_PACKAGE_BERKELEYDB) [N/y/?] (NEW) Enter
bison (BR2_PACKAGE_BISON) [N/y/?] (NEW) Enter
boa (BR2_PACKAGE_BOA) [N/y/?] (NEW) Enter
bridge (BR2_PACKAGE_BRIDGE) [N/y/?] (NEW) Enter
customize (BR2_PACKAGE_CUSTOMIZE) [N/y/?] (NEW) Enter
DHCP support (BR2_PACKAGE_ISC_DHCP) [N/y/?] (NEW) Enter
directfb (BR2_PACKAGE_DIRECTFB) [N/y/?] (NEW) Enter
distcc (BR2_PACKAGE_DISTCC) [N/y/?] (NEW) Enter
dm (BR2_PACKAGE_DM) [N/y/?] (NEW) Enter
dnsmasq (BR2_PACKAGE_DNSMASQ) [N/y/?] (NEW) Enter
dropbear_sshd (BR2_PACKAGE_DROPBEAR_SSHD) [N/y/?] (NEW) Enter
e2fsprogs (BR2_PACKAGE_E2FSPROGS) [N/y/?] (NEW) Enter
fakeroot (BR2_PACKAGE_FAKEROOT) [N/y/?] (NEW) Enter
file (BR2_PACKAGE_FILE) [N/y/?] (NEW) Enter
freetype (BR2_PACKAGE_FREETYPE) [N/y/?] (NEW) Enter
gettext (BR2_PACKAGE_GETTEXT) [N/y/?] (NEW) Enter
gzip (BR2_PACKAGE_GZIP) [N/y/?] (NEW) Enter
hostap (BR2_PACKAGE_HOSTAP) [N/y/?] (NEW) Enter
hotplug (BR2_PACKAGE_HOTPLUG) [N/y/?] (NEW) Enter
iproute2 (BR2_PACKAGE_IPROUTE2) [N/y/?] (NEW) Enter
iptables (BR2_PACKAGE_IPTABLES) [N/y/?] (NEW) Enter
jpeg (BR2_PACKAGE_JPEG) [N/y/?] (NEW) Enter
less (BR2_PACKAGE_LESS) [N/y/?] (NEW) Enter
libelf (BR2_PACKAGE_LIBELF) [N/y/?] (NEW) Enter
libfloat (BR2_PACKAGE_LIBFLOAT) [N/y/?] (NEW) Enter
libglib12 (BR2_PACKAGE_LIBGLIB12) [N/y/?] (NEW) Enter
libmad (BR2_PACKAGE_LIBMAD) [N/y/?] (NEW) Enter
libpcap (BR2_PACKAGE_LIBPCAP) [N/y/?] (NEW) Enter
libpng (BR2_PACKAGE_LIBPNG) [N/y/?] (NEW) Enter
libsysfs (BR2_PACKAGE_LIBSYSFS) [N/y/?] (NEW) Enter
libtool (BR2_PACKAGE_LIBTOOL) [N/y/?] (NEW) Enter
links (BR2_PACKAGE_LINKS) [N/y/?] (NEW) Enter
lrzsz (BR2_PACKAGE_LRZSZ) [N/y/?] (NEW) Enter
ltp-testsuite (BR2_PACKAGE_LTP-TESTSUITE) [N/y/?] (NEW) Enter
lvm2 (BR2_PACKAGE_LVM2) [N/y/?] (NEW) Enter
lzo (BR2_PACKAGE_LZO) [N/y/?] (NEW) Enter
m4 (BR2_PACKAGE_M4) [N/y/?] (NEW) Enter
microcom (BR2_PACKAGE_MICROCOM) [N/y/?] (NEW) Enter
microperl (BR2_PACKAGE_MICROPERL) [N/y/?] (NEW) Enter
microwin (BR2_PACKAGE_MICROWIN) [N/y/?] (NEW) Enter
mkdosfs (BR2_PACKAGE_MKDOSFS) [N/y/?] (NEW) Enter
module-init-tools (BR2_PACKAGE_MODULE_INIT_TOOLS) [N/y/?] (NEW) Enter
modutils (BR2_PACKAGE_MODUTILS) [N/y/?] (NEW) Enter
mpg123 (BR2_PACKAGE_MPG123) [N/y/?] (NEW) Enter
mrouted (BR2_PACKAGE_MROUTED) [N/y/?] (NEW) Enter
mtd/jffs2 utilities (BR2_PACKAGE_MTD) [N/y/?] (NEW) Enter
nano (BR2_PACKAGE_NANO) [N/y/?] (NEW) Enter
ncurses (BR2_PACKAGE_NCURSES) [N/y/?] (NEW) Enter
netkitbase (BR2_PACKAGE_NETKITBASE) [N/y/?] (NEW) Enter
netkittelnet (BR2_PACKAGE_NETKITTELNET) [N/y/?] (NEW) Enter
netsnmp (BR2_PACKAGE_NETSNMP) [N/y/?] (NEW) Enter
newt (BR2_PACKAGE_NEWT) [N/y/?] (NEW) Enter
ntp (BR2_PACKAGE_NTP) [N/y/?] (NEW) Enter
OpenNTPD (BR2_PACKAGE_OPENNTPD) [N/y/?] (NEW) Enter
openssh (BR2_PACKAGE_OPENSSH) [N/y/?] (NEW) Enter
openssl (BR2_PACKAGE_OPENSSL) [N/y/?] (NEW) Enter
openvpn (BR2_PACKAGE_OPENVPN) [N/y/?] (NEW) Enter
pciutils (BR2_PACKAGE_PCIUTILS) [N/y/?] (NEW) Enter
portage (BR2_PACKAGE_PORTAGE) [N/y/?] (NEW) Enter
portmap (BR2_PACKAGE_PORTMAP) [N/y/?] (NEW) Enter
pppd (BR2_PACKAGE_PPPD) [N/y/?] (NEW) Enter
procps (BR2_PACKAGE_PROCPS) [N/y/?] (NEW) Enter
python (BR2_PACKAGE_PYTHON) [N/y/?] (NEW) Enter
raidtools (BR2_PACKAGE_RAIDTOOLS) [N/y/?] (NEW) Enter
readline (BR2_READLINE) [N/y/?] (NEW) Enter
rsync (BR2_PACKAGE_RSYNC) [N/y/?] (NEW) Enter
rxvt (BR2_PACKAGE_RXVT) [N/y/?] (NEW) Enter
SDL (BR2_PACKAGE_SDL) [N/y/?] (NEW) Enter
sfdisk (BR2_PACKAGE_SFDISK) [N/y/?] (NEW) Enter
slang (BR2_PACKAGE_SLANG) [N/y/?] (NEW) Enter
socat (BR2_PACKAGE_SOCAT) [N/y/?] (NEW) Enter
strace (BR2_PACKAGE_STRACE) [N/y/?] (NEW) Enter
tcl (BR2_PACKAGE_TCL) [N/y/?] (NEW) Enter
tcpdump (BR2_PACKAGE_TCPDUMP) [N/y/?] (NEW) Enter
tftpd (BR2_PACKAGE_TFTPD) [N/y/?] (NEW) Enter
tinylogin (BR2_PACKAGE_TINYLOGIN) [N/y/?] (NEW) Enter
tinyx (BR2_PACKAGE_TINYX) [N/y/?] (NEW) Enter
tn5250 (BR2_PACKAGE_TN5250) [N/y/?] (NEW) Enter
ttcp (BR2_PACKAGE_TTCP) [N/y/?] (NEW) Enter
udev (BR2_PACKAGE_UDEV) [N/y/?] (NEW) Enter
udhcp (BR2_PACKAGE_UDHCP) [N/y/?] (NEW) Enter
util-linux (BR2_PACKAGE_UTIL-LINUX) [N/y/?] (NEW) Enter
valgrind (BR2_PACKAGE_VALGRIND) [N/y/?] (NEW) Enter
vtun (BR2_PACKAGE_VTUN) [N/y/?] (NEW) Enter
wget (BR2_PACKAGE_WGET) [N/y/?] (NEW) Enter
which (BR2_PACKAGE_WHICH) [N/y/?] (NEW) Enter
wireless tools (BR2_PACKAGE_WIRELESS_TOOLS) [N/y/?] (NEW) Enter
X.org X Window System (BR2_PACKAGE_XORG) [N/y/?] (NEW) Enter
zlib (BR2_PACKAGE_ZLIB) [N/y/?] (NEW) Enter
*
* Target Options
*
cramfs root filesystem for the target device (BR2_TARGET_ROOTFS_CRAMFS) [N/y/?] (NEW) Enter
ext2 root filesystem for the target device (BR2_TARGET_ROOTFS_EXT2) [Y/n/?] (NEW) Enter
  size in blocks (leave at 0 for auto calculation) (BR2_TARGET_ROOTFS_EXT2_BLOCKS) [0] (NEW) Enter
  inodes (leave at 0 for auto calculation) (BR2_TARGET_ROOTFS_EXT2_INODES) [0] (NEW) Enter
  reserved blocks (BR2_TARGET_ROOTFS_EXT2_RESBLKS) [0] (NEW) Enter
  Make all files be owned by root (BR2_TARGET_ROOTFS_EXT2_SQUASH) [Y/n] (NEW) Enter
  Output File (BR2_TARGET_ROOTFS_EXT2_OUTPUT) [$(IMAGE).ext2] (NEW) Enter
  gzip the output file (BR2_TARGET_ROOTFS_EXT2_GZ) [N/y] (NEW) Enter
  also copy the image to... (BR2_TARGET_ROOTFS_EXT2_COPYTO) [] (NEW) Enter
jffs2 root filesystem for the target device (BR2_TARGET_ROOTFS_JFFS2) [N/y/?] (NEW) Enter
squashfs root filesystem for the target device (BR2_TARGET_ROOTFS_SQUASHFS) [N/y/?] (NEW) Enter
tar the root filesystem for the target device (BR2_TARGET_ROOTFS_TAR) [N/y/?] (NEW) Enter
*
* Board Support Options
*
*
* Generic System Support
*
Generic wireless access point (BR2_TARGET_GENERIC_ACCESS_POINT) [N/y/?] (NEW) Enter
Generic firewall (BR2_TARGET_GENERIC_FIREWALL) [N/y/?] (NEW) Enter
Generic development system (BR2_TARGET_GENERIC_DEV_SYSTEM) [N/y/?] (NEW) Enter
# _

You will note that the above transcript only shows user pressing ENTER in a few places--the rest of the script blows by with the prefilled defaults. Once you answer these questions it'll continue to compile for a while again.

Now we're ready for the make. To make, type the following:

# make
<blah> <blah> <blah>

It'll run, downloading stuff from everywhere and running config and make in each of those packages. In the middle, it'll stop briefly to ask about the ARM type (choose Generic) Little and Big Endian and whether it has an MMU.

As tempted as you might be, please select "Generic Arm (CONFIG_GENERIC_ARM) (NEW)" (option 1) when you are prompted for it. The ARM processor used in the DMP1 is reported as 720T (EP7312 chip) but the project will fail in the build if you select the 720T processor. I have verified this to be true with at least 4 versions of build buildroot, using different compiler, uClibc, binutils versions and options. Finally I gave up and selected "Generic Arm" and everything compiled nicely, like it did before.

*
* uClibc Configuration
*
Target Architecture
  1. alpha (TARGET_alpha)
> 2. arm (TARGET_arm)
  3. bfin (TARGET_bfin)
  4. cris (TARGET_cris)
  5. e1 (TARGET_e1)
  6. frv (TARGET_frv)
  7. h8300 (TARGET_h8300)
  8. i386 (TARGET_i386)
  9. i960 (TARGET_i960)
  10. m68k (TARGET_m68k)
  11. microblaze (TARGET_microblaze)
  12. mips (TARGET_mips)
  13. nios (TARGET_nios)
  14. nios2 (TARGET_nios2)
  15. powerpc (TARGET_powerpc)
  16. superh (TARGET_sh)
  17. sh64 (TARGET_sh64)
  18. sparc (TARGET_sparc)
  19. v850 (TARGET_v850)
  20. x86_64 (TARGET_x86_64)
choice[1-20?]: 2
*
* Target Architecture Features and Options
*
Target Processor Type
> 1. Generic Arm (CONFIG_GENERIC_ARM) (NEW)
  2. Arm 610 (CONFIG_ARM610) (NEW)
  3. Arm 710 (CONFIG_ARM710) (NEW)
  4. Arm 720T (CONFIG_ARM720T) (NEW)
  5. Arm 920T (CONFIG_ARM920T) (NEW)
  6. Arm 922T (CONFIG_ARM922T) (NEW)
  7. Arm 926T (CONFIG_ARM926T) (NEW)
  8. Arm 1136JF-S (CONFIG_ARM1136JF_S) (NEW)
  9. Intel StrongArm SA-110 (CONFIG_ARM_SA110) (NEW)
  10. Intel StrongArm SA-1100 (CONFIG_ARM_SA1100) (NEW)
  11. Intel Xscale (CONFIG_ARM_XSCALE) (NEW)
choice[1-11?]: 1
Target Processor Endianness
> 1. Little Endian (ARCH_LITTLE_ENDIAN) (NEW)
  2. Big Endian (ARCH_BIG_ENDIAN) (NEW)
choice[1-2?]: Enter
Target CPU has a memory management unit (MMU) (ARCH_HAS_MMU) [Y/n/?] (NEW) Enter
Enable floating point number support (UCLIBC_HAS_FLOATS) [Y/n/?] y
  Target CPU has a floating point unit (FPU) (HAS_FPU) [N/y/?] n
  Enable full C99 math library support (DO_C99_MATH) [Y/n/?] y
Linux kernel header location (KERNEL_SOURCE) [/root/buildroot/toolchain_build_arm_nofpu/linux] /root/buildroot/toolchain_build_arm_nofpu/linux 
*
* General Library Settings
*
Generate Position Independent Code (PIC) (DOPIC) [Y/n/?] y
Enable support for shared libraries (HAVE_SHARED) [Y/n/?] y
Compile native shared library loader (BUILD_UCLIBC_LDSO) [Y/n/?] y
  Only load shared libraries which can share their text segment (FORCE_SHAREABLE_TEXT_SEGMENTS) [N/y/?] n
  Native shared library loader 'ldd' support (LDSO_LDD_SUPPORT) [Y/n/?] y
  Enable shared library loader cache (LDSO_CACHE_SUPPORT) [Y/n/?] y
  Enable shared library loader preload file support (LDSO_PRELOAD_FILE_SUPPORT) [N/y/?] n
   Shared library loader naming prefix (LDSO_BASE_FILENAME) [ld.so] ld.so
  Enable ELF RUNPATH tag support (LDSO_RUNPATH) [N/y/?] n
Support global constructors and destructors (UCLIBC_CTOR_DTOR) [Y/n/?] y
POSIX Threading Support (UCLIBC_HAS_THREADS) [Y/n/?] y
 Build pthreads debugging support (PTHREADS_DEBUG_SUPPORT) [Y/n/?] y
Large File Support (UCLIBC_HAS_LFS) [Y/n/?] y
Link ldconfig statically (UCLIBC_STATIC_LDCONFIG) [N/y/?] n
Malloc Implementation
  1. malloc (MALLOC)
  2. malloc-simple (MALLOC_SIMPLE)
> 3. malloc-standard (MALLOC_STANDARD)
choice[1-3?]: 3
Malloc returns live pointer for malloc(0) (MALLOC_GLIBC_COMPAT) [Y/n/?] y
Dynamic atexit() Support (UCLIBC_DYNAMIC_ATEXIT) [Y/n/?] y
Old (visible) atexit Support (COMPAT_ATEXIT) [N/y/?] (NEW) Enter
Shadow Password Support (HAS_SHADOW) [Y/n/?] y
Support only Unix 98 PTYs (UNIX98PTY_ONLY) [N/y/?] n
Assume that /dev/pts is a devpts or devfs file system (ASSUME_DEVPTS) [Y/n/?] y
Support 'struct tm' timezone extension fields (UCLIBC_HAS_TM_EXTENSIONS) [Y/n/?] y
Enable caching of the last valid timezone 'TZ' string (UCLIBC_HAS_TZ_CACHING) [Y/n/?] y
Enable '/etc/TZ' file support to set a default timezone (uClibc-specific) (UCLIBC_HAS_TZ_FILE) [Y/n/?] y
  Repeatedly read the '/etc/TZ' file (UCLIBC_HAS_TZ_FILE_READ_MANY) [Y/n/?] y
  Path to the 'TZ' file for setting the global timezone (UCLIBC_TZ_FILE_PATH) [/etc/TZ] /etc/TZ
*
* Networking Support
*
IP version 6 Support (UCLIBC_HAS_IPV6) [Y/n/?] y
Remote Procedure Call (RPC) support (UCLIBC_HAS_RPC) [Y/n/?] y
  Full RPC support (UCLIBC_HAS_FULL_RPC) [Y/n/?] y
  Reentrant RPC support (UCLIBC_HAS_REENTRANT_RPC) [N/y/?] (NEW) 
*
* String and Stdio Support
*
Use glibc generic string functions (UCLIBC_HAS_STRING_GENERIC_OPT) [Y/n/?] y
Use arch-specific string functions (UCLIBC_HAS_STRING_ARCH_OPT) [Y/n/?] y
Use Table Versions Of 'ctype.h' Functions. (UCLIBC_HAS_CTYPE_TABLES) [Y/n/?] y
  Support Signed Characters In 'ctype.h' Functions. (UCLIBC_HAS_CTYPE_SIGNED) [Y/n/?] y
  ctype argument checking
    1. Do not check -- unsafe (UCLIBC_HAS_CTYPE_UNSAFE)
  > 2. Detect and handle appropriately (UCLIBC_HAS_CTYPE_CHECKED)
    3. Issue a diagnostic and abort() (UCLIBC_HAS_CTYPE_ENFORCED)
  choice[1-3?]: 2
Wide Character Support (UCLIBC_HAS_WCHAR) [Y/n/?] y
Locale Support (UCLIBC_HAS_LOCALE) [N/y/?] n
Support hexadecimal float notation (UCLIBC_HAS_HEXADECIMAL_FLOATS) [Y/n/?] y
Support glibc's register_printf_function() (glibc-compat) (UCLIBC_HAS_GLIBC_CUSTOM_PRINTF) [Y/n/?] y
Maximum number of positional args.  Either 0 or >= 9. (UCLIBC_PRINTF_SCANF_POSITIONAL_ARGS) [9] 9
Support glibc's 'a' flag for scanf string conversions (not implemented) (UCLIBC_HAS_SCANF_GLIBC_A_FLAG) [Y/n/?] y
Stdio buffer size
  1. 256 (minimum ANSI/ISO C99 value) (UCLIBC_HAS_STDIO_BUFSIZ_256)
  2. 512 (UCLIBC_HAS_STDIO_BUFSIZ_512)
  3. 1024 (UCLIBC_HAS_STDIO_BUFSIZ_1024)
  4. 2048 (UCLIBC_HAS_STDIO_BUFSIZ_2048)
> 5. 4096 (UCLIBC_HAS_STDIO_BUFSIZ_4096)
  6. 8192 (UCLIBC_HAS_STDIO_BUFSIZ_8192)
choice[1-6?]: 5
Stdio builtin buffer size (uClibc-specific)
> 1. None (UCLIBC_HAS_STDIO_BUILTIN_BUFFER_NONE)
  2. 4 (UCLIBC_HAS_STDIO_BUILTIN_BUFFER_4)
  3. 8 (UCLIBC_HAS_STDIO_BUILTIN_BUFFER_8)
choice[1-3?]: 1
Attemt to shutdown stdio subsystem when abort() is called. (UCLIBC_HAS_STDIO_SHUTDOWN_ON_ABORT) [N/y/?] n
Provide a macro version of getc() (UCLIBC_HAS_STDIO_GETC_MACRO) [Y/n/?] y
Provide a macro version of putc() (UCLIBC_HAS_STDIO_PUTC_MACRO) [Y/n/?] y
Support auto-r/w transition (UCLIBC_HAS_STDIO_AUTO_RW_TRANSITION) [Y/n/?] y
Support an fopen() 'F' flag for large file mode (uClibc-specific) (UCLIBC_HAS_FOPEN_LARGEFILE_MODE) [N/y/?] n
Support an fopen() 'x' flag for exclusive mode (glibc-compat) (UCLIBC_HAS_FOPEN_EXCLUSIVE_MODE) [Y/n/?] y
Support fmemopen(), open_memstream(), and fopencookie() (glibc-compat) (UCLIBC_HAS_GLIBC_CUSTOM_STREAMS) [Y/n/?] y
Support the '%m' specifier in printf format strings (glibc-compat) (UCLIBC_HAS_PRINTF_M_SPEC) [Y/n/?] y
Include the errno message text in the library (UCLIBC_HAS_ERRNO_MESSAGES) [Y/n/?] y
  Support sys_errlist[] (obsolete-compat) (UCLIBC_HAS_SYS_ERRLIST) [N/y/?] n
Include the signum message text in the library (UCLIBC_HAS_SIGNUM_MESSAGES) [Y/n/?] y
  Support sys_siglist[] (bsd-compat) (UCLIBC_HAS_SYS_SIGLIST) [N/y/?] n
Support gnu getopt (UCLIBC_HAS_GNU_GETOPT) [Y/n/?] y
*
* Big and Tall
*
Regular Expression Support (UCLIBC_HAS_REGEX) [Y/n/?] y
Support the wordexp() interface (UCLIBC_HAS_WORDEXP) [N/y/?] n
Support the ftw() and nftw() interfaces (UCLIBC_HAS_FTW) [Y/n/?] y
Support the glob() interface (UCLIBC_HAS_GLOB) [Y/n/?] y
*
* Library Installation Options
*
Shared library loader path (SHARED_LIB_LOADER_PREFIX) [/lib] /lib
uClibc runtime library directory (RUNTIME_PREFIX) [/] /
uClibc development environment directory (DEVEL_PREFIX) [/usr/] /usr/
*
* uClibc security related options
*
Enable security options (UCLIBC_SECURITY) [N/y] n
*
* uClibc development/debugging options
*
Cross-compiling toolchain prefix (CROSS_COMPILER_PREFIX) [/root/buildroot/build_arm_nofpu/staging_dir/bin/arm-linux-uclibc-] /root/buildroot/build_arm_nofpu/staging_dir/bin/arm-linux-uclibc-
Build uClibc with debugging symbols (DODEBUG) [N/y/?] n
Build pthread with debugging output (DODEBUG_PT) [N/y/?] n
Build uClibc with run-time assertion testing (DOASSERTS) [N/y/?] n
Build the shared library loader with debugging support (SUPPORT_LD_DEBUG) [N/y/?] n
Build the shared library loader with early debugging support (SUPPORT_LD_DEBUG_EARLY) [N/y/?] n
Compiler Warnings (WARNINGS) [-Wall] -Wall
Manuel's hidden warnings (UCLIBC_MJN3_ONLY) [N/y/?] n

You'll blow by some more options and stop at a couple--make sure you select ARM 720T and choose defaults for the rest. As soon as you answer the question about Old (visible) atexit support, it'll blow right by the rest of the questions and resume downloading and compiling...

A Quick Comparison of BUILDROOT and CROSSTOOL

Here is an excerpt from an email I posted to the Omnifi group on 9/16/2005.

BTW: I've built a few RSYNC's today:

for i386-gcc 3.3.4-binutils 2.15.92.0.2 (runs natively on my Linux Box):

-rwxr-xr-x  1 root root 1341118 2005-09-01 21:05 /usr/local/bin/rsync*

for crosstool-0.38:

-rwxr-xr-x  1 root root 812692 2005-09-16 23:37 rsync*

for buildroot-20050906 using busybox, uClibc instead of clibc:

-rwxr-xr-x  1 root root 344916 2005-09-16 22:53 rsync*

This 344,916 byte version is statically compiled, and is the version sitting in my DMP1 currently. The last two, of course, run on the DMP1, I've also run strip on these as well. Before running strip, crosstool rsync was:

-rwxr-xr-x  1 root root 975175 2005-09-16 23:36 rsync*

The buildroot version was a little over 450,000 bytes before I ran strip. I never ran strip against the PC Linux version. I just make installed it...

I'm wondering if I can recompile openfi with my buildroot and see if I can shrink it down, some and still keep the functionality.

As you can see the buildroot version of rsync was 42% the size of the crosstool version. They both run perfectly fine on the DMP1. I opted for the smaller one because I'm a little proud of it :P. A copy of the dmp1 rsync built with BUILDROOT is available in the files section of the Yahoo Omnifi group.


See Also

External Links

Personal tools