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.  Build httpd 64Bit module

    Posted Wed May 31, 2023 04:17 AM

    Hello,

    I am trying to build a httpd 64Bit module on AIX with apxs, but apxs creates a 32Bit module. Has anyone already tried this and knows how to build a 64Bit module?

    This is the build output:

    $ /opt/freeware/bin/apxs -c mod_test.c
    /opt/freeware/lib/apr-1/build/libtool --silent --mode=compile /opt/freeware/bin/gcc -prefer-pic -maix32 -fsigned-char -D_LARGE_FILES -O2  -U__STR__ -D_THREAD_SAFE -D_USE_IRS -pthread -I/opt/freeware/include/httpd  -I/opt/freeware/include/apr-1   -I/opt/freeware/include/apr-1   -c -o mod_test.lo mod_test.c && touch mod_test.slo
    /opt/freeware/lib/apr-1/build/libtool --silent --mode=link /opt/freeware/bin/gcc -L/opt/freeware/lib -Wl,-blibpath:/opt/freeware/lib:/usr/lib:/lib -Wl,-bmaxdata:0x80000000   -o mod_test.la  -rpath /opt/freeware/lib/httpd/modules -module -avoid-version   -Wl,-brtl  mod_test.lo

    This is the system version information:

    $ oslevel -s
    7200-02-01-1732
            
    $ rpm -qa | grep -e http -e apr
    apr-1.5.2-1.ppc
    apr-util-devel-1.5.4-1.ppc
    httpd-devel-2.4.53-1.ppc
    apr-devel-1.5.2-1.ppc
    apr-util-1.5.4-1.ppc
    httpd-2.4.53-1.ppc

    $ sudo bootinfo -y
    64

    $ sudo bootinfo -K
    64

    Thanks, Henning



    ------------------------------
    Henning Bösch
    ------------------------------


  • 2.  RE: Build httpd 64Bit module

    Posted Wed May 31, 2023 08:48 AM
    Edited by RESHMA KUMAR Wed May 31, 2023 08:52 AM

    In AIX toolbox, we have both 32bit and 64bit apxs (provided by httpd-devel rpm). The default is 32bit. So, you can try building with apxs_64.



    ------------------------------
    RESHMA KUMAR
    ------------------------------



  • 3.  RE: Build httpd 64Bit module

    Posted Thu June 01, 2023 02:57 AM

    I tried building with apxs_64 and now it seems it is building in 64Bit, but somewhere during linking it uses 32Bit:

    $ /opt/freeware/bin/apxs_64 -c mod_test.c                                          
    /opt/freeware/lib64/apr-1/build/libtool --silent --mode=compile /opt/freeware/bin/gcc -prefer-pic -maix64 -fsigned-char -O2  -U__STR__ -D_THREAD_SAFE -D_USE_IRS -pthread -I/opt/freeware/include/httpd  -I/opt/freeware/include/apr-1   -I/opt/freeware/include/apr-1   -c -o mod_test.lo mod_test.c && touch mod_test.slo
    /opt/freeware/lib64/apr-1/build/libtool --silent --mode=link /opt/freeware/bin/gcc -L/opt/freeware/lib64 -L/opt/freeware/lib -Wl,-blibpath:/opt/freeware/lib64:/opt/freeware/lib:/usr/lib:/lib   -o mod_test.la  -rpath /opt/freeware/lib64/httpd/modules -module -avoid-version   -Wl,-brtl  mod_test.lo
    0654-210 .libs/mod_test.o is not valid in the current object file mode.
            Use the -X option to specify the desired object mode.
    ld: 0711-736 ERROR: Input file .libs/mod_test.o:
            XCOFF64 object files are not allowed in 32-bit mode.
    collect2: error: ld returned 8 exit status
    apxs:Error: Command failed with rc=65536

    Thanks, Henning



    ------------------------------
    Henning Bösch
    ------------------------------



  • 4.  RE: Build httpd 64Bit module

    Posted Thu June 01, 2023 11:02 AM

    You can run "export OBJECT_MODE=64" and then try again.



    ------------------------------
    RESHMA KUMAR
    ------------------------------



  • 5.  RE: Build httpd 64Bit module

    Posted Fri June 02, 2023 06:36 AM

    I have run the command with OBJECT_MODE=64, but now another error pops up. The file with the error is only temporary and imediately deleted after the command terminates. When searching for this error the provided the solutions I have found is to compile in 32Bit, but this is exactly what I not want.

    $ export OBJECT_MODE=64                                        

    $ /opt/freeware/bin/apxs_64 -c mod_test.c                       
    /opt/freeware/lib64/apr-1/build/libtool --silent --mode=compile /opt/freeware/bin/gcc -prefer-pic -maix64 -fsigned-char -O2  -U__STR__ -D_THREAD_SAFE -D_USE_IRS -pthread -I/opt/freeware/include/httpd  -I/opt/freeware/include/apr-1   -I/opt/freeware/include/apr-1   -c -o mod_test.lo mod_test.c && touch mod_test.slo
    /opt/freeware/lib64/apr-1/build/libtool --silent --mode=link /opt/freeware/bin/gcc -L/opt/freeware/lib64 -L/opt/freeware/lib -Wl,-blibpath:/opt/freeware/lib64:/opt/freeware/lib:/usr/lib:/lib   -o mod_test.la  -rpath /opt/freeware/lib64/httpd/modules -module -avoid-version   -Wl,-brtl  mod_test.lo
    Assembler:
    /tmp//ccbZexBe.s: line 18: Only .llong should be used for relocatable expressions.
    /tmp//ccbZexBe.s: line 83: Only .llong should be used for relocatable expressions.
    /tmp//ccbZexBe.s: line 142: Only .llong should be used for relocatable expressions.
    /tmp//ccbZexBe.s: line 170: Only .llong should be used for relocatable expressions.
    /tmp//ccbZexBe.s: line 196: Only .llong should be used for relocatable expressions.
    /tmp//ccbZexBe.s: line 199: Only .llong should be used for relocatable expressions.
    /tmp//ccbZexBe.s: line 200: Only .llong should be used for relocatable expressions.
    collect2: fatal error: gcc returned 1 exit status
    compilation terminated.
    apxs:Error: Command failed with rc=65536

    Thanks, Henning



    ------------------------------
    Henning Bösch
    ------------------------------



  • 6.  RE: Build httpd 64Bit module

    Posted Fri June 02, 2023 07:20 AM

    Looks like during the linking stage "-maix64" is not getting passed.

    You can run like this /opt/freeware/bin/apxs_64 -c -S CC="/opt/freeware/bin/gcc -maix64" mod_test.c

    This is a workaround but we will find a way to fix this permanently in httpd build. 



    ------------------------------
    Ayappan P
    ------------------------------



  • 7.  RE: Build httpd 64Bit module

    Posted Fri June 02, 2023 08:42 AM

    it is working now. Thanks for the help.

    Thanks, Henning



    ------------------------------
    Henning Bösch
    ------------------------------