Still no eLua for AVR?

classic Classic list List threaded Threaded
9 messages Options
jschievink jschievink
Reply | Threaded
Open this post in threaded view
|

Still no eLua for AVR?

This post was updated on .
CONTENTS DELETED
The author has deleted this message.
Patrick Mc(avery Patrick Mc(avery
Reply | Threaded
Open this post in threaded view
|

Re: Still no eLua for AVR?

Hi Jonas

eLua is a volunteer project so things only get done when people have
time. I think in the past year or so, some of the core developers have
had a lot on their plates.

Just curious, have you tried gcc 4.6 ? On other lists I have heard about
some issue with 4.7, perhaps there have been significant changes with 4.7


-Patrick


On 12-09-12 02:42 PM, Jonas Schievink wrote:

> After I saw my Arduino Mega uselessly lying around, I though that having Lua on that thing would make it much more useful (or at least it would be a semi-useful experiment). Searching the internet, I could not find any existing ports for AVRs. Porting eLua to AVR should be possible when using an ATmega128 or 256 with a bit of external SRAM using the XMEM interface. Newlib is also available for AVR (however it seems to be not much more useful than the default avr-libc).
> So here's the question: Why isn't there a eLua port for AVR?
> Meanwhile I've started my own try of porting, but I can't get gcc 4.7.1 to compile/work with newlib (maybe the wrong version?)... GCC seems to be really bugged at the time (can't find registers to spill and such weird errors), or it's because I've never compiled a compiler myself and have no experience... Any advices on that one?
>
> PS: This is my first mail ever in a mailing list, so please have patience with me :-)
> _______________________________________________
> eLua-dev mailing list
> [hidden email]
> https://lists.berlios.de/mailman/listinfo/elua-dev
>

_______________________________________________
eLua-dev mailing list
[hidden email]
https://lists.berlios.de/mailman/listinfo/elua-dev
jschievink jschievink
Reply | Threaded
Open this post in threaded view
|

Re: Still no eLua for AVR?

Well, I kind of expected that someone already did a port, because I can't be the only one who wants to run eLua on an AVR ;-)
But the internet said "No" and now I've to do it when I want to use Lua (which is kinda good for collecting experience and helping others).
Please don't misunderstand me, I really appreciate the time that all those people spend on making free software!
It took me a lot of time compiling avr-gcc 4.7.1 but I guess I'll try 4.6 in the next days. I have the feeling that I'll fail anyways because I never used Newlib before and have no clue of how it will work together with eLua and my Arduino. I'll post my success/failure when I tried it!

Jonas


> Hi Jonas
>
> eLua is a volunteer project so things only get done when people have time. I think in the past year or so, some of the core developers have had a lot on their plates.
>
> Just curious, have you tried gcc 4.6 ? On other lists I have heard about some issue with 4.7, perhaps there have been significant changes with 4.7
>
>
> -Patrick
>
>
> On 12-09-12 02:42 PM, Jonas Schievink wrote:
>> After I saw my Arduino Mega uselessly lying around, I though that having Lua on that thing would make it much more useful (or at least it would be a semi-useful experiment). Searching the internet, I could not find any existing ports for AVRs. Porting eLua to AVR should be possible when using an ATmega128 or 256 with a bit of external SRAM using the XMEM interface. Newlib is also available for AVR (however it seems to be not much more useful than the default avr-libc).
>> So here's the question: Why isn't there a eLua port for AVR?
>> Meanwhile I've started my own try of porting, but I can't get gcc 4.7.1 to compile/work with newlib (maybe the wrong version?)... GCC seems to be really bugged at the time (can't find registers to spill and such weird errors), or it's because I've never compiled a compiler myself and have no experience... Any advices on that one?
>>
>> PS: This is my first mail ever in a mailing list, so please have patience with me :-)
>> _______________________________________________
>> eLua-dev mailing list
>> [hidden email]
>> https://lists.berlios.de/mailman/listinfo/elua-dev
>>
_______________________________________________
eLua-dev mailing list
[hidden email]
https://lists.berlios.de/mailman/listinfo/elua-dev
BogdanM BogdanM
Reply | Threaded
Open this post in threaded view
|

Re: Still no eLua for AVR?

Hi,

On Wed, Sep 12, 2012 at 10:30 PM, Jonas Schievink <[hidden email]> wrote:
> Well, I kind of expected that someone already did a port, because I can't be the only one who wants to run eLua on an AVR ;-)
> But the internet said "No" and now I've to do it when I want to use Lua (which is kinda good for collecting experience and helping others).
> Please don't misunderstand me, I really appreciate the time that all those people spend on making free software!
> It took me a lot of time compiling avr-gcc 4.7.1 but I guess I'll try 4.6 in the next days. I have the feeling that I'll fail anyways because I never used Newlib before and have no clue of how it will work together with eLua and my Arduino. I'll post my success/failure when I tried it!

Good luck and please keep up posted! I'm personally focusing on 32-bit
architectures, but I can lend some help for such a nice project.

Best,
Bogdan

>
> Jonas
>
>
>> Hi Jonas
>>
>> eLua is a volunteer project so things only get done when people have time. I think in the past year or so, some of the core developers have had a lot on their plates.
>>
>> Just curious, have you tried gcc 4.6 ? On other lists I have heard about some issue with 4.7, perhaps there have been significant changes with 4.7
>>
>>
>> -Patrick
>>
>>
>> On 12-09-12 02:42 PM, Jonas Schievink wrote:
>>> After I saw my Arduino Mega uselessly lying around, I though that having Lua on that thing would make it much more useful (or at least it would be a semi-useful experiment). Searching the internet, I could not find any existing ports for AVRs. Porting eLua to AVR should be possible when using an ATmega128 or 256 with a bit of external SRAM using the XMEM interface. Newlib is also available for AVR (however it seems to be not much more useful than the default avr-libc).
>>> So here's the question: Why isn't there a eLua port for AVR?
>>> Meanwhile I've started my own try of porting, but I can't get gcc 4.7.1 to compile/work with newlib (maybe the wrong version?)... GCC seems to be really bugged at the time (can't find registers to spill and such weird errors), or it's because I've never compiled a compiler myself and have no experience... Any advices on that one?
>>>
>>> PS: This is my first mail ever in a mailing list, so please have patience with me :-)
>>> _______________________________________________
>>> eLua-dev mailing list
>>> [hidden email]
>>> https://lists.berlios.de/mailman/listinfo/elua-dev
>>>
> _______________________________________________
> eLua-dev mailing list
> [hidden email]
> https://lists.berlios.de/mailman/listinfo/elua-dev
_______________________________________________
eLua-dev mailing list
[hidden email]
https://lists.berlios.de/mailman/listinfo/elua-dev
jschievink jschievink
Reply | Threaded
Open this post in threaded view
|

Re: Still no eLua for AVR?

Thanks for your support, everyone!
I finally built avr-gcc with in-tree builds of avr-libc and newlib (really: I have no clue if using two libc's can even work, but I need avr-libc as it defines registers, ports and everything else). It invoked the wrong assembler first (normal as instead of avr-as), but I fixed it with a symlink (there's probably a configure option that fixes that). The avr-libc in-tree build didn't work (and failed silently), but I compiled it after avr-gcc and installed it using the same prefix. A test-program has compiled good and runs fine (it just flashes a LED so I don't know if everything works yet).
I'll try compiling eLua now!

~ Jonas


> Hi,
>
> On Wed, Sep 12, 2012 at 10:30 PM, Jonas Schievink <[hidden email]> wrote:
>> Well, I kind of expected that someone already did a port, because I can't be the only one who wants to run eLua on an AVR ;-)
>> But the internet said "No" and now I've to do it when I want to use Lua (which is kinda good for collecting experience and helping others).
>> Please don't misunderstand me, I really appreciate the time that all those people spend on making free software!
>> It took me a lot of time compiling avr-gcc 4.7.1 but I guess I'll try 4.6 in the next days. I have the feeling that I'll fail anyways because I never used Newlib before and have no clue of how it will work together with eLua and my Arduino. I'll post my success/failure when I tried it!
>
> Good luck and please keep up posted! I'm personally focusing on 32-bit
> architectures, but I can lend some help for such a nice project.
>
> Best,
> Bogdan
>
>>
>> Jonas
>>
>>
>>> Hi Jonas
>>>
>>> eLua is a volunteer project so things only get done when people have time. I think in the past year or so, some of the core developers have had a lot on their plates.
>>>
>>> Just curious, have you tried gcc 4.6 ? On other lists I have heard about some issue with 4.7, perhaps there have been significant changes with 4.7
>>>
>>>
>>> -Patrick
>>>
>>>
>>> On 12-09-12 02:42 PM, Jonas Schievink wrote:
>>>> After I saw my Arduino Mega uselessly lying around, I though that having Lua on that thing would make it much more useful (or at least it would be a semi-useful experiment). Searching the internet, I could not find any existing ports for AVRs. Porting eLua to AVR should be possible when using an ATmega128 or 256 with a bit of external SRAM using the XMEM interface. Newlib is also available for AVR (however it seems to be not much more useful than the default avr-libc).
>>>> So here's the question: Why isn't there a eLua port for AVR?
>>>> Meanwhile I've started my own try of porting, but I can't get gcc 4.7.1 to compile/work with newlib (maybe the wrong version?)... GCC seems to be really bugged at the time (can't find registers to spill and such weird errors), or it's because I've never compiled a compiler myself and have no experience... Any advices on that one?
>>>>
>>>> PS: This is my first mail ever in a mailing list, so please have patience with me :-)
>>>> _______________________________________________
>>>> eLua-dev mailing list
>>>> [hidden email]
>>>> https://lists.berlios.de/mailman/listinfo/elua-dev
>>>>
>> _______________________________________________
>> eLua-dev mailing list
>> [hidden email]
>> https://lists.berlios.de/mailman/listinfo/elua-dev
> _______________________________________________
> eLua-dev mailing list
> [hidden email]
> https://lists.berlios.de/mailman/listinfo/elua-dev
_______________________________________________
eLua-dev mailing list
[hidden email]
https://lists.berlios.de/mailman/listinfo/elua-dev
jschievink jschievink
Reply | Threaded
Open this post in threaded view
|

Re: Still no eLua for AVR?

Okay, compiling kinda worked. I got a lot of warnings and had to fix
some headers (avr-libc gets included when a file is found in newlib and
avr-libc), but it compiled then. It generated a 533 kb big .elf file
which I tried to convert to intel hex format (for burning with avrdude),
but the resulting file was only a few bytes... So I used avr-objdump to
disassemble the .elf file and found out that the only content of the
.text section was the default initialization code. So all eLua code got
stripped out somehow.
Does anyone has a clue of what's going on there?

> Thanks for your support, everyone!
> I finally built avr-gcc with in-tree builds of avr-libc and newlib (really: I have no clue if using two libc's can even work, but I need avr-libc as it defines registers, ports and everything else). It invoked the wrong assembler first (normal as instead of avr-as), but I fixed it with a symlink (there's probably a configure option that fixes that). The avr-libc in-tree build didn't work (and failed silently), but I compiled it after avr-gcc and installed it using the same prefix. A test-program has compiled good and runs fine (it just flashes a LED so I don't know if everything works yet).
> I'll try compiling eLua now!
>
> ~ Jonas
>
>
>> Hi,
>>
>> On Wed, Sep 12, 2012 at 10:30 PM, Jonas Schievink <[hidden email]> wrote:
>>> Well, I kind of expected that someone already did a port, because I can't be the only one who wants to run eLua on an AVR ;-)
>>> But the internet said "No" and now I've to do it when I want to use Lua (which is kinda good for collecting experience and helping others).
>>> Please don't misunderstand me, I really appreciate the time that all those people spend on making free software!
>>> It took me a lot of time compiling avr-gcc 4.7.1 but I guess I'll try 4.6 in the next days. I have the feeling that I'll fail anyways because I never used Newlib before and have no clue of how it will work together with eLua and my Arduino. I'll post my success/failure when I tried it!
>> Good luck and please keep up posted! I'm personally focusing on 32-bit
>> architectures, but I can lend some help for such a nice project.
>>
>> Best,
>> Bogdan
>>
>>> Jonas
>>>
>>>
>>>> Hi Jonas
>>>>
>>>> eLua is a volunteer project so things only get done when people have time. I think in the past year or so, some of the core developers have had a lot on their plates.
>>>>
>>>> Just curious, have you tried gcc 4.6 ? On other lists I have heard about some issue with 4.7, perhaps there have been significant changes with 4.7
>>>>
>>>>
>>>> -Patrick
>>>>
>>>>
>>>> On 12-09-12 02:42 PM, Jonas Schievink wrote:
>>>>> After I saw my Arduino Mega uselessly lying around, I though that having Lua on that thing would make it much more useful (or at least it would be a semi-useful experiment). Searching the internet, I could not find any existing ports for AVRs. Porting eLua to AVR should be possible when using an ATmega128 or 256 with a bit of external SRAM using the XMEM interface. Newlib is also available for AVR (however it seems to be not much more useful than the default avr-libc).
>>>>> So here's the question: Why isn't there a eLua port for AVR?
>>>>> Meanwhile I've started my own try of porting, but I can't get gcc 4.7.1 to compile/work with newlib (maybe the wrong version?)... GCC seems to be really bugged at the time (can't find registers to spill and such weird errors), or it's because I've never compiled a compiler myself and have no experience... Any advices on that one?
>>>>>
>>>>> PS: This is my first mail ever in a mailing list, so please have patience with me :-)
>>>>> _______________________________________________
>>>>> eLua-dev mailing list
>>>>> [hidden email]
>>>>> https://lists.berlios.de/mailman/listinfo/elua-dev
>>>>>
>>> _______________________________________________
>>> eLua-dev mailing list
>>> [hidden email]
>>> https://lists.berlios.de/mailman/listinfo/elua-dev
>> _______________________________________________
>> eLua-dev mailing list
>> [hidden email]
>> https://lists.berlios.de/mailman/listinfo/elua-dev
> _______________________________________________
> eLua-dev mailing list
> [hidden email]
> https://lists.berlios.de/mailman/listinfo/elua-dev
>

_______________________________________________
eLua-dev mailing list
[hidden email]
https://lists.berlios.de/mailman/listinfo/elua-dev
funlw65 funlw65
Reply | Threaded
Open this post in threaded view
|

Re: Still no eLua for AVR?

He, he, dead code removal? Just kidding... :D

On Sat, Sep 15, 2012 at 6:43 PM, Jonas Schievink <[hidden email]> wrote:
Okay, compiling kinda worked. I got a lot of warnings and had to fix some headers (avr-libc gets included when a file is found in newlib and avr-libc), but it compiled then. It generated a 533 kb big .elf file which I tried to convert to intel hex format (for burning with avrdude), but the resulting file was only a few bytes... So I used avr-objdump to disassemble the .elf file and found out that the only content of the .text section was the default initialization code. So all eLua code got stripped out somehow.
Does anyone has a clue of what's going on there?


Thanks for your support, everyone!
I finally built avr-gcc with in-tree builds of avr-libc and newlib (really: I have no clue if using two libc's can even work, but I need avr-libc as it defines registers, ports and everything else). It invoked the wrong assembler first (normal as instead of avr-as), but I fixed it with a symlink (there's probably a configure option that fixes that). The avr-libc in-tree build didn't work (and failed silently), but I compiled it after avr-gcc and installed it using the same prefix. A test-program has compiled good and runs fine (it just flashes a LED so I don't know if everything works yet).
I'll try compiling eLua now!

~ Jonas


Hi,

On Wed, Sep 12, 2012 at 10:30 PM, Jonas Schievink <[hidden email]> wrote:
Well, I kind of expected that someone already did a port, because I can't be the only one who wants to run eLua on an AVR ;-)
But the internet said "No" and now I've to do it when I want to use Lua (which is kinda good for collecting experience and helping others).
Please don't misunderstand me, I really appreciate the time that all those people spend on making free software!
It took me a lot of time compiling avr-gcc 4.7.1 but I guess I'll try 4.6 in the next days. I have the feeling that I'll fail anyways because I never used Newlib before and have no clue of how it will work together with eLua and my Arduino. I'll post my success/failure when I tried it!
Good luck and please keep up posted! I'm personally focusing on 32-bit
architectures, but I can lend some help for such a nice project.

Best,
Bogdan

Jonas


Hi Jonas

eLua is a volunteer project so things only get done when people have time. I think in the past year or so, some of the core developers have had a lot on their plates.

Just curious, have you tried gcc 4.6 ? On other lists I have heard about some issue with 4.7, perhaps there have been significant changes with 4.7


-Patrick


On 12-09-12 02:42 PM, Jonas Schievink wrote:
After I saw my Arduino Mega uselessly lying around, I though that having Lua on that thing would make it much more useful (or at least it would be a semi-useful experiment). Searching the internet, I could not find any existing ports for AVRs. Porting eLua to AVR should be possible when using an ATmega128 or 256 with a bit of external SRAM using the XMEM interface. Newlib is also available for AVR (however it seems to be not much more useful than the default avr-libc).
So here's the question: Why isn't there a eLua port for AVR?
Meanwhile I've started my own try of porting, but I can't get gcc 4.7.1 to compile/work with newlib (maybe the wrong version?)... GCC seems to be really bugged at the time (can't find registers to spill and such weird errors), or it's because I've never compiled a compiler myself and have no experience... Any advices on that one?

PS: This is my first mail ever in a mailing list, so please have patience with me :-)
_______________________________________________
eLua-dev mailing list
[hidden email]
https://lists.berlios.de/mailman/listinfo/elua-dev

_______________________________________________
eLua-dev mailing list
[hidden email]
https://lists.berlios.de/mailman/listinfo/elua-dev
_______________________________________________
eLua-dev mailing list
[hidden email]
https://lists.berlios.de/mailman/listinfo/elua-dev
_______________________________________________
eLua-dev mailing list
[hidden email]
https://lists.berlios.de/mailman/listinfo/elua-dev


_______________________________________________
eLua-dev mailing list
[hidden email]
https://lists.berlios.de/mailman/listinfo/elua-dev



--
Vasi

_______________________________________________
eLua-dev mailing list
[hidden email]
https://lists.berlios.de/mailman/listinfo/elua-dev
jschievink jschievink
Reply | Threaded
Open this post in threaded view
|

Re: Still no eLua for AVR?

Actually I think that is what's going on :D
But how the linker comes to the conclusion that every single byte of code is dead is the real question... It even compiles the main.c file fine and because that includes the "int main()" at least that should not be removed...

Here is the compiler invokation:
avr-gcc -o src/main.o -c -Os -fomit-frame-pointer -ffunction-sections -fdata-sections -fno-strict-aliasing -Wall -DBUFSIZ=512 -DELUA_BOARD=ARDUINO-MEGA -DELUA_BOARD_ARDUINOMEGA -DELUA_CPU=ATMEGA2560 -DELUA_CPU_ATMEGA2560 -DELUA_ENDIAN_LITTLE -DELUA_PLATFORM=AVR -DELUA_PLATFORM_AVR -DLUA_NUMBER_INTEGRAL -DLUA_OPTIMIZE_MEMORY=2 -DUSE_SIMPLE_ALLOCATOR -D__BUFSIZ__=128 -Iinc -Iinc/newlib -Iinc/remotefs -Isrc/platform -Isrc/lua -Isrc/modules -Isrc/platform/avr -Isrc/uip -Isrc/fatfs src/main.c

And here the linker invokation:
avr-gcc -o elua_lualong_atmega2560.elf -nostartfiles -nostdlib -Wl,--gc-sections -Wl,--allow-multiple-definition -Wl,--relax src/main.o src/romfs.o src/semifs.o src/xmodem.o src/shell.o src/term.o src/common.o src/common_tmr.o src/buf.o src/elua_adc.o src/dlmalloc.o src/salloc.o src/luarpc_elua_uart.o src/elua_int.o src/linenoise.o src/common_uart.o src/eluarpc.o src/elua_mmc.o src/mmcfs.o src/fatfs/ff.o src/fatfs/ccsbcs.o src/platform/avr/platform.o src/newlib/devman.o src/newlib/stubs.o src/newlib/genstd.o src/newlib/stdtcp.o src/elua_uip.o src/uip/uip_arp.o src/uip/uip.o src/uip/uiplib.o src/uip/dhcpc.o src/uip/psock.o src/uip/resolv.o src/uip/uip-neighbor.o src/lua/lapi.o src/lua/lcode.o src/lua/ldebug.o src/lua/ldo.o src/lua/ldump.o src/lua/lfunc.o src/lua/lgc.o src/lua/llex.o src/lua/lmem.o src/lua/lobject.o src/lua/lopcodes.o src/lua/lparser.o src/lua/lstate.o src/lua/lstring.o src/lua/ltable.o src/lua/ltm.o src/lua/lundump.o src/lua/lvm.o src/lua/lzio.o src/lua/lauxlib.o src/lua/lbaselib.o src/lua/ldblib.o src/lua/liolib.o src/lua/lmathlib.o src/lua/loslib.o src/lua/ltablib.o src/lua/lstrlib.o src/lua/loadlib.o src/lua/linit.o src/lua/lua.o src/lua/lrotable.o src/lua/legc.o src/modules/pio.o src/modules/spi.o src/modules/tmr.o src/modules/pd.o src/modules/uart.o src/modules/term.o src/modules/pwm.o src/modules/lpack.o src/modules/bit.o src/modules/net.o src/modules/cpu.o src/modules/adc.o src/modules/can.o src/modules/luarpc.o src/modules/bitarray.o src/modules/elua.o src/modules/i2c.o src/remotefs/remotefs.o src/remotefs/client.o src/remotefs/elua_os_io.o src/remotefs/elua_rfs.o -lc -lgcc -lm

I don't have that much experience with all those gcc options. The ones I used are mostly copied from the avr32 platoform.

Jonas


He, he, dead code removal? Just kidding... :D

On Sat, Sep 15, 2012 at 6:43 PM, Jonas Schievink <[hidden email]> wrote:
Okay, compiling kinda worked. I got a lot of warnings and had to fix some headers (avr-libc gets included when a file is found in newlib and avr-libc), but it compiled then. It generated a 533 kb big .elf file which I tried to convert to intel hex format (for burning with avrdude), but the resulting file was only a few bytes... So I used avr-objdump to disassemble the .elf file and found out that the only content of the .text section was the default initialization code. So all eLua code got stripped out somehow.
Does anyone has a clue of what's going on there?


Thanks for your support, everyone!
I finally built avr-gcc with in-tree builds of avr-libc and newlib (really: I have no clue if using two libc's can even work, but I need avr-libc as it defines registers, ports and everything else). It invoked the wrong assembler first (normal as instead of avr-as), but I fixed it with a symlink (there's probably a configure option that fixes that). The avr-libc in-tree build didn't work (and failed silently), but I compiled it after avr-gcc and installed it using the same prefix. A test-program has compiled good and runs fine (it just flashes a LED so I don't know if everything works yet).
I'll try compiling eLua now!

~ Jonas


Hi,

On Wed, Sep 12, 2012 at 10:30 PM, Jonas Schievink <[hidden email]> wrote:
Well, I kind of expected that someone already did a port, because I can't be the only one who wants to run eLua on an AVR ;-)
But the internet said "No" and now I've to do it when I want to use Lua (which is kinda good for collecting experience and helping others).
Please don't misunderstand me, I really appreciate the time that all those people spend on making free software!
It took me a lot of time compiling avr-gcc 4.7.1 but I guess I'll try 4.6 in the next days. I have the feeling that I'll fail anyways because I never used Newlib before and have no clue of how it will work together with eLua and my Arduino. I'll post my success/failure when I tried it!
Good luck and please keep up posted! I'm personally focusing on 32-bit
architectures, but I can lend some help for such a nice project.

Best,
Bogdan

Jonas


Hi Jonas

eLua is a volunteer project so things only get done when people have time. I think in the past year or so, some of the core developers have had a lot on their plates.

Just curious, have you tried gcc 4.6 ? On other lists I have heard about some issue with 4.7, perhaps there have been significant changes with 4.7


-Patrick


On 12-09-12 02:42 PM, Jonas Schievink wrote:
After I saw my Arduino Mega uselessly lying around, I though that having Lua on that thing would make it much more useful (or at least it would be a semi-useful experiment). Searching the internet, I could not find any existing ports for AVRs. Porting eLua to AVR should be possible when using an ATmega128 or 256 with a bit of external SRAM using the XMEM interface. Newlib is also available for AVR (however it seems to be not much more useful than the default avr-libc).
So here's the question: Why isn't there a eLua port for AVR?
Meanwhile I've started my own try of porting, but I can't get gcc 4.7.1 to compile/work with newlib (maybe the wrong version?)... GCC seems to be really bugged at the time (can't find registers to spill and such weird errors), or it's because I've never compiled a compiler myself and have no experience... Any advices on that one?

PS: This is my first mail ever in a mailing list, so please have patience with me :-)
_______________________________________________
eLua-dev mailing list
[hidden email]
https://lists.berlios.de/mailman/listinfo/elua-dev

_______________________________________________
eLua-dev mailing list
[hidden email]
https://lists.berlios.de/mailman/listinfo/elua-dev
_______________________________________________
eLua-dev mailing list
[hidden email]
https://lists.berlios.de/mailman/listinfo/elua-dev
_______________________________________________
eLua-dev mailing list
[hidden email]
https://lists.berlios.de/mailman/listinfo/elua-dev


