Open Source Development

Power Open Source Development

Explore the open source tools and capabilities for building and deploying modern applications on IBM Power platforms including AIX, IBM i, and Linux.


#Power


#Power

 View Only
  • 1.  Problems with PHP 7.2.32-1 build with source RPM

    Posted Wed November 18, 2020 08:29 AM
    I have installed the latest SRPM for PHP (7.2.32-1), so that I can initially build it, then customise it, so that it uses /opt/freeware/etc/php.d instead of /etc/php.d, and to add additional modules that are not in the default php build (unixODBC and pdo-odbc for DB2 interaction, and some xml modules amongst others).

    Applying patches during the prep phase defaults to using /opt/freeware/bin/patch, but patches applied in the spec file during the build phase do not use a pathed patch, so initially defaulted to /usr/bin/patch, which I worked around by moving /opt/freeware/bin to before /usr/bin in my PATH environment variable. Not sure if this is expected or not when using rpmbuild, or if the spec file should be fixed for running a pathed patch in the build phase.

    Continuing on after patching in the build phase, libtool is invoked and compiles and links some files, but eventually breaks with the following problem.

    /bin/sh /opt/freeware/src/packages/BUILD/php-7.2.32/64bit/build-cgi/libtool --silent --preserve-dup-deps --mode=link /opt/freeware/bin/gcc -fPIC -DPHP_ATOM_INC -I/opt/freeware/src/packages/BUILD/php-7.2.32/64bit/build-cgi/include -I/opt/freeware/src/packages/BUILD/php-7.2.32/64bit/build-cgi/main -I/opt/freeware/src/packages/BUILD/php-7.2.32/64bit -I/opt/freeware/src/packages/BUILD/php-7.2.32/64bit/build-cgi/ext/date/lib -I/opt/freeware/src/packages/BUILD/php-7.2.32/64bit/ext/date/lib -I/opt/freeware/include/libxml2 -I/opt/freeware/include -I/opt/freeware/include/freetype2 -I/opt/freeware/src/packages/BUILD/php-7.2.32/64bit/build-cgi/TSRM -I/opt/freeware/src/packages/BUILD/php-7.2.32/64bit/build-cgi/Zend -I/opt/freeware/src/packages/BUILD/php-7.2.32/64bit/main -I/opt/freeware/src/packages/BUILD/php-7.2.32/64bit/Zend -I/opt/freeware/src/packages/BUILD/php-7.2.32/64bit/TSRM -I/opt/freeware/src/packages/BUILD/php-7.2.32/64bit/build-cgi/ -I/opt/freeware/include -Wl,-bbigtoc -I/usr/include/openssl -O2 -maix64 -I/opt/freeware/include -fvisibility=hidden -DZEND_SIGNALS -L/opt/freeware/lib64 -L/usr/lib64 -L/opt/freeware/lib -L/usr/lib -lm -lXpm -lpthread -Wl,-blibpath:/opt/freeware/lib64:/opt/freeware/lib:/usr/lib:/lib -Wl,-G -o ext/soap/soap.la -export-dynamic -avoid-version -prefer-pic -module -rpath /opt/freeware/src/packages/BUILD/php-7.2.32/64bit/build-cgi/modules -L/opt/freeware/lib64 -L/opt/freeware/lib -lm -Wl,-blibpath:/opt/freeware/lib64:/opt/freeware/lib:/usr/lib:/lib -L/opt/freeware/lib ext/soap/soap.lo ext/soap/php_encoding.lo ext/soap/php_http.lo ext/soap/php_packet_soap.lo ext/soap/php_schema.lo ext/soap/php_sdl.lo ext/soap/php_xml.lo -L/opt/freeware/lib -L/opt/freeware/lib -L/opt/freeware/lib -L/opt/freeware/lib -L/opt/freeware/lib -L/opt/freeware/lib -lxml2 -lz -llzma -liconv -lm
    grep_64: /opt/freeware/lib/libiconv.la: No such file or directory
    /opt/freeware/bin/sed: can't read /opt/freeware/lib/libiconv.la: No such file or directory
    libtool: link: `/opt/freeware/lib/libiconv.la' is not a valid libtool archive
    make: *** [Makefile:1102: ext/soap/soap.la] Error 1
    error: Bad exit status from /var/tmp/rpm-tmp.T7LMab (%build)

    I have the following RPMs relevant to this problem installed (amongst others)
    automake 1.16.2-1
    autoconf 2.69-1
    grep 3.4-1
    libiconv 1.16-1
    libtool-ltdl-devel 2.4.6-2
    libtool-ltdl 2.4.6-2
    libtool 2.4.6-2
    m4 1.4.17-1
    sed 4.5-3

    As the current and prior libiconv rpm packages do not contain a libtool.la file, the only way I can see around this is to create my own libiconv.la file, which is not ideal as it doesn't belong to the libiconv RPM package.

    I must be building it in a different way to the AIX Toolbox team. Do you have a libiconv.la file on your build system that was not packaged in the libiconv rpm, or have I missed setting something, as I have not yet modified the php spec file as delivered from the SRPM.


    ------------------------------
    Michael Jack
    ------------------------------

    #AIXOpenSource


  • 2.  RE: Problems with PHP 7.2.32-1 build with source RPM
    Best Answer

    Posted Wed November 18, 2020 09:23 AM
    AIX Toolbox was shipping ".la" files for some packages sometime back which actually complicates the build dependencies. Other distros don't ship that.
    In the recent times we stopped shipping those .la files . But there might be some packages which still has the .la files getting shipped probably because we might not have updated that package in the recent times.

    In this case , I suspect there are some ".la" files present in /opt/freeware/lib (and/or /opt/freeware/lib64) which has reference to "/opt/freeware/lib/libiconv.la" .
    So I would suggest you to remove all .la files from the above two locations . And then trigger a fresh build again.

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



  • 3.  RE: Problems with PHP 7.2.32-1 build with source RPM

    Posted Wed November 18, 2020 12:32 PM
    Thanks Ayappan,

    As you suspected, there was a /opt/freeware/lib/libxml2.la file from the libxml2 rpm that depended on libiconv.la.

    I moved all *.la files out of /opt/freeware/lib and /opt/freeware/lib64 and have been able to successfully build the stock PHP 7.2.32-1 version.

    Thanks for your help.

    ------------------------------
    Michael Jack
    ------------------------------