Created
September 19, 2013 09:54
-
-
Save lukego/6621352 to your computer and use it in GitHub Desktop.
LuaJIT 2.1 object linking bug
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 \"test\""); | |
} | |
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 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