_______________________________________________
eLua-dev mailing list
[hidden email]
https://lists.berlios.de/mailman/listinfo/elua-dev



--
Vasi


_______________________________________________
eLua-dev mailing list
[hidden email]
https://lists.berlios.de/mailman/listinfo/elua-dev


_______________________________________________
eLua-dev mailing list
[hidden email]
https://lists.berlios.de/mailman/listinfo/elua-dev
jschievink jschievink
Reply | Threaded
Open this post in threaded view
|

Re: Still no eLua for AVR?

It WAS dead code removal! Without using "-Wl,--gc-sections" it shows linking errors because I didn't implement any of the platform functions. I wondered why it compiled fine before, though... Anyways, gotta implement those platform specific functions now :-)

Jonas


Actually I think that is what's going on :D
But how the linker comes to the conclusion that every single byte of code is dead is the real question... It even compiles the main.c file fine and because that includes the "int main()" at least that should not be removed...

Here is the compiler invokation:
avr-gcc -o src/main.o -c -Os -fomit-frame-pointer -ffunction-sections -fdata-sections -fno-strict-aliasing -Wall -DBUFSIZ=512 -DELUA_BOARD=ARDUINO-MEGA -DELUA_BOARD_ARDUINOMEGA -DELUA_CPU=ATMEGA2560 -DELUA_CPU_ATMEGA2560 -DELUA_ENDIAN_LITTLE -DELUA_PLATFORM=AVR -DELUA_PLATFORM_AVR -DLUA_NUMBER_INTEGRAL -DLUA_OPTIMIZE_MEMORY=2 -DUSE_SIMPLE_ALLOCATOR -D__BUFSIZ__=128 -Iinc -Iinc/newlib -Iinc/remotefs -Isrc/platform -Isrc/lua -Isrc/modules -Isrc/platform/avr -Isrc/uip -Isrc/fatfs src/main.c

And here the linker invokation:
avr-gcc -o elua_lualong_atmega2560.elf -nostartfiles -nostdlib -Wl,--gc-sections -Wl,--allow-multiple-definition -Wl,--relax src/main.o src/romfs.o src/semifs.o src/xmodem.o src/shell.o src/term.o src/common.o src/common_tmr.o src/buf.o src/elua_adc.o src/dlmalloc.o src/salloc.o src/luarpc_elua_uart.o src/elua_int.o src/linenoise.o src/common_uart.o src/eluarpc.o src/elua_mmc.o src/mmcfs.o src/fatfs/ff.o src/fatfs/ccsbcs.o src/platform/avr/platform.o src/newlib/devman.o src/newlib/stubs.o src/newlib/genstd.o src/newlib/stdtcp.o src/elua_uip.o src/uip/uip_arp.o src/uip/uip.o src/uip/uiplib.o src/uip/dhcpc.o src/uip/psock.o src/uip/resolv.o src/uip/uip-neighbor.o src/lua/lapi.o src/lua/lcode.o src/lua/ldebug.o src/lua/ldo.o src/lua/ldump.o src/lua/lfunc.o src/lua/lgc.o src/lua/llex.o src/lua/lmem.o src/lua/lobject.o src/lua/lopcodes.o src/lua/lparser.o src/lua/lstate.o src/lua/lstring.o src/lua/ltable.o src/lua/ltm.o src/lua/lundump.o src/lua/lvm.o src/lua/lzio.o src/lua/lauxlib.o src/lua/lbaselib.o src/lua/ldblib.o src/lua/liolib.o src/lua/lmathlib.o src/lua/loslib.o src/lua/ltablib.o src/lua/lstrlib.o src/lua/loadlib.o src/lua/linit.o src/lua/lua.o src/lua/lrotable.o src/lua/legc.o src/modules/pio.o src/modules/spi.o src/modules/tmr.o src/modules/pd.o src/modules/uart.o src/modules/term.o src/modules/pwm.o src/modules/lpack.o src/modules/bit.o src/modules/net.o src/modules/cpu.o src/modules/adc.o src/modules/can.o src/modules/luarpc.o src/modules/bitarray.o src/modules/elua.o src/modules/i2c.o src/remotefs/remotefs.o src/remotefs/client.o src/remotefs/elua_os_io.o src/remotefs/elua_rfs.o -lc -lgcc -lm

