1. Euphoria on ARM (and other processors)

i've been doing alot of programming on ARM devices (and mips and blackfin and...) recently and would really love to be able to use Euphoria on them, currently i'm using bash and lua so i wondered if anyone has been looking at porting the x86 assembler in the euphoria interpreter/compiler to other chips or if noone has, any suggestions on where to start doing it myself? :)

thnx

new topic     » topic index » view message » categorize

2. Re: Euphoria on ARM (and other processors)

As far I know the ARM has a C compiler . There Euphoria is wrote in C is should be posseble to compile it . Greating Menno .

new topic     » goto parent     » topic index » view message » categorize

3. Re: Euphoria on ARM (and other processors)

menno said...

As far I know the ARM has a C compiler . There Euphoria is wrote in C is should be posseble to compile it . Greating Menno .

RIght now Euphoria makes a lot of sizeof(void*)==sizeof(int)==sizeof(long)==4 assumptions. This is the biggest hurdle for anyone trying to port.

There is a handful of x86 assembly used in be_callc.c but this is fairly trivial assembly so anyone who knows ARM assemby could replace it easily. Failing this, a pure C version of be_callc.c exists and is used by the msvc40 branch.

I am not sure about other places. be_tasks.c no longer uses x86 assembly iiuc, but the pthreads library, so it should work ok. be_execute.c has some complex assembly hacks for the big switch statement, but those are Watcom specific. The gcc version uses a builtin gcc feature that should be portable (as in, it should just work) on the ARM port of gcc.

new topic     » goto parent     » topic index » view message » categorize

4. Re: Euphoria on ARM (and other processors)

jimcbrown said...

RIght now Euphoria makes a lot of sizeof(void*)==sizeof(int)==sizeof(long)==4 assumptions. This is the biggest hurdle for anyone trying to port.

There is a handful of x86 assembly used in be_callc.c but this is fairly trivial assembly so anyone who knows ARM assemby could replace it easily. Failing this, a pure C version of be_callc.c exists and is used by the msvc40 branch.

I am not sure about other places. be_tasks.c no longer uses x86 assembly iiuc, but the pthreads library, so it should work ok. be_execute.c has some complex assembly hacks for the big switch statement, but those are Watcom specific. The gcc version uses a builtin gcc feature that should be portable (as in, it should just work) on the ARM port of gcc.

ok last time i looked (around august/september last year) there seemed to be tons of assembler in there and it looked like a massive task. I have to finish up some mucking around with framebuffers and i'll give it a whirl and see what happens

thanks

new topic     » goto parent     » topic index » view message » categorize

5. Re: Euphoria on ARM (and other processors)

rkdavis said...

ok last time i looked (around august/september last year) there seemed to be tons of assembler in there and it looked like a massive task. I have to finish up some mucking around with framebuffers and i'll give it a whirl and see what happens

thanks

As of right now there are only two lines of assembly used for the gcc version, in be_callc.c

new topic     » goto parent     » topic index » view message » categorize

6. Re: Euphoria on ARM (and other processors)

jimcbrown said...

As of right now there are only two lines of assembly used for the gcc version, in be_callc.c

ok i'll fire up scratchbox and see what happens.

new topic     » goto parent     » topic index » view message » categorize

7. Re: Euphoria on ARM (and other processors)

I've also tried to cross compile eu3 for my motolora linux phone.

In the first trial it gave out an error saying that there are 'bad instructions' in the file be_callc.c

So I just changed those lines, from :

// RH Linux - ListFilter 
#define push() asm("pushl -28(%ebp)") 
#define  pop() asm( "addl -32(%ebp), %esp") 

to

// RH Linux - ListFilter 
#define push() //asm("pushl -28(%ebp)") 
#define  pop() //asm( "addl -32(%ebp), %esp") 

Then the compilation was successful. The interpreter worked fine.

However, when I tried to run some scripts such as callc.exu or mylib.exu in the demo/linux directory, it failed. It seemed that I cannot pass parameters to the external C functions.

I think the problem was due to the changes above. Anyone can tell me how to correct the 'bad instructions' with the appropriate ARM assembly code?

