[clamav-users] ARM Cross Compile
Mclean, John (GE Energy Management)
JohnD.Mclean at ge.com
Fri Sep 26 17:10:05 UTC 2014
Notes on cross compiling clamav-0.98.4 for freescale based arm board
Down load clamav-0.98.4.tar.gz
tar xvzf clamav-0.98.4.tar.gz
mkdir clamav_install_dir
created exports for cross compiler so configure finds the right stuff, e.g.; PATH, ARCH, CFLAGS, LDFLAGS, CROSS_COMPILE, CC, AR, LD.
cd clamav-0.98.4
This is the configure line I finally got to work:
./configure --build=i686-host-linux-gnu --host=arm-fsl-linux-gnueabi --with-openssl=/<built rootfs dir>/usr --with-zlib=/<built rootfs dir/usr --includedir=/<built rootfs dir>/usr/include --libdir=/<built rootfs dir>/usr/lib --with-gnu-ld --with-sysroot=/<built rootfs dir> - -prefix=/<my clamav build dir>/clamav_install_dir --disable-clamav --enable-unrar=no
In clamav-0.98.4/clamdscan/proto.c, sockaddr_un was unknown, so made the following change:
#ifndef _WIN32
// extern struct sockaddr_un nixsock;
struct sockaddr_in nixsock;
#endif20140924
make
make install
Note: for make install, library files are getting installed to <build rootfs dir> so you need write permssions here. It would be nice if --prefix would control where the lib files get installed. It's handy to be able to build in isolation and cherry pick what you need.
Binaries are in clamav_install_dir.
Copied binaries, libs, etc and daily.cvd to my target. On running any of the binaries I get the following warning, which I haven't been able to get rid of, even when using the configure flag --enable-unrar=no.
LibClamAV Warning: Cannot dlopen libclamunrar_iface: file not found - unrar support unavailable
But other than this, everything appears to work. Successfully scanning files! Yeah!
Note: <built rootfs dir> this is my cross compiled root file system directory. In my case it's a, previously built(cross-compiled), typical debian based, directory structure, e.g.: /bin, /sbin, /lib, /usr/lib, /usr/include. /lib, /usr/lib and /usr/include contain all dependent shared libraries and include files needed. (sorry if this is getting pedantic, but if cross compilation is new to you, this is a pre-requisit.)
Cheers, J.
Unsubscribe from our commercial electronic messages.
http://supportcentral.ge.com/esurvey/takesurvey.asp?p=17778&d=3834102
Désabonner de nos messages électroniques commerciaux.
http://supportcentral.ge.com/esurvey/takesurvey.asp?p=17778&d=3839563
More information about the clamav-users
mailing list