lua-users home
lua-l archive

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


Hi,

When linking a dynamically loadable C extension for use with Lua on MacOS you used to have to specify the magic flags
"-bundle -undefined dynamic_lookup". The dynamic linker would then look in the main program binary for undefined symbols.
This now produces a warning message. Example:

clang -I/Users/ge/lua-tools/src -dynamic -pedantic -std=gnu99 -O2 -Wall -DVERSION=\"test\" -c date.c -o .obj/date.o
clang -bundle -undefined dynamic_lookup .obj/date.o -o _date.so
ld: warning: -undefined dynamic_lookup may not work with chained fixups

Documentation is sparse, but you now have to link the dynamic library against the binary that contains the lua interpreter in the following way:

clang -bundle -bundle_loader /Users/ge/lua-tools/src/lua .obj/date.o -o _date.so

The flags are "-bundle -bundle_loader <path-to-program>"

Hope this is helpful to someone.

--