|
|
Install OpenSolaris 2008.11 or 2009.06 on x86 platform. The following packages are required.
Boot OpenSolaris and install above additional packages with packagemanager or pkg command.
$ pfexec pkg install ss-dev gcc-dev SUNWperl-xml-parser
The following tools are necessary to build and run Solaris for ARM.
$TESTWS is your workspace. $DOWNLOAD is your directory in which downloaded files are stored.
Pull the source of Solaris for arm from the osarm mercurial repository.
$ cd $TESTWS $ hg clone ssh://anon@hg.opensolaris.org/hg/osarm/onarm-gate
Download and unpack the closed binary of Solaris for arm.
$ cd $TESTWS $ cd onarm-gate $ gtar xjvf $DOWNLOAD/on-arm-closed-bins-20100414.tar.bz2
Create the directory to install toolchain. The toolchain is supposed to be installed in /opt/arm-eabi directory.
$ pfexec mkdir /opt/arm-eabi
Build source code.
$ cd $TESTWS/onarm-gate $ ./initenv.sh $ ./usr/src/tools/scripts/bldenv.sh -d opensolaris-arm.sh $ cd ./usr/src $ dmake setup $ cd cmd/sgs $ dmake cross $ exit
Install binary into /opt/arm-eabi/ccs.
$ cd $TESTWS/onarm-gate/usr/src/cmd/sgs/proto/cross/arm $ pfexec mkdir -p /opt/arm-eabi/ccs $ gtar cvf - . | (cd /opt/arm-eabi/ccs; pfexec gtar xvf -)
Download the binutils 1.18 and patch for Solaris, unpack the source and install patch.
$ cd $TESTWS $ gtar xjvf $DOWNLOAD/binutils-2.18.tar.bz2 $ cd binutils-2.18 $ bzcat $DOWNLOAD/binutils-2.18-arm-solaris.patch.bz2 | gpatch -p0
Build source code and install binary into /opt/arm-eabi
$ cd $TESTWS/binutils-2.18
$ mkdir objs
$ cd objs
$ $TESTWS/binutils-2.18/configure --prefix=/opt/arm-eabi
--target=arm-pc-solaris2.11
--with-sysroot=/opt/arm-eabi/root
$ gmake
$ pfexec gmake install
Download the gcc 4.1.1 and unpack the sources.
$ cd $TESTWS $ gtar xjvf $DOWNLOAD/gcc-4.1.1.tar.bz2 $ export PATH=$PATH:/opt/arm-eabi/bin
Download the patch for Solaris and install it.
$ cd $TESTWS/gcc-4.1.1 $ bzcat $DOWNLOAD/gcc-4.1.1-arm-solaris.patch.bz2 | gpatch -p0
The crt*.o, libc and libm for Solaris are required to become Solaris aware gcc. To build crt*.o and library, the base gcc is built with newlib first.
Download the newlib 1.17.0, unpack the sources and make a symbolic link in gcc directory.
$ cd $TESTWS $ gtar xzvf $DOWNLOAD/newlib-1.17.0.tar.gz $ cd gcc-4.1.1 $ ln -s ./../newlib-1.17.0/newlib
Build source code with newlib and install binary into /opt/arm-eabi.
$ cd $TESTWS/gcc-4.1.1
$ mkdir objs
$ cd objs
$ $TESTWS/gcc-4.1.1/configure --prefix=/opt/arm-eabi
--target=arm-pc-solaris2.11
--with-as=/opt/arm-eabi/arm-pc-solaris2.11/bin/as --with-gnu-as
--with-ld=/opt/arm-eabi/ccs/bin/ld
--with-ar=/opt/arm-eabi/arm-pc-solaris2.11/bin/ar --with-gnu-ar
--enable-languages=c
--with-cpu=mpcore --disable-multilib
--disable-shared --disable-threads
--disable-libssp --disable-libada
--with-newlib
$ gmake
$ pfexec gmake install
Build Solaris crt*.o, libc and libm.
$ cd $TESTWS/onarm-gate $ ./usr/src/tools/scripts/bldenv.sh -d opensolaris-arm.sh $ cd ./usr/src/lib/common $ dmake install $ cd ../libc $ dmake install $ cd ../libm $ dmake install $ exit
Remove base gcc in /opt/arm-eabi.
$ pfexec rm -rf /opt/arm-eabi
Reinstall Sun cross ld.
$ cd $TESTWS/onarm-gate/usr/src/cmd/sgs/proto/cross/arm $ pfexec mkdir -p /opt/arm-eabi/ccs $ gtar cvf - . | (cd /opt/arm-eabi/ccs; pfexec gtar xvf -)
Reinstall binutils
$ cd $TESTWS/binutils-2.18/objs $ pfexec gmake install
Build source code with Solaris crt*.o, libc and libm, and install binary into /opt/arm-eabi
$ cd $TESTWS/gcc-4.1.1
$ rm -rf objs newlib
$ mkdir objs
$ cd objs
$ $TESTWS/gcc-4.1.1/configure --prefix=/opt/arm-eabi
--target=arm-pc-solaris2.11
--with-sysroot=/opt/arm-eabi/root
--with-build-sysroot=$TESTWS/onarm-gate/proto/root_arm
--with-as=/opt/arm-eabi/arm-pc-solaris2.11/bin/as --with-gnu-as
--with-ld=/opt/arm-eabi/ccs/bin/ld
--with-ar=/opt/arm-eabi/arm-pc-solaris2.11/bin/ar --with-gnu-ar
--with-libiconv-prefix=system --enable-languages=c,c++
--with-cpu=mpcore --disable-multilib --enable-threads=posix
$ gmake
$ pfexec gmake install
If initenv.sh is done before and the opensolaris-arm.sh is generated in $TESTWS/onarm-gate, this step can be skipped.
$ cd $TESTWS/onarm-gate $ ./initenv.sh
Set up build environment. The -d option supports to build debugging version.
$ ./usr/src/tools/scripts/bldenv.sh -d opensolaris-arm.sh
If setup is done before, this step can be skipped.
$ cd $TESTWS/onarm-gate/usr/src $ dmake setup
If it is built for cross development toolchain before, the cleaning up is required.
$ cd $TESTWS/onarm-gate/usr/src $ dmake clean
$ cd $TESTWS/onarm-gate/usr/src $ dmake install $ exit
Download the qemu 0.9.1 and patch for ne1 platform, and unpack the source and install patch.
$ cd $TESTWS/onarm-gate/usr/src/qemu $ gtar xzvf $DOWNLOAD/qemu-0.9.1.tar.gz $ cd qemu-0.9.1 $ bzcat $DOWNLOAD/qemu-0.9.1-arm-ne1-solaris.patch.bz2 | gpatch -p0
Build the source code.
$ cd $TESTWS/onarm-gate/usr/src/qemu/qemu-0.9.1 $ ./configure --cc=/usr/sfw/bin/gcc --target-list=arm-softmmu $ gmake
Set up build environment. The -d option supports to build debugging version.
$ cd $TESTWS/onarm-gate $ ./usr/src/tools/scripts/bldenv.sh -d opensolaris-arm.sh $ cd usr/src
$ cd $TESTWS/onarm-gate/usr/src/qemu/rdimage $ pfexec make
$ cd $TESTWS/onarm-gate/usr/src/qemu/ne1 $ make
$ cd $TESTWS/onarm-gate/usr/src/qemu/ne1 $ ./ne1.sh
It shows message and then login prompt appears.
console login:
The root user is available without password.
console login: root #
Copy root file system into /opt/arm-eabi/root to build applications with the cross toolchain.
$ pfexec mkdir -p /opt/arm-eabi/root $ cd $TESTWS/onarm-gate/proto/root_arm $ gtar cvf - . | (cd /opt/arm-eabi/root; pfexec gtar xvf -)
Terms of Use
|
Privacy
|
Trademarks
|
Copyright Policy
|
Site Guidelines
|
Site Map
|
Help
Your use of this web site or any of its content or software indicates your agreement to be bound by these Terms of Use.
© 2012, Oracle Corporation and/or its affiliates.