Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nsd no longer builds out of tree (due to simdzone) #415

Open
fobser opened this issue Dec 20, 2024 · 3 comments
Open

nsd no longer builds out of tree (due to simdzone) #415

fobser opened this issue Dec 20, 2024 · 3 comments

Comments

@fobser
Copy link
Contributor

fobser commented Dec 20, 2024

$ mkdir demo
$ curl -s https://nlnetlabs.nl/downloads/nsd/nsd-4.11.0.tar.gz > nsd-4.11.0.tar.gz
$ tar xzf nsd-4.11.0.tar.gz
$ mkdir build
$ cd build
$ ../nsd-4.11.0/configure
checking for gcc... no
checking for cc... cc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether the compiler supports GNU C... yes
checking whether cc accepts -g... yes
checking for cc option to enable C11 features... none needed
checking for stdio.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for strings.h... yes
checking for sys/stat.h... yes
checking for sys/types.h... yes
checking for unistd.h... yes
checking for wchar.h... yes
checking for minix/config.h... no
checking for vfork.h... no
checking whether it is safe to define __EXTENSIONS__... yes
checking whether _XOPEN_SOURCE should be defined... no
checking whether the compiler supports GNU C... (cached) yes
checking whether cc accepts -g... (cached) yes
checking for cc option to enable C11 features... (cached) none needed
checking for a sed that does not truncate output... /usr/bin/sed
checking for gawk... gawk
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for flex... flex
checking for lex output file root... lex.yy
checking for lex library... none needed
checking whether yytext is a pointer... yes
checking for bison... bison -y
checking whether ln -s works... yes
checking for a BSD-compatible install... /usr/bin/install -c
checking whether lex accepts -i... yes
checking if lex defines yy_current_buffer... no
checking whether cc supports -g... yes
checking whether cc supports -O2... yes
checking if cc supports -flto... yes
checking for an ANSI C-conforming const... yes
checking for inline... inline
checking how to run the C preprocessor... cc -E
checking for uid_t in sys/types.h... yes
checking for pid_t... yes
checking for size_t... yes
checking for off_t... yes
checking whether the C compiler (cc) accepts the "format" attribute... yes
checking whether the C compiler (cc) accepts the "unused" attribute... yes
checking whether the C compiler (cc) accepts the "weak" attribute... yes
checking whether the C compiler (cc) accepts the "noreturn" attribute... yes
checking if memcmp compares unsigned... yes
checking whether ctime_r works with two arguments... yes
checking for libevent... found in /usr/local
checking for library containing clock_gettime... none required
checking for event.h... yes
checking for cc options needed to detect all undeclared functions... -fno-builtin
checking whether EV_VERSION_MAJOR is declared... no
checking for library containing event_set... -levent
checking for event_base_free... yes
checking for event_base_once... yes
checking for event_base_new... yes
checking for event_base_get_method... yes
checking for ev_loop... no
checking for ev_default_loop... no
checking for sys/wait.h that is POSIX.1 compatible... yes
checking for time.h... yes
checking for arpa/inet.h... yes
checking for signal.h... yes
checking for string.h... (cached) yes
checking for strings.h... (cached) yes
checking for fcntl.h... yes
checking for limits.h... yes
checking for netinet/in.h... yes
checking for netinet/tcp.h... yes
checking for stddef.h... yes
checking for sys/param.h... yes
checking for sys/socket.h... yes
checking for sys/un.h... yes
checking for syslog.h... yes
checking for unistd.h... (cached) yes
checking for sys/select.h... yes
checking for stdarg.h... yes
checking for stdint.h... (cached) yes
checking for netdb.h... yes
checking for sys/bitypes.h... no
checking for tcpd.h... no
checking for glob.h... yes
checking for grp.h... yes
checking for endian.h... yes
checking for sys/random.h... no
checking for ifaddrs.h... yes
checking for double definition of struct va_list... no
checking whether strptime needs defines... no
checking for library containing inet_pton... none required
checking for library containing socket... none required
checking whether strptime works... yes
checking if nonblocking sockets work... yes
checking whether mkdir has one arg... no
checking for int8_t... yes
checking for int16_t... yes
checking for int32_t... yes
checking for int64_t... yes
checking for uint8_t... yes
checking for uint16_t... yes
checking for uint32_t... yes
checking for uint64_t... yes
checking for socklen_t... yes
checking for sig_atomic_t... yes
checking for ssize_t... yes
checking for suseconds_t... yes
checking for in_addr_t... yes
checking for struct sockaddr_storage.ss_family... yes
checking for struct stat.st_mtimensec... yes
checking for struct stat.st_mtim.tv_nsec... yes
checking for struct sockaddr_un.sun_len... yes
checking build system type... x86_64-unknown-openbsd7.6
checking host system type... x86_64-unknown-openbsd7.6
checking for working chown... yes
checking for fork... yes
checking for vfork... yes
checking for working fork... yes
checking for working vfork... (cached) yes
checking for GNU libc compatible malloc... yes
checking for _LARGEFILE_SOURCE value needed for large files... no
checking for special C compiler options needed for large files... no
checking for _FILE_OFFSET_BITS value needed for large files... no
checking size of void*... 8
checking size of off_t... 8
checking for getrandom... no
checking for arc4random... yes
checking for arc4random_uniform... yes
checking for library containing setusercontext... none required
checking for login_cap.h... yes
checking for tzset... yes
checking for alarm... yes
checking for chroot... yes
checking for dup2... yes
checking for endpwent... yes
checking for gethostname... yes
checking for memset... yes
checking for memcpy... yes
checking for pwrite... yes
checking for socket... yes
checking for strcasecmp... yes
checking for strchr... yes
checking for strdup... yes
checking for strerror... yes
checking for strncasecmp... yes
checking for strtol... yes
checking for writev... yes
checking for getaddrinfo... yes
checking for getnameinfo... yes
checking for freeaddrinfo... yes
checking for gai_strerror... yes
checking for sigaction... yes
checking for sigprocmask... yes
checking for strptime... yes
checking for strftime... yes
checking for localtime_r... yes
checking for setusercontext... yes
checking for glob... yes
checking for initgroups... yes
checking for setresuid... yes
checking for setreuid... yes
checking for setresgid... yes
checking for setregid... yes
checking for getpwnam... yes
checking for mmap... yes
checking for ppoll... yes
checking for clock_gettime... yes
checking for accept4... yes
checking for getifaddrs... yes
checking for struct mmsghdr... yes
checking for sched.h... yes
checking for sys/cpuset.h... no
checking for cpu_set_t... no
checking for cpuset_t... no
checking for cpuid_t... yes
checking for sched_setaffinity... no
checking for basename... yes
checking for inet_aton... yes
checking for inet_pton... yes
checking for inet_ntop... yes
checking for snprintf... yes
checking for strlcat... yes
checking for strlcpy... yes
checking for strptime... (cached) yes
checking for b64_pton... no
checking for b64_ntop... no
checking for pselect... yes
checking for memmove... yes
checking for setproctitle... yes
checking for explicit_bzero... yes
checking for reallocarray... yes
checking whether reallocarray is declared... yes
checking for pselect prototype in sys/select.h... yes
checking for ctime_r prototype in time.h... yes
checking for struct timespec... yes
checking for SSL... found in /usr
checking if libssl needs libdl... no
checking for EVP_sha256 in -lcrypto... yes
checking for openssl/ssl.h... yes
checking for openssl/err.h... yes
checking for openssl/rand.h... yes
checking for openssl/ocsp.h... yes
checking for openssl/core_names.h... no
checking for openssl/x509v3.h... yes
checking for HMAC_CTX_reset... yes
checking for HMAC_CTX_new... yes
checking for EVP_cleanup... yes
checking for ERR_load_crypto_strings... yes
checking for OPENSSL_init_crypto... yes
checking for CRYPTO_memcmp... yes
checking for EC_KEY_new_by_curve_name... yes
checking for EVP_MAC_CTX_new... no
checking for EVP_MAC_CTX_set_params... no
checking for EVP_MAC_CTX_get_mac_size... no
checking for SHA1_Init... yes
checking for ASN1_STRING_get0_data... yes
checking if SHA1_Init is deprecated... no
checking whether SSL_CTX_set_ecdh_auto is declared... yes
checking whether SSL_CTX_set_tmp_ecdh is declared... yes
checking whether TLS1_3_VERSION is declared... yes
checking for OPENSSL_init_ssl... yes
checking for SSL_get1_peer_certificate... no
checking for SSL_CTX_set_security_level... yes
checking for ERR_load_SSL_strings... yes
checking if ERR_load_SSL_strings is deprecated... no
checking for pkg-config... /usr/bin/pkg-config
checking pkg-config is at least version 0.9.0... yes
configure: creating ./config.status
config.status: creating Makefile
config.status: creating config.h
=== configuring in simdzone (/home/florian/tmp/demo/build/simdzone)
configure: running /bin/sh ../../nsd-4.11.0/simdzone/configure --disable-option-checking '--prefix=/usr/local'  --cache-file=/dev/null --srcdir=../../nsd-4.11.0/simdzone
checking for gcc... no
checking for cc... cc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether the compiler supports GNU C... yes
checking whether cc accepts -g... yes
checking for cc option to enable C11 features... none needed
checking for stdio.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for strings.h... yes
checking for sys/stat.h... yes
checking for sys/types.h... yes
checking for unistd.h... yes
checking for endian.h... yes
checking for sys/endian.h... yes
checking for cc options needed to detect all undeclared functions... -fno-builtin
checking whether bswap16 is declared... no
checking whether bswap32 is declared... no
checking whether bswap64 is declared... no
checking whether C compiler accepts -MMD... yes
checking whether C compiler accepts -xMMD... no
checking build system type... x86_64-unknown-openbsd7.6
checking host system type... x86_64-unknown-openbsd7.6
checking target system type... x86_64-unknown-openbsd7.6
checking for immintrin.h... yes
checking whether C compiler accepts -march=westmere... yes
checking whether C compiler accepts -march=haswell... yes
checking whether -march=westmere works... yes
checking whether -march=haswell works... yes
checking for realpath... yes
configure: creating ./config.status
config.status: creating Makefile
config.status: creating config.h
$ make
make -C simdzone
cc -MMD -MP -I../../nsd-4.11.0/simdzone/include -I../../nsd-4.11.0/simdzone/src -I. -g -O2 -o src/zone.o -c ../../nsd-4.11.0/simdzone/src/zone.c
In file included from ../../nsd-4.11.0/simdzone/src/zone.c:26:
../../nsd-4.11.0/simdzone/include/zone.h:24:10: fatal error: 'zone/export.h' file not found
#include "zone/export.h"
         ^~~~~~~~~~~~~~~
1 error generated.
*** Error 1 in simdzone (Makefile:75 'src/zone.o')
*** Error 2 in /home/florian/tmp/demo/build (Makefile:200 'simdzone/libzone.a')
@fobser
Copy link
Contributor Author

fobser commented Dec 20, 2024

This used to work with 4.9.1.

Btw. I would love if export.h wasn't needed. I'm working around this in OpenBSD by adding simdzone/include/zone/export.h to the source tree with the generated content.

@wtoorop
Copy link
Member

wtoorop commented Dec 23, 2024

Ack. As I understand, it is only needed when building the simdzone library for MS Windows. Since NSD is (currently) not Windows compatible, I guess it is fine to not include the export file (and have ZONE_EXPORT defined in config.h instead). I'll prepare a PR for that.

@wtoorop
Copy link
Member

wtoorop commented Dec 23, 2024

Ack. As I understand, it is only needed when building the simdzone library for MS Windows. Since NSD is (currently) not Windows compatible, I guess it is fine to not include the export file (and have ZONE_EXPORT defined in config.h instead). I'll prepare a PR for that.

Actually, that turned out to be quite involved (I needed to add #include "config.h" in multiple C files in simdzone, that didn't had that yet), so I chose the change with the lesser impact and just adjusted the -I flags to include the generated zone/export.h from the build location.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants