lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


One issue: SUSv3 (Single Unix Specification, v3) requires you to either specify RTLD_LOCAL or RTLD_GLOBAL to 'dlopen'. The result is 'unspecified', otherwise. I suggest adding RTLD_LOCAL to the 'mode' parameter for 'dlopen' in the next version of Lua.

Another bugaboo: 'dlerror' is not required to be thread-safe. (dlopen/dlclose/dlsym are). I don't know what to do about that.....


On Apr 3, 2007, at 4:48 PM, Luiz Henrique de Figueiredo wrote:

You may need to build a .dylib.

  gcc -dynamiclib

Actually, I forgot -bundle. This line works:
cc -o random.so -bundle -undefined dynamic_lookup lrandom.o
But, as you suggested, so does
cc -o random.so -dynamiclib -undefined dynamic_lookup lrandom.o

The .so created with the first one is smaller. I don't know whether this means
anything...

Anyway, it seems that using dlopen in Mac OS X 10.4 is ok. Great.
Again, the correct Makefile line for building Lua to use dlopen is
$(MAKE) all MYCFLAGS="-DLUA_USE_LINUX" MYLIBS="-lreadline"

but perhaps LUA_USE_LINUX is confusing... (LUA_USE_LINUX just means
LUA_USE_POSIX, LUA_USE_DLOPEN, and LUA_USE_READLINE).
--lhf



--
Gé Weijers