Thx in advance.

new topic     » goto parent     » topic index » view message » categorize

8. Re: Euphoria on ARM (and other processors)

forte said...

I've also tried to cross compile eu3 for my motolora linux phone.

In the first trial it gave out an error saying that there are 'bad instructions' in the file be_callc.c

So I just changed those lines, from :

// RH Linux - ListFilter 
#define push() asm("pushl -28(%ebp)") 
#define  pop() asm( "addl -32(%ebp), %esp") 

to

// RH Linux - ListFilter 
#define push() //asm("pushl -28(%ebp)") 
#define  pop() //asm( "addl -32(%ebp), %esp") 

Then the compilation was successful. The interpreter worked fine.

However, when I tried to run some scripts such as callc.exu or mylib.exu in the demo/linux directory, it failed. It seemed that I cannot pass parameters to the external C functions.

I think the problem was due to the changes above. Anyone can tell me how to correct the 'bad instructions' with the appropriate ARM assembly code?

Thx in advance.

I am not familar with the type of CPU used by the motorola phones, and asside from x86 assembly I've only had a bit of experience tinkering with SPARC asm.

I recommend you use the version of be_callc.c at http://malcom.unkmar.com/be_callc_conly.c which is assembly free.

new topic     » goto parent     » topic index » view message » categorize

9. Re: Euphoria on ARM (and other processors)

I think the phone uses ARM processor because the cross compiler I used is arm-none-linux-gnueabi-*

By the way, thanks for the file, but may I ask where I can find the be_runtime.h required by the c source code? Is it for eu3 or eu4?

new topic     » goto parent     » topic index » view message » categorize

10. Re: Euphoria on ARM (and other processors)

forte said...

I think the phone uses ARM processor because the cross compiler I used is arm-none-linux-gnueabi-*

By the way, thanks for the file, but may I ask where I can find the be_runtime.h required by the c source code? Is it for eu3 or eu4?

This is based on eu4's source, but I think it should work for eu3 as well. It might need some minor tweaking. be_runtime.h is in eu4's source directory (same place as be_callc.c), not sure about eu3.

new topic     » goto parent     » topic index » view message » categorize

11. Re: Euphoria on ARM (and other processors)

jimcbrown said...
forte said...

I think the phone uses ARM processor because the cross compiler I used is arm-none-linux-gnueabi-*

By the way, thanks for the file, but may I ask where I can find the be_runtime.h required by the c source code? Is it for eu3 or eu4?

This is based on eu4's source, but I think it should work for eu3 as well. It might need some minor tweaking. be_runtime.h is in eu4's source directory (same place as be_callc.c), not sure about eu3.

Thanks, I've just tried this with eu3. The interpreter can now run some of the scripts correctly (mylib.exu), though the string copy test, sin test and printf test (of callc.exu) failed. I will try it out for eu4 later.

new topic     » goto parent     » topic index » view message » categorize

12. Re: Euphoria on ARM (and other processors)

I had a few startup problems trying to use scratchbox to crosscompile as it couldn't run the existing euphoria interpreter to bootstrap but using firmwarelinux i seem to be getting futher.

forte: thanks for the assembler, i was paging through arm datasheets to get the right instructions and you've saved me from "death of a thousand paper cuts"

new topic     » goto parent     » topic index » view message » categorize

13. Re: Euphoria on ARM (and other processors)

rkdavis said...

forte: thanks for the assembler, i was paging through arm datasheets to get the right instructions and you've saved me from "death of a thousand paper cuts"

well for the idea to comment them out anyway :)

new topic     » goto parent     » topic index » view message » categorize

14. Re: Euphoria on ARM (and other processors)

rkdavis said...
rkdavis said...

forte: thanks for the assembler, i was paging through arm datasheets to get the right instructions and you've saved me from "death of a thousand paper cuts"

well for the idea to comment them out anyway :)

You might have problems with this, at least the Windows port uses a lot of callc in the interpreter and the translator itself. So you might have a problem bootstrapping if callc is not functional. (We had this issue with MSVC, which is why the C-only version of be_callc.c exists.)

new topic     » goto parent     » topic index » view message » categorize

15. Re: Euphoria on ARM (and other processors)

jimcbrown said...

You might have problems with this, at least the Windows port uses a lot of callc in the interpreter and the translator itself. So you might have a problem bootstrapping if callc is not functional. (We had this issue with MSVC, which is why the C-only version of be_callc.c exists.)

my main problem with using the scratchbox crosscompile environment is the need for a running interpreter to build euphoria (i'm working on eu40, well actually i'm working on console-tools and kbd and fonts at the moment but in between i'm fiddiling with eu40). once i resetup buildroot and firmwarelinux i started to get a bit further along in the process although not got a working binary yet. but i'll grab the non-assembler version of the file and see if i get any further (this is all probably going to be an exercise in futility in the end though other than to say it works as the device i'm building for has very little ram (32meg) and only 8meg flash+2gig SD Card although i am hoping to use the practice for other devices with "exotic" cpu's and hopefully more ram and flash)

new topic     » goto parent     » topic index » view message » categorize

16. Re: Euphoria on ARM (and other processors)

forte said...

I think the phone uses ARM processor because the cross compiler I used is arm-none-linux-gnueabi-*

By the way, thanks for the file, but may I ask where I can find the be_runtime.h required by the c source code? Is it for eu3 or eu4?

just as a matter of interest what cross compiler toolchain are you using? i currently use firmwarelinux, buildroot, scratchbox and openembedded as each has it's pros and cons but i'm always up for finding new development environments for non-x86 processors

new topic     » goto parent     » topic index » view message » categorize

17. Re: Euphoria on ARM (and other processors)

rkdavis said...

my main problem with using the scratchbox crosscompile environment is the need for a running interpreter to build euphoria

The answer is to pre-translate the euphoria source code on an x86 box first, then move the entire source over to the ARM system to finish the compile.

If you are crosscompiling to ARM and the host system is x86, then you shouldn't have any problems just using an x86 binary for the translation steps.

rkdavis said...

(this is all probably going to be an exercise in futility in the end though other than to say it works as the device i'm building for has very little ram (32meg) and only 8meg flash+2gig SD Card although i am hoping to use the practice for other devices with "exotic" cpu's and hopefully more ram and flash)

I don't know what it takes to compile Eu .. but 4.0 should run in that environment, no problems..

new topic     » goto parent     » topic index » view message » categorize

18. Re: Euphoria on ARM (and other processors)

jimcbrown said...
rkdavis said...

my main problem with using the scratchbox crosscompile environment is the need for a running interpreter to build euphoria

The answer is to pre-translate the euphoria source code on an x86 box first, then move the entire source over to the ARM system to finish the compile.

If you are crosscompiling to ARM and the host system is x86, then you shouldn't have any problems just using an x86 binary for the translation steps.

I don't know what it takes to compile Eu .. but 4.0 should run in that environment, no problems..

that's where i'm having the problem. i'm compiling on x86 and moving that dir to my arm environment and removing the *.o's and thee binaries and rebuilding and it's still trying to run the eui. i have to step through everything one stage at a time i think/

new topic     » goto parent     » topic index » view message » categorize

19. Re: Euphoria on ARM (and other processors)

rkdavis said...

that's where i'm having the problem. i'm compiling on x86 and moving that dir to my arm environment and removing the *.o's and thee binaries and rebuilding and it's still trying to run the eui. i have to step through everything one stage at a time i think/

The dependencies are set up so that if one of the .o files for the translated source is missing, the entire translation process is rerun.

What you need to do is to run the translation step alone, and not compile any .o files until after you have moved it to the ARM box.

Also, when you do the copying, make sure it is with a tool that preserves timestamps. If the timestamps are not preserved, this can confuse make and cause it to unnecessarily rerun steps for dependencies (such as the translator).

new topic     » goto parent     » topic index » view message » categorize

20. Re: Euphoria on ARM (and other processors)

jimcbrown said...

The dependencies are set up so that if one of the .o files for the translated source is missing, the entire translation process is rerun.

What you need to do is to run the translation step alone, and not compile any .o files until after you have moved it to the ARM box.

Also, when you do the copying, make sure it is with a tool that preserves timestamps. If the timestamps are not preserved, this can confuse make and cause it to unnecessarily rerun steps for dependencies (such as the translator).

actually it looks like it might be a uClibc problem (the device uses uCLibc thus scratchbox uses it) and i seem to be erroring in some string stuff

gcc -c -w -DEUNIX -DELINUX -fsigned-char -ffast-math -fomit-frame-pointer -O2 -DESIMPLE_MALLOC -DELINUX be_main.c -o/home/zipitdev/euphoria-src-4.0b2/source/build/intobj/back/be_main.o In file included from be_main.c:97: alloc.h:67: error: conflicting types for 'strlcpy' /usr/include/string.h:430: error: previous declaration of 'strlcpy' was here alloc.h:68: error: conflicting types for 'strlcat' /usr/include/string.h:428: error: previous declaration of 'strlcat' was here make[1]: * [/home/zipitdev/euphoria-src-4.0b2/source/build/intobj/back/be_main.o] Error 1 make[1]: Leaving directory `/home/zipitdev/euphoria-src-4.0b2/source' make: * [interpreter] Error 2

by the way what is the configure/make params just to do the translation part? i've tried the without-euphoria option to configure but it still seemed to try to do something with eui

new topic     » goto parent     » topic index » view message » categorize

21. Re: Euphoria on ARM (and other processors)

rkdavis said...
forte said...

I think the phone uses ARM processor because the cross compiler I used is arm-none-linux-gnueabi-*

By the way, thanks for the file, but may I ask where I can find the be_runtime.h required by the c source code? Is it for eu3 or eu4?

just as a matter of interest what cross compiler toolchain are you using? i currently use firmwarelinux, buildroot, scratchbox and openembedded as each has it's pros and cons but i'm always up for finding new development environments for non-x86 processors

Actually, I don't know much about it. :p I just downloaded the un-official cross compiler toolchain and the SDK from a forum and followed the tutorials and instructions there to develop/cross compile apps for the phone.

new topic     » goto parent     » topic index » view message » categorize

22. Re: Euphoria on ARM (and other processors)

forte said...

Actually, I don't know much about it. :p I just downloaded the un-official cross compiler toolchain and the SDK from a forum and followed the tutorials and instructions there to develop/cross compile apps for the phone.

Ah ok.

new topic     » goto parent     » topic index » view message » categorize

23. Re: Euphoria on ARM (and other processors)

rkdavis said...

actually it looks like it might be a uClibc problem (the device uses uCLibc thus scratchbox uses it) and i seem to be erroring in some string stuff

gcc -c -w -DEUNIX -DELINUX -fsigned-char -ffast-math -fomit-frame-pointer -O2 -DESIMPLE_MALLOC -DELINUX be_main.c -o/home/zipitdev/euphoria-src-4.0b2/source/build/intobj/back/be_main.o In file included from be_main.c:97: alloc.h:67: error: conflicting types for 'strlcpy' /usr/include/string.h:430: error: previous declaration of 'strlcpy' was here alloc.h:68: error: conflicting types for 'strlcat' /usr/include/string.h:428: error: previous declaration of 'strlcat' was here make[1]: * [/home/zipitdev/euphoria-src-4.0b2/source/build/intobj/back/be_main.o] Error 1 make[1]: Leaving directory `/home/zipitdev/euphoria-src-4.0b2/source' make: * [interpreter] Error 2

We had an issue with some Unixes not defining strlcat() or strlcpy(). Since uClib seems to define them, just remove the "ELINUX" in the ifdef section for strlcat/strlcpy in alloc.h and in be_alloc.c

If you want, you can just comment out the entire sections in be_alloc.c and alloc.h

rkdavis said...

by the way what is the configure/make params just to do the translation part? i've tried the without-euphoria option to configure but it still seemed to try to do something with eui

The without-euphoria option is the opposite - it assumes the translation is already done and tries to do the remaining tests - the actual building of C source to final binary.

You need to do a 'make source' and then copy the tree over.

new topic     » goto parent     » topic index » view message » categorize

24. Re: Euphoria on ARM (and other processors)

thanks, that got me a bit further. i now have an eui and an euc that seem to be running ok although i have found a bit more assembler by the looks of it in be_task.c.

gcc -c -w -DEUNIX -DELINUX -DERUNTIME -fsigned-char -ffast-math -fomit-frame-pointer -O2 -DESIMPLE_MALLOC -DELINUX be_task.c -o/home/zipitdev/euphoria/source/build/libobj/back/be_task.o be_task.c: In function 'task_create': be_task.c:962: error: unknown register name '%esp' in 'asm' make[1]: * [/home/zipitdev/euphoria/source/build/libobj/back/be_task.o] Error 1 make[1]: Leaving directory `/home/zipitdev/euphoria/source' make: * [library] Error 2

but i'm getting further :) and i'll see if i can use eui for the translation stage.

new topic     » goto parent     » topic index » view message » categorize

25. Re: Euphoria on ARM (and other processors)

rkdavis said...

thanks, that got me a bit further. i now have an eui and an euc that seem to be running ok although i have found a bit more assembler by the looks of it in be_task.c.

gcc -c -w -DEUNIX -DELINUX -DERUNTIME -fsigned-char -ffast-math -fomit-frame-pointer -O2 -DESIMPLE_MALLOC -DELINUX be_task.c -o/home/zipitdev/euphoria/source/build/libobj/back/be_task.o be_task.c: In function 'task_create': be_task.c:962: error: unknown register name '%esp' in 'asm' make[1]: * [/home/zipitdev/euphoria/source/build/libobj/back/be_task.o] Error 1 make[1]: Leaving directory `/home/zipitdev/euphoria/source' make: * [library] Error 2

but i'm getting further :) and i'll see if i can use eui for the translation stage.

Like I said, 4.0 removed the assembly code in be_task.c

I am not sure what the level of pthreads support in uClib is, so I don't know if you gain anything by tring to port the 4.0 be_task.c to 3.1.1

If you are trying to port 4.0 to ARM then your version of 4.0 is too old and you should get a newer source. But unless pthreads works on uClib, you still won't get tasks to run.

new topic     » goto parent     » topic index » view message » categorize

26. Re: Euphoria on ARM (and other processors)

i'm not working with 3.1.1 i've been working with euphoria-4.0b2 source grabbed from the download link above.

actually i still have a problem with the eui i did build it won't open (run) anything, just errors. i'll have another go at a clean install again and see what happens

new topic     » goto parent     » topic index » view message » categorize

27. Re: Euphoria on ARM (and other processors)

ok apart from overheating my computer and thus having to take a break while it cooled down :) using the trunk.tar.gz from the svn completed successfully with eu.a and 3 eu? executables generated. i still can't get them to open any files but now we are getting somewhere :)

new topic     » goto parent     » topic index » view message » categorize

28. Re: Euphoria on ARM (and other processors)

Hello,

I am a EUPHORIA developer and I see you have moved into the arena. I hope you will share your work with us. It is amazing to me that you have a phone with gcc running on it. Could you maintain a diff of your modified source tree in the User Contributions page on the main www.rapideuphoria.com?

I think you are taking the correct approach with developing from the beta. Once you have a working port we can put #ifdef/#endif defines around the ARM/x86 specific code update to the bleeding edge and see how it works with the new code.

What is the model of your phone and where can I buy one?

Shawn Pringle

new topic     » goto parent     » topic index » view message » categorize

29. Re: Euphoria on ARM (and other processors)

SDPringle said...

Hello,

I am a EUPHORIA developer and I see you have moved into the arena. I hope you will share your work with us. It is amazing to me that you have a phone with gcc running on it. Could you maintain a diff of your modified source tree in the User Contributions page on the main www.rapideuphoria.com?

I think you are taking the correct approach with developing from the beta. Once you have a working port we can put #ifdef/#endif defines around the ARM/x86 specific code update to the bleeding edge and see how it works with the new code.

What is the model of your phone and where can I buy one?

forte is the one with the phone, i think he said motorola or samsung but i'm too lazy to scroll up and check :)

i'm currently targetting the arm cpu (pxa270) in the ZipitZ2 (http://zipitwireless.com Noisy web page with lots of teenager bubblegum pop last time i forgot to turn off my speakers before going there and http://linux.zipitwireless.com ) running the /stock/ os rather than the openembedded/debian ports although they'd probably be running by now as they are glibc rather than uclibc

my current plans are to get a quick and dirty port that sort of runs and then use that as a bootstrap to run the build process in an emulated system (qemu) using either scratchbox or firmwarelinux as that will give the easiest build process for the unnitiated in the dark arts of cross compiling (it will save on the virgin sacrifices (and my sanity) if i stuck with buildroot too, although i do plan to go back to working with buildroot if the problems don't turn out to be uclibc related as that will enable ports to processors not supported by qemu)

i will certainly send you any modifications (can't talk for forte though) i have to do to get it running on an non-x86 systems. currently the only changes i've had to make to get a semi-working binary have been to replace be_callc.c with be_callc_conly.c, change the internally defined strlcat/cpy to strlcat_eu/strlcpy_eu and change all of the relevant calls to their _eu suffixed versions and use make source and copy the whole tree over to the emulated environment (i'm now working with the trunk.tar.gz that was available on the 14/1/10 and should probably stick with that for a couple of days at least).

i'm not sure why i'm getting the can't open error running eui/c though probably a subtle difference between uclibc and glibc. i have had a cursory look through all the code and i can't see why it would be failing but i'll be having another look today.

i have to take things a bit slower as my computer has been overheating alot in the last 24 hours, probably not too keen on running 3 parallel builds in 4 virtual machines while listening to the bbc and downloading a few other bits and pieces

new topic     » goto parent     » topic index » view message » categorize

30. Re: Euphoria on ARM (and other processors)

This is off topic, but you might think about vacuuming the computer's insides from time to time.

new topic     » goto parent     » topic index » view message » categorize

31. Re: Euphoria on ARM (and other processors)

yup this laptop needs a good ol' clean. i haven't cleaned it's guts since we moved last year. and i really should get around to it in the next day or so but that means going to radioshack and buying some canned air and a few other bits and pieces while i'm there and i'm brasic this week.

new topic     » goto parent     » topic index » view message » categorize

32. Re: Euphoria on ARM (and other processors)

SDPringle said...

Hello,

I am a EUPHORIA developer and I see you have moved into the arena. I hope you will share your work with us. It is amazing to me that you have a phone with gcc running on it. Could you maintain a diff of your modified source tree in the User Contributions page on the main www.rapideuphoria.com?

I think you are taking the correct approach with developing from the beta. Once you have a working port we can put #ifdef/#endif defines around the ARM/x86 specific code update to the bleeding edge and see how it works with the new code.

What is the model of your phone and where can I buy one?

Shawn Pringle

Shawn,

i noticed you added an ARCH macro to the makefile.gnu file, can i suggest you also change the CC=gcc to utilize that too or add the full name of the compilier i.e. arm-none-linux-gnueabi-gcc....... etc.

Russell

new topic     » goto parent     » topic index » view message » categorize

33. Re: Euphoria on ARM (and other processors)

also thought of another define that should probably be in the Makefile as there are now really 3 main choices in the glibc arena, uclibc,glibc and eglibc and it does look like at least on my setup (uclibc) that i have to comment out a few things that euphoria is providing as they are included in my libs already, i should go through everything and see what is where but a few defines in the makefiles wouldn't go amiss

Russell

new topic     » goto parent     » topic index » view message » categorize

34. Re: Euphoria on ARM (and other processors)

i have what i believe are working armv7 binaries (glibc/eglibc) however i don't currently have anything that runs an armv7 cpu (long story of why i have armv7 and not armv4 or armv5 rhat i won'y bore anyone with) but if anyone does have a device that uses armv7 and wants to try them let me know and i'll send them to you.

ok back to work trying to get the build working with uclibc

new topic     » goto parent     » topic index » view message » categorize

35. Re: Euphoria on ARM (and other processors)

rkdavis said...

i have what i believe are working armv7 binaries (glibc/eglibc) however i don't currently have anything that runs an armv7 cpu (long story of why i have armv7 and not armv4 or armv5 rhat i won'y bore anyone with) but if anyone does have a device that uses armv7 and wants to try them let me know and i'll send them to you.

ok back to work trying to get the build working with uclibc

When will you make the source for all of this available?

new topic     » goto parent     » topic index » view message » categorize

36. Re: Euphoria on ARM (and other processors)

jimcbrown said...

When will you make the source for all of this available?

of course although at the moment (for what i hope are working armv7 binaries that use glibc/eglibc) it really isn't any changes to the source other than using the be_callc_conly.c and a recent trunk tarball (for be_task.c with no assembler) and removal of the -m32's from the makefile as ARM gcc doesn't want that (and reverting SDpringle's arch changes as they get mucked up in scratchbox). the main thing i have contributed to the process is discovering how to get scratchbox to allow me run an x86 eui/euc/eub within the qemu emulated environment so I don't have to copy the tree after the make source stage, which once i sat down and thought about it logically was a homer moment.

porting to the stock zipitz2 (which is what i am aiming for) seems to be taking alot more time and effort than i thought because of what i am assuming are subtle differences between uclibc and glibc/eglibc that really shouldn't exist as in theory they are supposed to be source compatability between the 3 libs and binary compatablility between glibc & eglibc. That said as glibc seems to work for arm i could move from scratchbox to openembedded although that means writing bitbake recipies (but that drives me nuts) and resign myself to not being able to use euphoria on a stock zipit which uses uclibc and just accept that i'll only be able to use it on my modded zipit's

(of course now i have scratchbox sussed all this (for glibc) can be replicated for a standalone cross toolchain (probably less hassle too) so additional processors can be targeted reasonably easily)

new topic     » goto parent     » topic index » view message » categorize

37. Re: Euphoria on ARM (and other processors)

i was going to put my notes up on the wiki but i can't get it to edit any pages as it doesn;t seem to think i'm logged in. so i'll write them up and put them up somewhere and link to them

new topic     » goto parent     » topic index » view message » categorize

38. Re: Euphoria on ARM (and other processors)

If you use the latest svn version you can take the original code like this:

#define push() asm("movl %0,%%ecx; pushl (%%ecx);" : /* no out */ : "r"(last_offset) : "%ecx" ) 
#define  pop() asm( "movl %0,%%ecx; addl (%%ecx),%%esp;" : /* no out */ : "r"(as_offset) : "%ecx" ) 

