From:             earlej at hotmail dot copm
Operating system: RHEL4
PHP version:      4.4.4
PHP Bug Type:     Compile Failure
Bug description:  Compile fails when using GCC 4.1.1/binutils 2.17

Description:
------------
# export CFLAGS="-m64 -fPIC"
# gcc -v
Using built-in specs.
Target: x86_64-unknown-linux-gnu
Configured with: ../gcc-4.1.1/configure --prefix=/usr/local/gcc411 --quiet
--enable-threads=posix --with-system-zlib --enable-__cxa_atexit
--enable-languages=c,c++ --disable-multilib
--disable-libunwind-exceptions
Thread model: posix
gcc version 4.1.1

# ./configure (about as simple as it gets)
# make
...
ext/mysql/libmysql/my_tempnam.o: In function `my_tempnam':
my_tempnam.c:(.text+0x69): warning: the use of `tempnam' is dangerous,
better use `mkstemp'
main/output.o: In function `php_output_init_globals':
output.c:(.text+0x12): undefined reference to `php_default_output_func'
output.c:(.text+0x23): undefined reference to `php_default_output_func'
collect2: ld returned 1 exit status
make: *** [sapi/cgi/php] Error 1

If I try and build a DSO for Apache 1.3.37, using:

./configure \
--prefix=~/tools/php \
--with-xsl=~/tools/libxslt \             
--with-openssl=~/tools/openssl \             
--with-libxml-dir=~/tools/libxml2 \             
--with-zlib=~/tools/zlib \             
--without-xmlrpc \             
--without-bz2 \             
--with-mysql \             
--without-sqlite \             
--enable-force-cgi-redirect \             
--enable-memory-limit \             
--disable-pear \             
--disable-ipv6 \
--with-pgsql=/home/jonathan/sw/build/pgclient \
--with-apxs=~/tools/apache/bin/apxs

Then I receive:

/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

Compile output shows main/output.c _is_built using -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/vdx_ostk/build/php-4.4.4/main/ -DPHP_ATOM_INC
-I/home/jonathan/sw/vdx_ostk/build/php-4.4.4/include
-I/home/jonathan/sw/vdx_ostk/build/php-4.4.4/main
-I/home/jonathan/sw/vdx_ostk/build/php-4.4.4
-I/root/vdxtools/openssl/include -I/root/vdxtools/zlib/include
-I/home/jonathan/sw/vdx_ostk/build/pgclient/
-I/home/jonathan/sw/vdx_ostk/build/php-4.4.4/ext/xml/expat
-I/home/jonathan/sw/vdx_ostk/build/php-4.4.4/TSRM
-I/home/jonathan/sw/vdx_ostk/build/php-4.4.4/Zend    -m64 -fPIC   -c
/home/jonathan/sw/vdx_ostk/build/php-4.4.4/main/output.c -o main/output.lo

Expected result:
----------------
I would expect a properly built PHP instance.

Actual result:
--------------
Unless I use GCC 3.4.6 (the default on this system), I cannot build PHP.

-- 
Edit bug report at http://bugs.php.net/?id=40335&edit=1
-- 
Try a CVS snapshot (PHP 4.4): 
http://bugs.php.net/fix.php?id=40335&r=trysnapshot44
Try a CVS snapshot (PHP 5.2): 
http://bugs.php.net/fix.php?id=40335&r=trysnapshot52
Try a CVS snapshot (PHP 6.0): 
http://bugs.php.net/fix.php?id=40335&r=trysnapshot60
Fixed in CVS:                 http://bugs.php.net/fix.php?id=40335&r=fixedcvs
Fixed in release:             
http://bugs.php.net/fix.php?id=40335&r=alreadyfixed
Need backtrace:               http://bugs.php.net/fix.php?id=40335&r=needtrace
Need Reproduce Script:        http://bugs.php.net/fix.php?id=40335&r=needscript
Try newer version:            http://bugs.php.net/fix.php?id=40335&r=oldversion
Not developer issue:          http://bugs.php.net/fix.php?id=40335&r=support
Expected behavior:            http://bugs.php.net/fix.php?id=40335&r=notwrong
Not enough info:              
http://bugs.php.net/fix.php?id=40335&r=notenoughinfo
Submitted twice:              
http://bugs.php.net/fix.php?id=40335&r=submittedtwice
register_globals:             http://bugs.php.net/fix.php?id=40335&r=globals
PHP 3 support discontinued:   http://bugs.php.net/fix.php?id=40335&r=php3
Daylight Savings:             http://bugs.php.net/fix.php?id=40335&r=dst
IIS Stability:                http://bugs.php.net/fix.php?id=40335&r=isapi
Install GNU Sed:              http://bugs.php.net/fix.php?id=40335&r=gnused
Floating point limitations:   http://bugs.php.net/fix.php?id=40335&r=float
No Zend Extensions:           http://bugs.php.net/fix.php?id=40335&r=nozend
MySQL Configuration Error:    http://bugs.php.net/fix.php?id=40335&r=mysqlcfg

Reply via email to