Dear Mike,
Thanks for your quick reply.
Well, 80% of the user base of LuaJIT is using Windows and so far
nobody ever reported a problem compiling it.
I haven't had problems compiling it either! But the .exe doesn't work.
Why don't you make a .exe that you distribute on your web site?
In this email, I will show you what happens in Vista and Cygwin. I
will mention what happens in MinGW and XP (without redoing it), but if
you want me to redo it, I can also do that.
First is the compilation. Here it is.
$ make cygwin
cd src && make cygwin
make[1]: Entering directory `/cygdrive/c/software/LuaJIT-1.1.4/src'
make "CC=gcc -mno-cygwin" mingw
make[2]: Entering directory `/cygdrive/c/software/LuaJIT-1.1.4/src'
make "LUA_A=lua51.dll" "LUA_T=luajit.exe" \
"AR=gcc -mno-cygwin -shared -o" "RANLIB=strip --strip-unneeded" \
"MYCFLAGS=-DLUA_BUILD_AS_DLL -maccumulate-outgoing-args" \
"MYLIBS=" "MYLDFLAGS=-s" luajit.exe
make[3]: Entering directory `/cygdrive/c/software/LuaJIT-1.1.4/src'
gcc -mno-cygwin -O3 -fomit-frame-pointer -Wall -DLUA_BUILD_AS_DLL
-maccumulate-o
utgoing-args -I../dynasm -c -o lua.o lua.c
gcc -mno-cygwin -O3 -fomit-frame-pointer -Wall -DLUA_BUILD_AS_DLL
-maccumulate-o
utgoing-args -I../dynasm -c -o lapi.o lapi.c
gcc -mno-cygwin -O3 -fomit-frame-pointer -Wall -DLUA_BUILD_AS_DLL
-maccumulate-o
utgoing-args -I../dynasm -c -o lcode.o lcode.c
gcc -mno-cygwin -O3 -fomit-frame-pointer -Wall -DLUA_BUILD_AS_DLL
-maccumulate-o
utgoing-args -I../dynasm -c -o ldebug.o ldebug.c
gcc -mno-cygwin -O3 -fomit-frame-pointer -Wall -DLUA_BUILD_AS_DLL
-maccumulate-o
utgoing-args -I../dynasm -c -o ldo.o ldo.c
gcc -mno-cygwin -O3 -fomit-frame-pointer -Wall -DLUA_BUILD_AS_DLL
-maccumulate-o
utgoing-args -I../dynasm -c -o ldump.o ldump.c
gcc -mno-cygwin -O3 -fomit-frame-pointer -Wall -DLUA_BUILD_AS_DLL
-maccumulate-o
utgoing-args -I../dynasm -c -o lfunc.o lfunc.c
gcc -mno-cygwin -O3 -fomit-frame-pointer -Wall -DLUA_BUILD_AS_DLL
-maccumulate-o
utgoing-args -I../dynasm -c -o lgc.o lgc.c
gcc -mno-cygwin -O3 -fomit-frame-pointer -Wall -DLUA_BUILD_AS_DLL
-maccumulate-o
utgoing-args -I../dynasm -c -o llex.o llex.c
gcc -mno-cygwin -O3 -fomit-frame-pointer -Wall -DLUA_BUILD_AS_DLL
-maccumulate-o
utgoing-args -I../dynasm -c -o lmem.o lmem.c
gcc -mno-cygwin -O3 -fomit-frame-pointer -Wall -DLUA_BUILD_AS_DLL
-maccumulate-o
utgoing-args -I../dynasm -c -o lobject.o lobject.c
gcc -mno-cygwin -O3 -fomit-frame-pointer -Wall -DLUA_BUILD_AS_DLL
-maccumulate-o
utgoing-args -I../dynasm -c -o lopcodes.o lopcodes.c
gcc -mno-cygwin -O3 -fomit-frame-pointer -Wall -DLUA_BUILD_AS_DLL
-maccumulate-o
utgoing-args -I../dynasm -c -o lparser.o lparser.c
gcc -mno-cygwin -O3 -fomit-frame-pointer -Wall -DLUA_BUILD_AS_DLL
-maccumulate-o
utgoing-args -I../dynasm -c -o lstate.o lstate.c
gcc -mno-cygwin -O3 -fomit-frame-pointer -Wall -DLUA_BUILD_AS_DLL
-maccumulate-o
utgoing-args -I../dynasm -c -o lstring.o lstring.c
gcc -mno-cygwin -O3 -fomit-frame-pointer -Wall -DLUA_BUILD_AS_DLL
-maccumulate-o
utgoing-args -I../dynasm -c -o ltable.o ltable.c
gcc -mno-cygwin -O3 -fomit-frame-pointer -Wall -DLUA_BUILD_AS_DLL
-maccumulate-o
utgoing-args -I../dynasm -c -o ltm.o ltm.c
gcc -mno-cygwin -O3 -fomit-frame-pointer -Wall -DLUA_BUILD_AS_DLL
-maccumulate-o
utgoing-args -I../dynasm -c -o lundump.o lundump.c
gcc -mno-cygwin -O3 -fomit-frame-pointer -Wall -DLUA_BUILD_AS_DLL
-maccumulate-o
utgoing-args -I../dynasm -c -o lvm.o lvm.c
gcc -mno-cygwin -O3 -fomit-frame-pointer -Wall -DLUA_BUILD_AS_DLL
-maccumulate-o
utgoing-args -I../dynasm -c -o lzio.o lzio.c
gcc -mno-cygwin -O3 -fomit-frame-pointer -Wall -DLUA_BUILD_AS_DLL
-maccumulate-o
utgoing-args -I../dynasm -c -o lcoco.o lcoco.c
gcc -mno-cygwin -O3 -fomit-frame-pointer -Wall -DLUA_BUILD_AS_DLL
-maccumulate-o
utgoing-args -I../dynasm -c -o ljit_core.o ljit_core.c
gcc -mno-cygwin -O3 -fomit-frame-pointer -Wall -DLUA_BUILD_AS_DLL
-maccumulate-o
utgoing-args -I../dynasm -c -o ljit_mem.o ljit_mem.c
gcc -mno-cygwin -O3 -fomit-frame-pointer -Wall -DLUA_BUILD_AS_DLL
-maccumulate-o
utgoing-args -I../dynasm -c -o ljit_dasm.o ljit_dasm.c
gcc -mno-cygwin -O3 -fomit-frame-pointer -Wall -DLUA_BUILD_AS_DLL
-maccumulate-o
utgoing-args -I../dynasm -c -o ljit_backend.o ljit_backend.c
gcc -mno-cygwin -O3 -fomit-frame-pointer -Wall -DLUA_BUILD_AS_DLL
-maccumulate-o
utgoing-args -I../dynasm -c -o lauxlib.o lauxlib.c
gcc -mno-cygwin -O3 -fomit-frame-pointer -Wall -DLUA_BUILD_AS_DLL
-maccumulate-o
utgoing-args -I../dynasm -c -o lbaselib.o lbaselib.c
gcc -mno-cygwin -O3 -fomit-frame-pointer -Wall -DLUA_BUILD_AS_DLL
-maccumulate-o
utgoing-args -I../dynasm -c -o ldblib.o ldblib.c
gcc -mno-cygwin -O3 -fomit-frame-pointer -Wall -DLUA_BUILD_AS_DLL
-maccumulate-o
utgoing-args -I../dynasm -c -o liolib.o liolib.c
gcc -mno-cygwin -O3 -fomit-frame-pointer -Wall -DLUA_BUILD_AS_DLL
-maccumulate-o
utgoing-args -I../dynasm -c -o lmathlib.o lmathlib.c
gcc -mno-cygwin -O3 -fomit-frame-pointer -Wall -DLUA_BUILD_AS_DLL
-maccumulate-o
utgoing-args -I../dynasm -c -o loslib.o loslib.c
gcc -mno-cygwin -O3 -fomit-frame-pointer -Wall -DLUA_BUILD_AS_DLL
-maccumulate-o
utgoing-args -I../dynasm -c -o ltablib.o ltablib.c
gcc -mno-cygwin -O3 -fomit-frame-pointer -Wall -DLUA_BUILD_AS_DLL
-maccumulate-o
utgoing-args -I../dynasm -c -o lstrlib.o lstrlib.c
gcc -mno-cygwin -O3 -fomit-frame-pointer -Wall -DLUA_BUILD_AS_DLL
-maccumulate-o
utgoing-args -I../dynasm -c -o loadlib.o loadlib.c
gcc -mno-cygwin -O3 -fomit-frame-pointer -Wall -DLUA_BUILD_AS_DLL
-maccumulate-o
utgoing-args -I../dynasm -c -o ljitlib.o ljitlib.c
gcc -mno-cygwin -O3 -fomit-frame-pointer -Wall -DLUA_BUILD_AS_DLL
-maccumulate-o
utgoing-args -I../dynasm -c -o linit.o linit.c
gcc -mno-cygwin -shared -o lua51.dll lapi.o lcode.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 lcoco.o ljit_core.o ljit_mem.o
ljit_dasm.o ljit_b
ackend.o lauxlib.o lbaselib.o ldblib.o liolib.o lmathlib.o loslib.o
ltablib.o ls
trlib.o loadlib.o ljitlib.o linit.o
strip --strip-unneeded lua51.dll
gcc -mno-cygwin -o luajit.exe -s lua.o lua51.dll -lm
make[3]: Leaving directory `/cygdrive/c/software/LuaJIT-1.1.4/src'
make[2]: Leaving directory `/cygdrive/c/software/LuaJIT-1.1.4/src'
make[1]: Leaving directory `/cygdrive/c/software/LuaJIT-1.1.4/src'
Now I can install it
$ make install
cd src && mkdir -p /usr/local/bin /usr/local/include /usr/local/lib
/usr/local/m
an/man1 /usr/local/share/lua/5.1 /usr/local/lib/lua/5.1
/usr/local/share/lua/5.1
/jit
cd src && install -p -m 0755 luajit /usr/local/bin
###cd src && install -p -m 0644 /usr/local/include
###cd src && install -p -m 0644 /usr/local/lib
###cd doc && install -p -m 0644 /usr/local/man/man1
cd jit && install -p -m 0644 *.lua /usr/local/share/lua/5.1/jit
Now I can run it.
$ luajit
At this point, in Vista 32 bits, the window "luajit.exe has stopped
working" pops up 6 times in a row.
I can gdb it.
$ gdb `which luajit`
GNU gdb 6.5.50.20060706-cvs (cygwin-special)
Copyright (C) 2006 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and
you are
welcome to change it and/or distribute copies of it under certain
conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB. Type "show warranty" for
details.
This GDB was configured as "i686-pc-cygwin"...(no debugging symbols found)
(gdb) run
Starting program: /usr/local/bin/luajit.exe
gdb: unknown target exception 0xc0000135 at 0x77179cac
Program received signal ?, Unknown signal.
Program exited with code 030000000465.
At this point, the window "luajit.exe has stopped working..." pops up
once. If I cancel, I get:
You can't do that without a process to debug.
(gdb)
In XP, the "crash" or hang is much less interesting. Instead of
popping up this "luajit.exe has stopped working..." window, it just
returns to the prompt without doing anything. It also had some
interesting behavior in gdb. In MinGW, I used "make mingw". There is
the additional problem that the lua5.1.dll or whatever it's called,
wasn't copied anywhere where it could be found. Once I fixed that, I
was able to start luajit.exe, which went into an infinite loop.
For completeness:
$ uname -a
CYGWIN_NT-6.0 Seb-ThinkPad 1.5.24(0.156/4/2) 2007-01-31 10:57 i686 Cygwin
--
Sébastien Loisel