diff --git a/configure b/configure index 1794f5113a..5d9bd43cc9 100755 --- a/configure +++ b/configure @@ -669,6 +669,7 @@ BIND9_ISCCFG_BUILDINCLUDE BIND9_ISCCC_BUILDINCLUDE BIND9_ISC_BUILDINCLUDE BIND9_TOP_BUILDDIR +WRAP_INTERPOSE LD_WRAP_TESTS KYUA UNITTESTS @@ -850,7 +851,6 @@ infodir docdir oldincludedir includedir -runstatedir localstatedir sharedstatedir sysconfdir @@ -1023,7 +1023,6 @@ datadir='${datarootdir}' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' -runstatedir='${localstatedir}/run' includedir='${prefix}/include' oldincludedir='/usr/include' docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' @@ -1276,15 +1275,6 @@ do | -silent | --silent | --silen | --sile | --sil) silent=yes ;; - -runstatedir | --runstatedir | --runstatedi | --runstated \ - | --runstate | --runstat | --runsta | --runst | --runs \ - | --run | --ru | --r) - ac_prev=runstatedir ;; - -runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \ - | --runstate=* | --runstat=* | --runsta=* | --runst=* | --runs=* \ - | --run=* | --ru=* | --r=*) - runstatedir=$ac_optarg ;; - -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) ac_prev=sbindir ;; -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ @@ -1422,7 +1412,7 @@ fi for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ datadir sysconfdir sharedstatedir localstatedir includedir \ oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ - libdir localedir mandir runstatedir + libdir localedir mandir do eval ac_val=\$$ac_var # Remove trailing slashes. @@ -1575,7 +1565,6 @@ Fine tuning of the installation directories: --sysconfdir=DIR read-only single-machine data [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] --localstatedir=DIR modifiable single-machine data [PREFIX/var] - --runstatedir=DIR modifiable per-process data [LOCALSTATEDIR/run] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] @@ -4019,7 +4008,7 @@ else We can't simply define LARGE_OFF_T to be 9223372036854775807, since some C++ compilers masquerading as C compilers incorrectly reject 9223372036854775807. */ -#define LARGE_OFF_T ((((off_t) 1 << 31) << 31) - 1 + (((off_t) 1 << 31) << 31)) +#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 && LARGE_OFF_T % 2147483647 == 1) ? 1 : -1]; @@ -4065,7 +4054,7 @@ else We can't simply define LARGE_OFF_T to be 9223372036854775807, since some C++ compilers masquerading as C compilers incorrectly reject 9223372036854775807. */ -#define LARGE_OFF_T ((((off_t) 1 << 31) << 31) - 1 + (((off_t) 1 << 31) << 31)) +#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 && LARGE_OFF_T % 2147483647 == 1) ? 1 : -1]; @@ -4089,7 +4078,7 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext We can't simply define LARGE_OFF_T to be 9223372036854775807, since some C++ compilers masquerading as C compilers incorrectly reject 9223372036854775807. */ -#define LARGE_OFF_T ((((off_t) 1 << 31) << 31) - 1 + (((off_t) 1 << 31) << 31)) +#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 && LARGE_OFF_T % 2147483647 == 1) ? 1 : -1]; @@ -4134,7 +4123,7 @@ else We can't simply define LARGE_OFF_T to be 9223372036854775807, since some C++ compilers masquerading as C compilers incorrectly reject 9223372036854775807. */ -#define LARGE_OFF_T ((((off_t) 1 << 31) << 31) - 1 + (((off_t) 1 << 31) << 31)) +#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 && LARGE_OFF_T % 2147483647 == 1) ? 1 : -1]; @@ -4158,7 +4147,7 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext We can't simply define LARGE_OFF_T to be 9223372036854775807, since some C++ compilers masquerading as C compilers incorrectly reject 9223372036854775807. */ -#define LARGE_OFF_T ((((off_t) 1 << 31) << 31) - 1 + (((off_t) 1 << 31) << 31)) +#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 && LARGE_OFF_T % 2147483647 == 1) ? 1 : -1]; @@ -21814,6 +21803,157 @@ rm -f core conftest.err conftest.$ac_objext \ +WRAP_INTERPOSE= +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for linker support for '-z interpose' option" >&5 +$as_echo_n "checking for linker support for '-z interpose' option... " >&6; } + + + CCASFLAGS_interpose_ax_save_flags=$CCASFLAGS + + + + CFLAGS_interpose_ax_save_flags=$CFLAGS + + + + CPPFLAGS_interpose_ax_save_flags=$CPPFLAGS + + + + CXXFLAGS_interpose_ax_save_flags=$CXXFLAGS + + + + ERLCFLAGS_interpose_ax_save_flags=$ERLCFLAGS + + + + FCFLAGS_interpose_ax_save_flags=$FCFLAGS + + + + FCLIBS_interpose_ax_save_flags=$FCLIBS + + + + FFLAGS_interpose_ax_save_flags=$FFLAGS + + + + FLIBS_interpose_ax_save_flags=$FLIBS + + + + GCJFLAGS_interpose_ax_save_flags=$GCJFLAGS + + + + JAVACFLAGS_interpose_ax_save_flags=$JAVACFLAGS + + + + LDFLAGS_interpose_ax_save_flags=$LDFLAGS + + + + LIBS_interpose_ax_save_flags=$LIBS + + + + OBJCFLAGS_interpose_ax_save_flags=$OBJCFLAGS + + + + OBJCXXFLAGS_interpose_ax_save_flags=$OBJCXXFLAGS + + + + UPCFLAGS_interpose_ax_save_flags=$UPCFLAGS + + + + VALAFLAGS_interpose_ax_save_flags=$VALAFLAGS + + + +LDFLAGS="-Wl,-z,interpose" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + WRAP_INTERPOSE="-Wl,-z,interpose" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + + CCASFLAGS=$CCASFLAGS_interpose_ax_save_flags + + + CFLAGS=$CFLAGS_interpose_ax_save_flags + + + CPPFLAGS=$CPPFLAGS_interpose_ax_save_flags + + + CXXFLAGS=$CXXFLAGS_interpose_ax_save_flags + + + ERLCFLAGS=$ERLCFLAGS_interpose_ax_save_flags + + + FCFLAGS=$FCFLAGS_interpose_ax_save_flags + + + FCLIBS=$FCLIBS_interpose_ax_save_flags + + + FFLAGS=$FFLAGS_interpose_ax_save_flags + + + FLIBS=$FLIBS_interpose_ax_save_flags + + + GCJFLAGS=$GCJFLAGS_interpose_ax_save_flags + + + JAVACFLAGS=$JAVACFLAGS_interpose_ax_save_flags + + + LDFLAGS=$LDFLAGS_interpose_ax_save_flags + + + LIBS=$LIBS_interpose_ax_save_flags + + + OBJCFLAGS=$OBJCFLAGS_interpose_ax_save_flags + + + OBJCXXFLAGS=$OBJCXXFLAGS_interpose_ax_save_flags + + + UPCFLAGS=$UPCFLAGS_interpose_ax_save_flags + + + VALAFLAGS=$VALAFLAGS_interpose_ax_save_flags + + + + + + # # Check for i18n # diff --git a/configure.ac b/configure.ac index f657d81562..d4751d134f 100644 --- a/configure.ac +++ b/configure.ac @@ -2191,6 +2191,19 @@ AX_RESTORE_FLAGS([wrap]) AC_SUBST([LD_WRAP_TESTS]) +WRAP_INTERPOSE= +AC_MSG_CHECKING([for linker support for '-z interpose' option]) +AX_SAVE_FLAGS([interpose]) +LDFLAGS="-Wl,-z,interpose" +AC_LINK_IFELSE( + [AC_LANG_PROGRAM([],[])], + [WRAP_INTERPOSE="-Wl,-z,interpose" + AC_MSG_RESULT([yes])], + [AC_MSG_RESULT([no])]) +AX_RESTORE_FLAGS([interpose]) + +AC_SUBST([WRAP_INTERPOSE]) + # # Check for i18n # diff --git a/lib/ns/tests/Makefile.in b/lib/ns/tests/Makefile.in index 0ba61773ff..ccc1ec35dd 100644 --- a/lib/ns/tests/Makefile.in +++ b/lib/ns/tests/Makefile.in @@ -15,7 +15,10 @@ VERSION=@BIND9_VERSION@ @BIND9_MAKE_INCLUDES@ +WRAP_INTERPOSE= @WRAP_INTERPOSE@ WRAP_OPTIONS = -Wl,--wrap=isc_nmhandle_unref +WRAP_RPATH = -Wl,-rpath,${top_builddir}/lib/ns/tests +WRAP_LIB = -L${top_builddir}/lib/ns/tests -lwrap CINCLUDES = -I. -Iinclude ${NS_INCLUDES} ${DNS_INCLUDES} ${ISC_INCLUDES} \ ${OPENSSL_CFLAGS} \ @@ -36,7 +39,7 @@ SO_LDFLAGS = @LDFLAGS@ @SO_LDFLAGS@ SO_OBJS = wrap.@O@ SO_SRCS = wrap.c -SO_TARGETS = libwrap.la +SO_TARGETS = libwrap.@SO@ OBJS = nstest.@O@ SRCS = nstest.c \ @@ -56,32 +59,32 @@ LD_WRAP_TESTS=@LD_WRAP_TESTS@ @BIND9_MAKE_RULES@ -libwrap.la: wrap.@O@ - ${LIBTOOL_MODE_LINK} @SO_LD@ ${SO_LDFLAGS} -Wl,-z,interpose -o $@ wrap.@O@ ${LIBS} +libwrap.@SO@: wrap.@O@ + ${LIBTOOL_MODE_LINK} @SO_LD@ ${SO_LDFLAGS} ${WRAP_INTERPOSE} -o $@ wrap.@O@ ${LIBS} -listenlist_test@EXEEXT@: listenlist_test.@O@ nstest.@O@ libwrap.la ${NSDEPLIBS} ${ISCDEPLIBS} ${DNSDEPLIBS} +listenlist_test@EXEEXT@: listenlist_test.@O@ nstest.@O@ libwrap.@SO@ ${NSDEPLIBS} ${ISCDEPLIBS} ${DNSDEPLIBS} if test "${LD_WRAP_TESTS}" = true -a -z "${LIBTOOL}"; then WRAP="${WRAP_OPTIONS}"; fi; \ ${LIBTOOL_MODE_LINK} ${PURIFY} ${CC} ${CFLAGS} \ - ${LDFLAGS} $${WRAP} -Wl,-rpath=${top_builddir}/lib/ns/tests -o $@ listenlist_test.@O@ nstest.@O@ \ - libwrap.la ${NSLIBS} ${DNSLIBS} ${ISCLIBS} ${LIBS} + ${LDFLAGS} $${WRAP} ${WRAP_RPATH} -o $@ listenlist_test.@O@ nstest.@O@ \ + ${WRAP_LIB} ${NSLIBS} ${DNSLIBS} ${ISCLIBS} ${LIBS} -notify_test@EXEEXT@: notify_test.@O@ nstest.@O@ libwrap.la ${NSDEPLIBS} ${ISCDEPLIBS} ${DNSDEPLIBS} +notify_test@EXEEXT@: notify_test.@O@ nstest.@O@ libwrap.@SO@ ${NSDEPLIBS} ${ISCDEPLIBS} ${DNSDEPLIBS} if test "${LD_WRAP_TESTS}" = true -a -z "${LIBTOOL}"; then WRAP="${WRAP_OPTIONS}"; fi; \ ${LIBTOOL_MODE_LINK} ${PURIFY} ${CC} ${CFLAGS} \ - ${LDFLAGS} $${WRAP} -Wl,-rpath=${top_builddir}/lib/ns/tests -o $@ notify_test.@O@ nstest.@O@ libwrap.la \ - libwrap.la ${NSLIBS} ${DNSLIBS} ${ISCLIBS} ${LIBS} + ${LDFLAGS} $${WRAP} ${WRAP_RPATH} -o $@ notify_test.@O@ nstest.@O@ \ + ${WRAP_LIB} ${NSLIBS} ${DNSLIBS} ${ISCLIBS} ${LIBS} -plugin_test@EXEEXT@: plugin_test.@O@ nstest.@O@ libwrap.la ${NSDEPLIBS} ${ISCDEPLIBS} ${DNSDEPLIBS} +plugin_test@EXEEXT@: plugin_test.@O@ nstest.@O@ libwrap.@SO@ ${NSDEPLIBS} ${ISCDEPLIBS} ${DNSDEPLIBS} if test "${LD_WRAP_TESTS}" = true -a -z "${LIBTOOL}"; then WRAP="${WRAP_OPTIONS}"; fi; \ ${LIBTOOL_MODE_LINK} ${PURIFY} ${CC} ${CFLAGS} \ - ${LDFLAGS} $${WRAP} -Wl,-rpath=${top_builddir}/lib/ns/tests -o $@ plugin_test.@O@ nstest.@O@ \ - libwrap.la ${NSLIBS} ${DNSLIBS} ${ISCLIBS} ${LIBS} + ${LDFLAGS} $${WRAP} ${WRAP_RPATH} -o $@ plugin_test.@O@ nstest.@O@ \ + ${WRAP_LIB} ${NSLIBS} ${DNSLIBS} ${ISCLIBS} ${LIBS} -query_test@EXEEXT@: query_test.@O@ nstest.@O@ libwrap.la ${NSDEPLIBS} ${ISCDEPLIBS} ${DNSDEPLIBS} +query_test@EXEEXT@: query_test.@O@ nstest.@O@ libwrap.@SO@ ${NSDEPLIBS} ${ISCDEPLIBS} ${DNSDEPLIBS} if test "${LD_WRAP_TESTS}" = true -a -z "${LIBTOOL}"; then WRAP="${WRAP_OPTIONS}"; fi; \ ${LIBTOOL_MODE_LINK} ${PURIFY} ${CC} ${CFLAGS} \ - ${LDFLAGS} $${WRAP} -Wl,-rpath=${top_builddir}/lib/ns/tests -o $@ query_test.@O@ nstest.@O@ \ - libwrap.la ${NSLIBS} ${DNSLIBS} ${ISCLIBS} ${LIBS} + ${LDFLAGS} $${WRAP} ${WRAP_RPATH} -o $@ query_test.@O@ nstest.@O@ \ + ${WRAP_LIB} ${NSLIBS} ${DNSLIBS} ${ISCLIBS} ${LIBS} unit:: sh ${top_builddir}/unit/unittest.sh