From: Vincent Bernat Date: Thu, 16 Jul 2015 18:52:51 +0000 (+0200) Subject: BUILD: link with libdl if needed for Lua support X-Git-Tag: v1.6-dev4~128 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=e192cbb585d40e8d467a1f740504b5604a3101ea;p=thirdparty%2Fhaproxy.git BUILD: link with libdl if needed for Lua support On platforms where the dl*() functions are not part of the libc, a program linking Lua also needs to link to libdl. Moreover, on platforms using a gold linker with the --as-needed flag, the libdl library needs to be linked after linking Lua, otherwise, it won't be marked as needed and will be discarded and its symbols won't be present at the end of the linking phase. Ubuntu enables the --as-needed flag by default. Other distributions may advertise its use, like Gentoo. --- diff --git a/Makefile b/Makefile index 6ab7d5469d..a1383a38c5 100644 --- a/Makefile +++ b/Makefile @@ -606,6 +606,9 @@ endif endif OPTIONS_LDFLAGS += $(LUA_LD_FLAGS) -l$(LUA_LIB_NAME) -lm +ifneq ($(USE_DL),) +OPTIONS_LDFLAGS += -ldl +endif OPTIONS_OBJS += src/hlua.o endif