From dff7867f39b72466ba376333a029121dde448cd8 Mon Sep 17 00:00:00 2001 From: Jeremy Harris Date: Fri, 6 Sep 2024 14:19:38 +0100 Subject: [PATCH] Fix dkim-static build for Solaris Broken-by: 44876330aea2 --- src/OS/Makefile-Base | 3 ++- src/OS/Makefile-FreeBSD | 3 +++ src/src/miscmods/Makefile | 2 +- src/src/miscmods/dkim_transport.c | 1 + 4 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/OS/Makefile-Base b/src/OS/Makefile-Base index 857c44776..ccbe3ccdd 100644 --- a/src/OS/Makefile-Base +++ b/src/OS/Makefile-Base @@ -1068,7 +1068,8 @@ buildauths: config buildmisc: config @cd miscmods && $(MAKE) SHELL=$(SHELL) AR="$(AR)" $(MFLAGS) \ CC="$(CC)" CFLAGS="$(CFLAGS)" \ - CFLAGS_DYNAMIC="$(CFLAGS_DYNAMIC)" HDRS="../version.h $(PHDRS)" \ + CFLAGS_DYNAMIC="$(CFLAGS_DYNAMIC)" \ + LDFLAGS_PARTIAL="$(LDFLAGS_PARTIAL)" HDRS="../version.h $(PHDRS)" \ FE="$(FE)" RANLIB="$(RANLIB)" RM_COMMAND="$(RM_COMMAND)" \ INCLUDE="$(INCLUDE) $(IPV6_INCLUDE)" @echo " " diff --git a/src/OS/Makefile-FreeBSD b/src/OS/Makefile-FreeBSD index ca1073e11..5f01b84e6 100644 --- a/src/OS/Makefile-FreeBSD +++ b/src/OS/Makefile-FreeBSD @@ -20,6 +20,9 @@ LIBS=-lcrypt -lm -lutil -lexecinfo # Dynamically loaded modules need to be built with -fPIC CFLAGS_DYNAMIC=-shared -rdynamic -fPIC +# Partial-linking needs -nostdlib +LDFLAGS_PARTIAL=-nostdlib + # FreeBSD always ships with Berkeley DB USE_DB=yes diff --git a/src/src/miscmods/Makefile b/src/src/miscmods/Makefile index 64a66276f..a4ffcfc92 100644 --- a/src/src/miscmods/Makefile +++ b/src/src/miscmods/Makefile @@ -41,7 +41,7 @@ spf.o spf.so: $(HDRS) spf.h spf.c dkim.o: @echo "$(CC) dkim.c dkim_transport.c pdkim.c signing.c" - $(FE)$(CC) -r -nostdlib $(CFLAGS) $(INCLUDE) \ + $(FE)$(CC) -r $(LDFLAGS_PARTIAL) $(CFLAGS) $(INCLUDE) \ dkim.c dkim_transport.c pdkim.c signing.c -o $@ dkim.so: diff --git a/src/src/miscmods/dkim_transport.c b/src/src/miscmods/dkim_transport.c index e2d1705e3..f367df1ad 100644 --- a/src/src/miscmods/dkim_transport.c +++ b/src/src/miscmods/dkim_transport.c @@ -11,6 +11,7 @@ #include "../exim.h" +#include "arc_api.h" #ifndef DISABLE_DKIM /* rest of file */ -- 2.30.2