Platform:Other

From GNUstepWiki

(Difference between revisions)
Revision as of 14:31, 16 September 2006
Hns (Talk | contribs)
Embedded GNUstep: mySTEP
← Previous diff
Current revision
Fedor (Talk | contribs)
update livecd again
Line 1: Line 1:
-= LiveCD for Intel =+== Embedded GNUstep: mySTEP ==
-Current version is 0.9.4.2+
-Find the instructions to install and the CD itself [http://livecd.gnustep.org/ here]+There is a "fork" of GNUstep with optimizations for embedded systems. It is called "mySTEP" - my being the German pronunciation of the greek letter mu (for micro). More information can be found at http://www.quantum-step.com/wiki.php?page=mySTEP and the source file tree at http://www.quantum-step.com/download/sources/
 +== Linksys NSLU2 ==
 +The first thing you need to do is to generate a gcc cross compiler with Objective-C enabled. The GCC currently used on nslu2 only has C and C++ enabled when building the crosstool-native package.
-= Embedded GNUstep: mySTEP =+* Check out unslung source using follow command
-There is a "fork" of GNUstep with optimizations for embedded systems. It is called "mySTEP" - my being the German pronunciation of the greek letter mu (for micro).+
-More information can be found at http://www.quantum-step.com/wiki.php?page=mySTEP and the source file tree at http://www.quantum-step.com/download/sources/+ cvs -z3 -d:pserver:anonymous@cvs.sourceforge.net:/cvsroot/nslu co unslung
-= Linksys NSLU2 =+* Add in Objective-C as a language that needs to be enabled
-* First thing need to happen is to gnerate a gcc cross compiler with objc enabled.+
- Current nslu2 supported gcc only has c and c++ enabled when building the crosstool-native package.+
-* check out unslung source using follow command. 
- 
- cvs -z3 -d:pserver:anonymous@cvs.sourceforge.net:/cvsroot/nslu co unslung 
- 
-* add in objc as language need to be enabled. 
- <pre> 
perl -pi -e 's!^GCC_LANGUAGES=.*!GCC_LANGUAGES="c,c++,objc"!' toolchain/crosstool/nslu2-cross335.sh perl -pi -e 's!^GCC_LANGUAGES=.*!GCC_LANGUAGES="c,c++,objc"!' toolchain/crosstool/nslu2-cross335.sh
perl -pi -e 's!^GCC_LANGUAGES=.*!GCC_LANGUAGES="c,c++,objc"!' sources/crosstool-native/nslu2-native335.sh perl -pi -e 's!^GCC_LANGUAGES=.*!GCC_LANGUAGES="c,c++,objc"!' sources/crosstool-native/nslu2-native335.sh
- </pre> 
-** Compile cross-compiler for arm cpu using gcc compiler on debian 3.1 linux. 
- <pre>+* Compile the cross-compiler for an ARM CPU using gcc (here: on Debian 3.1 Linux)
 + 
 +<pre>
tjyang@debian:~/unslung$ pwd tjyang@debian:~/unslung$ pwd
/home/tjyang/unslung /home/tjyang/unslung
Line 32: Line 24:
tjyang@debian:~/unslung$ rm toolchain/crosstool/.built tjyang@debian:~/unslung$ rm toolchain/crosstool/.built
tjyang@debian:~/unslung$ unset LD_LIBRARY_PATH tjyang@debian:~/unslung$ unset LD_LIBRARY_PATH
-tjyang@debian:~/unslung$make toolchain+tjyang@debian:~/unslung$ make toolchain
-</pre>+tjyang@debian:~/unslung$ /export/home/tjyang/slug/unslung/toolchain/armv5b-softfloat-linux/gcc-3.3.5-glibc-2.2.5/bin/armv5b-softfloat-linux-gcc -v
- +
-* A arm gcc with objective-C enabled.+
-<pre>+
-/export/home/tjyang/slug/unslung/toolchain/armv5b-softfloat-linux/gcc-3.3.5-glibc-2.2.5/bin/armv5b-softfloat-linux-gcc -v+
Reading specs from /export/home/tjyang/slug/unslung/toolchain/armv5b-softfloat-linux/gcc-3.3.5-glibc-2.2.5/lib/gcc-lib/armv5b-softfloat-linux/3.3.5/specs Reading specs from /export/home/tjyang/slug/unslung/toolchain/armv5b-softfloat-linux/gcc-3.3.5-glibc-2.2.5/lib/gcc-lib/armv5b-softfloat-linux/3.3.5/specs
Line 44: Line 32:
gcc version 3.3.5 gcc version 3.3.5
[tjyang@dual unslung]$ [tjyang@dual unslung]$
- </pre> +</pre>
-** A simple test of objc on host linux machine.+ 
- <pre>+* Do a simple test on the host machine
 + 
[tjyang@dual bin]$ pwd [tjyang@dual bin]$ pwd
/home/tjyang/slug/unslung/toolchain/armv5b-softfloat-linux/gcc-3.3.5-glibc-2.2.5/armv5b-softfloat-linux/bin /home/tjyang/slug/unslung/toolchain/armv5b-softfloat-linux/gcc-3.3.5-glibc-2.2.5/armv5b-softfloat-linux/bin
Line 63: Line 52:
Linux dual 2.4.21-9.ELsmp #1 SMP Thu Jan 8 17:08:56 EST 2004 i686 i686 i386 GNU/Linux Linux dual 2.4.21-9.ELsmp #1 SMP Thu Jan 8 17:08:56 EST 2004 i686 i686 i386 GNU/Linux
[tjyang@dual bin]$ [tjyang@dual bin]$
- </pre>+ 
-** Second step is to use this cross-compiler which generate binaries code for armb cpu to compile a native compiler. This complier can only be run on native machine nslu2 not on Intel linux.+* The second step is to use this cross-compiler which only generates binaries for ARM CPUs to compile a native compiler. This compiler can only be run on a native ARM machine (here: nslu2).
 + 
<pre> <pre>
[tjyang@dual unslung]$ make crosstool-native;make crosstool-native-ipk [tjyang@dual unslung]$ make crosstool-native;make crosstool-native-ipk
Line 102: Line 92:
Sat Feb 19 01:04:07 CST 2005 Sat Feb 19 01:04:07 CST 2005
bash-2.05b# bash-2.05b#
 +</pre>
 +* Try to compile the helloworld.m Objective-C file and run the helloworld binary on nslu2.
-</pre> 
-** try to compile helloworld.m objective-C file and run the helloworld binary on nslu2. 
<pre> <pre>
- 
bash-2.05b# gcc helloworld.m -lobjc -o helloworld bash-2.05b# gcc helloworld.m -lobjc -o helloworld
bash-2.05b# file helloworld bash-2.05b# file helloworld
Line 116: Line 105:
libobjc.so.1 is in /opt/armeb/armv5b-softfloat-linux/lib, this path need to be in LD_LIBRARY_PATH. libobjc.so.1 is in /opt/armeb/armv5b-softfloat-linux/lib, this path need to be in LD_LIBRARY_PATH.
- 
bash-2.05b# ./helloworld bash-2.05b# ./helloworld
Line 132: Line 120:
export PATH TERM export PATH TERM
bash-2.05b# bash-2.05b#
- 
</pre> </pre>
 +You can now use the Objective-C enabled GCC to compile the GNUstep core packages and GNUstep software. However, more strong testing is needed. Please add instructon below if you know how to run objective-c's testsuite in crosstool.
 +References: http://lists.gnu.org/archive/html/discuss-gnustep/2005-02/msg00124.html
-* Using Objective-C enalbed gcc to compile gnustep-core,gnustep-* software.+== LiveCD for Intel ==
-** more strong testing is needed. please add instructon below if you know how to run objective-c's testsuite in crosstool.+
-References: http://lists.gnu.org/archive/html/discuss-gnustep/2005-02/msg00124.html+Current version is 1.0
 + 
 +Find the instructions to install and the CD itself at [http://livecd.gnustep.org/ GNUSTEP LiveCD Homepage]
 +[[Image:GNUstepCDandCover.jpg]]
[[Category:Development]] [[Category:Development]]

Current revision

Embedded GNUstep: mySTEP

There is a "fork" of GNUstep with optimizations for embedded systems. It is called "mySTEP" - my being the German pronunciation of the greek letter mu (for micro). More information can be found at http://www.quantum-step.com/wiki.php?page=mySTEP and the source file tree at http://www.quantum-step.com/download/sources/

Linksys NSLU2

The first thing you need to do is to generate a gcc cross compiler with Objective-C enabled. The GCC currently used on nslu2 only has C and C++ enabled when building the crosstool-native package.

  • Check out unslung source using follow command
cvs -z3 -d:pserver:anonymous@cvs.sourceforge.net:/cvsroot/nslu co unslung
  • Add in Objective-C as a language that needs to be enabled
perl -pi -e 's!^GCC_LANGUAGES=.*!GCC_LANGUAGES="c,c++,objc"!' toolchain/crosstool/nslu2-cross335.sh
perl -pi -e 's!^GCC_LANGUAGES=.*!GCC_LANGUAGES="c,c++,objc"!' sources/crosstool-native/nslu2-native335.sh
  • Compile the cross-compiler for an ARM CPU using gcc (here: on Debian 3.1 Linux)
tjyang@debian:~/unslung$ pwd
/home/tjyang/unslung
tjyang@debian:~/unslung$ rm toolchain/crosstool/.configured
tjyang@debian:~/unslung$ rm toolchain/crosstool/.built
tjyang@debian:~/unslung$ unset LD_LIBRARY_PATH
tjyang@debian:~/unslung$ make toolchain
tjyang@debian:~/unslung$ /export/home/tjyang/slug/unslung/toolchain/armv5b-softfloat-linux/gcc-3.3.5-glibc-2.2.5/bin/armv5b-softfloat-linux-gcc -v

Reading specs from /export/home/tjyang/slug/unslung/toolchain/armv5b-softfloat-linux/gcc-3.3.5-glibc-2.2.5/lib/gcc-lib/armv5b-softfloat-linux/3.3.5/specs
Configured with: /export/home/tjyang/slug/unslung/toolchain/crosstool/build/armv5b-softfloat-linux/gcc-3.3.5-glibc-2.2.5/gcc-3.3.5/configure --target=armv5b-softfloat-linux --host=i686-host_pc-linux-gnu --prefix=/export/home/tjyang/slug/unslung/toolchain/armv5b-softfloat-linux/gcc-3.3.5-glibc-2.2.5 --with-float=soft --with-cpu=xscale --enable-cxx-flags=-mcpu=xscale --with-headers=/export/home/tjyang/slug/unslung/toolchain/armv5b-softfloat-linux/gcc-3.3.5-glibc-2.2.5/armv5b-softfloat-linux/include --with-local-prefix=/export/home/tjyang/slug/unslung/toolchain/armv5b-softfloat-linux/gcc-3.3.5-glibc-2.2.5/armv5b-softfloat-linux --disable-nls --enable-threads=posix --enable-symvers=gnu --enable-__cxa_atexit --enable-languages=c,c++,objc --enable-shared --enable-c99 --enable-long-long
Thread model: posix
gcc version 3.3.5
[tjyang@dual unslung]$
  • Do a simple test on the host machine
 [tjyang@dual bin]$ pwd
 /home/tjyang/slug/unslung/toolchain/armv5b-softfloat-linux/gcc-3.3.5-glibc-2.2.5/armv5b-softfloat-linux/bin
 [tjyang@dual bin]$
 [tjyang@dual bin]$ cat helloworld.m
 #include <stdio.h>
 
 int main(void)
 {
    printf("Hello World\n");
 }
 [tjyang@dual bin]$ ./gcc helloworld.m -lobjc -o helloworld
 [tjyang@dual bin]$ file helloworld
 hellow: ELF 32-bit MSB executable, ARM, version 1 (ARM), for GNU/Linux 2.4.3, dynamically linked (uses shared libs), not stripped
 [tjyang@dual bin]$ uname -a
 Linux dual 2.4.21-9.ELsmp #1 SMP Thu Jan 8 17:08:56 EST 2004 i686 i686 i386 GNU/Linux
 [tjyang@dual bin]$
  • The second step is to use this cross-compiler which only generates binaries for ARM CPUs to compile a native compiler. This compiler can only be run on a native ARM machine (here: nslu2).
[tjyang@dual unslung]$ make crosstool-native;make crosstool-native-ipk
[tjyang@dual unslung]$ ls -lrt builds/*.ipk
-rw-rw-r--    1 tjyang   tjyang    5569523 Feb 17 13:32 builds/crosstool-native-bin_0.28-rc37-3_armeb.ipk
-rw-rw-r--    1 tjyang   tjyang   12677163 Feb 17 13:33 builds/crosstool-native-lib_0.28-rc37-3_armeb.ipk
-rw-rw-r--    1 tjyang   tjyang    1722660 Feb 17 13:33 builds/crosstool-native-inc_0.28-rc37-3_armeb.ipk
-rw-rw-r--    1 tjyang   tjyang    7049858 Feb 17 13:34 builds/crosstool-native-arch-bin_0.28-rc37-3_armeb.ipk
-rw-rw-r--    1 tjyang   tjyang    9032668 Feb 17 13:34 builds/crosstool-native-arch-lib_0.28-rc37-3_armeb.ipk
-rw-rw-r--    1 tjyang   tjyang    7483945 Feb 17 13:35 builds/crosstool-native-arch-inc_0.28-rc37-3_armeb.ipk
-rw-rw-r--    1 tjyang   tjyang       1058 Feb 17 13:35 builds/crosstool-native_0.28-rc37-3_armeb.ipk

[tjyang@dual unslung]$ cp  /export/home/tjyang/slug/unslung/builds/*.ipk  /disk76/nslu2/tmp/
[tjyang@dual unslung]$

login into your nslu2, cd to where the ipk packages are.
run following commands.
bash-2.05b# for i in *.ipk
> do
> ipkg -force-overwrite install $i
> done
Upgrading crosstool-native-arch-bin on root from 0.28-rc37-3 to 0.28-rc37-5...
Configuring crosstool-native-arch-bin
Upgrading crosstool-native-arch-inc on root from 0.28-rc37-3 to 0.28-rc37-5...
Configuring crosstool-native-arch-inc
Upgrading crosstool-native-arch-lib on root from 0.28-rc37-3 to 0.28-rc37-5...
Configuring crosstool-native-arch-lib
Upgrading crosstool-native-bin on root from 0.28-rc37-3 to 0.28-rc37-5...
Configuring crosstool-native-bin
Upgrading crosstool-native-inc on root from 0.28-rc37-3 to 0.28-rc37-5...
Configuring crosstool-native-inc
Upgrading crosstool-native-lib on root from 0.28-rc37-3 to 0.28-rc37-5...
Configuring crosstool-native-lib
Upgrading crosstool-native on root from 0.28-rc37-3 to 0.28-rc37-5...
Configuring crosstool-native
bash-2.05b# date
Sat Feb 19 01:04:07 CST 2005
bash-2.05b#
  • Try to compile the helloworld.m Objective-C file and run the helloworld binary on nslu2.
bash-2.05b# gcc helloworld.m -lobjc -o helloworld
bash-2.05b# file helloworld
helloworld: ELF 32-bit MSB executable, ARM, version 1 (ARM), for GNU/Linux 2.4.3, dynamically linked (uses shared libs), not stripped
bash-2.05b# ./helloworld
./helloworld: error while loading shared libraries: libobjc.so.1: cannot open shared object file: No such file or directory
bash-2.05b#

libobjc.so.1 is in /opt/armeb/armv5b-softfloat-linux/lib, this path need to be in LD_LIBRARY_PATH.

bash-2.05b# ./helloworld
Hello World
bash-2.05b# uname -a
Linux LKG7BFA96 2.4.22-xfs #1 Sat Jan 1 21:34:54 HST 2005 armv5b unknown unknown GNU/Linux
bash-2.05b# date
Thu Feb 17 11:35:19 CST 2005
bash-2.05b# cat compile.sh
/opt/armeb/armv5b-softfloat-linux/bin/gcc  helloworld.m -o helloworld -lobjc
bash-2.05b# cat /etc/profile
PATH=/opt/bin:/share/hdd/data/public/nslu2/tjyang/unslung/staging/bin:${PATH}
TERM=xterm
export LD_LIBRARY_PATH=/opt/lib:/lib:/opt/armeb/armv5b-softfloat-linux/lib
export PATH TERM
bash-2.05b#

You can now use the Objective-C enabled GCC to compile the GNUstep core packages and GNUstep software. However, more strong testing is needed. Please add instructon below if you know how to run objective-c's testsuite in crosstool.

References: http://lists.gnu.org/archive/html/discuss-gnustep/2005-02/msg00124.html

LiveCD for Intel

Current version is 1.0

Find the instructions to install and the CD itself at GNUSTEP LiveCD Homepage

Image:GNUstepCDandCover.jpg