Commit graph

255 commits

Author SHA1 Message Date
Michał Kępień
119f3e0c2e Make lib/dns/tests/tkey_test.c more portable
Weak symbols are handled differently by different dynamic linkers.  With
glibc, lib/dns/tests/tkey_test works as expected no matter whether
--with-libtool is used or not: __attribute__((weak)) prevents a static
build from failing and it just so happens that the desired symbols are
picked at runtime for dynamic builds.  However, with BSD libc, the
libdns functions called from lib/dns/tests/tkey_test.c use the "real"
memory allocation functions from libisc, thus breaking that unit test.
(Note: similar behavior can be reproduced with glibc by setting the
LD_DYNAMIC_WEAK environment variable.)

The simplest way to make lib/dns/tests/tkey_test work reliably is to
drop all uses of __attribute__((weak)) in it - this way, the memory
functions inside lib/dns/tests/tkey_test.c will always be used instead
of the "real" libisc ones for dynamic builds.  However, this would not
work with static builds as it would result in multiple strong symbols
with the same name being present in a single binary.

Work around the problem by only compiling in the overriding definitions
of memory functions when building using --with-libtool.  For static
builds, keep relying on the --wrap linker option for replacing calls to
the functions we are interested in.
2019-09-12 14:25:57 +02:00
Ondřej Surý
9b6c6f57d8 configure.ac: Add OpenSSL SipHash support detection
Add check for creating new EVP_PKEY with EVP_PKEY_SIPHASH, but disable SipHash
on OpenSSL 1.1.1 as the hash length initialization is broken before OpenSSL
1.1.1a release.
2019-09-03 09:19:55 +02:00
Sergei Trofimovich
a5ad6b16c5 configure.ac: autodetect 'pause' instruction presence on sparc
The change fixes the following build failure on sparc T3 and older CPUs:

```
sparc-unknown-linux-gnu-gcc ... -O2 -mcpu=niagara2 ... -c rwlock.c
{standard input}: Assembler messages:
{standard input}:398: Error: Architecture mismatch on "pause ".
{standard input}:398: (Requires v9e|v9v|v9m|m8; requested architecture is v9b.)
make[1]: *** [Makefile:280: rwlock.o] Error 1
```

`pause` insutruction exists only on `-mcpu=niagara4` (`T4`) and upper.

The change adds `pause` configure-time autodetection and uses it if available.
config.h.in got new `HAVE_SPARC_PAUSE` knob. Fallback is a fall-through no-op.

Build-tested on:

- sparc-unknown-linux-gnu-gcc (no `pause`, build succeeds)
- sparc-unknown-linux-gnu-gcc -mcpu=niagara4 (`pause`, build succeeds)

Reported-by: Rolf Eike Beer
Bug: https://bugs.gentoo.org/691708
Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
2019-08-08 07:15:04 -04:00
Ondřej Surý
2b632a232f Convert the configure.ac rules for zlib library to use pkg-config 2019-07-31 14:54:40 +02:00
Witold Kręcicki
afa81ee4e4 Remove all cookie algorithms but AES, which was used as a default, for legacy purposes. 2019-07-21 10:08:14 -04:00
Witold Kręcicki
92424e23fa Special, for-tests-only, mode with atomics emulated by a mutex-locked variable - useful for finding atomics congestions 2019-07-09 16:09:36 +02:00
Evan Hunt
787f2a7e03 remove all support for legacy GeoIP 2019-07-04 08:56:45 -07:00
Evan Hunt
fea6b5bf10 add a search for GeoIP2 libraries in configure
- "--with-geoip" is used to enable the legacy GeoIP library.
- "--with-geoip2" is used to enable the new GeoIP2 library
  (libmaxminddb), and is on by default if the library is found.
- using both "--with-geoip" and "--with-geoip2" at the same time
  is an error.
- an attempt is made to determine the default GeoIP2 database path at
  compile time if pkg-config is able to report the module prefix. if
  this fails, it will be necessary to set the path in named.conf with
  geoip-directory
- Makefiles have been updated, and a stub lib/dns/geoip2.c has been
  added for the eventual GeoIP2 search implementation.
2019-06-27 14:58:13 -07:00
Ondřej Surý
0771dd3be8 Make the usage of libxml2 opaque to the caller
The libxml2 have previously leaked into the global namespace leading
to forced -I<include_path> for every compilation unit using isc/xml.h
header.  This MR fixes the usage making the caller object opaque.
2019-06-25 12:01:32 +02:00
Witold Kręcicki
02bbf1e2b9 Add --enable-pthread-rwlock option 2019-05-30 16:10:16 +02:00
Ondřej Surý
64fbffbbaa Use simple pthread_rwlock in place of our custom adaptive rwlock 2019-05-30 16:10:16 +02:00
Mark Andrews
20f2d9b41b test Ed448 against test vectors 2019-05-30 18:00:31 +10:00
Ondřej Surý
4d2d3b49ce Cleanup the way we detect json-c library to use only pkg-config 2019-05-29 15:08:52 +02:00
Ondřej Surý
d4596baed4 Pull the values for LFS_{CFLAGS,LDFLAGS,LIBS} from autoconf instead using them directly in make 2019-05-29 11:50:24 +02:00
Mark Andrews
f546769b8b arm: just use the compiler's default yield support 2019-05-12 21:39:43 -04:00
Ondřej Surý
7eea756858 Restore missing check for flockfile and getc_unlocked 2019-03-08 21:20:20 +01:00
Ondřej Surý
0eff9a184a Enable LFS using standard autoconf macros 2019-03-08 20:29:34 +01:00
Mark Andrews
4988367b53 run autoheader and autoconf 2019-03-04 09:37:42 +11:00
Ondřej Surý
ec7c41dd2a Simplify cmocka detection to use only pkg-config and always use cmocka if available 2019-02-06 12:04:33 +01:00
Evan Hunt
b9c9f2593a remove --disable-rpz-nsip and --disable-rpz-nsdname from configure 2019-01-24 11:32:44 -08:00
Ondřej Surý
e2cdf066ea Remove message catalogs 2019-01-09 23:44:26 +01:00
Ondřej Surý
de219b8555 Remove embedded atf-src and enforce atf >= 0.20 + kyua as execution engine 2018-11-15 16:28:20 +01:00
Mark Andrews
cd0d61e0c8 autoheader 2018-11-13 10:31:50 +11:00
Ondřej Surý
fbd2e47f51 Add small tweaks to the code to fix compilation when ISC assertions are disabled
While implementing the new unit testing framework cmocka, it was found that the
BIND 9 code doesn't compile when assertions are disabled or replaced with any
function (such as mock_assert() from cmocka unit testing framework) that's not
directly recognized as assertion by the compiler.

This made the compiler to complain about blocks of code that was recognized as
unreachable before, but now it isn't.

The changes in this commit include:

