[Pkg-clamav-devel] package status for jessie

Sebastian Andrzej Siewior sebastian at breakpoint.cc
Mon Aug 25 19:25:00 UTC 2014


On 2014-08-25 00:38:55 [+0200], Andreas Cadhalpun wrote:
> Hi Sebastian,
Hi Andreas,

> Unfortunately, it is not only a superfluous '-static'.
> As far as I can tell, llvm only ships the static libraries!
> Looking at the file list of llvm-3.4-dev [1], only one static library,
> libLTO.a, has a corresponding .so symlink.

You don't need the -static for that. Usually .so are picked for linking.
If they are not there then the .a are taken instead.

> Unless I'm missing something, linking statically against LLVM is the only
> option.

either the debian LLVM package is br0ken or upstream. So I removed
-static option and rebuild on sid-i386 and nothing changed. Then I
applied this piece:

diff --git a/libclamav/c++/Makefile.am b/libclamav/c++/Makefile.am
index 2824266..9ae5b08 100644
--- a/libclamav/c++/Makefile.am
+++ b/libclamav/c++/Makefile.am
@@ -39,8 +39,8 @@ if BUILD_LLVM3
 libclamavcxx_la_CXXFLAGS += -DLLVM30
 endif
 libclamavcxx_la_CXXFLAGS += -DLLVM_VERSION=${LLVM_VERSION}
-libclamavcxx_la_LDFLAGS = @LLVMCONFIG_LDFLAGS@ @LLVMCONFIG_LIBS@ @LLVMCONFIG_LDFLAGS@ @JSON_LDFLAGS@
-libclamavcxx_la_DEPENDENCIES = @LLVMCONFIG_LIBFILES@ @JSON_LIBS@
+libclamavcxx_la_LDFLAGS = @LLVMCONFIG_LDFLAGS@ @LLVMCONFIG_LDFLAGS@ @JSON_LDFLAGS@ -lLLVM-3.4
+#libclamavcxx_la_DEPENDENCIES = @LLVMCONFIG_LIBFILES@ @JSON_LIBS@
 noinst_LTLIBRARIES = libclamavcxx.la
 libclamavcxx_la_SOURCES += PointerTracking.cpp
 libclamavcxx_la_SOURCES += PointerTracking.h

and surprise surprise:
|ldd ./libclamav/.libs/libclamav.so.6.1.22 
|        linux-gate.so.1 (0xb770b000)
|        libxml2.so.2 => /usr/lib/i386-linux-gnu/libxml2.so.2 (0xb7361000)
|        libmspack.so.0 => /usr/lib/i386-linux-gnu/libmspack.so.0 (0xb734c000)
|        libz.so.1 => /lib/i386-linux-gnu/libz.so.1 (0xb7332000)
|        libbz2.so.1.0 => /lib/i386-linux-gnu/libbz2.so.1.0 (0xb7320000)
|        libltdl.so.7 => /usr/lib/i386-linux-gnu/libltdl.so.7 (0xb7316000)
|        libffi.so.6 => /usr/lib/i386-linux-gnu/libffi.so.6 (0xb730e000)
|        libtinfo.so.5 => /lib/i386-linux-gnu/libtinfo.so.5 (0xb72eb000)
         ⇣
|        libLLVM-3.4.so.1 => /usr/lib/i386-linux-gnu/libLLVM-3.4.so.1 (0xb56bc000)
         ⇡
|        libstdc++.so.6 => /usr/lib/i386-linux-gnu/libstdc++.so.6 (0xb55ca000)
|        libssl.so.1.0.0 => /usr/lib/i386-linux-gnu/i686/cmov/libssl.so.1.0.0 (0xb556c000)
|        libcrypto.so.1.0.0 => /usr/lib/i386-linux-gnu/i686/cmov/libcrypto.so.1.0.0 (0xb53a1000)
|        libjson-c.so.2 => /lib/i386-linux-gnu/libjson-c.so.2 (0xb5395000)
|        libpthread.so.0 => /lib/i386-linux-gnu/i686/cmov/libpthread.so.0 (0xb5378000)
|        libm.so.6 => /lib/i386-linux-gnu/i686/cmov/libm.so.6 (0xb5332000)
|        libdl.so.2 => /lib/i386-linux-gnu/i686/cmov/libdl.so.2 (0xb532d000)
|        libgcc_s.so.1 => /lib/i386-linux-gnu/libgcc_s.so.1 (0xb5310000)
|        libc.so.6 => /lib/i386-linux-gnu/i686/cmov/libc.so.6 (0xb5165000)
|        liblzma.so.5 => /lib/i386-linux-gnu/liblzma.so.5 (0xb513d000)
|        /lib/ld-linux.so.2 (0xb770c000)

it built and the testsuite passed. No unresovled symbols.

> Therefore I think we must add a Built-Using field [2] containing the
> corresponding LLVM version.

Yeah. Or could we get llvm to link against the .so file? It seems to
work. It looks like the problem is with llvm-config. Its --libs option
lists all the -l switch for all .a files. It would make sense to link
against .so lib instead. I wonder why they do it this way because they
ship a .so file but there is no way to link against without hardcoding
the lib name…

> Looking at LLVM's build log [3] one finds many uses of
> '-D_FILE_OFFSET_BITS=64', but it seems there is some problem in LLVM's build
> system, because not everything is built with that.

haha. so not only clamav has "its" problem :)

> After adding '-D_FILE_OFFSET_BITS=64' to CXXFLAGS in LLVM's debian/rules,
> rebuilding LLVM and then rebuilding clamav against this LLVM, libclamav
> doesn't contain any non-LFS symbols anymore.
> 
> So I opened a bug against LLVM [4].

Thanks.

> >Do you know by any chance what is the progress by upstream using external llvm?
> 
> I'm afraid I don't have any news about that. FWIW, the upstream bug [5] says
> the target milestone is 0.98.6.

Okay. 

> Best regards,
> Andreas

Sebastian



More information about the Pkg-clamav-devel mailing list