Created
September 20, 2013 08:59
-
-
Save lukego/6634948 to your computer and use it in GitHub Desktop.
LuaJIT bytecode module name (luajit -b -n newname ...) bug report.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
cat > main.c <<EOF | |
#include <lua.h> | |
#include <lualib.h> | |
#include <lauxlib.h> | |
int main(int argc, char** argv) { | |
lua_State* L = luaL_newstate(); | |
luaL_openlibs(L); | |
return luaL_dostring(L, "require \"newname\""); | |
} | |
EOF | |
cat > test.lua <<EOF | |
print "Hello, world!" | |
EOF | |
gcc -I$LUAJIT/usr/local/include/luajit-2.1 -c main.c -o main.o | |
luajit -b -n newname test.lua test.o | |
gcc -Wl,-E -Werror -Wall -o test main.o test.o $LUAJIT/src/libluajit.a -lc -ldl -lm -lrt -lpthread | |
./test || echo "Error:" $? | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment