[SOLVED] ld: duplicate symbol _clamav_module: mod_clamav APA

Alles, was den Apache betrifft, kann hier besprochen werden.

[SOLVED] ld: duplicate symbol _clamav_module: mod_clamav APA

Postby x11max » 19. April 2011 20:31

Have some problems to build an DSO mod_clamav.sp running OSX 10.6.7.

The last step, building the mod_clamav.so failed using the make command.

ld: duplicate symbol _clamav_module in .libs/mod_clamav_la-locking.o and .libs/mod_clamav_la-config.o
collect2: ld returned 1 exit status
make[1]: *** [mod_clamav.la] Error 1
make: *** [all] Error 2

The configure runs without any errors.
./configure CFLAGS="-O3" LDFLAGS="-L/opt/local/lib/x86_64" CPPFLAGS="-I/opt/local/include" LIBS="-lclamav" --prefix=/opt/local --exec-prefix=/opt/local --with-apr1config=/opt/local/bin --with-apxs=/usr/sbin/apxs

Who can help ?

--------------------------

Source : mod_clamav-0.23

Installed and working:
clamav @0.97_0 (active)
clamav-server @0.97_0 (active)

make all-am
/bin/sh ./libtool --tag=CC --mode=compile `/usr/sbin/apxs -q CC` -DHAVE_CONFIG_H -I. `apr-1-config --cppflags` `apr-1-config --includes` -I`/usr/sbin/apxs -q INCLUDEDIR` -I/opt/local/include `apr-1-config --cflags` `/usr/sbin/apxs -q CFLAGS_SHLIB` -O3 -MT mod_clamav_la-config.lo -MD -MP -MF .deps/mod_clamav_la-config.Tpo -c -o mod_clamav_la-config.lo `test -f 'config.c' || echo './'`config.c
mkdir .libs
gcc -DHAVE_CONFIG_H -I. -DDARWIN -DSIGPROCMASK_SETS_THREAD_MASK -no-cpp-precomp -I/opt/local/include/apr-1 -I/usr/include/apache2 -I/opt/local/include -O3 -MT mod_clamav_la-config.lo -MD -MP -MF .deps/mod_clamav_la-config.Tpo -c config.c -fno-common -DPIC -o .libs/mod_clamav_la-config.o
config.c: In function 'mod_clamav_set_perms_cmd':
config.c:164: warning: format '%o' expects type 'unsigned int *', but argument 3 has type 'mode_t *'
mv -f .deps/mod_clamav_la-config.Tpo .deps/mod_clamav_la-config.Plo
/bin/sh ./libtool --tag=CC --mode=compile `/usr/sbin/apxs -q CC` -DHAVE_CONFIG_H -I. `apr-1-config --cppflags` `apr-1-config --includes` -I`/usr/sbin/apxs -q INCLUDEDIR` -I/opt/local/include `apr-1-config --cflags` `/usr/sbin/apxs -q CFLAGS_SHLIB` -O3 -MT mod_clamav_la-locking.lo -MD -MP -MF .deps/mod_clamav_la-locking.Tpo -c -o mod_clamav_la-locking.lo `test -f 'locking.c' || echo './'`locking.c
gcc -DHAVE_CONFIG_H -I. -DDARWIN -DSIGPROCMASK_SETS_THREAD_MASK -no-cpp-precomp -I/opt/local/include/apr-1 -I/usr/include/apache2 -I/opt/local/include -O3 -MT mod_clamav_la-locking.lo -MD -MP -MF .deps/mod_clamav_la-locking.Tpo -c locking.c -fno-common -DPIC -o .libs/mod_clamav_la-locking.o
mv -f .deps/mod_clamav_la-locking.Tpo .deps/mod_clamav_la-locking.Plo
/bin/sh ./libtool --tag=CC --mode=compile `/usr/sbin/apxs -q CC` -DHAVE_CONFIG_H -I. `apr-1-config --cppflags` `apr-1-config --includes` -I`/usr/sbin/apxs -q INCLUDEDIR` -I/opt/local/include `apr-1-config --cflags` `/usr/sbin/apxs -q CFLAGS_SHLIB` -O3 -MT mod_clamav_la-handler.lo -MD -MP -MF .deps/mod_clamav_la-handler.Tpo -c -o mod_clamav_la-handler.lo `test -f 'handler.c' || echo './'`handler.c
gcc -DHAVE_CONFIG_H -I. -DDARWIN -DSIGPROCMASK_SETS_THREAD_MASK -no-cpp-precomp -I/opt/local/include/apr-1 -I/usr/include/apache2 -I/opt/local/include -O3 -MT mod_clamav_la-handler.lo -MD -MP -MF .deps/mod_clamav_la-handler.Tpo -c handler.c -fno-common -DPIC -o .libs/mod_clamav_la-handler.o
mv -f .deps/mod_clamav_la-handler.Tpo .deps/mod_clamav_la-handler.Plo
/bin/sh ./libtool --tag=CC --mode=compile `/usr/sbin/apxs -q CC` -DHAVE_CONFIG_H -I. `apr-1-config --cppflags` `apr-1-config --includes` -I`/usr/sbin/apxs -q INCLUDEDIR` -I/opt/local/include `apr-1-config --cflags` `/usr/sbin/apxs -q CFLAGS_SHLIB` -O3 -MT mod_clamav_la-shmem.lo -MD -MP -MF .deps/mod_clamav_la-shmem.Tpo -c -o mod_clamav_la-shmem.lo `test -f 'shmem.c' || echo './'`shmem.c
gcc -DHAVE_CONFIG_H -I. -DDARWIN -DSIGPROCMASK_SETS_THREAD_MASK -no-cpp-precomp -I/opt/local/include/apr-1 -I/usr/include/apache2 -I/opt/local/include -O3 -MT mod_clamav_la-shmem.lo -MD -MP -MF .deps/mod_clamav_la-shmem.Tpo -c shmem.c -fno-common -DPIC -o .libs/mod_clamav_la-shmem.o
mv -f .deps/mod_clamav_la-shmem.Tpo .deps/mod_clamav_la-shmem.Plo
/bin/sh ./libtool --tag=CC --mode=compile `/usr/sbin/apxs -q CC` -DHAVE_CONFIG_H -I. `apr-1-config --cppflags` `apr-1-config --includes` -I`/usr/sbin/apxs -q INCLUDEDIR` -I/opt/local/include `apr-1-config --cflags` `/usr/sbin/apxs -q CFLAGS_SHLIB` -O3 -MT mod_clamav_la-init.lo -MD -MP -MF .deps/mod_clamav_la-init.Tpo -c -o mod_clamav_la-init.lo `test -f 'init.c' || echo './'`init.c
gcc -DHAVE_CONFIG_H -I. -DDARWIN -DSIGPROCMASK_SETS_THREAD_MASK -no-cpp-precomp -I/opt/local/include/apr-1 -I/usr/include/apache2 -I/opt/local/include -O3 -MT mod_clamav_la-init.lo -MD -MP -MF .deps/mod_clamav_la-init.Tpo -c init.c -fno-common -DPIC -o .libs/mod_clamav_la-init.o
mv -f .deps/mod_clamav_la-init.Tpo .deps/mod_clamav_la-init.Plo
/bin/sh ./libtool --tag=CC --mode=compile `/usr/sbin/apxs -q CC` -DHAVE_CONFIG_H -I. `apr-1-config --cppflags` `apr-1-config --includes` -I`/usr/sbin/apxs -q INCLUDEDIR` -I/opt/local/include `apr-1-config --cflags` `/usr/sbin/apxs -q CFLAGS_SHLIB` -O3 -MT mod_clamav_la-filter.lo -MD -MP -MF .deps/mod_clamav_la-filter.Tpo -c -o mod_clamav_la-filter.lo `test -f 'filter.c' || echo './'`filter.c
gcc -DHAVE_CONFIG_H -I. -DDARWIN -DSIGPROCMASK_SETS_THREAD_MASK -no-cpp-precomp -I/opt/local/include/apr-1 -I/usr/include/apache2 -I/opt/local/include -O3 -MT mod_clamav_la-filter.lo -MD -MP -MF .deps/mod_clamav_la-filter.Tpo -c filter.c -fno-common -DPIC -o .libs/mod_clamav_la-filter.o
mv -f .deps/mod_clamav_la-filter.Tpo .deps/mod_clamav_la-filter.Plo
/bin/sh ./libtool --tag=CC --mode=compile `/usr/sbin/apxs -q CC` -DHAVE_CONFIG_H -I. `apr-1-config --cppflags` `apr-1-config --includes` -I`/usr/sbin/apxs -q INCLUDEDIR` -I/opt/local/include `apr-1-config --cflags` `/usr/sbin/apxs -q CFLAGS_SHLIB` -O3 -MT mod_clamav_la-bypass.lo -MD -MP -MF .deps/mod_clamav_la-bypass.Tpo -c -o mod_clamav_la-bypass.lo `test -f 'bypass.c' || echo './'`bypass.c
gcc -DHAVE_CONFIG_H -I. -DDARWIN -DSIGPROCMASK_SETS_THREAD_MASK -no-cpp-precomp -I/opt/local/include/apr-1 -I/usr/include/apache2 -I/opt/local/include -O3 -MT mod_clamav_la-bypass.lo -MD -MP -MF .deps/mod_clamav_la-bypass.Tpo -c bypass.c -fno-common -DPIC -o .libs/mod_clamav_la-bypass.o
mv -f .deps/mod_clamav_la-bypass.Tpo .deps/mod_clamav_la-bypass.Plo
/bin/sh ./libtool --tag=CC --mode=compile `/usr/sbin/apxs -q CC` -DHAVE_CONFIG_H -I. `apr-1-config --cppflags` `apr-1-config --includes` -I`/usr/sbin/apxs -q INCLUDEDIR` -I/opt/local/include `apr-1-config --cflags` `/usr/sbin/apxs -q CFLAGS_SHLIB` -O3 -MT mod_clamav_la-mod_clamav.lo -MD -MP -MF .deps/mod_clamav_la-mod_clamav.Tpo -c -o mod_clamav_la-mod_clamav.lo `test -f 'mod_clamav.c' || echo './'`mod_clamav.c
gcc -DHAVE_CONFIG_H -I. -DDARWIN -DSIGPROCMASK_SETS_THREAD_MASK -no-cpp-precomp -I/opt/local/include/apr-1 -I/usr/include/apache2 -I/opt/local/include -O3 -MT mod_clamav_la-mod_clamav.lo -MD -MP -MF .deps/mod_clamav_la-mod_clamav.Tpo -c mod_clamav.c -fno-common -DPIC -o .libs/mod_clamav_la-mod_clamav.o
mv -f .deps/mod_clamav_la-mod_clamav.Tpo .deps/mod_clamav_la-mod_clamav.Plo
/bin/sh ./libtool --tag=CC --mode=link `/usr/sbin/apxs -q CC` `apr-1-config --cflags` `/usr/sbin/apxs -q CFLAGS_SHLIB` -O3 `apr-1-config --ldflags` -module `/usr/sbin/apxs -q LDFLAGS_SHLIB` -L/opt/local/lib/x86_64 -o mod_clamav.la -rpath /opt/local/lib mod_clamav_la-config.lo mod_clamav_la-locking.lo mod_clamav_la-handler.lo mod_clamav_la-shmem.lo mod_clamav_la-init.lo mod_clamav_la-filter.lo mod_clamav_la-bypass.lo mod_clamav_la-mod_clamav.lo -lclamav -lclamav
gcc ${wl}-undefined ${wl}dynamic_lookup -o .libs/mod_clamav.0.0.0.so -bundle .libs/mod_clamav_la-config.o .libs/mod_clamav_la-locking.o .libs/mod_clamav_la-handler.o .libs/mod_clamav_la-shmem.o .libs/mod_clamav_la-init.o .libs/mod_clamav_la-filter.o .libs/mod_clamav_la-bypass.o .libs/mod_clamav_la-mod_clamav.o -L/opt/local/lib/x86_64 /opt/local/lib/x86_64/libclamav.dylib -L/opt/local/lib /opt/local/lib/libltdl.dylib /opt/local/lib/libz.dylib /opt/local/lib/libbz2.dylib /opt/local/lib/libiconv.dylib
ld: duplicate symbol _clamav_module in .libs/mod_clamav_la-locking.o and .libs/mod_clamav_la-config.o
collect2: ld returned 1 exit status
make[1]: *** [mod_clamav.la] Error 1
make: *** [all] Error 2
Last edited by x11max on 27. April 2011 21:29, edited 1 time in total.
x11max
 
Posts: 6
Joined: 19. April 2011 20:17

Re: ld: duplicate symbol _clamav_module : mod_clamav and apa

Postby x11max » 20. April 2011 20:09

answer my own question:

- change mod_clamav.h:

change "module AP_MODULE_DECLARE_DATA clamav_module;"

in "extern module AP_MODULE_DECLARE_DATA clamav_module;"

That solves the problem. :mrgreen: posting.php?mode=reply&f=5&t=45826&sid=dcf73ea25987ec99f1895d5f768bec87#

./configure CFLAGS="-DCLAMAV_DEBUG" LDFLAGS="-L/opt/local/lib/x86_64" CPPFLAGS="-I/opt/local/include" --prefix=/opt/local/apache2 --exec-prefix=/opt/local/apache2 --with-apr1config=/opt/local/bin --with-apxs=/opt/local/apache2/bin/apxs --with-apache=/opt/local/apache2
x11max
 
Posts: 6
Joined: 19. April 2011 20:17


Return to Apache

Who is online

Users browsing this forum: No registered users and 2 guests