lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


2015-04-07 11:04 GMT+02:00 Michal Kottman <michal.kottman@gmail.com>:
>
> On Apr 6, 2015 15:03, "Dirk Laurie" <dirk.laurie@gmail.com> wrote:
>>
>> I started hacking the `linux` option in the Makefile, when the
>> thought struck me: On a list lile this, surely someone has
>> succeeded in building Lua on an Android with the aid of the
>> Terminal IDE app. It has gcc 4.4.0 and GNU Make 3.82.
>
> Yes it is possible, unfortunately I upgraded to Android 5 and Terminal IDE
> stopped working (Android 5 requires PIE for all applications, Terminal IDE
> would have to be rebuilt), so I can't verify the procedure.

Thanks, this reply was very helpful. I needed to do a bit more, see
below, but after reading this it was obvious.

>
> I had to modify the Lua src/Makefile and do the following:
>
> --- Makefile
> +++ Makefile.terminalide
> @@ -6,16 +6,16 @@
> # Your platform. See PLATS for possible values.
> PLAT= none
>
> -CC= gcc
> -CFLAGS= -O2 -Wall -Wextra -DLUA_COMPAT_ALL $(SYSCFLAGS) $(MYCFLAGS)
> -LDFLAGS= $(SYSLDFLAGS) $(MYLDFLAGS)
> +CC= terminal-gcc
> +CFLAGS= -fPIE -O2 -Wall -Wextra -DLUA_COMPAT_ALL $(SYSCFLAGS) $(MYCFLAGS)
> +LDFLAGS= -Bsymbolic $(SYSLDFLAGS) $(MYLDFLAGS)
> LIBS= -lm $(SYSLIBS) $(MYLIBS)
>
> -AR= ar rcu
> -RANLIB= ranlib
> +AR= arm-eabi-ar rcu
> +RANLIB= arm-eabi-ranlib
> RM= rm -f
>
> Notice replacing CC, AR and RANLIB, and -fPIE and -Bsymbolic. I can't
> explain why those are needed, but are a result of a lot of frustration,
> experimentation, and StackOverflow/Google searching to find something that
> work. Also, another change I did is modifying llex.c to hardcode
> ls->decpoint = '.'.

Also in liolib.c.

Since I don't have readline (can one get it?) I needed modifications
to lconfig.h and the Makefile too.

One is so used to clean Lua compilations that the following warning
was almost a shock:

llex.c: In function 'readdecesc':
llex.c:398: warning: comparison between signed and unsigned integer expressions