On 2025-12-12 Andreas Metzler <[email protected]> wrote:
[...]
> The gcc manual says:
> -llibrary
> [...]
>     It makes a difference where in the command you write this option;
>     the linker searches and processes libraries and object files in the
>     order they are specified. Thus, ‘foo.o -lz bar.o’ searches library
>     ‘z’ after file foo.o but before bar.o. If bar.o refers to functions
>     in ‘z’, those functions may not be loaded.

suggested patch against GIT master attached.

cu Andreas
-- 
`What a good friend you are to him, Dr. Maturin. His other friends are
so grateful to you.'
`I sew his ears on from time to time, sure'
diff --git a/src/src/auths/Makefile b/src/src/auths/Makefile
index 6eab96a66..726b36d93 100644
--- a/src/src/auths/Makefile
+++ b/src/src/auths/Makefile
@@ -31,8 +31,9 @@ auths.a:	$(OBJ)
 
 SO_FLAGS = -DDYNLOOKUP $(CFLAGS_DYNAMIC) $(CFLAGS) $(INCLUDE) $(DLFLAGS)
 .c.so:;		@echo "$(CC) -shared $*.c"
-		$(FE)$(CC) $(SO_FLAGS) $(AUTH_$*_INCLUDE) $(AUTH_$*_LIBS) \
-			$*.c -o $@
+		$(FE)$(CC) $(SO_FLAGS) $(AUTH_$*_INCLUDE) \
+			$*.c -o $@ \
+			$(AUTH_$*_LIBS)
 
 
 $(OBJ) $(MOD): $(HDRS)
diff --git a/src/src/lookups/Makefile b/src/src/lookups/Makefile
index 27ae3fe1e..4f9f7a199 100644
--- a/src/src/lookups/Makefile
+++ b/src/src/lookups/Makefile
@@ -48,7 +48,8 @@ lookups.a:       avail_static_lookups.o $(OBJS)
 		 $(FE)$(CC) -c $(CFLAGS) $(INCLUDE) $*.c
 
 .c.so:;          @echo "$(CC) -shared $*.c"
-		 $(FE)$(CC) $(LOOKUP_$*_INCLUDE) $(LOOKUP_$*_LIBS) -DDYNLOOKUP $(CFLAGS_DYNAMIC) $(CFLAGS) $(INCLUDE) $(DLFLAGS) $*.c -o $@
+		 $(FE)$(CC) $(LOOKUP_$*_INCLUDE) -DDYNLOOKUP $(CFLAGS_DYNAMIC) $(CFLAGS) $(INCLUDE) $(DLFLAGS) $*.c -o $@ \
+			 $(LOOKUP_$*_LIBS)
 
 cdb.o cdb.so:           $(HDRS) cdb.c
 dbmdb.o dbmdb.so:       $(HDRS) dbmdb.c
diff --git a/src/src/miscmods/Makefile b/src/src/miscmods/Makefile
index e92c34941..418313438 100644
--- a/src/src/miscmods/Makefile
+++ b/src/src/miscmods/Makefile
@@ -27,9 +27,10 @@ miscmods.a:	$(OBJ)
 		$(FE)$(CC) -c $(CFLAGS) $(INCLUDE) $*.c
 
 .c.so:;         @echo "$(CC) -shared $*.c"
-		$(FE)$(CC) $(SUPPORT_$*_INCLUDE) $(SUPPORT_$*_LIBS) \
+		$(FE)$(CC) $(SUPPORT_$*_INCLUDE) \
 			-DDYNLOOKUP $(CFLAGS_DYNAMIC) $(CFLAGS) $(INCLUDE) \
-			$(DLFLAGS) $*.c -o $@
+			$(DLFLAGS) $*.c -o $@ \
+			$(SUPPORT_$*_LIBS)
 
 # Note that the sources from pdkim/ are linked into the build.../miscmods/ dir
 # by scripts/Makelinks.
@@ -69,9 +70,10 @@ dkim.o:
 dkim.so:
 	@echo "$(CC) -shared dkim.c dkim_transport.c pdkim.c signing.c"
 	$(FE)$(CC) -DDYNLOOKUP $(CFLAGS_DYNAMIC) -o $@ \
-		$(SUPPORT_$*_INCLUDE) $(SUPPORT_$*_LIBS) \
+		$(SUPPORT_$*_INCLUDE) \
 		$(CFLAGS) $(INCLUDE) $(TLS_INCLUDE) $(DLFLAGS) \
-		dkim.c dkim_transport.c pdkim.c signing.c
+		dkim.c dkim_transport.c pdkim.c signing.c \
+		$(SUPPORT_$*_LIBS)
 
 # spf_perl is special; Configure-Makefile asks for it but we actually
 # build resulting in a file named spf.so because the module-loading
@@ -81,9 +83,10 @@ dkim.so:
 
 spf_perl.so:
 	@echo "$(CC) -shared $*.c"
-	$(FE)$(CC) $(SUPPORT_SPF_PERL_INCLUDE) $(SUPPORT_SPF_PERL_LIBS) \
+	$(FE)$(CC) $(SUPPORT_SPF_PERL_INCLUDE) \
 			-DDYNLOOKUP $(CFLAGS_DYNAMIC) $(CFLAGS) $(INCLUDE) \
-			$(DLFLAGS) spf_perl.c -o spf.so
+			$(DLFLAGS) spf_perl.c -o spf.so \
+			 $(SUPPORT_SPF_PERL_LIBS)
 
 # DMARC
 dmarc.o dmarc_native.o:
@@ -97,9 +100,11 @@ dmarc.o dmarc_native.o:
 dmarc.so dmarc_native.so:
 	@echo "$(CC) -shared $*.c dmarc_common.c"
 	$(FE)$(CC) -DDYNLOOKUP $(CFLAGS_DYNAMIC) -o dmarc.so \
-		$(SUPPORT_$*_INCLUDE) $(SUPPORT_$*_LIBS) \
+		$(SUPPORT_$*_INCLUDE) \
 		$(CFLAGS) $(INCLUDE) $(TLS_INCLUDE) $(DLFLAGS) \
-		$*.c dmarc_common.c
+		$*.c dmarc_common.c \
+		$(SUPPORT_$*_LIBS)
+
 
 # Compile instructions for static perl.o for when EXIM_PERL is set
 # Dynamic is managed all via scripts/Configure-Makefile
-- 
## subscription configuration (requires account):
##   https://lists.exim.org/mailman3/postorius/lists/exim-users.lists.exim.org/
## unsubscribe (doesn't require an account):
##   [email protected]
## Exim details at http://www.exim.org/
## Please use the Wiki with this list - http://wiki.exim.org/

Reply via email to