Commit 86abd6c1 authored by Alexandre Duret-Lutz's avatar Alexandre Duret-Lutz
Browse files

Use -Bsymbolic-functions and -Bsymbolic

This avoids dynamic lookups to resolve symbols inside the library, but
disallows symbol interposition.

* m4/symbolic.m4: New file.
* buddy/m4/symbolic.m4: New link.
* configure.ac, buddy/configure.ac: Add AX_SYMBOLIC.
* buddy/src/Makefile.am, iface/ltsmin/Makefile.am, src/Makefile.am,
wrap/python/Makefile.am: Link with $(SYMBOLIC_LDFLAGS).
parent 05538423
......@@ -19,6 +19,7 @@ AC_PROG_YACC
AC_PROG_CXX
LT_INIT([win32-dll])
AX_BSYMBOLIC
# Use -Werror since using -fvisibility under MinGW is only a warning.
# (The option is ignored anyway since this does not make sense under windows).
......
../../m4/symbolic.m4
\ No newline at end of file
......@@ -5,7 +5,7 @@ BUDDY_FLAGS = -I$(top_builddir) -DVERSION=23 -DBUDDY_DLL_EXPORTS -DBUDDY_DLL
lib_LTLIBRARIES = libbddx.la
# See the `Updating version info' node of the Libtool manual before
# changing this.
libbddx_la_LDFLAGS = -no-undefined -version-info 0:0:0
libbddx_la_LDFLAGS = -no-undefined -version-info 0:0:0 $(SYMBOLIC_LDFLAGS)
libbddx_la_CPPFLAGS = $(BUDDY_FLAGS)
libbddx_la_SOURCES = \
bddio.c \
......
......@@ -118,6 +118,7 @@ LTDL_INIT([subproject convenience])
link_all_deplibs=yes
link_all_deplibs_CXX=yes
AX_BSYMBOLIC
AC_ARG_ENABLE([python],
[AC_HELP_STRING([--disable-python],
......
......@@ -29,6 +29,7 @@ lib_LTLIBRARIES = libspotltsmin.la
libspotltsmin_la_LIBADD = \
$(top_builddir)/src/libspot.la \
$(top_builddir)/ltdl/libltdlc.la -lpthread
libspotltsmin_la_LDFLAGS = -no-undefined $(SYMBOLIC_LDFLAGS)
libspotltsmin_la_SOURCES = ltsmin.cc
noinst_PROGRAMS = modelcheck
......
dnl This was addapted from a patch submitted written by H.J. Lu for GCC.
dnl https://gcc.gnu.org/ml/gcc/2007-01/msg00363.html
dnl The -Bsymbolic-functions is no-longer part of the --help of ld, but
dnl we can call ld -Bsymbolic-functions --help and it will choke if the
dnl option is not supported.
dnl Substitute SYMBOLIC_LDFLAGS with -Bsymbolic-functions for GNU linker
dnl if it is supported.
AC_DEFUN([AC_LIB_PROG_LD_GNU_SYMBOLIC],
[AC_CACHE_CHECK([if the GNU linker ($LD) supports -Bsymbolic-functions],
acl_cv_prog_gnu_ld_symbolic, [
acl_cv_prog_gnu_ld_symbolic=no
if test x"$with_gnu_ld" = x"yes"; then
if $LD -Bsymbolic-functions -Bsymbolic --help>/dev/null 2>&1 </dev/null; then
acl_cv_prog_gnu_ld_symbolic=yes
fi
fi])
if test x"$acl_cv_prog_gnu_ld_symbolic" = x"yes"; then
SYMBOLIC_LDFLAGS="-Wl,-Bsymbolic-functions -Wl,-Bsymbolic"
else
SYMBOLIC_LDFLAGS=''
fi
AC_SUBST([SYMBOLIC_LDFLAGS])])
AC_DEFUN([AX_BSYMBOLIC],
[AC_ARG_ENABLE([Bsymbolic],
[AS_HELP_STRING([--disable-Bsymbolic],
[disable linking with -Bsymbolic])],
[], [enable_Bsymbolic=yes])
if test "$enable_Bsymbolic" != "no"; then
AC_LIB_PROG_LD_GNU_SYMBOLIC
fi])
......@@ -30,7 +30,7 @@ SUBDIRS = misc priv tl graph twa twaalgos ta taalgos kripke \
lib_LTLIBRARIES = libspot.la
libspot_la_SOURCES =
libspot_la_LDFLAGS = $(BUDDY_LDFLAGS) -no-undefined
libspot_la_LDFLAGS = $(BUDDY_LDFLAGS) -no-undefined $(SYMBOLIC_LDFLAGS)
libspot_la_LIBADD = \
kripke/libkripke.la \
kripkeparse/libkripkeparse.la \
......
......@@ -36,7 +36,7 @@ MAINTAINERCLEANFILES = \
## spot
_spot_impl_la_SOURCES = $(srcdir)/spot_impl_wrap.cxx
_spot_impl_la_LDFLAGS = -avoid-version -module
_spot_impl_la_LDFLAGS = -avoid-version -module -no-undefined $(SYMBOLIC_LDFLAGS)
_spot_impl_la_LIBADD = $(top_builddir)/src/libspot.la
$(srcdir)/spot_impl_wrap.cxx: $(srcdir)/spot_impl.i
......@@ -49,7 +49,8 @@ $(srcdir)/spot_impl.py: $(srcdir)/spot_impl.i
## buddy
_buddy_la_SOURCES = $(srcdir)/buddy_wrap.cxx
_buddy_la_LDFLAGS = -avoid-version -module $(BUDDY_LDFLAGS)
_buddy_la_LDFLAGS = -avoid-version -module $(BUDDY_LDFLAGS) \
-no-undefined $(SYMBOLIC_LDFLAGS)
$(srcdir)/buddy_wrap.cxx: $(srcdir)/buddy.i
$(SWIG) -c++ -python $(BUDDY_CPPFLAGS) $(srcdir)/buddy.i
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment