From b396f555861f11d7d6cee2ceb0d94abb733e1101 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20K=C4=99pie=C5=84?= Date: Tue, 28 Feb 2023 12:54:02 +0100 Subject: [PATCH] (Mostly) fix building bin/tests/system/rpz/dnsrps Building the bin/tests/system/rpz/dnsrps helper binary is currently not possible at all as the necessary compiler and linker flag definitions are missing from bin/tests/system/Makefile.am. Add these as a basis for addressing the problem. Unfortunately, this is where the "mostly" bit mentioned in this commit's subject line comes into play. The dlopen() parts of DNSRPS code have not yet been reworked to use libuv's dlopen() API (uv_dlopen() etc.) (See commit 37b9511ce1dd9ba66a6620c5ff617016eb81188f for prior work in this area.) While it is certainly possible to do that, implementing such a change without testing it in practice against a usable librpz.so (i.e. a DNSRPS provider library) is bound to cause more trouble and confusion than keeping the code the way it is right now. However, making that code buildable as-is requires linking against a C standard library that exports the dlopen(), dlsym(), and dlclose() symbols used by the DNSRPS dynamic loading code. glibc 2.34+ satisfies that requirement, but older glibc versions do not (these come with a separate libdl shared library that would need to be linked in as well). (Other C standard library implementations have not been examined.) Since the long-term plan is to rely on libuv's dlopen() API exclusively and detecting the shared object containing dlopen() & friends would only pull in build system complexity for no good reason, assume for now that the target system provides the dlopen() API in its C standard library. This change enables the system test suite to be run for a BIND 9 build prepared using --enable-dnsrps --enable-dnsrps-dl (on systems satisfying the requirement explained above). However, it is important to note that this change by itself does NOT enable actual testing of the DNSRPS feature as doing that requires a DNSRPS provider library to be present on the test host. --- bin/tests/system/Makefile.am | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/bin/tests/system/Makefile.am b/bin/tests/system/Makefile.am index 18f88346f4..8f18733fd6 100644 --- a/bin/tests/system/Makefile.am +++ b/bin/tests/system/Makefile.am @@ -48,6 +48,14 @@ pipelined_pipequeries_LDADD = \ $(LDADD) \ $(LIBDNS_LIBS) +rpz_dnsrps_CPPFLAGS = \ + $(AM_CPPFLAGS) \ + $(LIBDNS_CFLAGS) + +rpz_dnsrps_LDADD = \ + $(LDADD) \ + $(LIBDNS_LIBS) + tkey_keycreate_CPPFLAGS = \ $(AM_CPPFLAGS) \ $(LIBDNS_CFLAGS)