MMU for Leon project (16.12.2002-16.3.2003):
Programmer: Konrad Eisele [eiselekd@web.de]
Funding: Gaisler research (www.gaisler.com)
How to compile the sparc-leon-linux cross-compiler:
[back]
[download gnu tools]
[download patches]
Assuming that you are in a working directory [base] and
assuming you have the following files in subdir tarballs:
[base]/tarballs/binutils-2.13.tar.gz
[base]/tarballs/gcc-core-3.2.2.tar.gz
[base]/tarballs/linux-2.5.59.tar.gz
[base]/tarballs/newlib-1.11.0.tar.gz
[base]/tarballs/uClibc-0.9.19.tar.gz
[base]/tarballs/binutils-2.13-leon01.diff
[base]/tarballs/gcc-3.2.2-leon01.diff
[base]/tarballs/linux-2.5.59-leon01.diff
[base]/tarballs/uClibc-0.9.19-leon01.diff
do the following commands:
$cd [base]
$tar xzf tarballs/binutils-2.13.tar.gz
$tar xzf tarballs/gcc-core-3.2.2.tar.gz
$tar xzf tarballs/linux-2.5.59.tar.gz
$tar xzf tarballs/uClibc-0.9.19.tar.gz
$cp -al binutils-2.13 binutils-2.13-patch
$cp -al gcc-3.2.2 gcc-3.2.2-patch
$cp -al linux-2.5.59 linux-2.5.59-patch
$cp -al uClibc-0.9.19 uClibc-0.9.19-patch
$cat tarballs/binutils-2.13-leon01.diff | patch -d binutils-2.13-patch -p1
$cat tarballs/gcc-3.2.2-leon01.diff | patch -d gcc-3.2.2-patch -p1
$cat tarballs/linux-2.5.59-leon01.diff | patch -d linux-2.5.59-patch -p1
$cat tarballs/uClibc-0.9.19-leon01.diff | patch -d uClibc-0.9.19-patch -p1
$find . -type f| xargs chmod a-w
$mkdir [base]/tools
$mkdir [base]/build-bin
$mkdir [base]/build-gcc
$cd [base]/uClibc-0.9.19-patch
At this point edit CROSS macro in Rules.mak:
"CROSS=sparc-rtems-"
(Because we have no sparc-leon-linux-gcc yet use the sparc-rtems-xx tools from lecc (at www.gaisler.com))
$make menuconfig
At this point select the clib options with menuconfig or my hand.
The following 2 options could look like this:
DEVEL_PREFIX="[base]/tools/gcc-3.2.2/sparc-leon-linux" ::where the headers should be clib and linux installed
KERNEL_SOURCE="[linux]" ::where the linux sources root can be found
A .config template is appended at the bottom of this page
$make all $make install
$cd [base]/build-bin
$../binutils-2.13-patch/configure --target=sparc-leon-linux \
--prefix=[base]/tools/gcc-3.2.2 :: adjust your $PATH $make all $make install
$cd [base]/build-gcc
$../gcc-3.2.2-patch/configure --target=sparc-leon-linux --with-gnu-as --with-gnu-ld --verbose \
--prefix=[base]/tools/gcc-3.2.2 \ ::adjust this to the place your $PATH points to
--enable-threads=posix \
--enable-languages=c \
--disable-shared \
--disable-nls \
--with-headers=[base]/tools/gcc-3.2.2/sparc-leon-linux/include \ :: the uclibc headers (the $DEVEL_PREFIX settings of uclibc build)
--with-libs=``[base]/tools/gcc-3.2.2/sparc-leon-linux/lib`` \ :: the uclibc lib.a s
$make all
$make install
$
uclibc .config template
+------------- cut -------------+
#
# Automatically generated make config: don't edit
#
#
# Target Architecture Features and Options
#
HAVE_ELF=y
UCLIBC_HAS_MMU=y
UCLIBC_HAS_FLOATS=y
# HAS_FPU is not set
UCLIBC_HAS_SOFT_FLOAT=y
# DO_C99_MATH is not set
WARNINGS="-Wall"
KERNEL_SOURCE="[linux]" :: replace [linux]
C_SYMBOL_PREFIX=""
HAVE_DOT_CONFIG=y
#
# General Library Settings
#
# DOPIC is not set
UCLIBC_CTOR_DTOR=y
UCLIBC_HAS_THREADS=y
UCLIBC_HAS_LFS=y
# MALLOC is not set
MALLOC_930716=y
UCLIBC_DYNAMIC_ATEXIT=y
HAS_SHADOW=y
UCLIBC_HAS_REGEX=y
UNIX98PTY_ONLY=y ASSUME_DEVPTS=y
#
# Networking Support
#
# UCLIBC_HAS_IPV6 is not set
# UCLIBC_HAS_RPC is not set
#
# String and Stdio Support
#
# UCLIBC_HAS_WCHAR is not set
# USE_OLD_VFPRINTF is not set
#
# Library Installation Options
#
DEVEL_PREFIX="[base]/tools/gcc-3.2.2/sparc-leon-linux" ::replace [base]
SYSTEM_DEVEL_PREFIX="$(DEVEL_PREFIX)"
DEVEL_TOOL_PREFIX="$(DEVEL_PREFIX)/usr"
#
# uClibc hacking options
#
# DODEBUG is not set
# DOASSERTS is not set