edwin at clamav
Sep 28, 2010, 6:57 AM
Post #1 of 3
Building ClamAV with external/system LLVM
I just committed some changes to configure and the bytecode2llvm.cpp to
allow building with an external LLVM.
This will allow you to build against LLVM 2.8 when it is released
(right now you can test with LLVM 2.8 rc2).
It won't work if you try linking against LLVM 2.7 for obvious reasons
(upstream's 2.7 doesn't have our patches).
How to use it:
./configure --enable-llvm --with-system-llvm=/path/to/llvm-config
What it does:
Skip building internal LLVM, link against external LLVM *statically*.
So LLVM will stay a build-time only dependency, and upgrading the
LLVM .so won't suddenly break ClamAV
Let me know if this is enough to create packages for your distribution
that links to system's LLVM, or if any other changes are needed.
For example on Debian:
(it should be /usr/bin/llvm-config-2.8 once its packaged)
What I tested:
- building with upstream LLVM 2.8 rc2 on amd64, Release and
- building against llvm2.8rc2 Debian package (updated manually [*])
[*] Since there is no llvm 2.8 rc2 package in Debian, and the -snapshot
is too old, I did this to build an up-to-date llvm 2.8 rc2 package the
same way the snapshot was built:
apt-get source llvm-snapshot
svn co $LLVMURL llvm2.8rc2
zcat ../llvm-snapshot_20100418-1.diff.gz |patch -p1
dpkg-buildpackage -us -uc -b -j6
sudo dpkg -i ../llvm-snapshot_20100418-1_amd64.deb
# workaround debian bug #578483
sudo ln -s /usr/lib/llvm-snapshot/ /usr/lib/llvm
Please submit your patches to our Bugzilla: http://bugs.clamav.net