I don't have that much experience with all those gcc options. The ones I used are mostly copied from the avr32 platoform.

Jonas


He, he, dead code removal? Just kidding... :D

On Sat, Sep 15, 2012 at 6:43 PM, Jonas Schievink <[hidden email]> wrote:
Okay, compiling kinda worked. I got a lot of warnings and had to fix some headers (avr-libc gets included when a file is found in newlib and avr-libc), but it compiled then. It generated a 533 kb big .elf file which I tried to convert to intel hex format (for burning with avrdude), but the resulting file was only a few bytes... So I used avr-objdump to disassemble the .elf file and found out that the only content of the .text section was the default initialization code. So all eLua code got stripped out somehow.
Does anyone has a clue of what's going on there?


Thanks for your support, everyone!
I finally built avr-gcc with in-tree builds of avr-libc and newlib (really: I have no clue if using two libc's can even work, but I need avr-libc as it defines registers, ports and everything else). It invoked the wrong assembler first (normal as instead of avr-as), but I fixed it with a symlink (there's probably a configure option that fixes that). The avr-libc in-tree build didn't work (and failed silently), but I compiled it after avr-gcc and installed it using the same prefix. A test-program has compiled good and runs fine (it just flashes a LED so I don't know if everything works yet).
I'll try compiling eLua now!

~ Jonas


Hi,

On Wed, Sep 12, 2012 at 10:30 PM, Jonas Schievink <[hidden email]> wrote:
Well, I kind of expected that someone already did a port, because I can't be the only one who wants to run eLua on an AVR ;-)
But the internet said "No" and now I've to do it when I want to use Lua (which is kinda good for collecting experience and helping others).
Please don't misunderstand me, I really appreciate the time that all those people spend on making free software!
It took me a lot of time compiling avr-gcc 4.7.1 but I guess I'll try 4.6 in the next days. I have the feeling that I'll fail anyways because I never used Newlib before and have no clue of how it will work together with eLua and my Arduino. I'll post my success/failure when I tried it!
Good luck and please keep up posted! I'm personally focusing on 32-bit
architectures, but I can lend some help for such a nice project.

Best,
Bogdan

Jonas


Hi Jonas

eLua is a volunteer project so things only get done when people have time. I think in the past year or so, some of the core developers have had a lot on their plates.

Just curious, have you tried gcc 4.6 ? On other lists I have heard about some issue with 4.7, perhaps there have been significant changes with 4.7


-Patrick


On 12-09-12 02:42 PM, Jonas Schievink wrote:
After I saw my Arduino Mega uselessly lying around, I though that having Lua on that thing would make it much more useful (or at least it would be a semi-useful experiment). Searching the internet, I could not find any existing ports for AVRs. Porting eLua to AVR should be possible when using an ATmega128 or 256 with a bit of external SRAM using the XMEM interface. Newlib is also available for AVR (however it seems to be not much more useful than the default avr-libc).
So here's the question: Why isn't there a eLua port for AVR?
Meanwhile I've started my own try of porting, but I can't get gcc 4.7.1 to compile/work with newlib (maybe the wrong version?)... GCC seems to be really bugged at the time (can't find registers to spill and such weird errors), or it's because I've never compiled a compiler myself and have no experience... Any advices on that one?

PS: This is my first mail ever in a mailing list, so please have patience with me :-)
_______________________________________________
eLua-dev mailing list
[hidden email]
https://lists.berlios.de/mailman/listinfo/elua-dev

_______________________________________________
eLua-dev mailing list
[hidden email]
https://lists.berlios.de/mailman/listinfo/elua-dev
_______________________________________________
eLua-dev mailing list
[hidden email]
https://lists.berlios.de/mailman/listinfo/elua-dev
_______________________________________________
eLua-dev mailing list
[hidden email]
https://lists.berlios.de/mailman/listinfo/elua-dev


_______________________________________________
eLua-dev mailing list
[hidden email]
https://lists.berlios.de/mailman/listinfo/elua-dev



--
Vasi


_______________________________________________
eLua-dev mailing list
[hidden email]
https://lists.berlios.de/mailman/listinfo/elua-dev



_______________________________________________
eLua-dev mailing list
[hidden email]
https://lists.berlios.de/mailman/listinfo/elua-dev


_______________________________________________
eLua-dev mailing list
[hidden email]
https://lists.berlios.de/mailman/listinfo/elua-dev