Compilation problems.

Can you help improve your favourite game? Hardcore C mages, talented artists, and players with any level of experience are welcome!
Lachu
Elite
Posts: 418
Joined: Sat May 04, 2013 2:19 pm

Compilation problems.

Postby Lachu » Thu Jun 18, 2020 2:19 pm

I use debug flag for autogen. It's not my error, because on master the same error occur. Is the a way to suppress this single error? Compile this file with different autogen options set and copy an object file? Maybe better approach?

CC lstring.lo
In function ‘createstrobj’,
inlined from ‘luaS_createlngstrobj’ at ../../../../dependencies/lua-5.4/src/lstring.c:168:17,
inlined from ‘luaS_newlstr’ at ../../../../dependencies/lua-5.4/src/lstring.c:238:10:
../../../../dependencies/lua-5.4/src/lstring.c:162:17: error: writing 1 byte into a region of size 0 [-Werror=stringop-overflow=]
162 | getstr(ts)[l] = '\0'; /* ending 0 */
In file included from ../../../../dependencies/lua-5.4/src/ldebug.h:11,
from ../../../../dependencies/lua-5.4/src/lstring.c:17:
../../../../dependencies/lua-5.4/src/lstring.c: In function ‘luaS_newlstr’:
../../../../dependencies/lua-5.4/src/lstate.h:315:18: note: at offset 0 to object ‘ts’ with size 24 declared here
315 | struct TString ts;
| ^~
cc1: all warnings being treated as errors

cazfi
Elite
Posts: 1781
Joined: Tue Jan 29, 2013 6:54 pm

Re: Compilation problems.

Postby cazfi » Thu Jun 18, 2020 9:42 pm

Which distribution?

In case of Debian; Debian Experimental has liblua5.4-dev package. Once you have that installed, you don't need to compile lua as part of freeciv build.

Lachu
Elite
Posts: 418
Joined: Sat May 04, 2013 2:19 pm

Re: Compilation problems.

Postby Lachu » Fri Jun 19, 2020 5:14 pm

OpenSUSE Tumbleweed

liblua5_3-5 | The Lua integration library

Above one is installed.

libluajit-5_1-2 | Library for JIT Lua compiler

Above one too.

But I don't have header installed and it isn't available in setup repositories.

Lachu
Elite
Posts: 418
Joined: Sat May 04, 2013 2:19 pm

Re: Compilation problems.

Postby Lachu » Sun Jun 21, 2020 7:28 pm

I have an question. Where could I find autogen/configure documentation? When calling ./autogen.sh --help, it not display help. I will compile lua in different directory and copy object files.