OESF Portables Forum

Model Specific Forums => Sharp Zaurus => Zaurus - pdaXrom => Topic started by: VoiDeR on December 03, 2005, 01:10:47 am

Title: Porting Applictions
Post by: VoiDeR on December 03, 2005, 01:10:47 am
I have the rc10 verison for the sl-5500 working pretty well but i was wondering what is involved in porting applications over to it. Is it a matter of just recompiling or do they need recoded. I really need to figure out how to setup mouse clicks. Ive read that xmonobut will do what i want but theres no version in the rc10 feed for the sl-5500. Can i use packages for the OZ feeds? Any suggestions would be greatly appriceated.
Title: Porting Applictions
Post by: pgas on December 05, 2005, 03:13:12 am
Quote
i was wondering what is involved in porting applications over to it. Is it a matter of just recompiling or do they need recoded

It depends, most of the time it's just a matter of recompiling.
Some applications doesn't like the arm architecture, some needs some tweaking of the configure script/Makefile especially if you are cross compiling.

Quote
I really need to figure out how to setup mouse clicks.

you can also use xmodmap to modify the button like this :
Code: [Select]
xmodmap -e "pointer 1 2 3"
xmodmap -e "pointer 2 3 1"
xmodmap -e "pointer 3 1 2"

each line will set the "left click" to button 1 2 3 respectively.

not  a definitive solution I agree.
recompiling xmonobut is probably better.


Quote
Can i use packages for the OZ feeds? Any suggestions would be greatly appriceated.
probably no, OZ use newer glibc
Title: Porting Applictions
Post by: VoiDeR on December 09, 2005, 12:59:28 am
Are there any tutorials on how to recompile programs? Do i compile them on the sl-5500 or can i compile them on my linux box (gentoo)
Title: Porting Applictions
Post by: pgas on December 09, 2005, 01:38:59 am
Either the way are possible, even both at the same time.

To compile natively, the quickest way is to install http://mail.pdaxrom.org/rc10/Zaurus-Collie/zgcc-3.3.6.img (http://mail.pdaxrom.org/rc10/Zaurus-Collie/zgcc-3.3.6.img)

