Clang does not have -export-dynamic. Instead dlopen(3) teaches us to use the -rdynamic option to cc(1).

The attached patch is needed for smtp-vilter to be able to dlopen(3) the clamd and spamd backends on clang archs too.

/Niklas

diff --git a/mail/smtp-vilter/patches/patch-bin_smtp-vilter_Makefile 
b/mail/smtp-vilter/patches/patch-bin_smtp-vilter_Makefile
index 7d6d6147b7c..30dab7adb89 100644
--- a/mail/smtp-vilter/patches/patch-bin_smtp-vilter_Makefile
+++ b/mail/smtp-vilter/patches/patch-bin_smtp-vilter_Makefile
@@ -1,7 +1,13 @@
 Index: bin/smtp-vilter/Makefile
 --- bin/smtp-vilter/Makefile.orig
 +++ bin/smtp-vilter/Makefile
-@@ -12,7 +12,7 @@ YFLAGS=              -d -p vilter
+@@ -7,12 +7,12 @@ SRCS=                smtp-vilter.c engine.c imsg.c buffer.c 
pftable.
+ CFLAGS+=      -pthread -Wall -I{.CURDIR} -I${.CURDIR}/../../include \
+               -I/usr/src/gnu/usr.sbin/sendmail/include
+ 
+-LDADD+=               -export-dynamic -lmilter -lpthread -L/usr/local/lib -lm
++LDADD+=               -rdynamic -lmilter -lpthread -L/usr/local/lib -lm
+ YFLAGS=               -d -p vilter
  LFLAGS=               -Pvilter -olex.yy.c
  LINTFLAGS+=   -u
  

Reply via email to