PATCH: fix std_get_desc() stub type

classic Classic list List threaded Threaded
3 messages Options
Martin Guy Martin Guy
Reply | Threaded
Open this post in threaded view
|

PATCH: fix std_get_desc() stub type

Hi again
  Here's tiny patch to fix a type error when building with neither
BUILD_CON_GENERIC nor BUILD_CON_TCP defined

  I guess I should introduce myself: I'm porting eLua to a new avr32
platform with 128KB of flash. The good news is that it *does* still
fit in 128KB, just, but only if all BUILD_ options and all ROM modules
are disabled, so apart from the porting, I'll be focussing on various
ways of reducing the static code size so that I can enable some of the
modules we will be needing.

Cheers

   M

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

elua-fix-std_get_desc-stub-type.patch (462 bytes) Download Attachment
BogdanM BogdanM
Reply | Threaded
Open this post in threaded view
|

Re: PATCH: fix std_get_desc() stub type

On Fri, Jul 30, 2010 at 3:41 PM, Martin Guy <[hidden email]> wrote:
> Hi again
>  Here's tiny patch to fix a type error when building with neither
> BUILD_CON_GENERIC nor BUILD_CON_TCP defined

Thanks!

>  I guess I should introduce myself: I'm porting eLua to a new avr32
> platform with 128KB of flash. The good news is that it *does* still
> fit in 128KB, just, but only if all BUILD_ options and all ROM modules
> are disabled, so apart from the porting, I'll be focussing on various
> ways of reducing the static code size so that I can enable some of the
> modules we will be needing.

Excellent news. Some ideas:

- do you require the compiler? if no, you can build the image without
the Lua compiler (which is fine if you just need to execute bytecode).
There's no explicit support in eLua for this, but look in a standard
Lua 5.1.4 source distribution at etc/noparser.c for a good starting
point.
- do you need floating point in eLua? If not, you can try to compile
in integer mode (lualong). Not sure if this will save much space
though.
- do you feel brave? :) If so, you can start re-writing the C library :)

And finally, something that I'd like you to check since you're going
this route: can you please try and see if eLua compiles under AVR32
without libm (remove -lm from the link options) if you don't include
the Lua math library?

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

Re: PATCH: fix std_get_desc() stub type

On 7/30/10, Bogdan Marinescu <[hidden email]> wrote:

>  >  I guess I should introduce myself: I'm porting eLua to a new avr32
>  > platform with 128KB of flash. The good news is that it *does* still
>  > fit in 128KB, just, but only if all BUILD_ options and all ROM modules
>  > are disabled, so apart from the porting, I'll be focussing on various
>  > ways of reducing the static code size so that I can enable some of the
>  > modules we will be needing.
>
> Excellent news. Some ideas:
>
>  - do you require the compiler? if no, you can build the image without
>  the Lua compiler (which is fine if you just need to execute bytecode).
>  There's no explicit support in eLua for this, but look in a standard
>  Lua 5.1.4 source distribution at etc/noparser.c for a good starting
>  point.

That's a very interesting idea, though we were hoping to allow people
simply to write a Lua program on an SD card, put it in and have it
work.

>  - do you need floating point in eLua? If not, you can try to compile
>  in integer mode (lualong). Not sure if this will save much space
>  though.

It saves 44592 bytes of code and 44 of initialized data.

>  - do you feel brave? :) If so, you can start re-writing the C library :)
Thanks! :)

The current low-hanging fruit i see is the large number of strings in
the binary, including 5KB of sys_errlist[], easily dropped by
providing a dummy strerror() function, and lots of verbose syntax
error messages in src/lua/ldebug.c. However, I am reluctant to change
the src/lua section, since that makes it more difficult to follow the
upstream sources. I might try ripping out the debug-hooks interface,
if that is possible without breaking the interpreter.

>  And finally, something that I'd like you to check since you're going
>  this route: can you please try and see if eLua compiles under AVR32
>  without libm (remove -lm from the link options) if you don't include
>  the Lua math library?

I can't see where to do that in the source (the only -lm I see is when
linking the native cross-compiler in cross-lua.py) but I just ran the
final "avr32-gcc -l elua-lualong-* ..." command without the -lm and it
links fine giving the same output file - tested with atevk1100 with
its usual selection of  modules and ROM libraries.

Thanks again

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