Link the main library with -Wl,-z,nodelete
to prevent unloading (#2934)
See: https://github.com/libvips/php-vips-ext/pull/44
This commit is contained in:
parent
57fff0fe2b
commit
fa6c034b32
14
configure.ac
14
configure.ac
@ -457,6 +457,20 @@ else
|
||||
fi
|
||||
fi
|
||||
|
||||
SAVE_LDFLAGS="$LDFLAGS"
|
||||
LDFLAGS="$LDFLAGS -Wl,-z,nodelete"
|
||||
AC_MSG_CHECKING([whether linker understands -z nodelete])
|
||||
AC_LINK_IFELSE([AC_LANG_PROGRAM([], [])],
|
||||
[
|
||||
AC_MSG_RESULT([yes])
|
||||
LDFLAGS_Z_NODELETE="-Wl,-z,nodelete"
|
||||
],[
|
||||
AC_MSG_RESULT([no])
|
||||
LDFLAGS_Z_NODELETE=""
|
||||
])
|
||||
LDFLAGS="$SAVE_LDFLAGS"
|
||||
AC_SUBST(LDFLAGS_Z_NODELETE)
|
||||
|
||||
# check for gtk-doc
|
||||
GTK_DOC_CHECK([1.14],[--flavour no-tmpl])
|
||||
|
||||
|
@ -58,6 +58,7 @@ libvips_la_LIBADD = \
|
||||
@VIPS_LIBS@
|
||||
|
||||
libvips_la_LDFLAGS = \
|
||||
$(LDFLAGS_Z_NODELETE) \
|
||||
-no-undefined \
|
||||
-version-info @LIBRARY_CURRENT@:@LIBRARY_REVISION@:@LIBRARY_AGE@
|
||||
|
||||
|
@ -26,6 +26,7 @@ libvips_lib = library('vips',
|
||||
darwin_versions: darwin_versions,
|
||||
gnu_symbol_visibility: 'hidden',
|
||||
install: true,
|
||||
link_args: nodelete_link_args,
|
||||
)
|
||||
|
||||
libvips_dep = declare_dependency(
|
||||
|
@ -67,6 +67,7 @@ libvips_deps = [
|
||||
thread_dep,
|
||||
m_dep,
|
||||
]
|
||||
nodelete_link_args = cc.get_supported_link_arguments('-Wl,-z,nodelete')
|
||||
|
||||
prefix_dir = get_option('prefix')
|
||||
lib_dir = prefix_dir / get_option('libdir')
|
||||
|
Loading…
Reference in New Issue
Block a user