|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2007-02-02 22:32 UTC] earlej at hotmail dot com
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. PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Oct 26 01:00:01 2025 UTC |
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