Problem building PHP with GCC 4.1.1

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]



Hi folks,

Trying to build php 4.4.4 on a RHEL4 (64-bit) box using GCC 4.1.1 (binutils
2.17) that I built on this box (default compiler was gcc 3.4.6).

Compiling under 3.4.6 works fine.  However, when compiling under 4.1.1, I get
the following error:

..
/usr/local/gcc411/lib/gcc/x86_64-unknown-linux-gnu/4.1.1/../../../../x86_64-unknown-linux-gnu/bin/ld:
main/output.lo: relocation R_X86_64_PC32 against `php_default_output_func'
can not be used when making a shared object; recompile with -fPIC
/usr/local/gcc411/lib/gcc/x86_64-unknown-linux-gnu/4.1.1/../../../../x86_64-unknown-linux-gnu/bin/ld:
final link failed: Bad value
collect2: ld returned 1 exit status
make: *** [libphp4.la] Error 1

The object, however, IS built with -fPIC:

...
/bin/sh /home/jonathan/sw/vdx_ostk/build/php-4.4.4/libtool --silent
--preserve-dup-deps --mode=compile gcc  -Imain/
-I/home/jonathan/sw/build/php-4.4.4/main/ -DPHP_ATOM_INC
-I/home/jonathan/sw/build/php-4.4.4/include
-I/home/jonathan/sw/build/php-4.4.4/main
-I/home/jonathan/sw/build/php-4.4.4
-I/root/tools/openssl/include
-I/root/tools/zlib/include
-I/home/jonathan/sw/build/pgclient/
-I/home/jonathan/sw/build/php-4.4.4/ext/xml/expat
-I/home/jonathan/sw/build/php-4.4.4/TSRM
-I/home/jonathan/sw/build/php-4.4.4/Zend    -m64 -fPIC   -c
/home/jonathan/sw/build/php-4.4.4/main/output.c -o main/output.lo
...

This is how I'm building PHP (operation is scripted):

    options="--prefix=${PFX_PHP} \
             --with-xsl=${PFX_LIBXSLT} \
             --with-openssl=${PFX_OPENSSL} \
             --with-libxml-dir=${PFX_LIBXML2} \
             --with-zlib=${PFX_ZLIB} \
             --without-xmlrpc \
             --without-bz2 \
             --with-mysql \
             --without-sqlite \
             --enable-force-cgi-redirect \
             --enable-memory-limit \
             --disable-pear \
             --disable-ipv6 \
             --with-pgsql=${BUILD}/${SD_PGCLIENT} \
             --with-apxs=${APACHEBIN}/apxs"

    ./configure $options

I have no idea what to make of the above error.  Seems to refer to a function
(pointer?)  Perhaps something to do with it being a global?

Anyone else run into this or have an idea how to get around it?

Cheers!
Jon

[Index of Archives]     [PHP Users]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [Postgresql]     [PHP Books]     [PHP Databases]     [PHP SOAP]
  Powered by Linux