Luvit on embedded device

238 views
Skip to first unread message

Anthony Viallard

unread,
Mar 25, 2015, 9:57:10 AM3/25/15
to lu...@googlegroups.com
Hi group,

I'm interrested by using luvit on my ARM embedded device. But, I'm little bit confused about how to do this...

Actually, I began to use node.js on my embedded device to implement quickly an API REST. I was enjoying it until I saw the memory consumption. 36Mb ! So, after a couple of search on internet, I found luvit and this is why I'm here right now.

So, here some points which annoying me:
 * I use buildroot. So, I can do cross-compilation very easily with this tool. As I understand, I need to cross compil the luvi tool. After that, I will be able to generate the luvit and lit binaries from my ARM device. But this workflow doesn't allow me to generate the luvit and lit binaries from my amd64 computer and buildroot. Am I right ? Is there a way to cross-compil the luvit program from my amd64 to my arm5 arch (armv5tejl) ? As I understand, I can use lit from my computer to retrieve and update lua files (this is what I did with npm for node.js) so I don't have the need to cross-compil lit.
 * Moreover, I saw in the luvi repository the use of git submodule to retrieve openssl, luv, zlib, ... And, the makefile generates a static binary with all dependencies in it. Not really a good thing for me who use embedded device with few memory available... It would be nice to have a binary with dynamic link to these shared libraries. Why don't you use autotools ? It will be easier to cross-compil and will make me happy :) If you don't familiar with autotools, I can give you some help about this.

Otherwise, can I use directly the lua source code of luvit with the lua interpreter ? Maybe I can make a bootstrap program in C to emulate your luvit binary ?

Anthony.

Jörg Krause

unread,
Apr 4, 2015, 6:04:58 PM4/4/15
to lu...@googlegroups.com
Hi Anthony,

I use Buildroot too and I successfully cross-compiled luv, luvi, and luvit for ARMv5. For this to get work I patched the CMakelist files to use the shared libraries from Buildroot. luvit is a special build since it is luvi plus an appended zip archive of the lua sources.

I'm preparing packages for Buildroot, and I will submit patches to my forked repos within the next days.

Jörg.

Jörg Krause

unread,
Apr 4, 2015, 6:28:40 PM4/4/15
to lu...@googlegroups.com
Some more remarks.

You cannot cross-compile modules with lit as you can do with npm. At least yet. It could be possible since luajit is able to build for ARM, mips, and several other targets.

I'm using Buildroots cmake-package infrastructure and some self written CMake find_package files for locating the libraries. This is like pkg-config for autotools I guess.

I also started an issue for luv at github about building luv: https://github.com/luvit/luv/issues/134

Jörg

Francisco D' Agostino

unread,
Jun 12, 2015, 12:31:39 AM6/12/15
to lu...@googlegroups.com
Hi Anthony, Jörg,
This is Francisco from Buenos Aires, Argentina, pleased to meet you! I'm fascinated with Luvit and their possibilities on embedded devices. 
I'm newbie about Lua/LuaJIT/Luvit/etc.

I'm interested in implementing Luvit on an ARM device too.
This device is an EFT-POS (Castles Technology VEGA 5000S) has a Broadcom BCM5892 ARMv61 SoC with Linux (without console access).

I need the Luvit runtime as a shared library in order to embed it on C/C++ code, simillar as Mono (http://www.mono-project.com/docs/advanced/embedding/) or Duktape (http://duktape.org/). Is it possible to obtain something like this?

I think I've to cross-compile Luvit using the toolchain provided by the manufacturer (arm-brcm-linux-gnueabi-xxxx over windows with cygwin) in order to obtain a .so compatible with the device but I don't have so much experience doing this.
I'd really really appreaciate any guidance and insight!

Regards,
Francisco

Tim Caswell

unread,
Jun 12, 2015, 3:08:53 PM6/12/15
to lu...@googlegroups.com
We talked on IRC.  The plan is to just use luajit + luv.

This provides the core value of luvit without worrying about zip assets and lit packages. Also it's considerably easier to cross-compile.

--
You received this message because you are subscribed to the Google Groups "luvit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to luvit+un...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Francisco D' Agostino

unread,
Jun 12, 2015, 8:10:06 PM6/12/15
to lu...@googlegroups.com
Thanks for all the help Tim, I've succesfully cross-compiled luajit using the following command: 

make HOST_CC="mingw32-gcc.exe -m32" CROSS=arm-brcm-linux-gnueabi- TARGET_CFLAGS="-mfloat-abi=soft" TARGET_SYS=Linux CFLAGS="-DLUAJIT_NO_EXP2 -DLUAJIT_NO_LOG2"

Regards,
Reply all
Reply to author
Forward
0 new messages