And replace it with:

#if ARCH == ix86  
#define push() asm("movl %0,%%ecx; pushl (%%ecx);" : /* no out */ : "r"(last_offset) : "%ecx" ) 
#define  pop() asm( "movl %0,%%ecx; addl (%%ecx),%%esp;" : /* no out */ : "r"(as_offset) : "%ecx" ) 
#else 
#define push() asm("mov %%r1,%0;push (%%r1);" : /* no out */ : "r"(last_offset) : "%r1" ) 
#define pop()  asm("mov %%r1,%0;add %%r13, 0, %r1;" : /* no out */ : "r"(as_offset) : "%r1" ) 
#endif 

Then push()&pop() will be like the original code when compiled on a PC and it will use the other assembler code for the ARM. You will have to replace my example with code that has been tested. ;)

You can submit a patch to www.rapideuphoria.com which has always worked for me in the past or you could paste your patch into a http://euphoria.pastey.net and post the link here.

Shawn Pringle

new topic     » goto parent     » topic index » view message » categorize

39. Re: Euphoria on ARM (and other processors)

got side tracked for a couple of days trying to help a few people setting up their zipits but i'll get to writing up what i have so far in the next day or so. it definatly looks like glibc/eglibc systems will work pretty much out of the box no matter what processor they use (arm, mips....) but uclibc ones are going to be a PITA

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu