x一、玩客云 > 分区1 > onecloud > tools > lua-5.3.4.tar.gz二、https://www.lua.org/download.html
xxxxxxxxxxmake linux ; make install
xxxxxxxxxx一、更改 Makefile 中的编译器CC,ar 工具为指定工具链二、指定依赖包 ncurses 和 readline 的头文件。以及 lib 路径-Wl -E参数即可xxxxxxxxxxMakefile 中明明带上了 -static 选项,明确要求编译成静太库。但是实际编译出来的却是动态的。通过 file 命令查看,如:[root@localhost bin]# file mesgmesg: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.32, BuildID[sha1]=2bb790035ffda6d6875fcfb271af8dc18e3e0535, stripped最后将 Makefile 中 -Wl -E 两个参数删除,竟然意外的好了。此问题在 ppc 的交叉编译环境上没有表现出来,面在 arm 上表现出来了
xxxxxxxxxxfor i,v in ipairs(arg) do print ("arg[".. i .. "] is " .. v)endfunction test() print ("arg[-3]=",arg[-3]) print ("arg[-2]=",arg[-2]) print ("arg[-1]=",arg[-1]) print ("arg[ 0]=",arg[ 0]) print ("arg[ 1]=",arg[ 1]) print ("arg[ 2]=",arg[ 2])endtest()--> 以上为 test.lua 的内容:[wishcell@localhost lua]$ lua test.lua 1 2 3arg[1] is 1arg[2] is 2arg[3] is 3arg[-3]= nilarg[-2]= nilarg[-1]= luaarg[ 0]= test.luaarg[ 1]= 1arg[ 2]= 2[wishcell@localhost lua]$