AIX Open Source

AIX Open Source

Share your experiences and connect with fellow developers to discover how to build and manage open source software for the AIX operating system

 View Only
Expand all | Collapse all

clamAV for AIX 7.1/7.2 [suggestion/wish]

  • 1.  clamAV for AIX 7.1/7.2 [suggestion/wish]

    Posted Fri April 20, 2018 05:39 AM

    Originally posted by: ruxi002


    I would need a recent version of clamAV for AIX.

    The newest version 0.100.0 does not compile because of some type conflicts for unrar. I will adress this issue on the clamAV forum too if nobody thinks that it should be part of the AIX toolbox.

     

    We use clamAV for different products running on our AIX LPAR's - just for additional scanning mostly because using more than one AV product seems to be worthy.

     

    For me it would be nice if clamAV could become a standard product of the AIX toolbox.

     

    For all interested in the compile try, here the interesting part of the gcc output:

     

    The makefile is generated with configure. I couldn't find any useful hint on google - only with older versions that the clamav developers needed to fix those things.

     

    Target "all-am" is up to date.
      CC       unrar15.lo
      CC       unrar.lo
      CC       unrar20.lo
    In file included from ../libclamunrar/unrar.h:27:0,
                     from ../libclamunrar/unrar20.c:22:
    /opt/freeware/lib/gcc/powerpc-ibm-aix7.1.0.0/4.9.4/include-fixed/unistd.h:210:16: error: conflicting types for 'lseek64'
     extern off64_t lseek64(int, off64_t, int);
                    ^
    /opt/freeware/lib/gcc/powerpc-ibm-aix7.1.0.0/4.9.4/include-fixed/unistd.h:208:14: note: previous declaration of 'lseek64' was here
     extern off_t lseek(int, off_t, int);
                  ^
    In file included from /opt/freeware/lib/gcc/powerpc-ibm-aix7.1.0.0/4.9.4/include-fixed/unistd.h:841:0,
                     from ../libclamunrar/unrar.h:27,
                     from ../libclamunrar/unrar20.c:22:
    /usr/include/sys/lockf.h:64:13: error: conflicting types for 'lockf64'
      extern int lockf64 (int, int, off64_t);
                 ^
    /usr/include/sys/lockf.h:62:13: note: previous declaration of 'lockf64' was here
      extern int lockf (int, int, off_t);
                 ^
    In file included from ../libclamunrar/unrar.h:27:0,
                     from ../libclamunrar/unrar20.c:22:
    /opt/freeware/lib/gcc/powerpc-ibm-aix7.1.0.0/4.9.4/include-fixed/unistd.h:914:14: error: conflicting types for 'ftruncate64'
      extern int  ftruncate64(int, off64_t);
                  ^
    In file included from ../libclamunrar/unrar.h:27:0,
                     from ../libclamunrar/unrar20.c:22:
    /opt/freeware/lib/gcc/powerpc-ibm-aix7.1.0.0/4.9.4/include-fixed/unistd.h:912:14: note: previous declaration of 'ftruncate64' was here
      extern int  ftruncate(int, off_t);
                  ^
    In file included from ../libclamunrar/unrar.h:27:0,
                     from ../libclamunrar/unrar20.c:22:
    /opt/freeware/lib/gcc/powerpc-ibm-aix7.1.0.0/4.9.4/include-fixed/unistd.h:971:14: error: conflicting types for 'truncate64'
      extern int  truncate64(const char *, off64_t);
                  ^
    In file included from ../libclamunrar/unrar.h:27:0,
                     from ../libclamunrar/unrar20.c:22:
    /opt/freeware/lib/gcc/powerpc-ibm-aix7.1.0.0/4.9.4/include-fixed/unistd.h:969:14: note: previous declaration of 'truncate64' was here
      extern int  truncate(const char *, off_t);
                  ^
    In file included from ../libclamunrar/unrar.h:27:0,
                     from ../libclamunrar/unrar20.c:22:
    /opt/freeware/lib/gcc/powerpc-ibm-aix7.1.0.0/4.9.4/include-fixed/unistd.h:990:18: error: conflicting types for 'pread64'
      extern ssize_t  pread64(int, void *, size_t, off64_t);

    /opt/freeware/lib/gcc/powerpc-ibm-aix7.1.0.0/4.9.4/include-fixed/unistd.h:987:18: note: previous declaration of 'pread64' was here
      extern ssize_t  pread(int, void *, size_t, off_t);
                      ^
    /opt/freeware/lib/gcc/powerpc-ibm-aix7.1.0.0/4.9.4/include-fixed/unistd.h:991:18: error: conflicting types for 'pwrite64'
      extern ssize_t  pwrite64(int, const void *, size_t, off64_t);
                      ^
    /opt/freeware/lib/gcc/powerpc-ibm-aix7.1.0.0/4.9.4/include-fixed/unistd.h:988:18: note: previous declaration of 'pwrite64' was here
      extern ssize_t  pwrite(int, const void *, size_t, off_t);
                      ^
    /opt/freeware/lib/gcc/powerpc-ibm-aix7.1.0.0/4.9.4/include-fixed/unistd.h:1076:17: error: conflicting types for 'fclear64'
      extern off64_t fclear64(int, off64_t);
                     ^
    /opt/freeware/lib/gcc/powerpc-ibm-aix7.1.0.0/4.9.4/include-fixed/unistd.h:1073:15: note: previous declaration of 'fclear64' was here
      extern off_t fclear(int, off_t);
                   ^
    /opt/freeware/lib/gcc/powerpc-ibm-aix7.1.0.0/4.9.4/include-fixed/unistd.h:1077:13: error: conflicting types for 'fsync_range64'
      extern int fsync_range64(int, int, off64_t, off64_t);
                 ^
    /opt/freeware/lib/gcc/powerpc-ibm-aix7.1.0.0/4.9.4/include-fixed/unistd.h:1074:13: note: previous declaration of 'fsync_range64' was here
      extern int fsync_range(int, int, off_t, off_t);
                 ^
    make: 1254-004 The error code from the last command is 1.

    Stop.
    make: 1254-004 The error code from the last command is 1.

    Stop.
    make: 1254-004 The error code from the last command is 2.

    Stop.
    make: 1254-004 The error code from the last command is 1.

    Stop.
    make: 1254-004 The error code from the last command is 2.

    Stop.

     

    If somebody has a hint how to solve this problem quickly I would also be thankful.

     

    Thanks in advance

    Martin



  • 2.  Re: clamAV for AIX 7.1/7.2 [suggestion/wish]

    Posted Fri April 20, 2018 08:06 AM

    Originally posted by: AyappanP


    It seems like the clamAV source code supports only 64 bit build. You need to export these two env variables.

    export OBJECT_MODE=64

    export CFLAGS="-maix64"   --> For gcc 

    export CFLAGS="-q64"         --> For xlc

     

     



  • 3.  Re: clamAV for AIX 7.1/7.2 [suggestion/wish]

    Posted Fri April 20, 2018 10:36 AM

    Originally posted by: ruxi002


    Thanks for the hint, but using the 64bit options it doesn't compile either - but with different errors.

     

    First, when I set the 64bit parameters, I started the configure script again and got the following message:

     

    export CFLAGS="-maix64"
    export OBJECT_MODE=64

    configure: WARNING:
    ****** WARNING:
    ****** You are cross compiling to a different host or you are
    ****** linking to bugged system libraries or you have manually
    ****** disabled important configure checks.
    ****** Please be aware that this build may be badly broken.
    ****** DO NOT REPORT BUGS BASED ON THIS BUILD !!!

     

    the make itself runs some time and the highlights were ....

     

    a lot of these warnings:

     

    In file included from matcher.h:29:0,
                     from others.h:22,
                     from yara_clam.h:45,
                     from yara_parser.c:55:
    others.h: In function 'cli_readint64':
    others.h:590:9: warning: left shift count >= width of type
             ret |= (((const char *)buff)[4] & 0xff) << 32;
             ^
    others.h:591:9: warning: left shift count >= width of type
             ret |= (((const char *)buff)[5] & 0xff) << 40;
             ^
    others.h:592:9: warning: left shift count >= width of type
             ret |= (((const char *)buff)[6] & 0xff) << 48;
             ^
    others.h:593:9: warning: left shift count >= width of type
             ret |= (((const char *)buff)[7] & 0xff) << 56;

     

    and then the error itself - despite the warnings above and the undefined symbol error it seems clean ;-)

     

      CC       libclamav_internal_utils_la-strlcat.lo
      CCLD     libclamav_internal_utils.la
      CCLD     libclamav.la
    ld: 0711-224 WARNING: Duplicate symbol: .memmove
    ld: 0711-224 WARNING: Duplicate symbol: .bcopy
    ld: 0711-345 Use the -bloadmap or -bnoquiet option to obtain more information.
    ld: 0711-317 ERROR: Undefined symbol: .__cxa_finalize
    collect2: error: ld returned 8 exit status
    make: 1254-004 The error code from the last command is 1.

    Stop.
    make: 1254-004 The error code from the last command is 1.

    Stop.
    make: 1254-004 The error code from the last command is 2.

    Stop.
    make: 1254-004 The error code from the last command is 1.

    Stop.
    make: 1254-004 The error code from the last command is 2.

    Stop.

     

    I also opened a bugzilla request at clamav.net : https://bugzilla.clamav.net/show_bug.cgi?id=12106

     

    I will add the information of the 64bit compilation log to the bugzilla ticket when they are asking for more information.



  • 4.  Re: clamAV for AIX 7.1/7.2 [suggestion/wish]

    Posted Mon April 23, 2018 01:58 AM

    Originally posted by: AyappanP


    I just built clamav-0.100.0 without any issues. And i used gcc 6.3.0 version from AIX Toolbox.

    export CC="/opt/freeware/bin/gcc"

    export CFLAGS="-maix64"

    export OBJECT_MODE="64"

     

    Build steps

    ========

    make distclean

    ./configure

    make



  • 5.  Re: clamAV for AIX 7.1/7.2 [suggestion/wish]

    Posted Mon April 23, 2018 10:17 AM

    Originally posted by: ruxi002


    Hi,

     

    thanks for the hint - I upgraded everything to  the newest gcc and it seems to work - easy method.

    I got still tons of warnings but if everything works fine I can accept that (still needs some testing).

     

    The warning I get mostly look like this:

     

    In file included from ../libclamav/matcher.h:29:0,
                     from ../libclamav/others.h:22,
                     from vba.h:24,
                     from sigtool.c:57:
    ../libclamav/others.h: In function 'cli_readint64':
    ../libclamav/others.h:590:49: warning: left shift count >= width of type [-Wshift-count-overflow]
             ret |= (((const char *)buff)[4] & 0xff) << 32;
                                                     ^~
    ../libclamav/others.h:591:49: warning: left shift count >= width of type [-Wshift-count-overflow]
             ret |= (((const char *)buff)[5] & 0xff) << 40;
                                                     ^~
    ../libclamav/others.h:592:49: warning: left shift count >= width of type [-Wshift-count-overflow]
             ret |= (((const char *)buff)[6] & 0xff) << 48;
                                                     ^~
    ../libclamav/others.h:593:49: warning: left shift count >= width of type [-Wshift-count-overflow]
             ret |= (((const char *)buff)[7] & 0xff) << 56;
                                                     ^~

     

    So my last wish is to package and that and provide it for download as a standard package of the AIX toolbox ;-)

     

    Thanks a lot

    Martin



  • 6.  Re: clamAV for AIX 7.1/7.2 [suggestion/wish]

    Posted Mon April 23, 2018 10:27 AM

    Originally posted by: AyappanP


    We will keep this in our list and decide based upon on our other priorities.



  • 7.  Re: clamAV for AIX 7.1/7.2 [suggestion/wish]

    Posted Mon April 23, 2018 10:46 AM

    Originally posted by: ruxi002


    Thanks - my top priority is security  Laughing  and after the security problems of clamav prior 0.99.3 I needed an update Yes  For now I should have some time untill the next security problem comes - hopefully.

    Best wishes.

     

    Oh, I forgot - clamav.net forum marked by bug report as a duplicate of a bug report for compile problems for AIX 5.3 ... that was not helpful.

    I told them Your hint and sent them the warnings I got during compiling - but I dont think that anyone will invest any work for solving that little issue.

    As long as the scanner works I can live with that.



  • 8.  Re: clamAV for AIX 7.1/7.2 [suggestion/wish]

    Posted Mon January 28, 2019 09:38 AM

    Originally posted by: AyappanP


    clamav 0.100.2-1 is now available in AIX Toolbox. 

    ftp://public.dhe.ibm.com/aix/freeSoftware/aixtoolbox/RPMS/ppc/clamav/

    Please use yum to install it since it has lot of dependencies.



  • 9.  Re: clamAV for AIX 7.1/7.2 [suggestion/wish]

    Posted Tue January 29, 2019 02:59 AM

    Originally posted by: KiloBravo


    Great!  You just saved me a bunch of time working on this (new workplace requirement just creeping in), but any particular reason you went with the 100.2 version from last October instead of the current stable version 0.101.1 ?  (i.e. compile issues? dependency hell? something else I should watch out for if I need to upgrade?)

    Also, is clamav going to go on the regular update list given the nature of the tool, or is this a one-off?  Need to know what to expect when fresmclam starts screaming the version is out-of-date.

     



  • 10.  Re: clamAV for AIX 7.1/7.2 [suggestion/wish]

    Posted Tue January 29, 2019 04:06 AM

    Originally posted by: AyappanP


    Every quarter we have a list of packages to be updated. 

    We started clamav porting work in October and 0.100.2 is the latest version at that time. 

    I see clamav releases being aggressive. 3 releases in 4 months. Anyway we will try to update it every alternate quarter.



  • 11.  Re: clamAV for AIX 7.1/7.2 [suggestion/wish]

    Posted Tue January 29, 2019 10:05 AM

    Originally posted by: KiloBravo


    Release cycle workload - got it. Makes a lot of sense.  Thanks  for the response!

    Related side-note.  You guys are doing a great job with the work you're doing.  It's really appreciated. :)

     



  • 12.  Re: clamAV for AIX 7.1/7.2 [suggestion/wish]

    Posted Mon January 28, 2019 09:57 AM

    Originally posted by: ruxi002


    Hi,

     

    thank You so much Smile . I will exchange my compiled version with yours and hopefully this will fullfill all my needs regarding antivirus tools.

    Please keep up the good work.

     

    Thanks a lot  Laughing

    Martin