[clamav-users] How to recompile with -fPIC?

albertomatxain at protonmail.com albertomatxain at protonmail.com
Fri Jun 19 11:52:16 UTC 2020


Hi.

I'm trying to install the latest version of clamav (0.102.3) on Ubuntu 20.04. I'm configuring clamav following the steps explained in http://www.clamav.net/documents/installation-on-debian-and-ubuntu-linux-distributions. It's the first time that I download the source code and I configure and compile a programme. I'm blocked because I don't know how to recompile with fPIC.

The two last steps:

./configure --enable-check --disable-clamav --with-libjson-static=/usr/lib/x86_64-linux-gnu/libjson-c.a

configure: Summary of detected features follows
OS : linux-gnu
pthreads : yes (-lpthread)
configure: Summary of miscellaneous features
check : -lcheck_pic -pthread -lrt -lm -lsubunit
fanotify : yes
fdpassing : 1
IPv6 : yes
openssl : /usr
libcurl : /usr
configure: Summary of optional tools
clamdtop : yes (-lncurses)
milter : no (missing libmilter) (disabled)
clamsubmit : yes (libjson-c-dev found at /usr, linking=static)
clamonacc : yes (auto)
configure: Summary of engine performance features
release mode: yes
llvm : no (disabled)
mempool : yes
configure: Summary of engine detection features
iconv : yes
bzip2 : ok
zlib : yes (from system)
unrar : yes
preclass : yes (libjson-c-dev found at /usr, linking=static)
pcre : /usr
libmspack : yes (Internal)
libxml2 : yes, from /usr
yara : yes
fts : yes (libc)

I think it's all right. Then, I try to compile:

make -j2

(...)
*** Warning: Linking the shared library libclamav.la against the
*** static library /usr/lib/x86_64-linux-gnu/libjson-c.a is not portable!
/usr/bin/ld: /usr/lib/x86_64-linux-gnu/libjson-c.a(json_object.o): relocation R_X86_64_TPOFF32 against `tls_serialization_float_format' can not be used when making a shared object; recompile with -fPIC
collect2: error: ld returned 1 exit status
make[4]: *** [Makefile:1547: libclamav.la] Error 1
make[4]: Leaving directory '/home/alberto/Deskargak/clamav-0.102.3/libclamav'
make[3]: *** [Makefile:4320: all-recursive] Error 1
make[3]: Leaving directory '/home/alberto/Deskargak/clamav-0.102.3/libclamav'
make[2]: *** [Makefile:1463: all] Error 2
make[2]: Leaving directory '/home/alberto/Deskargak/clamav-0.102.3/libclamav'
make[1]: *** [Makefile:853: all-recursive] Error 1
make[1]: Leaving directory '/home/alberto/Deskargak/clamav-0.102.3'
make: *** [Makefile:649: all] Error 2

Those are the last messages. I have to recompile with -fPIC, but I don't know how. I've spent some hours trying to find the way to do it, but... Can you help me? Thank you very much.

Alberto

Sent with [ProtonMail](https://protonmail.com) Secure Email.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.clamav.net/pipermail/clamav-users/attachments/20200619/9d4fae52/attachment.htm>


More information about the clamav-users mailing list