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
  • 1.  Cannot compile Perl 5.26.1 with db-4.8.24-3 installed

    Posted Thu October 26, 2017 09:53 AM

    Originally posted by: Brian G


    Attempting to compile Perl 5.26.1 with this environment and configure command:

     

    export OBJECT_MODE=64

     

    ./Configure \
    -d \
    -Dcc=cc_r \
    -Duseshrplib \
    -Dusethreads \
    -Duse64bitall \
    -Dprefix=/usr/opt/perl5_64

     

    The Perl configure command produces this error:

     

    I used the command:

            cc_r -o try -O -D_ALL_SOURCE -D_ANSI_C_SOURCE -D_POSIX_SOURCE -qmaxmem=-1 -qnoansialias -qlanglvl=extc99 -DUSE_NATIVE_DLOPEN -DNEED_PTHREAD_INIT -I/usr/local/include -brtl -bdynamic -L/usr/local/lib try.c -lpthread -lbind -lnsl -ldbm -ldb -ldl -lld -lm -lcrypt -lpthreads -lc
             ./try

    and I got the following output:

    ld: 0711-738 ERROR: Input file /usr/lib/libdb.so:
            XCOFF32 object files are not allowed in 64-bit mode.
    I can't compile the test program.
    (The supplied flags or libraries might be incorrect.)

    You have a BIG problem.  Shall I abort Configure [y]
    Ok.  Stopping Configure.



  • 2.  Re: Cannot compile Perl 5.26.1 with db-4.8.24-3 installed

    Posted Thu October 26, 2017 10:20 AM

    Originally posted by: AyappanP


    64 bit library is available in /usr/lib64 or /opt/freeware/lib64 . You can include -L/usr/lib64 in your LDFLAGS to avoid this build error.



  • 3.  Re: Cannot compile Perl 5.26.1 with db-4.8.24-3 installed

    Posted Thu October 26, 2017 10:38 AM

    Originally posted by: Brian G


    I tried this and got the same error:

     

    export LDFLAGS="-L/opt/freeware/lib64 -L/opt/freeware/lib -L/usr/local/lib -Wl,-blibpath:/opt/freeware/lib64:/opt/freeware/lib:/usr/local/lib:/usr/lib:/lib -Wl,-bmaxdata:0x80000000"

     

    Here is what is in /opt/freeware/lib64 for libdb.*  There is no libdb.so

    # ls -l /opt/freeware/lib64/libdb*
    lrwxrwxrwx    1 root     system           18 Jul 07 07:30 /opt/freeware/lib64/libdb-4.8.a -> ../lib/libdb-4.8.a
    lrwxrwxrwx    1 root     system           16 Jul 07 07:30 /opt/freeware/lib64/libdb-4.a -> ../lib/libdb-4.a
    lrwxrwxrwx    1 root     system           14 Jul 07 07:30 /opt/freeware/lib64/libdb.a -> ../lib/libdb.a
    lrwxrwxrwx    1 root     system           15 Jul 07 07:30 /opt/freeware/lib64/libdb4.a -> ../lib/libdb4.a

     

    Here is what is in /opt/freeware/lib for libdb.*  There is a libdb.so

    # ls -l /opt/freeware/lib/libdb*
    -rw-r--r--    1 root     system      5490772 Jan 29 2015  /opt/freeware/lib/libdb-4.8.a
    -rw-r--r--    1 root     system          925 Jan 29 2015  /opt/freeware/lib/libdb-4.8.la
    -rwxr-xr-x    1 root     system      2518523 Jan 29 2015  /opt/freeware/lib/libdb-4.8.so
    lrwxrwxrwx    1 root     system           11 Jul 07 07:30 /opt/freeware/lib/libdb-4.a -> libdb-4.8.a
    lrwxrwxrwx    1 root     system           12 Jul 07 07:30 /opt/freeware/lib/libdb-4.so -> libdb-4.8.so
    lrwxrwxrwx    1 root     system           11 Jul 07 07:30 /opt/freeware/lib/libdb.a -> libdb-4.8.a
    lrwxrwxrwx    1 root     system           12 Jul 07 07:30 /opt/freeware/lib/libdb.so -> libdb-4.8.so
    lrwxrwxrwx    1 root     system           11 Jul 07 07:30 /opt/freeware/lib/libdb4.a -> libdb-4.8.a

     

    Thanks.



  • 4.  Re: Cannot compile Perl 5.26.1 with db-4.8.24-3 installed

    Posted Thu October 26, 2017 11:13 AM

    Originally posted by: AyappanP


    Make sure you use AIX linker and not GNU binutils linker. 

    export AR="/usr/bin/ar"

    export LD="/usr/bin/ld"

    Have a look at AIX Toolbox perl spec file for proper build parameters --> ftp://public.dhe.ibm.com/aix/freeSoftware/aixtoolbox/SPECS/perl-5.22.0-1.spec



  • 5.  Re: Cannot compile Perl 5.26.1 with db-4.8.24-3 installed

    Posted Thu October 26, 2017 11:24 AM

    Originally posted by: Brian G


    I took a look at the link you supplied and changed my build environment to be the following:

     

    export CC='/opt/IBM/xlC/13.1.3/bin/xlc_r -q64'
    export LDFLAGS="-s -Wl,-bmaxdata:0x80000000 -L/opt/freeware/lib64 -L/usr/lib64 -L/opt/freeware/lib"
    export AR="/usr/bin/ar"
    export LD="/usr/bin/ld"
    export OBJECT_MODE=64

     

    Unfortunately I get the same error.

     

    ld: 0711-738 ERROR: Input file /usr/lib/libdb.so:
            XCOFF32 object files are not allowed in 64-bit mode.



  • 6.  Re: Cannot compile Perl 5.26.1 with db-4.8.24-3 installed

    Posted Fri October 27, 2017 01:28 AM

    Originally posted by: sanket


    Don't use -bmaxdata flag for 64bit compilation. This flag is only useful in 32bit compilation and can have negative effect for 64bit compilation.

    But this is not related to your error.

     



  • 7.  Re: Cannot compile Perl 5.26.1 with db-4.8.24-3 installed

    Posted Thu October 26, 2017 11:58 AM

    Originally posted by: AyappanP


    I just did a build of perl 5.26.1. It is successful. Not sure what is the problem in your setup. 

    export AR="/usr/bin/ar"
    export LD="/usr/bin/ld"

    export OBJECT_MODE=64
     
    export CC='/usr/vac/bin/xlc_r -q64'
    export LDFLAGS="-s -Wl,-bmaxdata:0x80000000 -L/opt/freeware/lib64 -L/usr/lib64 -L/opt/freeware/lib"
     
    ./Configure -desr -d \
    -Dcc="$CC" -Dldflags="$LDFLAGS" \
    -Duselargefiles \
    -Duseshrplib \
    -Dusethreads \
      -Duse64bitall \
    -A define:ld='/usr/vac/bin/xlc_r -q64' \
    -A define:ccdlflags='-brtl -bdynamic' \
    -A define:lddlflags='-bexpall -G -L/opt/freeware/lib64  -L/usr/lib64 -L/opt/freeware/lib'

    make



  • 8.  Re: Cannot compile Perl 5.26.1 with db-4.8.24-3 installed

    Posted Thu October 26, 2017 12:02 PM

    Originally posted by: Brian G


    Do you also have db-4.8.24-3.aix6.1.ppc.rpm installed?



  • 9.  Re: Cannot compile Perl 5.26.1 with db-4.8.24-3 installed

    Posted Fri October 27, 2017 04:04 AM

    Originally posted by: AyappanP


    Yes. I also have db-4.8.24-3 installed. Checking this perl library DB_File.so. It's perfectly linking with the 64bit libdb library.

    # ldd ./lib/auto/DB_File/DB_File.so
    ./lib/auto/DB_File/DB_File.so needs:
             /opt/freeware/lib64/libdb.a(libdb-4.8.so)
             /usr/lib/libpthread.a(shr_xpg5_64.o)
             /usr/lib/libc.a(shr_64.o)
             /unix
             /usr/lib/libcrypt.a(shr_64.o)

     

    And yes , we should not be using -bmaxdata for 64 bit compilation.