From 11970aeee2a66c0fc9614720301579f372961cf8 Mon Sep 17 00:00:00 2001 From: "W.C.A. Wijngaards" Date: Thu, 2 Oct 2025 12:27:42 +0200 Subject: [PATCH 01/10] - integration-unbound-changes, update acx_nlnetlabs.m4 version and set up libtool in configure.ac. --- acx_nlnetlabs.m4 | 71 ++++++++++++++++++++++++++++++++++++++++-------- configure.ac | 2 ++ 2 files changed, 61 insertions(+), 12 deletions(-) diff --git a/acx_nlnetlabs.m4 b/acx_nlnetlabs.m4 index 6a01dc5..c8195f5 100644 --- a/acx_nlnetlabs.m4 +++ b/acx_nlnetlabs.m4 @@ -2,7 +2,10 @@ # Copyright 2009, Wouter Wijngaards, NLnet Labs. # BSD licensed. # -# Version 48 +# Version 50 +# 2025-09-29 add ac_cv_func_malloc_0_nonnull as a cache value for the malloc(0) +# check by ACX_FUNC_MALLOC. +# 2025-09-29 add ACX_CHECK_NONSTRING_ATTRIBUTE, AHX_CONFIG_NONSTRING_ATTRIBUTE. # 2024-01-16 fix to add -l:libssp.a to -lcrypto link check. # and check for getaddrinfo with only header. # 2024-01-15 fix to add crypt32 to -lcrypto link check when checking for gdi32. @@ -71,6 +74,7 @@ # ACX_DEPFLAG - find cc dependency flags. # ACX_DETERMINE_EXT_FLAGS_UNBOUND - find out which flags enable BSD and POSIX. # ACX_CHECK_FORMAT_ATTRIBUTE - find cc printf format syntax. +# ACX_CHECK_NONSTRING_ATTRIBUTE - find cc nonstring attribute syntax. # ACX_CHECK_UNUSED_ATTRIBUTE - find cc variable unused syntax. # ACX_CHECK_FLTO - see if cc supports -flto and use it if so. # ACX_LIBTOOL_C_ONLY - create libtool for C only, improved. @@ -92,6 +96,7 @@ # ACX_FUNC_IOCTLSOCKET - find ioctlsocket, portably. # ACX_FUNC_MALLOC - check malloc, define replacement . # AHX_CONFIG_FORMAT_ATTRIBUTE - config.h text for format. +# AHX_CONFIG_NONSTRING_ATTRIBUTE - config.h text for nonstring. # AHX_CONFIG_UNUSED_ATTRIBUTE - config.h text for unused. # AHX_CONFIG_FSEEKO - define fseeko, ftello fallback. # AHX_CONFIG_RAND_MAX - define RAND_MAX if needed. @@ -490,7 +495,7 @@ AC_DEFUN([AHX_CONFIG_FORMAT_ATTRIBUTE], ]) dnl Check how to mark function arguments as unused. -dnl result in HAVE_ATTR_UNUSED. +dnl result in HAVE_ATTR_UNUSED. dnl Make sure you include AHX_CONFIG_UNUSED_ATTRIBUTE also. AC_DEFUN([ACX_CHECK_UNUSED_ATTRIBUTE], [AC_REQUIRE([AC_PROG_CC]) @@ -525,6 +530,45 @@ if test $ac_cv_c_unused_attribute = yes; then fi ])dnl +dnl Check how to mark function arguments as nonstring. +dnl result in HAVE_ATTR_NONSTRING. +dnl Make sure you include AHX_CONFIG_NONSTRING_ATTRIBUTE also. +AC_DEFUN([ACX_CHECK_NONSTRING_ATTRIBUTE], +[AC_REQUIRE([AC_PROG_CC]) +AC_MSG_CHECKING(whether the C compiler (${CC-cc}) accepts the "nonstring" attribute) +AC_CACHE_VAL(ac_cv_c_nonstring_attribute, +[ac_cv_c_nonstring_attribute=no +AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include +struct test { + char __attribute__((nonstring)) s[1]; +}; +]], [[ + struct test t = { "1" }; + (void) t; +]])],[ac_cv_c_nonstring_attribute="yes"],[ac_cv_c_nonstring_attribute="no"]) +]) + +dnl Setup ATTR_NONSTRING config.h parts. +dnl make sure you call ACX_CHECK_NONSTRING_ATTRIBUTE also. +AC_DEFUN([AHX_CONFIG_NONSTRING_ATTRIBUTE], +[ +#if defined(DOXYGEN) +# define ATTR_NONSTRING(x) x +#elif defined(__cplusplus) +# define ATTR_NONSTRING(x) __attribute__((nonstring)) x +#elif defined(HAVE_ATTR_NONSTRING) +# define ATTR_NONSTRING(x) __attribute__((nonstring)) x +#else /* !HAVE_ATTR_NONSTRING */ +# define ATTR_NONSTRING(x) x +#endif /* !HAVE_ATTR_NONSTRING */ +]) + +AC_MSG_RESULT($ac_cv_c_nonstring_attribute) +if test $ac_cv_c_nonstring_attribute = yes; then + AC_DEFINE(HAVE_ATTR_NONSTRING, 1, [Whether the C compiler accepts the "nonstring" attribute]) +fi +])dnl + dnl Pre-fun for ACX_LIBTOOL_C_ONLY AC_DEFUN([ACX_LIBTOOL_C_PRE], [ # skip these tests, we do not need them. @@ -1190,8 +1234,9 @@ dnl detect malloc and provide malloc compat prototype. dnl $1: unique name for compat code AC_DEFUN([ACX_FUNC_MALLOC], [ - AC_MSG_CHECKING([for GNU libc compatible malloc]) - AC_RUN_IFELSE([AC_LANG_PROGRAM( + AC_CACHE_CHECK([for GNU libc compatible malloc],[ac_cv_func_malloc_0_nonnull], + [ + AC_RUN_IFELSE([AC_LANG_PROGRAM( [[#if defined STDC_HEADERS || defined HAVE_STDLIB_H #include #else @@ -1199,14 +1244,16 @@ char *malloc (); #endif ]], [ if(malloc(0) != 0) return 1;]) ], - [AC_MSG_RESULT([no]) - AC_LIBOBJ(malloc) - AC_DEFINE_UNQUOTED([malloc], [rpl_malloc_$1], [Define if replacement function should be used.])] , - [AC_MSG_RESULT([yes]) - AC_DEFINE([HAVE_MALLOC], 1, [If have GNU libc compatible malloc])], - [AC_MSG_RESULT([no (crosscompile)]) - AC_LIBOBJ(malloc) - AC_DEFINE_UNQUOTED([malloc], [rpl_malloc_$1], [Define if replacement function should be used.])] ) + [ac_cv_func_malloc_0_nonnull=no], + [ac_cv_func_malloc_0_nonnull=yes], + [ac_cv_func_malloc_0_nonnull="no (crosscompile)"]) + ]) + AS_IF([test "$ac_cv_func_malloc_0_nonnull" = yes], + [AC_DEFINE([HAVE_MALLOC], 1, [If have GNU libc compatible malloc])], + [ + AC_LIBOBJ(malloc) + AC_DEFINE_UNQUOTED([malloc], [rpl_malloc_$1], [Define if replacement function should be used.]) + ]) ]) dnl Define fallback for fseeko and ftello if needed. diff --git a/configure.ac b/configure.ac index 1a3c034..825093a 100644 --- a/configure.ac +++ b/configure.ac @@ -28,6 +28,8 @@ ACX_CHECK_COMPILER_FLAG(O2, [CFLAGS="$CFLAGS -O2"]) ACX_CHECK_PIE fi +ACX_LIBTOOL_C_ONLY + AC_CHECK_HEADERS([endian.h sys/endian.h],,, [AC_INCLUDES_DEFAULT]) AC_CHECK_DECLS([bswap16,bswap32,bswap64], [], [], [ AC_INCLUDES_DEFAULT From 7234150700b75e9cf848ac12df3f6a05e5e4a267 Mon Sep 17 00:00:00 2001 From: "W.C.A. Wijngaards" Date: Thu, 2 Oct 2025 14:10:25 +0200 Subject: [PATCH 02/10] - integration-unbound-changes, build .lo files in Makefile. --- Makefile.in | 29 +++++++++++++++++++++++------ 1 file changed, 23 insertions(+), 6 deletions(-) diff --git a/Makefile.in b/Makefile.in index 51aa1bc..57071e8 100644 --- a/Makefile.in +++ b/Makefile.in @@ -13,7 +13,12 @@ CPPFLAGS = @CPPFLAGS@ -Iinclude -I$(SOURCE)/include -I$(SOURCE)/src -I. CFLAGS = @CFLAGS@ DEPFLAGS = @DEPFLAGS@ VPATH = @srcdir@ - +libtool=@libtool@ +LIBTOOL=$(libtool) +srcdir=@srcdir@ +prefix=@prefix@ +exec_prefix=@exec_prefix@ +libdir=@libdir@ SOURCE = @srcdir@ SOURCES = src/zone.c src/fallback/parser.c @@ -36,9 +41,9 @@ DEPENDS = $(SOURCES:.c=.d) $(WESTMERE_SOURCES:.c=.d) $(HASWELL_SOURCES:.c=.d) # macros for compatibility. EXPORT_HEADER = include/zone/export.h -.PHONY: all clean +.PHONY: all clean lib -all: libzone.a +all: lib clean: @rm -f .depend @@ -59,21 +64,33 @@ devclean: realclean libzone.a: $(OBJECTS) $($(WESTMERE)_OBJECTS) $($(HASWELL)_OBJECTS) Makefile $(AR) rcs libzone.a $(OBJECTS) $($(WESTMERE)_OBJECTS) $($(HASWELL)_OBJECTS) +libzone.la: $(OBJECTS) $($(WESTMERE)_OBJECTS) $($(HASWELL)_OBJECTS) Makefile + $(LIBTOOL) --tag=CC --mode=link $(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) -version-info 0:1:0 -no-undefined -o $@ $(OBJECTS:.o=.lo) $($(WESTMERE)_OBJECTS:.o=.lo) $($(HASWELL)_OBJECTS:.o=.lo) -rpath $(libdir) + +# The copy to the main directory is because that is where (NSD) picks up +# the static library to link to. +# The shared object files are listed to link with. +lib: libzone.la + cp .libs/libzone.a . + +list_objs: + @echo $(OBJECTS:.o=.lo) $($(WESTMERE)_OBJECTS:.o=.lo) $($(HASWELL)_OBJECTS:.o=.lo) + $(EXPORT_HEADER): @mkdir -p include/zone @echo "#define ZONE_EXPORT" > $(EXPORT_HEADER) $(WESTMERE_OBJECTS): $(EXPORT_HEADER) .depend Makefile @mkdir -p src/westmere - $(CC) $(DEPFLAGS) $(CPPFLAGS) $(CFLAGS) -march=westmere -o $@ -c $(SOURCE)/$(@:.o=.c) + $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEPFLAGS) $(CPPFLAGS) $(CFLAGS) -march=westmere -o $@ -c $(SOURCE)/$(@:.o=.c) $(HASWELL_OBJECTS): $(EXPORT_HEADER) .depend Makefile @mkdir -p src/haswell - $(CC) $(DEPFLAGS) $(CPPFLAGS) $(CFLAGS) -march=haswell -o $@ -c $(SOURCE)/$(@:.o=.c) + $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEPFLAGS) $(CPPFLAGS) $(CFLAGS) -march=haswell -o $@ -c $(SOURCE)/$(@:.o=.c) $(OBJECTS): $(EXPORT_HEADER) .depend Makefile @mkdir -p src/fallback - $(CC) $(DEPFLAGS) $(CPPFLAGS) $(CFLAGS) -o $@ -c $(SOURCE)/$(@:.o=.c) + $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEPFLAGS) $(CPPFLAGS) $(CFLAGS) -o $@ -c $(SOURCE)/$(@:.o=.c) @touch $@ .depend: From f57929189352284a724465c240b34ba3f767de8c Mon Sep 17 00:00:00 2001 From: "W.C.A. Wijngaards" Date: Thu, 2 Oct 2025 14:47:00 +0200 Subject: [PATCH 03/10] - integration-unbound-changes, Add files to gitignore. Version info from configure and export symbol list. Fix to not copy library if not needed. --- .gitignore | 7 +++++++ Makefile.in | 13 ++++++++----- configure.ac | 25 +++++++++++++++++++++++++ lzonesyms.def | 3 +++ 4 files changed, 43 insertions(+), 5 deletions(-) create mode 100644 lzonesyms.def diff --git a/.gitignore b/.gitignore index 32c9c17..437f81f 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,8 @@ *.o +*.lo *.d +/.libs/ +/aclocal.m4 /autom4te.cache /build /config.guess @@ -11,7 +14,11 @@ /config.sub /configure /configure~ +/install-sh +/libtool /libzone.a +/libzone.la +/ltmain.sh /make.dep /.depend /Makefile diff --git a/Makefile.in b/Makefile.in index 57071e8..0082a57 100644 --- a/Makefile.in +++ b/Makefile.in @@ -20,6 +20,7 @@ prefix=@prefix@ exec_prefix=@exec_prefix@ libdir=@libdir@ SOURCE = @srcdir@ +version_info=@version_info@ SOURCES = src/zone.c src/fallback/parser.c OBJECTS = $(SOURCES:.c=.o) @@ -61,17 +62,19 @@ maintainer-clean: realclean devclean: realclean @rm -rf config.h.in configure -libzone.a: $(OBJECTS) $($(WESTMERE)_OBJECTS) $($(HASWELL)_OBJECTS) Makefile - $(AR) rcs libzone.a $(OBJECTS) $($(WESTMERE)_OBJECTS) $($(HASWELL)_OBJECTS) +#libzone.a: $(OBJECTS) $($(WESTMERE)_OBJECTS) $($(HASWELL)_OBJECTS) Makefile + #$(AR) rcs libzone.a $(OBJECTS) $($(WESTMERE)_OBJECTS) $($(HASWELL)_OBJECTS) libzone.la: $(OBJECTS) $($(WESTMERE)_OBJECTS) $($(HASWELL)_OBJECTS) Makefile - $(LIBTOOL) --tag=CC --mode=link $(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) -version-info 0:1:0 -no-undefined -o $@ $(OBJECTS:.o=.lo) $($(WESTMERE)_OBJECTS:.o=.lo) $($(HASWELL)_OBJECTS:.o=.lo) -rpath $(libdir) + $(LIBTOOL) --tag=CC --mode=link $(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) -version-info $(version_info) -no-undefined -export-symbols $(srcdir)/lzonesyms.def -o $@ $(OBJECTS:.o=.lo) $($(WESTMERE)_OBJECTS:.o=.lo) $($(HASWELL)_OBJECTS:.o=.lo) -rpath $(libdir) + +libzone.a: libzone.la + cp .libs/libzone.a $@ # The copy to the main directory is because that is where (NSD) picks up # the static library to link to. # The shared object files are listed to link with. -lib: libzone.la - cp .libs/libzone.a . +lib: libzone.a list_objs: @echo $(OBJECTS:.o=.lo) $($(WESTMERE)_OBJECTS:.o=.lo) $($(HASWELL)_OBJECTS:.o=.lo) diff --git a/configure.ac b/configure.ac index 825093a..5f40af4 100644 --- a/configure.ac +++ b/configure.ac @@ -15,6 +15,31 @@ AC_INIT([simdzone],[0.2.4],[https://github.com/NLnetLabs/simdzone/issues]) AC_CONFIG_HEADERS([config.h]) AC_CONFIG_FILES([Makefile]) +version_info=0:1:0 +# This is current:revision:age +# 0.2.4 had 0:1:0 +# +# +# Current -- the number of the binary API that we're implementing +# Revision -- which iteration of the implementation of the binary +# API are we supplying? +# Age -- How many previous binary API versions do we also +# support? +# +# If we release a new version that does not change the binary API, +# increment Revision. +# +# If we release a new version that changes the binary API, but does +# not break programs compiled against the old binary API, increment +# Current and Age. Set Revision to 0, since this is the first +# implementation of the new API. +# +# Otherwise, we're changing the binary API and breaking backward +# compatibility with old binaries. Increment Current. Set Age to 0, +# since we're backward compatible with no previous APIs. Set Revision +# to 0 too. +AC_SUBST(version_info) + sinclude(acx_nlnetlabs.m4) m4_include(m4/ax_check_compile_flag.m4) diff --git a/lzonesyms.def b/lzonesyms.def new file mode 100644 index 0000000..645a1d4 --- /dev/null +++ b/lzonesyms.def @@ -0,0 +1,3 @@ +zone_log +zone_parse +zone_parse_string From 6a2afd75fb98c570d159b8000093563262a66006 Mon Sep 17 00:00:00 2001 From: "W.C.A. Wijngaards" Date: Thu, 2 Oct 2025 14:58:24 +0200 Subject: [PATCH 04/10] - integration-unbound-changes, fix ci to install libtool. --- .github/workflows/build-test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-test.yml b/.github/workflows/build-test.yml index 694a805..70c2e09 100644 --- a/.github/workflows/build-test.yml +++ b/.github/workflows/build-test.yml @@ -127,6 +127,6 @@ jobs: run: | set -e -x echo $PATH - autoreconf -i + autoreconf -fi ./configure make -j 2 From 1993bb7fea875e3d61173c37e7e7ae95b656ee91 Mon Sep 17 00:00:00 2001 From: "W.C.A. Wijngaards" Date: Thu, 2 Oct 2025 15:01:59 +0200 Subject: [PATCH 05/10] - integration-unbound-changes, fix ci to install libtool and autoconf. --- .github/workflows/build-test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-test.yml b/.github/workflows/build-test.yml index 70c2e09..fbfa668 100644 --- a/.github/workflows/build-test.yml +++ b/.github/workflows/build-test.yml @@ -20,7 +20,7 @@ jobs: analyzer: off sanitizer: address,undefined - os: macos-14 - packages: automake + packages: autoconf automake libtool build_type: Debug build_tool_options: -j 4 analyzer: off From 8f7b1b4bbe26ada1ee94633f18755c21ed5daabd Mon Sep 17 00:00:00 2001 From: "W.C.A. Wijngaards" Date: Tue, 7 Oct 2025 15:51:26 +0200 Subject: [PATCH 06/10] - integration-unbound-changes, renames parser.o for haswell and westmere. With different object names, it stops libtool from having to rename them. --- CMakeLists.txt | 8 ++++---- Makefile.in | 4 ++-- src/haswell/{parser.c => hwparser.c} | 0 src/westmere/{parser.c => wmparser.c} | 0 4 files changed, 6 insertions(+), 6 deletions(-) rename src/haswell/{parser.c => hwparser.c} (100%) rename src/westmere/{parser.c => wmparser.c} (100%) diff --git a/CMakeLists.txt b/CMakeLists.txt index f28d224..eb352a5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -218,8 +218,8 @@ if(architecture STREQUAL "x86_64" OR architecture STREQUAL "amd64") unset(CMAKE_REQUIRED_FLAGS) if (HAVE_WESTMERE) set_source_files_properties( - src/westmere/parser.c PROPERTIES COMPILE_FLAGS "-march=westmere") - target_sources(zone PRIVATE src/westmere/parser.c) + src/westmere/wmparser.c PROPERTIES COMPILE_FLAGS "-march=westmere") + target_sources(zone PRIVATE src/westmere/wmparser.c) set_source_files_properties( src/westmere/bench.c PROPERTIES COMPILE_FLAGS "-march=westmere") target_sources(zone-bench PRIVATE src/westmere/bench.c) @@ -233,8 +233,8 @@ if(architecture STREQUAL "x86_64" OR architecture STREQUAL "amd64") unset(CMAKE_REQUIRED_FLAGS) if (HAVE_HASWELL) set_source_files_properties( - src/haswell/parser.c PROPERTIES COMPILE_FLAGS "-march=haswell") - target_sources(zone PRIVATE src/haswell/parser.c) + src/haswell/hwparser.c PROPERTIES COMPILE_FLAGS "-march=haswell") + target_sources(zone PRIVATE src/haswell/hwparser.c) set_source_files_properties( src/haswell/bench.c PROPERTIES COMPILE_FLAGS "-march=haswell") target_sources(zone-bench PRIVATE src/haswell/bench.c) diff --git a/Makefile.in b/Makefile.in index 0082a57..4bbe962 100644 --- a/Makefile.in +++ b/Makefile.in @@ -25,10 +25,10 @@ version_info=@version_info@ SOURCES = src/zone.c src/fallback/parser.c OBJECTS = $(SOURCES:.c=.o) -WESTMERE_SOURCES = src/westmere/parser.c +WESTMERE_SOURCES = src/westmere/wmparser.c WESTMERE_OBJECTS = $(WESTMERE_SOURCES:.c=.o) -HASWELL_SOURCES = src/haswell/parser.c +HASWELL_SOURCES = src/haswell/hwparser.c HASWELL_OBJECTS = $(HASWELL_SOURCES:.c=.o) NO_OBJECTS = diff --git a/src/haswell/parser.c b/src/haswell/hwparser.c similarity index 100% rename from src/haswell/parser.c rename to src/haswell/hwparser.c diff --git a/src/westmere/parser.c b/src/westmere/wmparser.c similarity index 100% rename from src/westmere/parser.c rename to src/westmere/wmparser.c From 611cc8e91c952e3b981aed05f1f9e4ce4d948b86 Mon Sep 17 00:00:00 2001 From: "W.C.A. Wijngaards" Date: Wed, 8 Oct 2025 17:14:51 +0200 Subject: [PATCH 07/10] - integration-unbound-changes, fix realpath function test for windows compile. --- configure.ac | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index 5f40af4..152e693 100644 --- a/configure.ac +++ b/configure.ac @@ -167,7 +167,11 @@ int main(int argc, char *argv[]) fi fi -AC_CHECK_FUNCS([realpath],,[AC_MSG_ERROR([realpath is not available])]) +AC_CHECK_FUNCS([realpath],,[ + AC_CHECK_FUNCS([_fullpath],,[ + AC_MSG_ERROR([realpath and _fullpath are not available]) + ]) +]) AC_SUBST([HAVE_ENDIAN_H]) AC_SUBST([HAVE_WESTMERE]) From bd67c9aca6b31be7956ff6b1b5696563defb6d9b Mon Sep 17 00:00:00 2001 From: "W.C.A. Wijngaards" Date: Fri, 10 Oct 2025 13:35:24 +0200 Subject: [PATCH 08/10] - integration-unbound-changes, add -lssp on mingw, and LDFLAGS and LIBS support. --- Makefile.in | 4 +++- configure.ac | 13 +++++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/Makefile.in b/Makefile.in index 4bbe962..de1176c 100644 --- a/Makefile.in +++ b/Makefile.in @@ -12,6 +12,8 @@ CC = @CC@ CPPFLAGS = @CPPFLAGS@ -Iinclude -I$(SOURCE)/include -I$(SOURCE)/src -I. CFLAGS = @CFLAGS@ DEPFLAGS = @DEPFLAGS@ +LDFLAGS=@LDFLAGS@ +LIBS=@LIBS@ VPATH = @srcdir@ libtool=@libtool@ LIBTOOL=$(libtool) @@ -66,7 +68,7 @@ devclean: realclean #$(AR) rcs libzone.a $(OBJECTS) $($(WESTMERE)_OBJECTS) $($(HASWELL)_OBJECTS) libzone.la: $(OBJECTS) $($(WESTMERE)_OBJECTS) $($(HASWELL)_OBJECTS) Makefile - $(LIBTOOL) --tag=CC --mode=link $(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) -version-info $(version_info) -no-undefined -export-symbols $(srcdir)/lzonesyms.def -o $@ $(OBJECTS:.o=.lo) $($(WESTMERE)_OBJECTS:.o=.lo) $($(HASWELL)_OBJECTS:.o=.lo) -rpath $(libdir) + $(LIBTOOL) --tag=CC --mode=link $(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) -version-info $(version_info) -no-undefined -export-symbols $(srcdir)/lzonesyms.def -o $@ $(OBJECTS:.o=.lo) $($(WESTMERE)_OBJECTS:.o=.lo) $($(HASWELL)_OBJECTS:.o=.lo) $(LIBS) -rpath $(libdir) libzone.a: libzone.la cp .libs/libzone.a $@ diff --git a/configure.ac b/configure.ac index 152e693..f318824 100644 --- a/configure.ac +++ b/configure.ac @@ -46,6 +46,19 @@ m4_include(m4/ax_check_compile_flag.m4) CFLAGS="$CFLAGS" m4_version_prereq([2.70], [AC_PROG_CC], [AC_PROG_CC_STDC]) +# are we on MinGW? +if uname -s 2>&1 | grep MINGW >/dev/null; then on_mingw="yes" +else + if echo $host | grep mingw >/dev/null; then on_mingw="yes" + else on_mingw="no"; fi +fi +if test "$on_mingw" = "yes"; then + # link with libssp for the stack protector functions on the windows + # compile, for the static compile -l:libssp.a could be used. + # But there is no static option right now for simdzone. + if test -z "$LIBS"; then LIBS="-lssp"; else LIBS="$LIBS -lssp"; fi +fi + # allow user to override the -g -O2 flags. if test "x$CFLAGS" = "x" ; then ACX_CHECK_COMPILER_FLAG(g, [CFLAGS="$CFLAGS -g"]) From 873339842f795cc2085eb6793b93e5e0ceb23d02 Mon Sep 17 00:00:00 2001 From: "W.C.A. Wijngaards" Date: Thu, 16 Oct 2025 13:45:16 +0200 Subject: [PATCH 09/10] - integration-unbound-changes, fix libzone.a for disable-static build. --- Makefile.in | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Makefile.in b/Makefile.in index de1176c..f27d07c 100644 --- a/Makefile.in +++ b/Makefile.in @@ -50,7 +50,7 @@ all: lib clean: @rm -f .depend - @rm -f libzone.a $(OBJECTS) $(EXPORT_HEADER) + @rm -f libzone.a libzone.la $(OBJECTS) $(EXPORT_HEADER) @rm -f $($(WESTMERE)_OBJECTS) $($(HASWELL)_OBJECTS) distclean: clean @@ -69,14 +69,14 @@ devclean: realclean libzone.la: $(OBJECTS) $($(WESTMERE)_OBJECTS) $($(HASWELL)_OBJECTS) Makefile $(LIBTOOL) --tag=CC --mode=link $(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) -version-info $(version_info) -no-undefined -export-symbols $(srcdir)/lzonesyms.def -o $@ $(OBJECTS:.o=.lo) $($(WESTMERE)_OBJECTS:.o=.lo) $($(HASWELL)_OBJECTS:.o=.lo) $(LIBS) -rpath $(libdir) + if test -f .libs/libzone.a; then cp .libs/libzone.a .; fi libzone.a: libzone.la - cp .libs/libzone.a $@ # The copy to the main directory is because that is where (NSD) picks up # the static library to link to. # The shared object files are listed to link with. -lib: libzone.a +lib: libzone.la list_objs: @echo $(OBJECTS:.o=.lo) $($(WESTMERE)_OBJECTS:.o=.lo) $($(HASWELL)_OBJECTS:.o=.lo) From 6948734a4a3de01ce6c9f4b46f5f6eeadb36768b Mon Sep 17 00:00:00 2001 From: "W.C.A. Wijngaards" Date: Fri, 17 Oct 2025 16:10:34 +0200 Subject: [PATCH 10/10] - integration-unbound-changes, fix -lssp for mingw. --- configure.ac | 2 ++ 1 file changed, 2 insertions(+) diff --git a/configure.ac b/configure.ac index f318824..c45d04d 100644 --- a/configure.ac +++ b/configure.ac @@ -53,10 +53,12 @@ else else on_mingw="no"; fi fi if test "$on_mingw" = "yes"; then + if echo "$host" | $GREP -i -e linux >/dev/null; then # link with libssp for the stack protector functions on the windows # compile, for the static compile -l:libssp.a could be used. # But there is no static option right now for simdzone. if test -z "$LIBS"; then LIBS="-lssp"; else LIBS="$LIBS -lssp"; fi + fi fi # allow user to override the -g -O2 flags.