* assigns default values to couple of local variables,
* moves some return statements around INSIST assertions,
* adds __builtin_unreachable(); annotations after some INSIST assertions,
* fixes one broken assertion (= instead of ==)
2018-11-08 12:21:53 +07:00
Witold Krecicki
7b6721b27f isc_thread_setaffinity() 2018-11-06 08:19:50 +00:00
Ondřej Surý
d6c50674bb Remove last traces of DSA and NSEC3DSA algorithm, but restore the algnumber -> name mapping 2018-10-26 11:50:11 +02:00
Ondřej Surý
eb603cb021 Check for individual OpenSSL functions instead of relying on version number 2018-10-26 06:15:51 +02:00
Ondřej Surý
7fd3dc63de Add generic message digest API (isc_md) to replace specific MD functions md5/sha1/sha256 2018-10-25 08:15:42 +02:00
Ondřej Surý
866991c2cb Rename configure.in to proper name configure.ac 2018-10-23 09:55:26 +02:00
Ondřej Surý
c4cee27f9b Add support for enabling and enforcing FIPS mode in OpenSSL:
* Add configure option --enable-fips-mode that detects and enables FIPS mode
* Add a function to enable FIPS mode and call it on crypto init
* Log an OpenSSL error when FIPS_mode_set() fails and exit
* Report FIPS mode status in a separate log message from named
2018-10-22 20:55:35 +02:00
Ondřej Surý
8e4cc152f7 Remove HAVE_SYS_PRCTL_H check as the prctl() system call was introduced in Linux 2.1.57. 2018-09-07 12:43:43 +02:00
Ondřej Surý
2ed5eb3b9e Remove now empty acconfig.h 2018-09-07 12:17:41 +02:00
Ondřej Surý
341fd22bb0 Remove custom HAVE_UNAME define with proper AC_DEFINE call 2018-09-07 12:17:40 +02:00
Ondřej Surý
161b5dccae Remove NEED_PTHREAD_SCOPE_SYSTEM define that was needed on older FreeBSDs 2018-09-07 12:17:40 +02:00
Ondřej Surý
2750799132 Assume socklen_t is always available on all supported platforms (except on Windows where it is typedefed to int32_t) 2018-09-07 12:17:40 +02:00
Ondřej Surý
7e25330b3d Remove now dummy HAVE_STRERROR 2018-09-07 12:17:40 +02:00
Ondřej Surý
5a0f618d22 Replace custom HAVE_PTHREAD_ATTR_GETSTACKSIZE and HAVE_PTHREAD_ATTR_SETSTACKSIZE with proper AC_CHECK_FUNCS call 2018-09-07 12:17:40 +02:00
Ondřej Surý
7716bdd400 Remove dummy PATH_RANDOMDEV and CHECK_DSA defines 2018-09-07 12:17:40 +02:00
Ondřej Surý
43c468926b Remove HAVE_FLOCKFILE and HAVE_GETCUNLOCKED custom defines in favour of AC_CHECK_FUNCS call 2018-09-07 12:17:40 +02:00
Ondřej Surý
5d8f9bf935 Always enable CALL_PTHREAD_SETCONCURRENCY as it is part of POSIX Threads 2018-09-07 12:17:40 +02:00
Ondřej Surý
fa048a9b2c Replace custom HAVE_TZSET define with AC_CHECK_FUNCS call 2018-09-07 12:17:40 +02:00
Ondřej Surý
c83d9b9b50 Remove now dummy HAVE_IFLIST_SYSCTL define 2018-09-07 12:17:40 +02:00
Ondřej Surý
51bcdb78af Remove now dummy HAVE_GETIFADDRS define 2018-09-07 12:17:40 +02:00
Ondřej Surý
7384a9f23a Replace custom HAVE_CATGETS define with AC_CHECK_FUNCS call 2018-09-07 12:17:40 +02:00
Ondřej Surý
78bb5761a0 Replace custom HAVE_SYSCTLBYNAME define with AC_CHECK_FUNCS call 2018-09-07 12:17:40 +02:00
Ondřej Surý
4a5ecad038 Replace custom HAVE_SIGWAIT define with AC_CHECK_FUNCS 2018-09-07 12:17:40 +02:00
Ondřej Surý
19ae4438ab Replace custom HAVE_SYSCONF with proper AC_CHECK_FUNCS call 2018-09-07 12:17:40 +02:00
Ondřej Surý
927b65aa7f Remove now dummy HAVE_UNIXWARE_SIGWAIT define 2018-09-07 12:17:40 +02:00
Ondřej Surý
c7b1e7fd08 Linux (glibc) has NPTL since LinuxThreads are no-more, so remove HAVE_LINUXTHREADS 2018-09-07 12:17:40 +02:00
Ondřej Surý
2f02552a93 Remove now dummy NEED_PTHREAD_INIT 2018-09-07 12:17:30 +02:00