Hello,

I have been playing around with dlopened lookups modules, but they do
not end up being linked against the respective library:

make[2]: Entering directory '/tmp/EXIM4/exim4/build-Linux-x86_64/lookups'
cc -shared sqlite.c
cc  -lsqlite3  -DDYNLOOKUP -shared -rdynamic -fPIC -O -D_FILE_OFFSET_BITS=64 
-D_LARGEFILE_SOURCE -I/usr/include/p11-kit-1  -I/usr/include/p11-kit-1    
sqlite.c -o sqlite.so
[...]
ametzler@argenau:/tmp/EXIM4/exim4$ objdump -p 
./build-Linux-x86_64/dynmodules/sqlite_lookup.so | grep NEEDED
  NEEDED               libc.so.6
ametzler@argenau:/tmp/EXIM4/exim4$ ldd -r 
./build-Linux-x86_64/dynmodules/sqlite_lookup.so
        linux-vdso.so.1 (0x00007f541dbd4000)
        libc.so.6 => /usr/lib/x86_64-linux-gnu/libc.so.6 (0x00007f541d800000)
        /lib64/ld-linux-x86-64.so.2 (0x00007f541dbd6000)
undefined symbol: sqlite_lock_timeout   
(./build-Linux-x86_64/dynmodules/sqlite_lookup.so)
[...]

I think the cc invocation is not correctly ordered, the -lsqlite3 should
be at the end, i.e.
+++ src/lookups/Makefile
[...]
-                $(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)

I can try to come up with a patch if you agree with this premise.

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'

-- 
## 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