Building Lua 5.3 from Lua.org on FreeBSD

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
60 messages Options
123
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Building Lua 5.3 from Lua.org on FreeBSD

Russell Haley
Hi,

I've built lua a bunch of times on TrueOS (aka FreeBSD 12-Current)
using the files from git. I usually mangle the Makefile myself to use
clang and make it install where I want to.

Anyway, I have an arm board with FreeBSD 12-Current on it. I tried
building from the tarball provided by the lua.org website. I modified
the Makefile to use clang because, well, this is FreeBSD! I added the
CC=cc flag from osx target to the freebsd.

The following is my failed build output is below. For the record,
readline 6.3.8_1 installed with git and git seems to work fine.


freebsd@imx6:~/lua/lua-5.3.4/src % make freebsd
make all SYSCFLAGS="-DLUA_USE_LINUX" SYSLIBS="-Wl,-E -lreadline" CC=cc
cc  -O2 -Wall -Wextra -DLUA_COMPAT_5_2 -DLUA_USE_LINUX  -c lapi.c -o lapi.o
cc  -O2 -Wall -Wextra -DLUA_COMPAT_5_2 -DLUA_USE_LINUX  -c lcode.c -o lcode.o
cc  -O2 -Wall -Wextra -DLUA_COMPAT_5_2 -DLUA_USE_LINUX  -c lctype.c -o lctype.o
cc  -O2 -Wall -Wextra -DLUA_COMPAT_5_2 -DLUA_USE_LINUX  -c ldebug.c -o ldebug.o
cc  -O2 -Wall -Wextra -DLUA_COMPAT_5_2 -DLUA_USE_LINUX  -c ldo.c -o ldo.o
cc  -O2 -Wall -Wextra -DLUA_COMPAT_5_2 -DLUA_USE_LINUX  -c ldump.c -o ldump.o
cc  -O2 -Wall -Wextra -DLUA_COMPAT_5_2 -DLUA_USE_LINUX  -c lfunc.c -o lfunc.o
cc  -O2 -Wall -Wextra -DLUA_COMPAT_5_2 -DLUA_USE_LINUX  -c lgc.c -o lgc.o
cc  -O2 -Wall -Wextra -DLUA_COMPAT_5_2 -DLUA_USE_LINUX  -c llex.c -o llex.o
cc  -O2 -Wall -Wextra -DLUA_COMPAT_5_2 -DLUA_USE_LINUX  -c lmem.c -o lmem.o
cc  -O2 -Wall -Wextra -DLUA_COMPAT_5_2 -DLUA_USE_LINUX  -c lobject.c
-o lobject.o
cc  -O2 -Wall -Wextra -DLUA_COMPAT_5_2 -DLUA_USE_LINUX  -c lopcodes.c
-o lopcodes.o
cc  -O2 -Wall -Wextra -DLUA_COMPAT_5_2 -DLUA_USE_LINUX  -c lparser.c
-o lparser.o
cc  -O2 -Wall -Wextra -DLUA_COMPAT_5_2 -DLUA_USE_LINUX  -c lstate.c -o lstate.o
cc  -O2 -Wall -Wextra -DLUA_COMPAT_5_2 -DLUA_USE_LINUX  -c lstring.c
-o lstring.o
cc  -O2 -Wall -Wextra -DLUA_COMPAT_5_2 -DLUA_USE_LINUX  -c ltable.c -o ltable.o
cc  -O2 -Wall -Wextra -DLUA_COMPAT_5_2 -DLUA_USE_LINUX  -c ltm.c -o ltm.o
cc  -O2 -Wall -Wextra -DLUA_COMPAT_5_2 -DLUA_USE_LINUX  -c lundump.c
-o lundump.o
cc  -O2 -Wall -Wextra -DLUA_COMPAT_5_2 -DLUA_USE_LINUX  -c lvm.c -o lvm.o
cc  -O2 -Wall -Wextra -DLUA_COMPAT_5_2 -DLUA_USE_LINUX  -c lzio.c -o lzio.o
cc  -O2 -Wall -Wextra -DLUA_COMPAT_5_2 -DLUA_USE_LINUX  -c lauxlib.c
-o lauxlib.o
cc  -O2 -Wall -Wextra -DLUA_COMPAT_5_2 -DLUA_USE_LINUX  -c lbaselib.c
-o lbaselib.o
cc  -O2 -Wall -Wextra -DLUA_COMPAT_5_2 -DLUA_USE_LINUX  -c lbitlib.c
-o lbitlib.o
cc  -O2 -Wall -Wextra -DLUA_COMPAT_5_2 -DLUA_USE_LINUX  -c lcorolib.c
-o lcorolib.o
cc  -O2 -Wall -Wextra -DLUA_COMPAT_5_2 -DLUA_USE_LINUX  -c ldblib.c -o ldblib.o
cc  -O2 -Wall -Wextra -DLUA_COMPAT_5_2 -DLUA_USE_LINUX  -c liolib.c -o liolib.o
cc  -O2 -Wall -Wextra -DLUA_COMPAT_5_2 -DLUA_USE_LINUX  -c lmathlib.c
-o lmathlib.o
cc  -O2 -Wall -Wextra -DLUA_COMPAT_5_2 -DLUA_USE_LINUX  -c loslib.c -o loslib.o
cc  -O2 -Wall -Wextra -DLUA_COMPAT_5_2 -DLUA_USE_LINUX  -c lstrlib.c
-o lstrlib.o
cc  -O2 -Wall -Wextra -DLUA_COMPAT_5_2 -DLUA_USE_LINUX  -c ltablib.c
-o ltablib.o
cc  -O2 -Wall -Wextra -DLUA_COMPAT_5_2 -DLUA_USE_LINUX  -c lutf8lib.c
-o lutf8lib.o
cc  -O2 -Wall -Wextra -DLUA_COMPAT_5_2 -DLUA_USE_LINUX  -c loadlib.c
-o loadlib.o
cc  -O2 -Wall -Wextra -DLUA_COMPAT_5_2 -DLUA_USE_LINUX  -c linit.c -o linit.o
ar rcu liblua.a lapi.o lcode.o lctype.o ldebug.o ldo.o ldump.o lfunc.o
lgc.o llex.o  lmem.o lobject.o lopcodes.o lparser.o lstate.o lstring.o
ltable.o  ltm.o lundump.o lvm.o lzio.o lauxlib.o lbaselib.o lbitlib.o
lcorolib.o ldblib.o liolib.o  lmathlib.o loslib.o lstrlib.o ltablib.o
lutf8lib.o loadlib.o linit.o
ranlib liblua.a
cc  -O2 -Wall -Wextra -DLUA_COMPAT_5_2 -DLUA_USE_LINUX  -c lua.c -o lua.o
In file included from lua.c:12:
In file included from /usr/include/signal.h:40:
/usr/include/machine/ucontext.h:81:2: error: unknown type name
'size_t'; did you mean '__size_t'?
        size_t          mc_vfp_size;
        ^
/usr/include/machine/_types.h:87:20: note: '__size_t' declared here
typedef __uint32_t      __size_t;               /* sizeof() */
                        ^
lua.c:82:10: fatal error: 'readline/readline.h' file not found
#include <readline/readline.h>
         ^~~~~~~~~~~~~~~~~~~~~
2 errors generated.
*** Error code 1

Stop.
make[1]: stopped in /home/freebsd/lua/lua-5.3.4/src
*** Error code 1

Stop.
make: stopped in /home/freebsd/lua/lua-5.3.4/src


Thanks in advance,

Russ

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Building Lua 5.3 from Lua.org on FreeBSD

Charles Heywood
Depending on your system information you might need to use -I/path/to/readline/dir in your CFLAGS ?

On Fri, Jul 21, 2017, 22:49 Russell Haley <[hidden email]> wrote:
Hi,

I've built lua a bunch of times on TrueOS (aka FreeBSD 12-Current)
using the files from git. I usually mangle the Makefile myself to use
clang and make it install where I want to.

Anyway, I have an arm board with FreeBSD 12-Current on it. I tried
building from the tarball provided by the lua.org website. I modified
the Makefile to use clang because, well, this is FreeBSD! I added the
CC=cc flag from osx target to the freebsd.

The following is my failed build output is below. For the record,
readline 6.3.8_1 installed with git and git seems to work fine.


freebsd@imx6:~/lua/lua-5.3.4/src % make freebsd
make all SYSCFLAGS="-DLUA_USE_LINUX" SYSLIBS="-Wl,-E -lreadline" CC=cc
cc  -O2 -Wall -Wextra -DLUA_COMPAT_5_2 -DLUA_USE_LINUX  -c lapi.c -o lapi.o
cc  -O2 -Wall -Wextra -DLUA_COMPAT_5_2 -DLUA_USE_LINUX  -c lcode.c -o lcode.o
cc  -O2 -Wall -Wextra -DLUA_COMPAT_5_2 -DLUA_USE_LINUX  -c lctype.c -o lctype.o
cc  -O2 -Wall -Wextra -DLUA_COMPAT_5_2 -DLUA_USE_LINUX  -c ldebug.c -o ldebug.o
cc  -O2 -Wall -Wextra -DLUA_COMPAT_5_2 -DLUA_USE_LINUX  -c ldo.c -o ldo.o
cc  -O2 -Wall -Wextra -DLUA_COMPAT_5_2 -DLUA_USE_LINUX  -c ldump.c -o ldump.o
cc  -O2 -Wall -Wextra -DLUA_COMPAT_5_2 -DLUA_USE_LINUX  -c lfunc.c -o lfunc.o
cc  -O2 -Wall -Wextra -DLUA_COMPAT_5_2 -DLUA_USE_LINUX  -c lgc.c -o lgc.o
cc  -O2 -Wall -Wextra -DLUA_COMPAT_5_2 -DLUA_USE_LINUX  -c llex.c -o llex.o
cc  -O2 -Wall -Wextra -DLUA_COMPAT_5_2 -DLUA_USE_LINUX  -c lmem.c -o lmem.o
cc  -O2 -Wall -Wextra -DLUA_COMPAT_5_2 -DLUA_USE_LINUX  -c lobject.c
-o lobject.o
cc  -O2 -Wall -Wextra -DLUA_COMPAT_5_2 -DLUA_USE_LINUX  -c lopcodes.c
-o lopcodes.o
cc  -O2 -Wall -Wextra -DLUA_COMPAT_5_2 -DLUA_USE_LINUX  -c lparser.c
-o lparser.o
cc  -O2 -Wall -Wextra -DLUA_COMPAT_5_2 -DLUA_USE_LINUX  -c lstate.c -o lstate.o
cc  -O2 -Wall -Wextra -DLUA_COMPAT_5_2 -DLUA_USE_LINUX  -c lstring.c
-o lstring.o
cc  -O2 -Wall -Wextra -DLUA_COMPAT_5_2 -DLUA_USE_LINUX  -c ltable.c -o ltable.o
cc  -O2 -Wall -Wextra -DLUA_COMPAT_5_2 -DLUA_USE_LINUX  -c ltm.c -o ltm.o
cc  -O2 -Wall -Wextra -DLUA_COMPAT_5_2 -DLUA_USE_LINUX  -c lundump.c
-o lundump.o
cc  -O2 -Wall -Wextra -DLUA_COMPAT_5_2 -DLUA_USE_LINUX  -c lvm.c -o lvm.o
cc  -O2 -Wall -Wextra -DLUA_COMPAT_5_2 -DLUA_USE_LINUX  -c lzio.c -o lzio.o
cc  -O2 -Wall -Wextra -DLUA_COMPAT_5_2 -DLUA_USE_LINUX  -c lauxlib.c
-o lauxlib.o
cc  -O2 -Wall -Wextra -DLUA_COMPAT_5_2 -DLUA_USE_LINUX  -c lbaselib.c
-o lbaselib.o
cc  -O2 -Wall -Wextra -DLUA_COMPAT_5_2 -DLUA_USE_LINUX  -c lbitlib.c
-o lbitlib.o
cc  -O2 -Wall -Wextra -DLUA_COMPAT_5_2 -DLUA_USE_LINUX  -c lcorolib.c
-o lcorolib.o
cc  -O2 -Wall -Wextra -DLUA_COMPAT_5_2 -DLUA_USE_LINUX  -c ldblib.c -o ldblib.o
cc  -O2 -Wall -Wextra -DLUA_COMPAT_5_2 -DLUA_USE_LINUX  -c liolib.c -o liolib.o
cc  -O2 -Wall -Wextra -DLUA_COMPAT_5_2 -DLUA_USE_LINUX  -c lmathlib.c
-o lmathlib.o
cc  -O2 -Wall -Wextra -DLUA_COMPAT_5_2 -DLUA_USE_LINUX  -c loslib.c -o loslib.o
cc  -O2 -Wall -Wextra -DLUA_COMPAT_5_2 -DLUA_USE_LINUX  -c lstrlib.c
-o lstrlib.o
cc  -O2 -Wall -Wextra -DLUA_COMPAT_5_2 -DLUA_USE_LINUX  -c ltablib.c
-o ltablib.o
cc  -O2 -Wall -Wextra -DLUA_COMPAT_5_2 -DLUA_USE_LINUX  -c lutf8lib.c
-o lutf8lib.o
cc  -O2 -Wall -Wextra -DLUA_COMPAT_5_2 -DLUA_USE_LINUX  -c loadlib.c
-o loadlib.o
cc  -O2 -Wall -Wextra -DLUA_COMPAT_5_2 -DLUA_USE_LINUX  -c linit.c -o linit.o
ar rcu liblua.a lapi.o lcode.o lctype.o ldebug.o ldo.o ldump.o lfunc.o
lgc.o llex.o  lmem.o lobject.o lopcodes.o lparser.o lstate.o lstring.o
ltable.o  ltm.o lundump.o lvm.o lzio.o lauxlib.o lbaselib.o lbitlib.o
lcorolib.o ldblib.o liolib.o  lmathlib.o loslib.o lstrlib.o ltablib.o
lutf8lib.o loadlib.o linit.o
ranlib liblua.a
cc  -O2 -Wall -Wextra -DLUA_COMPAT_5_2 -DLUA_USE_LINUX  -c lua.c -o lua.o
In file included from lua.c:12:
In file included from /usr/include/signal.h:40:
/usr/include/machine/ucontext.h:81:2: error: unknown type name
'size_t'; did you mean '__size_t'?
        size_t          mc_vfp_size;
        ^
/usr/include/machine/_types.h:87:20: note: '__size_t' declared here
typedef __uint32_t      __size_t;               /* sizeof() */
                        ^
lua.c:82:10: fatal error: 'readline/readline.h' file not found
#include <readline/readline.h>
         ^~~~~~~~~~~~~~~~~~~~~
2 errors generated.
*** Error code 1

Stop.
make[1]: stopped in /home/freebsd/lua/lua-5.3.4/src
*** Error code 1

Stop.
make: stopped in /home/freebsd/lua/lua-5.3.4/src


Thanks in advance,

Russ

--
--
Ryan <[hidden email]>
Software Developer / System Administrator
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Building Lua 5.3 from Lua.org on FreeBSD

Russell Haley
Thank you. Thats the change I forgot I had made. I added the following
to Makefile:

MYCFLAGS=-I/usr/local/include
MYLDFLAGS=-L/usr/local/lib

And the readline error is gone. However:

freebsd@imx6:~/lua/lua-5.3.4/src % make freebsd
make all SYSCFLAGS="-DLUA_USE_LINUX" SYSLIBS="-Wl,-E -lreadline" CC=cc
cc  -O2 -Wall -Wextra -DLUA_COMPAT_5_2 -DLUA_USE_LINUX
-I/usr/local/include -c lua.c -o lua.o
In file included from lua.c:12:
In file included from /usr/include/signal.h:40:
/usr/include/machine/ucontext.h:81:2: error: unknown type name
'size_t'; did you mean '__size_t'?
        size_t          mc_vfp_size;
        ^
/usr/include/machine/_types.h:87:20: note: '__size_t' declared here
typedef __uint32_t      __size_t;               /* sizeof() */
                        ^
1 error generated.
*** Error code 1

Stop.
make[1]: stopped in /home/freebsd/lua/lua-5.3.4/src
*** Error code 1

Stop.
make: stopped in /home/freebsd/lua/lua-5.3.4/src





On Fri, Jul 21, 2017 at 8:51 PM, Charles Heywood <[hidden email]> wrote:

> Depending on your system information you might need to use
> -I/path/to/readline/dir in your CFLAGS ?
>
>
> On Fri, Jul 21, 2017, 22:49 Russell Haley <[hidden email]> wrote:
>>
>> Hi,
>>
>> I've built lua a bunch of times on TrueOS (aka FreeBSD 12-Current)
>> using the files from git. I usually mangle the Makefile myself to use
>> clang and make it install where I want to.
>>
>> Anyway, I have an arm board with FreeBSD 12-Current on it. I tried
>> building from the tarball provided by the lua.org website. I modified
>> the Makefile to use clang because, well, this is FreeBSD! I added the
>> CC=cc flag from osx target to the freebsd.
>>
>> The following is my failed build output is below. For the record,
>> readline 6.3.8_1 installed with git and git seems to work fine.
>>
>>
>> freebsd@imx6:~/lua/lua-5.3.4/src % make freebsd
>> make all SYSCFLAGS="-DLUA_USE_LINUX" SYSLIBS="-Wl,-E -lreadline" CC=cc
>> cc  -O2 -Wall -Wextra -DLUA_COMPAT_5_2 -DLUA_USE_LINUX  -c lapi.c -o
>> lapi.o
>> cc  -O2 -Wall -Wextra -DLUA_COMPAT_5_2 -DLUA_USE_LINUX  -c lcode.c -o
>> lcode.o
>> cc  -O2 -Wall -Wextra -DLUA_COMPAT_5_2 -DLUA_USE_LINUX  -c lctype.c -o
>> lctype.o
>> cc  -O2 -Wall -Wextra -DLUA_COMPAT_5_2 -DLUA_USE_LINUX  -c ldebug.c -o
>> ldebug.o
>> cc  -O2 -Wall -Wextra -DLUA_COMPAT_5_2 -DLUA_USE_LINUX  -c ldo.c -o ldo.o
>> cc  -O2 -Wall -Wextra -DLUA_COMPAT_5_2 -DLUA_USE_LINUX  -c ldump.c -o
>> ldump.o
>> cc  -O2 -Wall -Wextra -DLUA_COMPAT_5_2 -DLUA_USE_LINUX  -c lfunc.c -o
>> lfunc.o
>> cc  -O2 -Wall -Wextra -DLUA_COMPAT_5_2 -DLUA_USE_LINUX  -c lgc.c -o lgc.o
>> cc  -O2 -Wall -Wextra -DLUA_COMPAT_5_2 -DLUA_USE_LINUX  -c llex.c -o
>> llex.o
>> cc  -O2 -Wall -Wextra -DLUA_COMPAT_5_2 -DLUA_USE_LINUX  -c lmem.c -o
>> lmem.o
>> cc  -O2 -Wall -Wextra -DLUA_COMPAT_5_2 -DLUA_USE_LINUX  -c lobject.c
>> -o lobject.o
>> cc  -O2 -Wall -Wextra -DLUA_COMPAT_5_2 -DLUA_USE_LINUX  -c lopcodes.c
>> -o lopcodes.o
>> cc  -O2 -Wall -Wextra -DLUA_COMPAT_5_2 -DLUA_USE_LINUX  -c lparser.c
>> -o lparser.o
>> cc  -O2 -Wall -Wextra -DLUA_COMPAT_5_2 -DLUA_USE_LINUX  -c lstate.c -o
>> lstate.o
>> cc  -O2 -Wall -Wextra -DLUA_COMPAT_5_2 -DLUA_USE_LINUX  -c lstring.c
>> -o lstring.o
>> cc  -O2 -Wall -Wextra -DLUA_COMPAT_5_2 -DLUA_USE_LINUX  -c ltable.c -o
>> ltable.o
>> cc  -O2 -Wall -Wextra -DLUA_COMPAT_5_2 -DLUA_USE_LINUX  -c ltm.c -o ltm.o
>> cc  -O2 -Wall -Wextra -DLUA_COMPAT_5_2 -DLUA_USE_LINUX  -c lundump.c
>> -o lundump.o
>> cc  -O2 -Wall -Wextra -DLUA_COMPAT_5_2 -DLUA_USE_LINUX  -c lvm.c -o lvm.o
>> cc  -O2 -Wall -Wextra -DLUA_COMPAT_5_2 -DLUA_USE_LINUX  -c lzio.c -o
>> lzio.o
>> cc  -O2 -Wall -Wextra -DLUA_COMPAT_5_2 -DLUA_USE_LINUX  -c lauxlib.c
>> -o lauxlib.o
>> cc  -O2 -Wall -Wextra -DLUA_COMPAT_5_2 -DLUA_USE_LINUX  -c lbaselib.c
>> -o lbaselib.o
>> cc  -O2 -Wall -Wextra -DLUA_COMPAT_5_2 -DLUA_USE_LINUX  -c lbitlib.c
>> -o lbitlib.o
>> cc  -O2 -Wall -Wextra -DLUA_COMPAT_5_2 -DLUA_USE_LINUX  -c lcorolib.c
>> -o lcorolib.o
>> cc  -O2 -Wall -Wextra -DLUA_COMPAT_5_2 -DLUA_USE_LINUX  -c ldblib.c -o
>> ldblib.o
>> cc  -O2 -Wall -Wextra -DLUA_COMPAT_5_2 -DLUA_USE_LINUX  -c liolib.c -o
>> liolib.o
>> cc  -O2 -Wall -Wextra -DLUA_COMPAT_5_2 -DLUA_USE_LINUX  -c lmathlib.c
>> -o lmathlib.o
>> cc  -O2 -Wall -Wextra -DLUA_COMPAT_5_2 -DLUA_USE_LINUX  -c loslib.c -o
>> loslib.o
>> cc  -O2 -Wall -Wextra -DLUA_COMPAT_5_2 -DLUA_USE_LINUX  -c lstrlib.c
>> -o lstrlib.o
>> cc  -O2 -Wall -Wextra -DLUA_COMPAT_5_2 -DLUA_USE_LINUX  -c ltablib.c
>> -o ltablib.o
>> cc  -O2 -Wall -Wextra -DLUA_COMPAT_5_2 -DLUA_USE_LINUX  -c lutf8lib.c
>> -o lutf8lib.o
>> cc  -O2 -Wall -Wextra -DLUA_COMPAT_5_2 -DLUA_USE_LINUX  -c loadlib.c
>> -o loadlib.o
>> cc  -O2 -Wall -Wextra -DLUA_COMPAT_5_2 -DLUA_USE_LINUX  -c linit.c -o
>> linit.o
>> ar rcu liblua.a lapi.o lcode.o lctype.o ldebug.o ldo.o ldump.o lfunc.o
>> lgc.o llex.o  lmem.o lobject.o lopcodes.o lparser.o lstate.o lstring.o
>> ltable.o  ltm.o lundump.o lvm.o lzio.o lauxlib.o lbaselib.o lbitlib.o
>> lcorolib.o ldblib.o liolib.o  lmathlib.o loslib.o lstrlib.o ltablib.o
>> lutf8lib.o loadlib.o linit.o
>> ranlib liblua.a
>> cc  -O2 -Wall -Wextra -DLUA_COMPAT_5_2 -DLUA_USE_LINUX  -c lua.c -o lua.o
>> In file included from lua.c:12:
>> In file included from /usr/include/signal.h:40:
>> /usr/include/machine/ucontext.h:81:2: error: unknown type name
>> 'size_t'; did you mean '__size_t'?
>>         size_t          mc_vfp_size;
>>         ^
>> /usr/include/machine/_types.h:87:20: note: '__size_t' declared here
>> typedef __uint32_t      __size_t;               /* sizeof() */
>>                         ^
>> lua.c:82:10: fatal error: 'readline/readline.h' file not found
>> #include <readline/readline.h>
>>          ^~~~~~~~~~~~~~~~~~~~~
>> 2 errors generated.
>> *** Error code 1
>>
>> Stop.
>> make[1]: stopped in /home/freebsd/lua/lua-5.3.4/src
>> *** Error code 1
>>
>> Stop.
>> make: stopped in /home/freebsd/lua/lua-5.3.4/src
>>
>>
>> Thanks in advance,
>>
>> Russ
>>
> --
> --
> Ryan <[hidden email]>
> Software Developer / System Administrator
> https://hashbang.sh

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Building Lua 5.3 from Lua.org on FreeBSD

Charles Heywood
Perhaps https://docs.freebsd.org/info/g++FAQ/g++FAQ.info.More_size_t_problems.html might lead to something relevant. In short, I think you might be using an old compiler version that isn't aware of `size_t`. If that doesn't work, I dunno, but I thought size_t was quite standard given it's the return value of `sizeof()`.

On Fri, Jul 21, 2017 at 11:25 PM Russell Haley <[hidden email]> wrote:
Thank you. Thats the change I forgot I had made. I added the following
to Makefile:

MYCFLAGS=-I/usr/local/include
MYLDFLAGS=-L/usr/local/lib

And the readline error is gone. However:

freebsd@imx6:~/lua/lua-5.3.4/src % make freebsd
make all SYSCFLAGS="-DLUA_USE_LINUX" SYSLIBS="-Wl,-E -lreadline" CC=cc
cc  -O2 -Wall -Wextra -DLUA_COMPAT_5_2 -DLUA_USE_LINUX
-I/usr/local/include -c lua.c -o lua.o
In file included from lua.c:12:
In file included from /usr/include/signal.h:40:
/usr/include/machine/ucontext.h:81:2: error: unknown type name
'size_t'; did you mean '__size_t'?
        size_t          mc_vfp_size;
        ^
/usr/include/machine/_types.h:87:20: note: '__size_t' declared here
typedef __uint32_t      __size_t;               /* sizeof() */
                        ^
1 error generated.
*** Error code 1

Stop.
make[1]: stopped in /home/freebsd/lua/lua-5.3.4/src
*** Error code 1

Stop.
make: stopped in /home/freebsd/lua/lua-5.3.4/src





On Fri, Jul 21, 2017 at 8:51 PM, Charles Heywood <[hidden email]> wrote:
> Depending on your system information you might need to use
> -I/path/to/readline/dir in your CFLAGS ?
>
>
> On Fri, Jul 21, 2017, 22:49 Russell Haley <[hidden email]> wrote:
>>
>> Hi,
>>
>> I've built lua a bunch of times on TrueOS (aka FreeBSD 12-Current)
>> using the files from git. I usually mangle the Makefile myself to use
>> clang and make it install where I want to.
>>
>> Anyway, I have an arm board with FreeBSD 12-Current on it. I tried
>> building from the tarball provided by the lua.org website. I modified
>> the Makefile to use clang because, well, this is FreeBSD! I added the
>> CC=cc flag from osx target to the freebsd.
>>
>> The following is my failed build output is below. For the record,
>> readline 6.3.8_1 installed with git and git seems to work fine.
>>
>>
>> freebsd@imx6:~/lua/lua-5.3.4/src % make freebsd
>> make all SYSCFLAGS="-DLUA_USE_LINUX" SYSLIBS="-Wl,-E -lreadline" CC=cc
>> cc  -O2 -Wall -Wextra -DLUA_COMPAT_5_2 -DLUA_USE_LINUX  -c lapi.c -o
>> lapi.o
>> cc  -O2 -Wall -Wextra -DLUA_COMPAT_5_2 -DLUA_USE_LINUX  -c lcode.c -o
>> lcode.o
>> cc  -O2 -Wall -Wextra -DLUA_COMPAT_5_2 -DLUA_USE_LINUX  -c lctype.c -o
>> lctype.o
>> cc  -O2 -Wall -Wextra -DLUA_COMPAT_5_2 -DLUA_USE_LINUX  -c ldebug.c -o
>> ldebug.o
>> cc  -O2 -Wall -Wextra -DLUA_COMPAT_5_2 -DLUA_USE_LINUX  -c ldo.c -o ldo.o
>> cc  -O2 -Wall -Wextra -DLUA_COMPAT_5_2 -DLUA_USE_LINUX  -c ldump.c -o
>> ldump.o
>> cc  -O2 -Wall -Wextra -DLUA_COMPAT_5_2 -DLUA_USE_LINUX  -c lfunc.c -o
>> lfunc.o
>> cc  -O2 -Wall -Wextra -DLUA_COMPAT_5_2 -DLUA_USE_LINUX  -c lgc.c -o lgc.o
>> cc  -O2 -Wall -Wextra -DLUA_COMPAT_5_2 -DLUA_USE_LINUX  -c llex.c -o
>> llex.o
>> cc  -O2 -Wall -Wextra -DLUA_COMPAT_5_2 -DLUA_USE_LINUX  -c lmem.c -o
>> lmem.o
>> cc  -O2 -Wall -Wextra -DLUA_COMPAT_5_2 -DLUA_USE_LINUX  -c lobject.c
>> -o lobject.o
>> cc  -O2 -Wall -Wextra -DLUA_COMPAT_5_2 -DLUA_USE_LINUX  -c lopcodes.c
>> -o lopcodes.o
>> cc  -O2 -Wall -Wextra -DLUA_COMPAT_5_2 -DLUA_USE_LINUX  -c lparser.c
>> -o lparser.o
>> cc  -O2 -Wall -Wextra -DLUA_COMPAT_5_2 -DLUA_USE_LINUX  -c lstate.c -o
>> lstate.o
>> cc  -O2 -Wall -Wextra -DLUA_COMPAT_5_2 -DLUA_USE_LINUX  -c lstring.c
>> -o lstring.o
>> cc  -O2 -Wall -Wextra -DLUA_COMPAT_5_2 -DLUA_USE_LINUX  -c ltable.c -o
>> ltable.o
>> cc  -O2 -Wall -Wextra -DLUA_COMPAT_5_2 -DLUA_USE_LINUX  -c ltm.c -o ltm.o
>> cc  -O2 -Wall -Wextra -DLUA_COMPAT_5_2 -DLUA_USE_LINUX  -c lundump.c
>> -o lundump.o
>> cc  -O2 -Wall -Wextra -DLUA_COMPAT_5_2 -DLUA_USE_LINUX  -c lvm.c -o lvm.o
>> cc  -O2 -Wall -Wextra -DLUA_COMPAT_5_2 -DLUA_USE_LINUX  -c lzio.c -o
>> lzio.o
>> cc  -O2 -Wall -Wextra -DLUA_COMPAT_5_2 -DLUA_USE_LINUX  -c lauxlib.c
>> -o lauxlib.o
>> cc  -O2 -Wall -Wextra -DLUA_COMPAT_5_2 -DLUA_USE_LINUX  -c lbaselib.c
>> -o lbaselib.o
>> cc  -O2 -Wall -Wextra -DLUA_COMPAT_5_2 -DLUA_USE_LINUX  -c lbitlib.c
>> -o lbitlib.o
>> cc  -O2 -Wall -Wextra -DLUA_COMPAT_5_2 -DLUA_USE_LINUX  -c lcorolib.c
>> -o lcorolib.o
>> cc  -O2 -Wall -Wextra -DLUA_COMPAT_5_2 -DLUA_USE_LINUX  -c ldblib.c -o
>> ldblib.o
>> cc  -O2 -Wall -Wextra -DLUA_COMPAT_5_2 -DLUA_USE_LINUX  -c liolib.c -o
>> liolib.o
>> cc  -O2 -Wall -Wextra -DLUA_COMPAT_5_2 -DLUA_USE_LINUX  -c lmathlib.c
>> -o lmathlib.o
>> cc  -O2 -Wall -Wextra -DLUA_COMPAT_5_2 -DLUA_USE_LINUX  -c loslib.c -o
>> loslib.o
>> cc  -O2 -Wall -Wextra -DLUA_COMPAT_5_2 -DLUA_USE_LINUX  -c lstrlib.c
>> -o lstrlib.o
>> cc  -O2 -Wall -Wextra -DLUA_COMPAT_5_2 -DLUA_USE_LINUX  -c ltablib.c
>> -o ltablib.o
>> cc  -O2 -Wall -Wextra -DLUA_COMPAT_5_2 -DLUA_USE_LINUX  -c lutf8lib.c
>> -o lutf8lib.o
>> cc  -O2 -Wall -Wextra -DLUA_COMPAT_5_2 -DLUA_USE_LINUX  -c loadlib.c
>> -o loadlib.o
>> cc  -O2 -Wall -Wextra -DLUA_COMPAT_5_2 -DLUA_USE_LINUX  -c linit.c -o
>> linit.o
>> ar rcu liblua.a lapi.o lcode.o lctype.o ldebug.o ldo.o ldump.o lfunc.o
>> lgc.o llex.o  lmem.o lobject.o lopcodes.o lparser.o lstate.o lstring.o
>> ltable.o  ltm.o lundump.o lvm.o lzio.o lauxlib.o lbaselib.o lbitlib.o
>> lcorolib.o ldblib.o liolib.o  lmathlib.o loslib.o lstrlib.o ltablib.o
>> lutf8lib.o loadlib.o linit.o
>> ranlib liblua.a
>> cc  -O2 -Wall -Wextra -DLUA_COMPAT_5_2 -DLUA_USE_LINUX  -c lua.c -o lua.o
>> In file included from lua.c:12:
>> In file included from /usr/include/signal.h:40:
>> /usr/include/machine/ucontext.h:81:2: error: unknown type name
>> 'size_t'; did you mean '__size_t'?
>>         size_t          mc_vfp_size;
>>         ^
>> /usr/include/machine/_types.h:87:20: note: '__size_t' declared here
>> typedef __uint32_t      __size_t;               /* sizeof() */
>>                         ^
>> lua.c:82:10: fatal error: 'readline/readline.h' file not found
>> #include <readline/readline.h>
>>          ^~~~~~~~~~~~~~~~~~~~~
>> 2 errors generated.
>> *** Error code 1
>>
>> Stop.
>> make[1]: stopped in /home/freebsd/lua/lua-5.3.4/src
>> *** Error code 1
>>
>> Stop.
>> make: stopped in /home/freebsd/lua/lua-5.3.4/src
>>
>>
>> Thanks in advance,
>>
>> Russ
>>
> --
> --
> Ryan <[hidden email]>
> Software Developer / System Administrator
> https://hashbang.sh

--
--
Ryan <[hidden email]>
Software Developer / System Administrator
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Building Lua 5.3 from Lua.org on FreeBSD

jungle Boogie
In reply to this post by Russell Haley
Hi Russell,
On 07/21/2017 08:48 PM, Russell Haley wrote:

> Hi,
>
> I've built lua a bunch of times on TrueOS (aka FreeBSD 12-Current)
> using the files from git. I usually mangle the Makefile myself to use
> clang and make it install where I want to.
>
> Anyway, I have an arm board with FreeBSD 12-Current on it. I tried
> building from the tarball provided by the lua.org website. I modified
> the Makefile to use clang because, well, this is FreeBSD! I added the
> CC=cc flag from osx target to the freebsd.
>

Lua 5.3.4 is available as a package/port. Depending on your board, you
might be able to do pkg install lua53.

If not, here's the makefile on how the port is build, it might give you
an idea of what to do:

https://svnweb.freebsd.org/ports/head/lang/lua53/Makefile?view=markup&pathrev=435741

Let us know how to goes.

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Building Lua 5.3 from Lua.org on FreeBSD

Sean Conner
In reply to this post by Russell Haley
It was thus said that the Great Russell Haley once stated:

> Hi,
>
> I've built lua a bunch of times on TrueOS (aka FreeBSD 12-Current)
> using the files from git. I usually mangle the Makefile myself to use
> clang and make it install where I want to.
>
> Anyway, I have an arm board with FreeBSD 12-Current on it. I tried
> building from the tarball provided by the lua.org website. I modified
> the Makefile to use clang because, well, this is FreeBSD! I added the
> CC=cc flag from osx target to the freebsd.
>
> The following is my failed build output is below. For the record,
> readline 6.3.8_1 installed with git and git seems to work fine.
>
>
> freebsd@imx6:~/lua/lua-5.3.4/src % make freebsd
> make all SYSCFLAGS="-DLUA_USE_LINUX" SYSLIBS="-Wl,-E -lreadline" CC=cc
> cc  -O2 -Wall -Wextra -DLUA_COMPAT_5_2 -DLUA_USE_LINUX  -c lapi.c -o lapi.o
                                          ^^^^^^^^^^^^^^
Perhaps define LUA_USE_POSIX?  Any reason you are using LUA_USE_LINUX on a
non-Linux system?

  -spc


Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Building Lua 5.3 from Lua.org on FreeBSD

Russell Haley
In reply to this post by jungle Boogie
On Fri, Jul 21, 2017 at 10:07 PM, jungle boogie <[hidden email]> wrote:

> Hi Russell,
> On 07/21/2017 08:48 PM, Russell Haley wrote:
>>
>> Hi,
>>
>> I've built lua a bunch of times on TrueOS (aka FreeBSD 12-Current)
>> using the files from git. I usually mangle the Makefile myself to use
>> clang and make it install where I want to.
>>
>> Anyway, I have an arm board with FreeBSD 12-Current on it. I tried
>> building from the tarball provided by the lua.org website. I modified
>> the Makefile to use clang because, well, this is FreeBSD! I added the
>> CC=cc flag from osx target to the freebsd.
>>
>
> Lua 5.3.4 is available as a package/port. Depending on your board, you might
> be able to do pkg install lua53.
>
> If not, here's the makefile on how the port is build, it might give you an
> idea of what to do:
>
> https://svnweb.freebsd.org/ports/head/lang/lua53/Makefile?view=markup&pathrev=435741

Thanks, for some reason there is no lua53 in pkg so I thought I'd give
the "old tar ball" a try. I figured the freebsd build target would
work. I just checked and I get the same error when building from ports
so now I see why it's not in the pkg repository. I'll report it with
FreeBSD.

cc  -Wall -Wextra -DLUA_COMPAT_5_2  -O -pipe  -fPIC -isystem
/usr/local/include -fno-strict-aliasing -I/usr/local/include -isystem
/usr/local/include -DLUA_USE_LINUX -c lua.c -o lua.o
In file included from lua.c:12:
In file included from /usr/include/signal.h:40:
/usr/include/machine/ucontext.h:81:2: error: unknown type name
'size_t'; did you mean '__size_t'?
        size_t          mc_vfp_size;
        ^
/usr/include/machine/_types.h:87:20: note: '__size_t' declared here
typedef __uint32_t      __size_t;               /* sizeof() */
                        ^
1 error generated.
*** [lua.o] Error code 1

make[1]: stopped in /usr/ports/lang/lua53/work/lua-5.3.4/src
1 error

make[1]: stopped in /usr/ports/lang/lua53/work/lua-5.3.4/src
===> Compilation failed unexpectedly.
Try to set MAKE_JOBS_UNSAFE=yes and rebuild before reporting the failure to
the maintainer.
*** Error code 1

Stop.
make: stopped in /usr/ports/lang/lua53


Thanks!
Russ

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Building Lua 5.3 from Lua.org on FreeBSD

Russell Haley
In reply to this post by Sean Conner
On Fri, Jul 21, 2017 at 11:28 PM, Sean Conner <[hidden email]> wrote:

> It was thus said that the Great Russell Haley once stated:
>> Hi,
>>
>> I've built lua a bunch of times on TrueOS (aka FreeBSD 12-Current)
>> using the files from git. I usually mangle the Makefile myself to use
>> clang and make it install where I want to.
>>
>> Anyway, I have an arm board with FreeBSD 12-Current on it. I tried
>> building from the tarball provided by the lua.org website. I modified
>> the Makefile to use clang because, well, this is FreeBSD! I added the
>> CC=cc flag from osx target to the freebsd.
>>
>> The following is my failed build output is below. For the record,
>> readline 6.3.8_1 installed with git and git seems to work fine.
>>
>>
>> freebsd@imx6:~/lua/lua-5.3.4/src % make freebsd
>> make all SYSCFLAGS="-DLUA_USE_LINUX" SYSLIBS="-Wl,-E -lreadline" CC=cc
>> cc  -O2 -Wall -Wextra -DLUA_COMPAT_5_2 -DLUA_USE_LINUX  -c lapi.c -o lapi.o
>                                           ^^^^^^^^^^^^^^
> Perhaps define LUA_USE_POSIX?  Any reason you are using LUA_USE_LINUX on a
> non-Linux system?

That's what's in the default makefile from the lua site.

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Building Lua 5.3 from Lua.org on FreeBSD

Sean Conner
It was thus said that the Great Russell Haley once stated:

> On Fri, Jul 21, 2017 at 11:28 PM, Sean Conner <[hidden email]> wrote:
> > It was thus said that the Great Russell Haley once stated:
> >> Hi,
> >>
> >> I've built lua a bunch of times on TrueOS (aka FreeBSD 12-Current)
> >> using the files from git. I usually mangle the Makefile myself to use
> >> clang and make it install where I want to.
> >>
> >> Anyway, I have an arm board with FreeBSD 12-Current on it. I tried
> >> building from the tarball provided by the lua.org website. I modified
> >> the Makefile to use clang because, well, this is FreeBSD! I added the
> >> CC=cc flag from osx target to the freebsd.
> >>
> >> The following is my failed build output is below. For the record,
> >> readline 6.3.8_1 installed with git and git seems to work fine.
> >>
> >>
> >> freebsd@imx6:~/lua/lua-5.3.4/src % make freebsd
> >> make all SYSCFLAGS="-DLUA_USE_LINUX" SYSLIBS="-Wl,-E -lreadline" CC=cc
> >> cc  -O2 -Wall -Wextra -DLUA_COMPAT_5_2 -DLUA_USE_LINUX  -c lapi.c -o lapi.o
> >                                           ^^^^^^^^^^^^^^
> > Perhaps define LUA_USE_POSIX?  Any reason you are using LUA_USE_LINUX on a
> > non-Linux system?
>
> That's what's in the default makefile from the lua site.

  Huh ... so it is.  Weird.  

  Anyway, I would try LUA_USE_POSIX (and maybe LUA_USE_DLOPEN for good
measure).  From the errors, it seems that size_t (or __size_t) isn't be
defined, and it may be smoething that LUA_USE_LINUX includes (or defines)
that is causing the issue (but that's just a guess, not having TrueOS to
test this on).

  -spc


Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Building Lua 5.3 from Lua.org on FreeBSD

jungle Boogie
In reply to this post by Russell Haley
On 07/21/2017 11:36 PM, Russell Haley wrote:

> On Fri, Jul 21, 2017 at 10:07 PM, jungle boogie <[hidden email]> wrote:
>> Hi Russell,
>> On 07/21/2017 08:48 PM, Russell Haley wrote:
>>>
>>> Hi,
>>>
>>> I've built lua a bunch of times on TrueOS (aka FreeBSD 12-Current)
>>> using the files from git. I usually mangle the Makefile myself to use
>>> clang and make it install where I want to.
>>>
>>> Anyway, I have an arm board with FreeBSD 12-Current on it. I tried
>>> building from the tarball provided by the lua.org website. I modified
>>> the Makefile to use clang because, well, this is FreeBSD! I added the
>>> CC=cc flag from osx target to the freebsd.
>>>
>>
>> Lua 5.3.4 is available as a package/port. Depending on your board, you might
>> be able to do pkg install lua53.
>>
>> If not, here's the makefile on how the port is build, it might give you an
>> idea of what to do:
>>
>> https://svnweb.freebsd.org/ports/head/lang/lua53/Makefile?view=markup&pathrev=435741
>
> Thanks, for some reason there is no lua53 in pkg so I thought I'd give
> the "old tar ball" a try. I figured the freebsd build target would
> work. I just checked and I get the same error when building from ports
> so now I see why it's not in the pkg repository. I'll report it with
> FreeBSD.
>

What's the platform?


Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Building Lua 5.3 from Lua.org on FreeBSD

Russell Haley
Armv6. 12-current built today running on an imx6 hummingboard. 

Hit the wall and need sleep. 

Night
Russ

Sent from my BlackBerry 10 smartphone on the Virgin Mobile network.
  Original Message  
From: jungle boogie
Sent: Friday, July 21, 2017 11:53 PM
To: [hidden email]
Reply To: Lua mailing list
Subject: Re: Building Lua 5.3 from Lua.org on FreeBSD

On 07/21/2017 11:36 PM, Russell Haley wrote:

> On Fri, Jul 21, 2017 at 10:07 PM, jungle boogie <[hidden email]> wrote:
>> Hi Russell,
>> On 07/21/2017 08:48 PM, Russell Haley wrote:
>>>
>>> Hi,
>>>
>>> I've built lua a bunch of times on TrueOS (aka FreeBSD 12-Current)
>>> using the files from git. I usually mangle the Makefile myself to use
>>> clang and make it install where I want to.
>>>
>>> Anyway, I have an arm board with FreeBSD 12-Current on it. I tried
>>> building from the tarball provided by the lua.org website. I modified
>>> the Makefile to use clang because, well, this is FreeBSD! I added the
>>> CC=cc flag from osx target to the freebsd.
>>>
>>
>> Lua 5.3.4 is available as a package/port. Depending on your board, you might
>> be able to do pkg install lua53.
>>
>> If not, here's the makefile on how the port is build, it might give you an
>> idea of what to do:
>>
>> https://svnweb.freebsd.org/ports/head/lang/lua53/Makefile?view=markup&pathrev=435741
>
> Thanks, for some reason there is no lua53 in pkg so I thought I'd give
> the "old tar ball" a try. I figured the freebsd build target would
> work. I just checked and I get the same error when building from ports
> so now I see why it's not in the pkg repository. I'll report it with
> FreeBSD.
>

What's the platform?



Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Building Lua 5.3 from Lua.org on FreeBSD

Luiz Henrique de Figueiredo
In reply to this post by Russell Haley
The freebsd target was added in Lua 5.1.2 released in 2007. It has
remained essentially the same since then. At that time we did test it on
arbornet, a free shell service that is no longer available. Currently,
we don't have access to FreeBSD to test it, though. We rely on feedback
from the users of the various platforms. We haven't had a complaint
about FreeBSD and other targets at all.

For the record, does the freebsd target work on other FreeBSD systems?

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Building Lua 5.3 from Lua.org on FreeBSD

Russell Haley
On Sat, Jul 22, 2017 at 5:13 AM, Luiz Henrique de Figueiredo
<[hidden email]> wrote:
> The freebsd target was added in Lua 5.1.2 released in 2007. It has
> remained essentially the same since then. At that time we did test it on
> arbornet, a free shell service that is no longer available. Currently,
> we don't have access to FreeBSD to test it, though. We rely on feedback
> from the users of the various platforms. We haven't had a complaint
> about FreeBSD and other targets at all.

I have complained in the past about the make file. Please see:
http://lua-users.org/lists/lua-l/2016-07/msg00401.html --> Contains
some of what is below. For the records, the official FreeBSD port
makefile now contains -fPIC for all platforms
and
http://lua-users.org/lists/lua-l/2016-07/msg00406.html

And Mr. Ahern seems to have had concerns as well, although I didn't
read his emails.

However reviewing the conversations in the archive it doesn't seem to
contain much of the conversations I THOUGHT I had so perhaps my
complaints were all in my head, which is unhelpful for you. :)

> For the record, does the freebsd target work on other FreeBSD systems?

Unmodified, no. I have never been able to build Lua for FreeBSD
unmodified, and the 'official' FreeBSD version is modified my the
maintainer in the poretsmakefile. Mr. JungleBoogie provided a link to
the ports makefile here:
https://svnweb.freebsd.org/ports/head/lang/lua53/Makefile?view=markup&pathrev=435741

All lua Makefiles (tarball and github) require modification to run on
FreeBSD as far as I can tell for the following reasons:

1) gcc is the required compiler for the freebsd target which is not in
the base FreeBSD image
2) The include and linking directories must be modified (done through
the ports system for the 'official' freebsd package) - thanks again
for reminding me Charles. (My brain is working again this morning so I
can remember what LDFlags are for;  as much as I ever understood them
anyway) All libraries in FreeBSD are installed to /usr/local. It has
been that way since I started using FreeBSD 5 years ago with 8.1.
3) I ran into issues with missing -fPIC and always added it to my make
files (outlined in the first email noted above). The official FreeBSD
ports version also does the same for all platforms.
4) As Sean pointed out, it should probably use USE_POSIX not
USE_LINUX. I *think* had tested that once in 2016 and got it to work.
The files, however, were lost in the "Great Zpool Debacle of 2016" (we
speak not of such things).

In conclusions, I doubt many FreeBSD users have complained because the
official port has papered over the difficulties. I personally would be
thrilled to be able to build from the tarball or git without having to
modify the files. I also think the official Makefile in the tarball
should be modified to detect the OS as I suggested in 2016, but I
understand the hesitancy there. That said, we would never know if it
would work if we don't try it!

I'm in kernel land right now but will be looping back to application
layer code next week and will revisit the Makefile if desired.  I
would be honoured to help test and contribute.

Cheers,

Russ

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Building Lua 5.3 from Lua.org on FreeBSD

Russell Haley
In reply to this post by Russell Haley
On Fri, Jul 21, 2017 at 9:25 PM, Russell Haley <[hidden email]> wrote:

> Thank you. Thats the change I forgot I had made. I added the following
> to Makefile:
>
> MYCFLAGS=-I/usr/local/include
> MYLDFLAGS=-L/usr/local/lib
>
> And the readline error is gone. However:
>
> freebsd@imx6:~/lua/lua-5.3.4/src % make freebsd
> make all SYSCFLAGS="-DLUA_USE_LINUX" SYSLIBS="-Wl,-E -lreadline" CC=cc
> cc  -O2 -Wall -Wextra -DLUA_COMPAT_5_2 -DLUA_USE_LINUX
> -I/usr/local/include -c lua.c -o lua.o
> In file included from lua.c:12:
> In file included from /usr/include/signal.h:40:
> /usr/include/machine/ucontext.h:81:2: error: unknown type name
> 'size_t'; did you mean '__size_t'?
>         size_t          mc_vfp_size;
>         ^
> /usr/include/machine/_types.h:87:20: note: '__size_t' declared here
> typedef __uint32_t      __size_t;               /* sizeof() */
>                         ^
> 1 error generated.
> *** Error code 1
>
> Stop.
> make[1]: stopped in /home/freebsd/lua/lua-5.3.4/src
> *** Error code 1
>
> Stop.
> make: stopped in /home/freebsd/lua/lua-5.3.4/src

The following is the response from the port maintainer about the issue
noted above:

Hi Russell,

> On Jul 21, 2017, at 11:47 PM, Russell Haley <[hidden email]> wrote:
>
> I'm contacting you because you are listed as the port maintainer for
> Lua53. The port does not currently build on armv6. I can confirm that
> this problem extends to the official package from lua and the lua
> mirror from git.
>
> The error listed in PortsMon is the same as I am experiencing:

Thanks for reporting.

The issue here is that a header (ucontext.h) refers to size_t without
having included it explicitly. ucontext.h should probably have used
the internal name __size_t instead of size_t. The patch at [1] is a
quick fix to that problem. (Please note that this is not an issue in
Lua’s implementation, but in a header that it transitively includes.)

Let me know if that fixes the issue!

[1] https://github.com/pfsense/FreeBSD-ports/blob/1110cd5f947a5e774ae0a4e5e6d74776ee0e3678/lang/lua53/files/patch-src_lua.c

Cheers,
- Salazar

I will test this patch today at some point.
Cheers,
Russ

> On Fri, Jul 21, 2017 at 8:51 PM, Charles Heywood <[hidden email]> wrote:
>> Depending on your system information you might need to use
>> -I/path/to/readline/dir in your CFLAGS ?
>>
>>
>> On Fri, Jul 21, 2017, 22:49 Russell Haley <[hidden email]> wrote:
>>>
>>> Hi,
>>>
>>> I've built lua a bunch of times on TrueOS (aka FreeBSD 12-Current)
>>> using the files from git. I usually mangle the Makefile myself to use
>>> clang and make it install where I want to.
>>>
>>> Anyway, I have an arm board with FreeBSD 12-Current on it. I tried
>>> building from the tarball provided by the lua.org website. I modified
>>> the Makefile to use clang because, well, this is FreeBSD! I added the
>>> CC=cc flag from osx target to the freebsd.
>>>
>>> The following is my failed build output is below. For the record,
>>> readline 6.3.8_1 installed with git and git seems to work fine.
>>>
>>>
>>> freebsd@imx6:~/lua/lua-5.3.4/src % make freebsd
>>> make all SYSCFLAGS="-DLUA_USE_LINUX" SYSLIBS="-Wl,-E -lreadline" CC=cc
>>> cc  -O2 -Wall -Wextra -DLUA_COMPAT_5_2 -DLUA_USE_LINUX  -c lapi.c -o
>>> lapi.o
>>> cc  -O2 -Wall -Wextra -DLUA_COMPAT_5_2 -DLUA_USE_LINUX  -c lcode.c -o
>>> lcode.o
>>> cc  -O2 -Wall -Wextra -DLUA_COMPAT_5_2 -DLUA_USE_LINUX  -c lctype.c -o
>>> lctype.o
>>> cc  -O2 -Wall -Wextra -DLUA_COMPAT_5_2 -DLUA_USE_LINUX  -c ldebug.c -o
>>> ldebug.o
>>> cc  -O2 -Wall -Wextra -DLUA_COMPAT_5_2 -DLUA_USE_LINUX  -c ldo.c -o ldo.o
>>> cc  -O2 -Wall -Wextra -DLUA_COMPAT_5_2 -DLUA_USE_LINUX  -c ldump.c -o
>>> ldump.o
>>> cc  -O2 -Wall -Wextra -DLUA_COMPAT_5_2 -DLUA_USE_LINUX  -c lfunc.c -o
>>> lfunc.o
>>> cc  -O2 -Wall -Wextra -DLUA_COMPAT_5_2 -DLUA_USE_LINUX  -c lgc.c -o lgc.o
>>> cc  -O2 -Wall -Wextra -DLUA_COMPAT_5_2 -DLUA_USE_LINUX  -c llex.c -o
>>> llex.o
>>> cc  -O2 -Wall -Wextra -DLUA_COMPAT_5_2 -DLUA_USE_LINUX  -c lmem.c -o
>>> lmem.o
>>> cc  -O2 -Wall -Wextra -DLUA_COMPAT_5_2 -DLUA_USE_LINUX  -c lobject.c
>>> -o lobject.o
>>> cc  -O2 -Wall -Wextra -DLUA_COMPAT_5_2 -DLUA_USE_LINUX  -c lopcodes.c
>>> -o lopcodes.o
>>> cc  -O2 -Wall -Wextra -DLUA_COMPAT_5_2 -DLUA_USE_LINUX  -c lparser.c
>>> -o lparser.o
>>> cc  -O2 -Wall -Wextra -DLUA_COMPAT_5_2 -DLUA_USE_LINUX  -c lstate.c -o
>>> lstate.o
>>> cc  -O2 -Wall -Wextra -DLUA_COMPAT_5_2 -DLUA_USE_LINUX  -c lstring.c
>>> -o lstring.o
>>> cc  -O2 -Wall -Wextra -DLUA_COMPAT_5_2 -DLUA_USE_LINUX  -c ltable.c -o
>>> ltable.o
>>> cc  -O2 -Wall -Wextra -DLUA_COMPAT_5_2 -DLUA_USE_LINUX  -c ltm.c -o ltm.o
>>> cc  -O2 -Wall -Wextra -DLUA_COMPAT_5_2 -DLUA_USE_LINUX  -c lundump.c
>>> -o lundump.o
>>> cc  -O2 -Wall -Wextra -DLUA_COMPAT_5_2 -DLUA_USE_LINUX  -c lvm.c -o lvm.o
>>> cc  -O2 -Wall -Wextra -DLUA_COMPAT_5_2 -DLUA_USE_LINUX  -c lzio.c -o
>>> lzio.o
>>> cc  -O2 -Wall -Wextra -DLUA_COMPAT_5_2 -DLUA_USE_LINUX  -c lauxlib.c
>>> -o lauxlib.o
>>> cc  -O2 -Wall -Wextra -DLUA_COMPAT_5_2 -DLUA_USE_LINUX  -c lbaselib.c
>>> -o lbaselib.o
>>> cc  -O2 -Wall -Wextra -DLUA_COMPAT_5_2 -DLUA_USE_LINUX  -c lbitlib.c
>>> -o lbitlib.o
>>> cc  -O2 -Wall -Wextra -DLUA_COMPAT_5_2 -DLUA_USE_LINUX  -c lcorolib.c
>>> -o lcorolib.o
>>> cc  -O2 -Wall -Wextra -DLUA_COMPAT_5_2 -DLUA_USE_LINUX  -c ldblib.c -o
>>> ldblib.o
>>> cc  -O2 -Wall -Wextra -DLUA_COMPAT_5_2 -DLUA_USE_LINUX  -c liolib.c -o
>>> liolib.o
>>> cc  -O2 -Wall -Wextra -DLUA_COMPAT_5_2 -DLUA_USE_LINUX  -c lmathlib.c
>>> -o lmathlib.o
>>> cc  -O2 -Wall -Wextra -DLUA_COMPAT_5_2 -DLUA_USE_LINUX  -c loslib.c -o
>>> loslib.o
>>> cc  -O2 -Wall -Wextra -DLUA_COMPAT_5_2 -DLUA_USE_LINUX  -c lstrlib.c
>>> -o lstrlib.o
>>> cc  -O2 -Wall -Wextra -DLUA_COMPAT_5_2 -DLUA_USE_LINUX  -c ltablib.c
>>> -o ltablib.o
>>> cc  -O2 -Wall -Wextra -DLUA_COMPAT_5_2 -DLUA_USE_LINUX  -c lutf8lib.c
>>> -o lutf8lib.o
>>> cc  -O2 -Wall -Wextra -DLUA_COMPAT_5_2 -DLUA_USE_LINUX  -c loadlib.c
>>> -o loadlib.o
>>> cc  -O2 -Wall -Wextra -DLUA_COMPAT_5_2 -DLUA_USE_LINUX  -c linit.c -o
>>> linit.o
>>> ar rcu liblua.a lapi.o lcode.o lctype.o ldebug.o ldo.o ldump.o lfunc.o
>>> lgc.o llex.o  lmem.o lobject.o lopcodes.o lparser.o lstate.o lstring.o
>>> ltable.o  ltm.o lundump.o lvm.o lzio.o lauxlib.o lbaselib.o lbitlib.o
>>> lcorolib.o ldblib.o liolib.o  lmathlib.o loslib.o lstrlib.o ltablib.o
>>> lutf8lib.o loadlib.o linit.o
>>> ranlib liblua.a
>>> cc  -O2 -Wall -Wextra -DLUA_COMPAT_5_2 -DLUA_USE_LINUX  -c lua.c -o lua.o
>>> In file included from lua.c:12:
>>> In file included from /usr/include/signal.h:40:
>>> /usr/include/machine/ucontext.h:81:2: error: unknown type name
>>> 'size_t'; did you mean '__size_t'?
>>>         size_t          mc_vfp_size;
>>>         ^
>>> /usr/include/machine/_types.h:87:20: note: '__size_t' declared here
>>> typedef __uint32_t      __size_t;               /* sizeof() */
>>>                         ^
>>> lua.c:82:10: fatal error: 'readline/readline.h' file not found
>>> #include <readline/readline.h>
>>>          ^~~~~~~~~~~~~~~~~~~~~
>>> 2 errors generated.
>>> *** Error code 1
>>>
>>> Stop.
>>> make[1]: stopped in /home/freebsd/lua/lua-5.3.4/src
>>> *** Error code 1
>>>
>>> Stop.
>>> make: stopped in /home/freebsd/lua/lua-5.3.4/src
>>>
>>>
>>> Thanks in advance,
>>>
>>> Russ
>>>
>> --
>> --
>> Ryan <[hidden email]>
>> Software Developer / System Administrator
>> https://hashbang.sh

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Building Lua 5.3 from Lua.org on FreeBSD

jungle Boogie
In reply to this post by Luiz Henrique de Figueiredo
On 07/22/2017 05:13 AM, Luiz Henrique de Figueiredo wrote:
> The freebsd target was added in Lua 5.1.2 released in 2007. It has
> remained essentially the same since then. At that time we did test it on
> arbornet, a free shell service that is no longer available. Currently,
> we don't have access to FreeBSD to test it, though. We rely on feedback
> from the users of the various platforms. We haven't had a complaint
> about FreeBSD and other targets at all.
>
> For the record, does the freebsd target work on other FreeBSD systems?
>

While Digital Ocean isn't free, it's a very inexpensive option to test
build Lua on FreeBSD: https://www.digitalocean.com

It looks like you would need to 'pkg add devel/libedit' then download
the Lua53 tarball. Clang is in base so you wouldn't need to installer a
compiler.

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Building Lua 5.3 from Lua.org on FreeBSD

Russell Haley
Thank you for the reference. I have had some droplets in the past. The
offering is excellent. Unfortunately they charge you to keep them
dormant so i deleted them, though the disk is still sitting there if I
ever wanted.

I appreciate the thought, however, I'm writing to you on FreeBSD
Current with a FreeBSD 11-release jail in which I am attempting to
build RTEMS 4.12 to link to Lua. I have running a Beaglebone and
Hummingboard arm SBCs, both with FBSD 12-C kernels I build using new
sata and sdio drivers I am testing. Mine is not a shortage of targets.
;)

In Jest,
Russ

On Sat, Jul 22, 2017 at 1:44 PM, jungle boogie <[hidden email]> wrote:

> On 07/22/2017 05:13 AM, Luiz Henrique de Figueiredo wrote:
>>
>> The freebsd target was added in Lua 5.1.2 released in 2007. It has
>> remained essentially the same since then. At that time we did test it on
>> arbornet, a free shell service that is no longer available. Currently,
>> we don't have access to FreeBSD to test it, though. We rely on feedback
>> from the users of the various platforms. We haven't had a complaint
>> about FreeBSD and other targets at all.
>>
>> For the record, does the freebsd target work on other FreeBSD systems?
>>
>
> While Digital Ocean isn't free, it's a very inexpensive option to test build
> Lua on FreeBSD: https://www.digitalocean.com
>
> It looks like you would need to 'pkg add devel/libedit' then download the
> Lua53 tarball. Clang is in base so you wouldn't need to installer a
> compiler.
>

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Building Lua 5.3 from Lua.org on FreeBSD

Russell Haley
In reply to this post by Russell Haley
I can confirm the patch fixes Lua 5.3.4 as provided by the tarball on
FreeBSD 12-CURRENT on armv6 and in a 11.0-RELEASE jail running on a
12-CURRENT amd64 host. I have not tested:

- Head Lua from Git, any platform
- 12-CURRENT amd64

I assume, however, they will work. :-/

(Russ stumbles over cliff screaming "but it compiled!")

Russ

On Sat, Jul 22, 2017 at 10:13 AM, Russell Haley <[hidden email]> wrote:

> On Fri, Jul 21, 2017 at 9:25 PM, Russell Haley <[hidden email]> wrote:
>> Thank you. Thats the change I forgot I had made. I added the following
>> to Makefile:
>>
>> MYCFLAGS=-I/usr/local/include
>> MYLDFLAGS=-L/usr/local/lib
>>
>> And the readline error is gone. However:
>>
>> freebsd@imx6:~/lua/lua-5.3.4/src % make freebsd
>> make all SYSCFLAGS="-DLUA_USE_LINUX" SYSLIBS="-Wl,-E -lreadline" CC=cc
>> cc  -O2 -Wall -Wextra -DLUA_COMPAT_5_2 -DLUA_USE_LINUX
>> -I/usr/local/include -c lua.c -o lua.o
>> In file included from lua.c:12:
>> In file included from /usr/include/signal.h:40:
>> /usr/include/machine/ucontext.h:81:2: error: unknown type name
>> 'size_t'; did you mean '__size_t'?
>>         size_t          mc_vfp_size;
>>         ^
>> /usr/include/machine/_types.h:87:20: note: '__size_t' declared here
>> typedef __uint32_t      __size_t;               /* sizeof() */
>>                         ^
>> 1 error generated.
>> *** Error code 1
>>
>> Stop.
>> make[1]: stopped in /home/freebsd/lua/lua-5.3.4/src
>> *** Error code 1
>>
>> Stop.
>> make: stopped in /home/freebsd/lua/lua-5.3.4/src
>
> The following is the response from the port maintainer about the issue
> noted above:
>
> Hi Russell,
>
>> On Jul 21, 2017, at 11:47 PM, Russell Haley <[hidden email]> wrote:
>>
>> I'm contacting you because you are listed as the port maintainer for
>> Lua53. The port does not currently build on armv6. I can confirm that
>> this problem extends to the official package from lua and the lua
>> mirror from git.
>>
>> The error listed in PortsMon is the same as I am experiencing:
>
> Thanks for reporting.
>
> The issue here is that a header (ucontext.h) refers to size_t without
> having included it explicitly. ucontext.h should probably have used
> the internal name __size_t instead of size_t. The patch at [1] is a
> quick fix to that problem. (Please note that this is not an issue in
> Lua’s implementation, but in a header that it transitively includes.)
>
> Let me know if that fixes the issue!
>
> [1] https://github.com/pfsense/FreeBSD-ports/blob/1110cd5f947a5e774ae0a4e5e6d74776ee0e3678/lang/lua53/files/patch-src_lua.c
>
> Cheers,
> - Salazar
>
> I will test this patch today at some point.
> Cheers,
> Russ
>
>> On Fri, Jul 21, 2017 at 8:51 PM, Charles Heywood <[hidden email]> wrote:
>>> Depending on your system information you might need to use
>>> -I/path/to/readline/dir in your CFLAGS ?
>>>
>>>
>>> On Fri, Jul 21, 2017, 22:49 Russell Haley <[hidden email]> wrote:
>>>>
>>>> Hi,
>>>>
>>>> I've built lua a bunch of times on TrueOS (aka FreeBSD 12-Current)
>>>> using the files from git. I usually mangle the Makefile myself to use
>>>> clang and make it install where I want to.
>>>>
>>>> Anyway, I have an arm board with FreeBSD 12-Current on it. I tried
>>>> building from the tarball provided by the lua.org website. I modified
>>>> the Makefile to use clang because, well, this is FreeBSD! I added the
>>>> CC=cc flag from osx target to the freebsd.
>>>>
>>>> The following is my failed build output is below. For the record,
>>>> readline 6.3.8_1 installed with git and git seems to work fine.
>>>>
>>>>
>>>> freebsd@imx6:~/lua/lua-5.3.4/src % make freebsd
>>>> make all SYSCFLAGS="-DLUA_USE_LINUX" SYSLIBS="-Wl,-E -lreadline" CC=cc
>>>> cc  -O2 -Wall -Wextra -DLUA_COMPAT_5_2 -DLUA_USE_LINUX  -c lapi.c -o
>>>> lapi.o
>>>> cc  -O2 -Wall -Wextra -DLUA_COMPAT_5_2 -DLUA_USE_LINUX  -c lcode.c -o
>>>> lcode.o
>>>> cc  -O2 -Wall -Wextra -DLUA_COMPAT_5_2 -DLUA_USE_LINUX  -c lctype.c -o
>>>> lctype.o
>>>> cc  -O2 -Wall -Wextra -DLUA_COMPAT_5_2 -DLUA_USE_LINUX  -c ldebug.c -o
>>>> ldebug.o
>>>> cc  -O2 -Wall -Wextra -DLUA_COMPAT_5_2 -DLUA_USE_LINUX  -c ldo.c -o ldo.o
>>>> cc  -O2 -Wall -Wextra -DLUA_COMPAT_5_2 -DLUA_USE_LINUX  -c ldump.c -o
>>>> ldump.o
>>>> cc  -O2 -Wall -Wextra -DLUA_COMPAT_5_2 -DLUA_USE_LINUX  -c lfunc.c -o
>>>> lfunc.o
>>>> cc  -O2 -Wall -Wextra -DLUA_COMPAT_5_2 -DLUA_USE_LINUX  -c lgc.c -o lgc.o
>>>> cc  -O2 -Wall -Wextra -DLUA_COMPAT_5_2 -DLUA_USE_LINUX  -c llex.c -o
>>>> llex.o
>>>> cc  -O2 -Wall -Wextra -DLUA_COMPAT_5_2 -DLUA_USE_LINUX  -c lmem.c -o
>>>> lmem.o
>>>> cc  -O2 -Wall -Wextra -DLUA_COMPAT_5_2 -DLUA_USE_LINUX  -c lobject.c
>>>> -o lobject.o
>>>> cc  -O2 -Wall -Wextra -DLUA_COMPAT_5_2 -DLUA_USE_LINUX  -c lopcodes.c
>>>> -o lopcodes.o
>>>> cc  -O2 -Wall -Wextra -DLUA_COMPAT_5_2 -DLUA_USE_LINUX  -c lparser.c
>>>> -o lparser.o
>>>> cc  -O2 -Wall -Wextra -DLUA_COMPAT_5_2 -DLUA_USE_LINUX  -c lstate.c -o
>>>> lstate.o
>>>> cc  -O2 -Wall -Wextra -DLUA_COMPAT_5_2 -DLUA_USE_LINUX  -c lstring.c
>>>> -o lstring.o
>>>> cc  -O2 -Wall -Wextra -DLUA_COMPAT_5_2 -DLUA_USE_LINUX  -c ltable.c -o
>>>> ltable.o
>>>> cc  -O2 -Wall -Wextra -DLUA_COMPAT_5_2 -DLUA_USE_LINUX  -c ltm.c -o ltm.o
>>>> cc  -O2 -Wall -Wextra -DLUA_COMPAT_5_2 -DLUA_USE_LINUX  -c lundump.c
>>>> -o lundump.o
>>>> cc  -O2 -Wall -Wextra -DLUA_COMPAT_5_2 -DLUA_USE_LINUX  -c lvm.c -o lvm.o
>>>> cc  -O2 -Wall -Wextra -DLUA_COMPAT_5_2 -DLUA_USE_LINUX  -c lzio.c -o
>>>> lzio.o
>>>> cc  -O2 -Wall -Wextra -DLUA_COMPAT_5_2 -DLUA_USE_LINUX  -c lauxlib.c
>>>> -o lauxlib.o
>>>> cc  -O2 -Wall -Wextra -DLUA_COMPAT_5_2 -DLUA_USE_LINUX  -c lbaselib.c
>>>> -o lbaselib.o
>>>> cc  -O2 -Wall -Wextra -DLUA_COMPAT_5_2 -DLUA_USE_LINUX  -c lbitlib.c
>>>> -o lbitlib.o
>>>> cc  -O2 -Wall -Wextra -DLUA_COMPAT_5_2 -DLUA_USE_LINUX  -c lcorolib.c
>>>> -o lcorolib.o
>>>> cc  -O2 -Wall -Wextra -DLUA_COMPAT_5_2 -DLUA_USE_LINUX  -c ldblib.c -o
>>>> ldblib.o
>>>> cc  -O2 -Wall -Wextra -DLUA_COMPAT_5_2 -DLUA_USE_LINUX  -c liolib.c -o
>>>> liolib.o
>>>> cc  -O2 -Wall -Wextra -DLUA_COMPAT_5_2 -DLUA_USE_LINUX  -c lmathlib.c
>>>> -o lmathlib.o
>>>> cc  -O2 -Wall -Wextra -DLUA_COMPAT_5_2 -DLUA_USE_LINUX  -c loslib.c -o
>>>> loslib.o
>>>> cc  -O2 -Wall -Wextra -DLUA_COMPAT_5_2 -DLUA_USE_LINUX  -c lstrlib.c
>>>> -o lstrlib.o
>>>> cc  -O2 -Wall -Wextra -DLUA_COMPAT_5_2 -DLUA_USE_LINUX  -c ltablib.c
>>>> -o ltablib.o
>>>> cc  -O2 -Wall -Wextra -DLUA_COMPAT_5_2 -DLUA_USE_LINUX  -c lutf8lib.c
>>>> -o lutf8lib.o
>>>> cc  -O2 -Wall -Wextra -DLUA_COMPAT_5_2 -DLUA_USE_LINUX  -c loadlib.c
>>>> -o loadlib.o
>>>> cc  -O2 -Wall -Wextra -DLUA_COMPAT_5_2 -DLUA_USE_LINUX  -c linit.c -o
>>>> linit.o
>>>> ar rcu liblua.a lapi.o lcode.o lctype.o ldebug.o ldo.o ldump.o lfunc.o
>>>> lgc.o llex.o  lmem.o lobject.o lopcodes.o lparser.o lstate.o lstring.o
>>>> ltable.o  ltm.o lundump.o lvm.o lzio.o lauxlib.o lbaselib.o lbitlib.o
>>>> lcorolib.o ldblib.o liolib.o  lmathlib.o loslib.o lstrlib.o ltablib.o
>>>> lutf8lib.o loadlib.o linit.o
>>>> ranlib liblua.a
>>>> cc  -O2 -Wall -Wextra -DLUA_COMPAT_5_2 -DLUA_USE_LINUX  -c lua.c -o lua.o
>>>> In file included from lua.c:12:
>>>> In file included from /usr/include/signal.h:40:
>>>> /usr/include/machine/ucontext.h:81:2: error: unknown type name
>>>> 'size_t'; did you mean '__size_t'?
>>>>         size_t          mc_vfp_size;
>>>>         ^
>>>> /usr/include/machine/_types.h:87:20: note: '__size_t' declared here
>>>> typedef __uint32_t      __size_t;               /* sizeof() */
>>>>                         ^
>>>> lua.c:82:10: fatal error: 'readline/readline.h' file not found
>>>> #include <readline/readline.h>
>>>>          ^~~~~~~~~~~~~~~~~~~~~
>>>> 2 errors generated.
>>>> *** Error code 1
>>>>
>>>> Stop.
>>>> make[1]: stopped in /home/freebsd/lua/lua-5.3.4/src
>>>> *** Error code 1
>>>>
>>>> Stop.
>>>> make: stopped in /home/freebsd/lua/lua-5.3.4/src
>>>>
>>>>
>>>> Thanks in advance,
>>>>
>>>> Russ
>>>>
>>> --
>>> --
>>> Ryan <[hidden email]>
>>> Software Developer / System Administrator
>>> https://hashbang.sh

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Building Lua 5.3 from Lua.org on FreeBSD

Russell Haley
On Sat, Jul 22, 2017 at 2:31 PM, Russell Haley <[hidden email]> wrote:
> I can confirm the patch fixes Lua 5.3.4 as provided by the tarball on
> FreeBSD 12-CURRENT on armv6 and in a 11.0-RELEASE jail running on a
> 12-CURRENT amd64 host. I have not tested:
>
> - Head Lua from Git, any platform
> - 12-CURRENT amd64

Argh, sorry, that assumes the previously mentioned changes to the
Makefile (changing to clang  and adding CFLAGS and LDFLAGS noted
previously)

> On Sat, Jul 22, 2017 at 10:13 AM, Russell Haley <[hidden email]> wrote:
>> On Fri, Jul 21, 2017 at 9:25 PM, Russell Haley <[hidden email]> wrote:
>>> Thank you. Thats the change I forgot I had made. I added the following
>>> to Makefile:
>>>
>>> MYCFLAGS=-I/usr/local/include
>>> MYLDFLAGS=-L/usr/local/lib
>>>
>>> And the readline error is gone. However:
>>>
>>> freebsd@imx6:~/lua/lua-5.3.4/src % make freebsd
>>> make all SYSCFLAGS="-DLUA_USE_LINUX" SYSLIBS="-Wl,-E -lreadline" CC=cc
>>> cc  -O2 -Wall -Wextra -DLUA_COMPAT_5_2 -DLUA_USE_LINUX
>>> -I/usr/local/include -c lua.c -o lua.o
>>> In file included from lua.c:12:
>>> In file included from /usr/include/signal.h:40:
>>> /usr/include/machine/ucontext.h:81:2: error: unknown type name
>>> 'size_t'; did you mean '__size_t'?
>>>         size_t          mc_vfp_size;
>>>         ^
>>> /usr/include/machine/_types.h:87:20: note: '__size_t' declared here
>>> typedef __uint32_t      __size_t;               /* sizeof() */
>>>                         ^
>>> 1 error generated.
>>> *** Error code 1
>>>
>>> Stop.
>>> make[1]: stopped in /home/freebsd/lua/lua-5.3.4/src
>>> *** Error code 1
>>>
>>> Stop.
>>> make: stopped in /home/freebsd/lua/lua-5.3.4/src
>>
>> The following is the response from the port maintainer about the issue
>> noted above:
>>
>> Hi Russell,
>>
>>> On Jul 21, 2017, at 11:47 PM, Russell Haley <[hidden email]> wrote:
>>>
>>> I'm contacting you because you are listed as the port maintainer for
>>> Lua53. The port does not currently build on armv6. I can confirm that
>>> this problem extends to the official package from lua and the lua
>>> mirror from git.
>>>
>>> The error listed in PortsMon is the same as I am experiencing:
>>
>> Thanks for reporting.
>>
>> The issue here is that a header (ucontext.h) refers to size_t without
>> having included it explicitly. ucontext.h should probably have used
>> the internal name __size_t instead of size_t. The patch at [1] is a
>> quick fix to that problem. (Please note that this is not an issue in
>> Lua’s implementation, but in a header that it transitively includes.)
>>
>> Let me know if that fixes the issue!
>>
>> [1] https://github.com/pfsense/FreeBSD-ports/blob/1110cd5f947a5e774ae0a4e5e6d74776ee0e3678/lang/lua53/files/patch-src_lua.c
>>
>> Cheers,
>> - Salazar
>>
>> I will test this patch today at some point.
>> Cheers,
>> Russ
>>
>>> On Fri, Jul 21, 2017 at 8:51 PM, Charles Heywood <[hidden email]> wrote:
>>>> Depending on your system information you might need to use
>>>> -I/path/to/readline/dir in your CFLAGS ?
>>>>
>>>>
>>>> On Fri, Jul 21, 2017, 22:49 Russell Haley <[hidden email]> wrote:
>>>>>
>>>>> Hi,
>>>>>
>>>>> I've built lua a bunch of times on TrueOS (aka FreeBSD 12-Current)
>>>>> using the files from git. I usually mangle the Makefile myself to use
>>>>> clang and make it install where I want to.
>>>>>
>>>>> Anyway, I have an arm board with FreeBSD 12-Current on it. I tried
>>>>> building from the tarball provided by the lua.org website. I modified
>>>>> the Makefile to use clang because, well, this is FreeBSD! I added the
>>>>> CC=cc flag from osx target to the freebsd.
>>>>>
>>>>> The following is my failed build output is below. For the record,
>>>>> readline 6.3.8_1 installed with git and git seems to work fine.
>>>>>
>>>>>
>>>>> freebsd@imx6:~/lua/lua-5.3.4/src % make freebsd
>>>>> make all SYSCFLAGS="-DLUA_USE_LINUX" SYSLIBS="-Wl,-E -lreadline" CC=cc
>>>>> cc  -O2 -Wall -Wextra -DLUA_COMPAT_5_2 -DLUA_USE_LINUX  -c lapi.c -o
>>>>> lapi.o
>>>>> cc  -O2 -Wall -Wextra -DLUA_COMPAT_5_2 -DLUA_USE_LINUX  -c lcode.c -o
>>>>> lcode.o
>>>>> cc  -O2 -Wall -Wextra -DLUA_COMPAT_5_2 -DLUA_USE_LINUX  -c lctype.c -o
>>>>> lctype.o
>>>>> cc  -O2 -Wall -Wextra -DLUA_COMPAT_5_2 -DLUA_USE_LINUX  -c ldebug.c -o
>>>>> ldebug.o
>>>>> cc  -O2 -Wall -Wextra -DLUA_COMPAT_5_2 -DLUA_USE_LINUX  -c ldo.c -o ldo.o
>>>>> cc  -O2 -Wall -Wextra -DLUA_COMPAT_5_2 -DLUA_USE_LINUX  -c ldump.c -o
>>>>> ldump.o
>>>>> cc  -O2 -Wall -Wextra -DLUA_COMPAT_5_2 -DLUA_USE_LINUX  -c lfunc.c -o
>>>>> lfunc.o
>>>>> cc  -O2 -Wall -Wextra -DLUA_COMPAT_5_2 -DLUA_USE_LINUX  -c lgc.c -o lgc.o
>>>>> cc  -O2 -Wall -Wextra -DLUA_COMPAT_5_2 -DLUA_USE_LINUX  -c llex.c -o
>>>>> llex.o
>>>>> cc  -O2 -Wall -Wextra -DLUA_COMPAT_5_2 -DLUA_USE_LINUX  -c lmem.c -o
>>>>> lmem.o
>>>>> cc  -O2 -Wall -Wextra -DLUA_COMPAT_5_2 -DLUA_USE_LINUX  -c lobject.c
>>>>> -o lobject.o
>>>>> cc  -O2 -Wall -Wextra -DLUA_COMPAT_5_2 -DLUA_USE_LINUX  -c lopcodes.c
>>>>> -o lopcodes.o
>>>>> cc  -O2 -Wall -Wextra -DLUA_COMPAT_5_2 -DLUA_USE_LINUX  -c lparser.c
>>>>> -o lparser.o
>>>>> cc  -O2 -Wall -Wextra -DLUA_COMPAT_5_2 -DLUA_USE_LINUX  -c lstate.c -o
>>>>> lstate.o
>>>>> cc  -O2 -Wall -Wextra -DLUA_COMPAT_5_2 -DLUA_USE_LINUX  -c lstring.c
>>>>> -o lstring.o
>>>>> cc  -O2 -Wall -Wextra -DLUA_COMPAT_5_2 -DLUA_USE_LINUX  -c ltable.c -o
>>>>> ltable.o
>>>>> cc  -O2 -Wall -Wextra -DLUA_COMPAT_5_2 -DLUA_USE_LINUX  -c ltm.c -o ltm.o
>>>>> cc  -O2 -Wall -Wextra -DLUA_COMPAT_5_2 -DLUA_USE_LINUX  -c lundump.c
>>>>> -o lundump.o
>>>>> cc  -O2 -Wall -Wextra -DLUA_COMPAT_5_2 -DLUA_USE_LINUX  -c lvm.c -o lvm.o
>>>>> cc  -O2 -Wall -Wextra -DLUA_COMPAT_5_2 -DLUA_USE_LINUX  -c lzio.c -o
>>>>> lzio.o
>>>>> cc  -O2 -Wall -Wextra -DLUA_COMPAT_5_2 -DLUA_USE_LINUX  -c lauxlib.c
>>>>> -o lauxlib.o
>>>>> cc  -O2 -Wall -Wextra -DLUA_COMPAT_5_2 -DLUA_USE_LINUX  -c lbaselib.c
>>>>> -o lbaselib.o
>>>>> cc  -O2 -Wall -Wextra -DLUA_COMPAT_5_2 -DLUA_USE_LINUX  -c lbitlib.c
>>>>> -o lbitlib.o
>>>>> cc  -O2 -Wall -Wextra -DLUA_COMPAT_5_2 -DLUA_USE_LINUX  -c lcorolib.c
>>>>> -o lcorolib.o
>>>>> cc  -O2 -Wall -Wextra -DLUA_COMPAT_5_2 -DLUA_USE_LINUX  -c ldblib.c -o
>>>>> ldblib.o
>>>>> cc  -O2 -Wall -Wextra -DLUA_COMPAT_5_2 -DLUA_USE_LINUX  -c liolib.c -o
>>>>> liolib.o
>>>>> cc  -O2 -Wall -Wextra -DLUA_COMPAT_5_2 -DLUA_USE_LINUX  -c lmathlib.c
>>>>> -o lmathlib.o
>>>>> cc  -O2 -Wall -Wextra -DLUA_COMPAT_5_2 -DLUA_USE_LINUX  -c loslib.c -o
>>>>> loslib.o
>>>>> cc  -O2 -Wall -Wextra -DLUA_COMPAT_5_2 -DLUA_USE_LINUX  -c lstrlib.c
>>>>> -o lstrlib.o
>>>>> cc  -O2 -Wall -Wextra -DLUA_COMPAT_5_2 -DLUA_USE_LINUX  -c ltablib.c
>>>>> -o ltablib.o
>>>>> cc  -O2 -Wall -Wextra -DLUA_COMPAT_5_2 -DLUA_USE_LINUX  -c lutf8lib.c
>>>>> -o lutf8lib.o
>>>>> cc  -O2 -Wall -Wextra -DLUA_COMPAT_5_2 -DLUA_USE_LINUX  -c loadlib.c
>>>>> -o loadlib.o
>>>>> cc  -O2 -Wall -Wextra -DLUA_COMPAT_5_2 -DLUA_USE_LINUX  -c linit.c -o
>>>>> linit.o
>>>>> ar rcu liblua.a lapi.o lcode.o lctype.o ldebug.o ldo.o ldump.o lfunc.o
>>>>> lgc.o llex.o  lmem.o lobject.o lopcodes.o lparser.o lstate.o lstring.o
>>>>> ltable.o  ltm.o lundump.o lvm.o lzio.o lauxlib.o lbaselib.o lbitlib.o
>>>>> lcorolib.o ldblib.o liolib.o  lmathlib.o loslib.o lstrlib.o ltablib.o
>>>>> lutf8lib.o loadlib.o linit.o
>>>>> ranlib liblua.a
>>>>> cc  -O2 -Wall -Wextra -DLUA_COMPAT_5_2 -DLUA_USE_LINUX  -c lua.c -o lua.o
>>>>> In file included from lua.c:12:
>>>>> In file included from /usr/include/signal.h:40:
>>>>> /usr/include/machine/ucontext.h:81:2: error: unknown type name
>>>>> 'size_t'; did you mean '__size_t'?
>>>>>         size_t          mc_vfp_size;
>>>>>         ^
>>>>> /usr/include/machine/_types.h:87:20: note: '__size_t' declared here
>>>>> typedef __uint32_t      __size_t;               /* sizeof() */
>>>>>                         ^
>>>>> lua.c:82:10: fatal error: 'readline/readline.h' file not found
>>>>> #include <readline/readline.h>
>>>>>          ^~~~~~~~~~~~~~~~~~~~~
>>>>> 2 errors generated.
>>>>> *** Error code 1
>>>>>
>>>>> Stop.
>>>>> make[1]: stopped in /home/freebsd/lua/lua-5.3.4/src
>>>>> *** Error code 1
>>>>>
>>>>> Stop.
>>>>> make: stopped in /home/freebsd/lua/lua-5.3.4/src
>>>>>
>>>>>
>>>>> Thanks in advance,
>>>>>
>>>>> Russ
>>>>>
>>>> --
>>>> --
>>>> Ryan <[hidden email]>
>>>> Software Developer / System Administrator
>>>> https://hashbang.sh

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Building Lua 5.3 from Lua.org on FreeBSD

Luiz Henrique de Figueiredo
In reply to this post by Russell Haley
> I can confirm the patch fixes Lua 5.3.4 as provided by the tarball on
> FreeBSD 12-CURRENT on armv6 and in a 11.0-RELEASE jail running on a
> 12-CURRENT amd64 host. I have not tested:

Are you talking about this?
        https://github.com/pfsense/FreeBSD-ports/blob/1110cd5f947a5e774ae0a4e5e6d74776ee0e3678/lang/lua53/files/patch-src_lua.c

This patches lua.c to include <string.h> before <signal.h>.

Otherwise, could you please give a link to the patch ?

Thanks.

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Building Lua 5.3 from Lua.org on FreeBSD

Russell Haley
Yes, that's the patch! I was also surprised when I looked at it and
checked the site again in case it was a wrong link. I performed the
change manually in vim and Lua compiled. I reversed the change to
prove that it wasn't just me. Lua does not compile without this
change!

Regards,
Russ

On Sat, Jul 22, 2017 at 2:58 PM, Luiz Henrique de Figueiredo
<[hidden email]> wrote:

>> I can confirm the patch fixes Lua 5.3.4 as provided by the tarball on
>> FreeBSD 12-CURRENT on armv6 and in a 11.0-RELEASE jail running on a
>> 12-CURRENT amd64 host. I have not tested:
>
> Are you talking about this?
>         https://github.com/pfsense/FreeBSD-ports/blob/1110cd5f947a5e774ae0a4e5e6d74776ee0e3678/lang/lua53/files/patch-src_lua.c
>
> This patches lua.c to include <string.h> before <signal.h>.
>
> Otherwise, could you please give a link to the patch ?
>
> Thanks.
>

123
Loading...