To install this you can drop it in /home/root and reboot or mount it manually with mount -o loop /opt/native/...  (you have to check the exact command which should be in /et/rc.d/rc.sysinit

Compiling natively is the same as compiling on a normal pc.

To cross compile use the  cross-sdk install instruction are in http://mail.pdaxrom.org/rc10/Zaurus-Collie/cross-sdk.txt (http://mail.pdaxrom.org/rc10/Zaurus-Collie/cross-sdk.txt)

use ./configure --host=arm-cacko-linux --build=i686-linux instead of just ./configure (actually arm-cacko-linux might be wrong as I don't know if it is the right prefix for 55000).


you can search here for a thread about distcc "semi-native compilation".
Title: Porting Applictions
Post by: ThirtyOne on December 09, 2005, 07:34:31 am
pgas -

I just wanted to mention how helpful you are in these forums.  It is knowledgeable, patient posters like you that make this site (and the zaurus) so useful.

Thanks
Title: Porting Applictions
Post by: VoiDeR on December 09, 2005, 01:39:02 pm
SO far so good! Fvwm is compileing. My next question is do i "make install" or do i copy the binarys and stuff to my sd card and link them manually (please god say no lol). Is there a set of tools to make ".ipk" files so i can add my package too the feed.
Title: Porting Applictions
Post by: pgas on December 09, 2005, 01:54:22 pm
@ThirtyOne thanks for the nice words.

Quote
y next question is do i "make install" or do i copy the binarys and stuff to my sd card and link them manually (please god say no lol).
No. :-)
Often you can use
Code: [Select]
mkdir /mnt/nfs/my_package/ipkg
make DESTDIR=/mnt/nfs/my_package/ipkg install
use strip ( or arm-linux-strip) on all the binaries (and .so). it reduces a lot their sizes

to create an ipk see:
http://www.pdaxrom.org/index.php?showid=35&menuid=1 (http://www.pdaxrom.org/index.php?showid=35&menuid=1)
and search a bit around. (check more than once the syntax of your control file architecture will be arm in your casse)

ipkg will create the links for you when you install your package
Title: Porting Applictions
Post by: VoiDeR on December 09, 2005, 11:12:04 pm
Thank you! Thank you! Thank you! Fvwm is installed and running like a champ. If i can find a prog to take a screenshot ill post one.
Title: Porting Applictions
Post by: VoiDeR on December 10, 2005, 02:09:30 am
Heres a screenshot of what i have so far. Nothing much fvwm 2.5.14, aterm, and i have nano installed. I hope to get feh, kismet, and a few other small programs compiled tomorrow. Then im going to start working on a custom fvwm setup. Im also hunting for a font that looks good at point 8. Im not sure how to install fonts like artwiz since theres no xfree or xorg config and i cant find a font directory.

Screenshot (http://thevoided.net/zaurus.jpg)
Title: Porting Applictions
Post by: VoiDeR on December 10, 2005, 01:02:44 pm
Quick update heres a list of packages i have compiled and have working
fetchmail_6.3.0
fvwm_2.5.14
mutt_1.5.10
nano_1.3.9
procmail_3.15.2
sudo_1.6.8

Heres a quick screenshot with xystray at the bottom corner. Screenshot 2 (http://thevoided.net/zaurus2.jpg)
Next will be a cron daemon and postfix. For some reason i cant get imlib2 to install because im missing libttf.so.2 but when i install freetype it doesnt install it so ill work on that later.
Title: Porting Applictions
Post by: pgas on December 10, 2005, 01:23:17 pm
Quote
Im not sure how to install fonts like artwiz

maybe something like that in your .xinitrc?

xset +fp /usr/X11R6/lib/X11/fonts/artwiz
Title: Porting Applictions
Post by: VoiDeR on December 11, 2005, 11:38:04 am
Quote
Quote
Im not sure how to install fonts like artwiz

maybe something like that in your .xinitrc?

xset +fp /usr/X11R6/lib/X11/fonts/artwiz
[div align=\"right\"][{POST_SNAPBACK}][/a][/div]
 (http://index.php?act=findpost&pid=106691\")

Thats works fine. I changed it to xset +fp ~/.font so i didnt have to set permissions for it. Is there a way to add new modules? I installed the hostap modules from [a href=\"http://oz.pdai.org/official/unstable/3.5.3/feed/machine/collie/]HERE[/url] but theres no modules-update command so i cant get modprobe not notice them. The orinoco drivers that come in the kernel dont have the monitor mode patch so i cant use kismet.

I have one more question reguarding recomiling. Can i put the packages up on the net legally since i dont have the source with them?

Heres the latest screenshot. (http://thevoided.net/zaurus3.jpg) I now have battery status and 0/0 new/total mail status.
Title: Porting Applictions
Post by: koen on December 11, 2005, 02:17:35 pm
Quote
I have one more question reguarding recomiling. Can i put the packages up on the net legally since i dont have the source with them?
[div align=\"right\"][a href=\"index.php?act=findpost&pid=106758\"][{POST_SNAPBACK}][/a][/div]

If they are (L)GPL, no
Title: Porting Applictions
Post by: pgas on December 11, 2005, 02:20:57 pm
hmm I don't know if you can use these modules with the pdaxrom kernel.....

you can perhaps try to use insmod mymodule.o to load the modules

also search here to find the files you need to modify.
to recompile the module and the kernel you might want to try the pdaxrom-builder..

It's probably not completely legal, but with a link to where you download the sources, I don't think you will have problem.
Title: Porting Applictions
Post by: VoiDeR on December 15, 2005, 09:44:08 pm
Rox-filer anyone! SCREENSHOT (http://thevoided.net/zaurus4.jpg)
I have ported a few applications over the last few days but i still cant figure out how to recomile the kernel so i can add either the hostap drivers or the patched orinoco ones. Could i use one of the 64-0 kernels from open zaurus and install the whole os on an SD card

Is there anyway to backup what i have done? I plan on getting a bigger SD card but i have moved alot of things around to  make alittle more room on / an di really dont want to have to start from scratch again.

Thanks VoiDeR
Title: Porting Applictions
Post by: VoiDeR on December 17, 2005, 09:04:48 pm
I decided to try using the cross-sdk method but i keep getting this error messege.

checking for SDL - version >= 1.0.1... no
*** Could not run SDL test program, checking why...
*** The test program compiled, but did not run. This usually means
*** that the run-time linker is not finding SDL or finding the wrong
*** version of SDL. If it is not finding SDL, you'll need to set your
*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point
*** to the installed location  Also, make sure you have run ldconfig if that
*** is required on your system
***
*** If you have an old version installed, it is best to remove it, although
*** you may also be able to get things to work by modifying LD_LIBRARY_PATH
configure: error: *** SDL version 1.0.1 not found!

Any ideas. The host system is a 1.2 ghz pentium running gentoo.
Title: Porting Applictions
Post by: pgas on December 17, 2005, 09:19:28 pm
it says it all

The program compiled but did not run.
because you are crosscompiling, the test program is compiled for arm, and did not run because it runs it on x86.

not all configure script are made or tested to behave correctly in the case of cross-compilation.

In this case I usually hack the configure script to bypass the test ( ie making it to return true all the time, if I know the answer)
Title: Porting Applictions
Post by: VoiDeR on December 17, 2005, 09:31:32 pm
The newvox program had a --disable-sdltest function so i used that and it passed the ./configure. Now when i "make" i get this

if gcc -DPACKAGE_NAME=\"\" -DPACKAGE_TARNAME=\"\" -DPACKAGE_VERSION=\"\" -DPACKA                                                         GE_STRING=\"\" -DPACKAGE_BUGREPORT=\"\" -DPACKAGE=\"newvox\" -DVERSION=\"1.0\"                                                           -I. -I.     -g -O2 -I/opt/cross/arm/3.3.6-sa1100-softvfp/arm-cacko-linux-gnu/inc                                                         lude/SDL -D_REENTRANT -MT newvox.o -MD -MP -MF ".deps/newvox.Tpo" \
  -c -o newvox.o `test -f 'newvox.c' || echo './'`newvox.c; \
then mv ".deps/newvox.Tpo" ".deps/newvox.Po"; \
else rm -f ".deps/newvox.Tpo"; exit 1; \
fi
gcc  -g -O2 -I/opt/cross/arm/3.3.6-sa1100-softvfp/arm-cacko-linux-gnu/include/SD                                                         L -D_REENTRANT   -o newvox  newvox.o  -L/opt/cross/arm/3.3.6-sa1100-softvfp/arm-                                                         cacko-linux-gnu/lib -Wl,-rpath,/opt/cross/arm/3.3.6-sa1100-softvfp/arm-cacko-lin                                                         ux-gnu/lib -lSDL -lpthread
/usr/lib/gcc-lib/i686-pc-linux-gnu/3.3.6/../../../../i686-pc-linux-gnu/bin/ld: s                                                         kipping incompatible /opt/cross/arm/3.3.6-sa1100-softvfp/arm-cacko-linux-gnu/lib                                                         /libSDL.so when searching for -lSDL
/usr/lib/gcc-lib/i686-pc-linux-gnu/3.3.6/../../../../i686-pc-linux-gnu/bin/ld: s                                                         kipping incompatible /opt/cross/arm/3.3.6-sa1100-softvfp/arm-cacko-linux-gnu/lib                                                         /libpthread.so when searching for -lpthread
/usr/lib/gcc-lib/i686-pc-linux-gnu/3.3.6/../../../../i686-pc-linux-gnu/bin/ld: s                                                         kipping incompatible /opt/cross/arm/3.3.6-sa1100-softvfp/arm-cacko-linux-gnu/lib                                                         /libpthread.a when searching for -lpthread
/usr/lib/gcc-lib/i686-pc-linux-gnu/3.3.6/../../../../i686-pc-linux-gnu/bin/ld: s                                                         kipping incompatible /opt/cross/arm/3.3.6-sa1100-softvfp/arm-cacko-linux-gnu/lib                                                         /libc.so.6 when searching for libc.so.6
/usr/lib/gcc-lib/i686-pc-linux-gnu/3.3.6/../../../../i686-pc-linux-gnu/bin/ld: s                                                         kipping incompatible /opt/cross/arm/3.3.6-sa1100-softvfp/arm-cacko-linux-gnu/lib                                                         /libc_nonshared.a when searching for libc_nonshared.a

It compiles fine but wont execute on the zaurus i get an "cannot execute this binary" the permissions are set fine on it.

So far this whole experince has been extremly educational. I want to thank you pgas for all your help and patients.
Title: Porting Applictions
Post by: pgas on December 18, 2005, 01:28:38 am
thanks.

It seems that your compilation does not use the cross compiler.

did you run configure with  something like
Code: [Select]
LDFLAGS="-Wl,-rpath-link,/opt/arm/3.3.2/armv5tel-cacko-linux/X11R6/lib" ./configure --host=armv5tel-cacko-linux --build=i686-linux --x-includes=/opt/arm/3.3.2/armv5tel-cacko-linux/X11R6/include --x-libraries=/opt/arm/3.3.2/armv5tel-cacko-linux/X11R6/lib --disable-debug --prefix=/usr/local  
 replacing the path used by the one of your cross sdk?
 and replacing --host=armv5tel-cacko-linux by host=arm-cacko-linux (note that besides the path /opt/arm... in your sdk the X11R6/include might be just include)
Title: Porting Applictions
Post by: VoiDeR on December 18, 2005, 12:21:07 pm
Heres my config and make output.

Code: [Select]
confused newvox-1.0 # LDFLAGS="-Wl,-rpath-link,/opt/cross/arm/3.3.6-sa1100-softvfp/arm-cacko-linux/lib" ./configure --host=arm-cacko-linux --build=i686-linux --x-includes=/opt/cross/arm/3.3.6-sa1100-softvfp/arm-cacko-linux/include --x-libraries=/opt/cross/arm/3.3.6-sa1100-softvfp/arm-cacko-linux/lib --disable-debug --prefix=/usr/local                  
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
/root/newvox-1.0/missing: Unknown `--run' option
Try `/root/newvox-1.0/missing --help' for more information
configure: WARNING: `missing' script is too old or missing
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking for arm-cacko-linux-strip... no
checking for strip... strip
checking for arm-cacko-linux-gcc... no
checking for gcc... gcc
checking for C compiler default output... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... yes
checking for suffix of executables...
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ANSI C... none needed
checking for style of include used by make... GNU
checking dependency style of gcc... gcc3
checking for sdl-config... /usr/bin/sdl-config
checking for SDL - version >= 1.0.1... cross compiling; assumed OK...
yes
configure: creating ./config.status
config.status: creating Makefile
config.status: executing depfiles commands

confused newvox-1.0 # make
if gcc -DPACKAGE_NAME=\"\" -DPACKAGE_TARNAME=\"\" -DPACKAGE_VERSION=\"\" -DPACKAGE_STRING=\"\" -DPACKAGE_BUGREPORT=\"\" -DPACKAGE=\"newvox\" -DVERSION=\"1.0\"  -I. -I.     -g -O2 -I/usr/include/SDL -D_REENTRANT -MT newvox.o -MD -MP -MF ".deps/newvox.Tpo" \
  -c -o newvox.o `test -f 'newvox.c' || echo './'`newvox.c; \
then mv ".deps/newvox.Tpo" ".deps/newvox.Po"; \
else rm -f ".deps/newvox.Tpo"; exit 1; \
fi
gcc  -g -O2 -I/usr/include/SDL -D_REENTRANT  -Wl,-rpath-link,/opt/cross/arm/3.3.6-sa1100-softvfp/arm-cacko-linux/lib -o newvox  newvox.o  -lSDL -lpthread
Title: Porting Applictions
Post by: pgas on December 18, 2005, 12:55:44 pm
is there no arm-cacko-linux-gcc in /opt/cross/arm/3.3.6-sa1100-softvfp/bin/ ?

do you run /opt/cross/arm/3.3.6-sa1100-softvfp/runsdk.sh before compiling?
Title: Porting Applictions
Post by: VoiDeR on December 18, 2005, 01:09:56 pm
I did run runsdk.sh before hand. I dont have arm-cacko-linux-gcc but i do have g++, gcc, c++. Should i make a symbolic ling from gcc to arm-cacko-linux-gcc?
Title: Porting Applictions
Post by: VoiDeR on December 18, 2005, 08:40:52 pm
Scratch that i was in /opt/cross/a/opt/cross/arm/3.3.6-sa1100-softvfp/arm-cacko-linux-gnu/bin/ instead of
 /opt/cross/arm/3.3.6-sa1100-softvfp/bin. SO yeah its there.
Title: Porting Applictions
Post by: pgas on December 19, 2005, 03:03:28 am
hmm, I guess I will have to download the cross sdk and try out to see If I can find what's wrong...

is it arm-cacko-linux-gnu or arm-cacko-linux ?

maybe you should pass --host=arm-cacko-linux-gnu ?
Title: Porting Applictions
Post by: VoiDeR on December 19, 2005, 11:11:27 am
Ill give that a try and let ya know.
Title: Porting Applictions
Post by: VoiDeR on December 19, 2005, 11:34:18 am
That was the problem. Everything works great now. Now its time to try and figure out the kernel stuff.

VoiDeR