#40335 [Fbk]: Compile fails when using GCC 4.1.1/binutils 2.17

2007-02-09 Thread tony2001
 ID:   40335
 Updated by:   [EMAIL PROTECTED]
 Reported By:  earlej at hotmail dot com
 Status:   Feedback
 Bug Type: Compile Failure
 Operating System: RHEL4
 PHP Version:  4.4.4
 New Comment:

Could you please test the patch from the previous comment?


Previous Comments:


[2007-02-09 14:26:14] earlej at hotmail dot com

Oh.. found where I got the hint about removing the inline keyword (of
course, I find it _after_ I post my results):

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30153



[2007-02-09 14:24:59] [EMAIL PROTECTED]

Does it work for you with this patch:
http://tony2001.phpclub.net/dev/tmp/bug40335.diff
?



[2007-02-09 14:19:16] earlej at hotmail dot com

Fixed my issue.  If this is suitable, can this be incorporated into the
4.4.4 codebase?

I got the idea elsewhere - forget where - to remove the inline keyword
as the compiler (GCC 4.0+, IIRC) seems to put the code for the (inline)
function _after_ the first incantation of the function.  I don't profess
to understand how compilers do the magic they do but that is my (very)
basic understanding of what happens.  This fixes things (and I see that
inline has also been removed from the 5.x tree).

# Allow PHP 4.4.4 to build on a 64-bit environment using 
# GCC 4.1.1. Seems to be correctd in 5.x.
cd ${BUILD}/${SD_PHP}
cp main/output.c main/output.c.bak
$SED -e '53 s/inline//' main/output.c.bak > main/output.c



[2007-02-07 20:56:28] [EMAIL PROTECTED]

>Are you trying PHP 4.4.4 or 5.x?
Both.

>Can you suggest anything 
I can suggest only using default GCC instead of manually built (unless
you're testing GCC).



[2007-02-07 20:53:11] earlej at hotmail dot com

Are you trying PHP 4.4.4 or 5.x?

I downloaded GCC 4.1.1 within the last week from gcc.gnu.org and have
had this problem since.  Can you suggest anything (build options for
gcc/php, tests to run, magic spells, etc?) to try and troubleshoot
this?



The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
http://bugs.php.net/40335

-- 
Edit this bug report at http://bugs.php.net/?id=40335&edit=1


#40335 [Fbk]: Compile fails when using GCC 4.1.1/binutils 2.17

2007-02-07 Thread tony2001
 ID:   40335
 Updated by:   [EMAIL PROTECTED]
 Reported By:  earlej at hotmail dot copm
 Status:   Feedback
 Bug Type: Compile Failure
 Operating System: RHEL4
 PHP Version:  4.4.4
 New Comment:

>Are you trying PHP 4.4.4 or 5.x?
Both.

>Can you suggest anything 
I can suggest only using default GCC instead of manually built (unless
you're testing GCC).


Previous Comments:


[2007-02-07 20:53:11] earlej at hotmail dot com

Are you trying PHP 4.4.4 or 5.x?

I downloaded GCC 4.1.1 within the last week from gcc.gnu.org and have
had this problem since.  Can you suggest anything (build options for
gcc/php, tests to run, magic spells, etc?) to try and troubleshoot
this?



[2007-02-06 17:14:45] [EMAIL PROTECTED]

Works just fine with GCC 4.1.1 and GCC 4.1.2.



[2007-02-06 16:13:52] earlej at hotmail dot com

Yes.. for various reasons, we also cannot upgrade to 5.x.  Perhaps, one
day, time permitting, I will again be able to test the building of 5.x
on all our systems, but so far, we've found the 4.x series to be the
most (easily) compilable (via scripted operations) across our systems.



[2007-02-05 15:40:00] shane at hemc dot coop

Is there a fix for the 4.4.4 version? I cannot upgrade to v5 quite
yet...please help.



[2007-02-02 22:41:40] [EMAIL PROTECTED]

Please try using this CVS snapshot:

  http://snaps.php.net/php5.2-latest.tar.gz
 
For Windows:
 
  http://snaps.php.net/win32/php5.2-win32-latest.zip





The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
http://bugs.php.net/40335

-- 
Edit this bug report at http://bugs.php.net/?id=40335&edit=1


#40335 [Fbk]: Compile fails when using GCC 4.1.1/binutils 2.17

2007-02-06 Thread tony2001
 ID:   40335
 Updated by:   [EMAIL PROTECTED]
 Reported By:  earlej at hotmail dot copm
 Status:   Feedback
 Bug Type: Compile Failure
 Operating System: RHEL4
 PHP Version:  4.4.4
 New Comment:

Works just fine with GCC 4.1.1 and GCC 4.1.2.


Previous Comments:


[2007-02-06 16:13:52] earlej at hotmail dot com

Yes.. for various reasons, we also cannot upgrade to 5.x.  Perhaps, one
day, time permitting, I will again be able to test the building of 5.x
on all our systems, but so far, we've found the 4.x series to be the
most (easily) compilable (via scripted operations) across our systems.



[2007-02-05 15:40:00] shane at hemc dot coop

Is there a fix for the 4.4.4 version? I cannot upgrade to v5 quite
yet...please help.



[2007-02-02 22:41:40] [EMAIL PROTECTED]

Please try using this CVS snapshot:

  http://snaps.php.net/php5.2-latest.tar.gz
 
For Windows:
 
  http://snaps.php.net/win32/php5.2-win32-latest.zip





[2007-02-02 22:35:25] earlej at hotmail dot copm

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/build/php-4.4.4/libtool --silent
--preserve-dup-deps --mode=compile gcc  -Imain/
-I/home/jonathan/sw/vbuild/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~/tools/openssl/include 
-I~/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

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.



[2007-02-02 22:32:28] earlej at hotmail dot copm

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