Merge branch '1725-clean-up-use-of-function-wrapping' into 'v9_16'

Clean up use of function wrapping

See merge request isc-projects/bind9!4175
This commit is contained in:
Michał Kępień
2020-09-28 07:20:05 +00:00
6 changed files with 24 additions and 84 deletions
Vendored
+2
View File
@@ -13629,6 +13629,8 @@ $as_echo "$as_me: WARNING: When using GNU C Compiler on Solaris, -zrelax=transtl
fi
;; #(
*-darwin*) :
LDFLAGS="$LDFLAGS -Wl,-flat_namespace" ;; #(
*) :
;;
esac
+2 -18
View File
@@ -382,7 +382,8 @@ AS_CASE([$host],
[LDFLAGS="$LDFLAGS -zrelax=transtls"
AC_MSG_WARN([When using GNU C Compiler on Solaris, -zrelax=transtls linker flag is used to fix bug in Thread Local Storage])
])
])
],
[*-darwin*],[LDFLAGS="$LDFLAGS -Wl,-flat_namespace"])
#
# CCNOOPT defaults to -O0 on gcc and disables optimization when is last
@@ -2260,23 +2261,6 @@ 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])
WRAP_NAME=''
AS_CASE([$host],[*-darwin*],[WRAP_NAME='${WRAP_NAME}'])
AC_SUBST([WRAP_NAME])
#
# Check for i18n
#
+13 -25
View File
@@ -15,11 +15,7 @@ VERSION=@BIND9_VERSION@
@BIND9_MAKE_INCLUDES@
WRAP_INTERPOSE= @WRAP_INTERPOSE@
WRAP_OPTIONS = -Wl,--wrap=isc_nmhandle_unref
WRAP_NAME = -Wl,-install_name,${top_builddir}/lib/ns/tests/$@
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} \
@@ -38,10 +34,6 @@ LIBS = @LIBS@ @CMOCKA_LIBS@
SO_CFLAGS = @CFLAGS@ @SO_CFLAGS@
SO_LDFLAGS = @LDFLAGS@ @SO_LDFLAGS@
SO_OBJS = wrap.@O@
SO_SRCS = wrap.c
SO_TARGETS = libwrap.@SO@
OBJS = nstest.@O@
SRCS = nstest.c \
listenlist_test.c \
@@ -53,39 +45,35 @@ SUBDIRS =
TARGETS = listenlist_test@EXEEXT@ \
notify_test@EXEEXT@ \
plugin_test@EXEEXT@ \
query_test@EXEEXT@ \
@SO_TARGETS@
query_test@EXEEXT@
LD_WRAP_TESTS=@LD_WRAP_TESTS@
@BIND9_MAKE_RULES@
libwrap.@SO@: wrap.@O@
${LIBTOOL_MODE_LINK} @SO_LD@ ${SO_LDFLAGS} ${WRAP_INTERPOSE} @WRAP_NAME@ -o $@ wrap.@O@ ${LIBS}
listenlist_test@EXEEXT@: listenlist_test.@O@ nstest.@O@ libwrap.@SO@ ${NSDEPLIBS} ${ISCDEPLIBS} ${DNSDEPLIBS}
listenlist_test@EXEEXT@: listenlist_test.@O@ nstest.@O@ ${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} ${WRAP_RPATH} -o $@ listenlist_test.@O@ nstest.@O@ \
${WRAP_LIB} ${NSLIBS} ${DNSLIBS} ${ISCLIBS} ${LIBS}
${LDFLAGS} $${WRAP} -o $@ listenlist_test.@O@ nstest.@O@ \
${NSLIBS} ${DNSLIBS} ${ISCLIBS} ${LIBS}
notify_test@EXEEXT@: notify_test.@O@ nstest.@O@ libwrap.@SO@ ${NSDEPLIBS} ${ISCDEPLIBS} ${DNSDEPLIBS}
notify_test@EXEEXT@: notify_test.@O@ nstest.@O@ ${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} ${WRAP_RPATH} -o $@ notify_test.@O@ nstest.@O@ \
${WRAP_LIB} ${NSLIBS} ${DNSLIBS} ${ISCLIBS} ${LIBS}
${LDFLAGS} $${WRAP} -o $@ notify_test.@O@ nstest.@O@ \
${NSLIBS} ${DNSLIBS} ${ISCLIBS} ${LIBS}
plugin_test@EXEEXT@: plugin_test.@O@ nstest.@O@ libwrap.@SO@ ${NSDEPLIBS} ${ISCDEPLIBS} ${DNSDEPLIBS}
plugin_test@EXEEXT@: plugin_test.@O@ nstest.@O@ ${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} ${WRAP_RPATH} -o $@ plugin_test.@O@ nstest.@O@ \
${WRAP_LIB} ${NSLIBS} ${DNSLIBS} ${ISCLIBS} ${LIBS}
${LDFLAGS} $${WRAP} -o $@ plugin_test.@O@ nstest.@O@ \
${NSLIBS} ${DNSLIBS} ${ISCLIBS} ${LIBS}
query_test@EXEEXT@: query_test.@O@ nstest.@O@ libwrap.@SO@ ${NSDEPLIBS} ${ISCDEPLIBS} ${DNSDEPLIBS}
query_test@EXEEXT@: query_test.@O@ nstest.@O@ ${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} ${WRAP_RPATH} -o $@ query_test.@O@ nstest.@O@ \
${WRAP_LIB} ${NSLIBS} ${DNSLIBS} ${ISCLIBS} ${LIBS}
${LDFLAGS} $${WRAP} -o $@ query_test.@O@ nstest.@O@ \
${NSLIBS} ${DNSLIBS} ${ISCLIBS} ${LIBS}
unit::
sh ${top_builddir}/unit/unittest.sh
+7
View File
@@ -102,6 +102,13 @@ __wrap_isc_nmhandle_unref(isc_nmhandle_t *handle) {
return;
}
#ifdef USE_LIBTOOL
void
isc_nmhandle_unref(isc_nmhandle_t *handle) {
__wrap_isc_nmhandle_unref(handle);
}
#endif /* USE_LIBTOOL */
/*
* Logging categories: this needs to match the list in lib/ns/log.c.
*/
-40
View File
@@ -1,40 +0,0 @@
/*
* Copyright (C) Internet Systems Consortium, Inc. ("ISC")
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, you can obtain one at https://mozilla.org/MPL/2.0/.
*
* See the COPYRIGHT file distributed with this work for additional
* information regarding copyright ownership.
*/
/*! \file */
#include <inttypes.h>
#include <stdbool.h>
#include <stdlib.h>
#include <time.h>
#include <unistd.h>
#include <isc/mem.h>
#include <isc/netmgr.h>
#include <isc/util.h>
#include <dns/view.h>
#include <ns/client.h>
/*
* This overrides calls to isc_nmhandle_unref(), sending them to
* __wrap_isc_nmhandle_unref(), when libtool is in use and LD_WRAP
* can't be used.
*/
extern void
__wrap_isc_nmhandle_unref(isc_nmhandle_t *handle);
void
isc_nmhandle_unref(isc_nmhandle_t *handle) {
__wrap_isc_nmhandle_unref(handle);
}
-1
View File
@@ -2396,7 +2396,6 @@
./lib/ns/tests/plugin_test.c C 2019,2020
./lib/ns/tests/query_test.c C 2017,2018,2019,2020
./lib/ns/tests/testdata/notify/notify1.msg X 2017,2018,2019,2020
./lib/ns/tests/wrap.c C 2019,2020
./lib/ns/update.c C 2017,2018,2019,2020
./lib/ns/version.c C 2017,2018,2019,2020
./lib/ns/win32/DLLMain.c C 2017,2018,2019,2020