From: Bjorn dot Wiberg at its dot uu dot se Operating system: IBM AIX 5.3 5300-08-01-0819 PHP version: 5.3CVS-2008-08-07 (snap) PHP Bug Type: Compile Failure Bug description: Fileinfo/libmagic linking fails with undefined symbol .asprintf/.vasprintf
Description: ------------ Linking failure referring to undefined symbols ".vasprintf" and ".asprintf". Looking in ext/fileinfo/libmagic indicates that those functions are used in funcs.c and softmagic.c. Googling indicates that asprintf() and vasprintf() require stdio.h and linking against the C library (-lc). Reproduce code: --------------- #! /bin/sh # # Created by configure LDFLAGS='-Wl,-bbigtoc' \ CC='gcc' \ './configure' \ '--enable-bcmath' \ '--enable-calendar' \ '--enable-cli' \ '--enable-dba' \ '--enable-dbase' \ '--enable-debug' \ '--enable-exif' \ '--enable-flatfile' \ '--enable-ftp' \ '--enable-gd-jis-conv' \ '--enable-gd-native-ttf' \ '--enable-inifile' \ '--enable-mbstring' \ '--enable-pcntl' \ '--enable-shmop' \ '--enable-soap' \ '--enable-sockets' \ '--enable-sqlite-utf8' \ '--enable-sysvmsg' \ '--enable-sysvsem' \ '--enable-sysvshm' \ '--enable-wddx' \ '--enable-zip' \ '--enable-zend-multibyte' \ '--prefix=/apache/php' \ '--with-apxs2=/apache/bin/apxs' \ '--with-bz2' \ '--with-cdb' \ '--with-curl' \ '--with-freetype-dir' \ '--with-gd' \ '--with-gdbm' \ '--with-gettext' \ '--with-jpeg-dir' \ '--with-ldap' \ '--with-libxml-dir=/usr/local' \ '--with-mime-magic' \ '--with-mysql=mysqlnd' \ '--with-mysqli=mysqlnd' \ '--with-openssl=/opt/freeware' \ '--with-pdo-mysql=mysqlnd' \ '--with-png-dir' \ '--with-xmlrpc' \ '--with-xpm-dir' \ '--with-xsl' \ '--with-zlib' \ '--with-zlib-dir' \ "$@" (GNU) make Expected result: ---------------- Successful compilation/linking. Actual result: -------------- ---8<--- excerpt ---8<--- 2/usr/lib -L/gestconf/project/GNOME_ACL/GNOME/build/M_acc_gnome2_12_0f1/export/power_510_32/usr/lib -L/gestconf/project/GNOME_ACL/GNOME/build/acc_gnome2_12_0f1/export/power_510_32/usr/lib -L/gestconf/project/GNOME_ACL/GNOME/build/GNOME_2_12_0/export/power_510_32/usr/lib -lz -lX11 -lXpm -lpng -L/gestconf/project/GNOME_ACL/GNOME/build/BLD_M_gnome2_14f1/export/power_510_32/usr/lib -L/gestconf/project/GNOME_ACL/GNOME/build/M_acc_gnome2_14_0f1/export/power_510_32/usr/lib -L/gestconf/project/GNOME_ACL/GNOME/build/acc_gnome2_14_0f1/export/power_510_32/usr/lib -L/gestconf/project/GNOME_ACL/GNOME/build/GNOME_2_14_0/export/power_510_32/usr/lib -L/users/project/PDP/PDP_51_vac_6_14/usr/ccs/lib -L/users/project/PDP/PDP_51_vac_6_14/usr/lib -lz -lm -lz -ljpeg -lssl -lcrypto -lgdbm -lbz2 -lz -lssl -lcrypto -lm -lz -liconv -lm -lcurl -lssl -lcrypto -lz -lssl -lcrypto -lz -lz -liconv -lm -lz -liconv -lm -lz -liconv -lm -lz -liconv -lm -lz -liconv -lm -lz -liconv -lm -lz -liconv -lm -lz -liconv -lm -lxslt -lz -liconv -lm -lxml2 -lpthread -lz -liconv -lm -lz -liconv -lm -Wl,-blibpath:/usr/local/lib:/opt/freeware/lib:/usr/X11R6/lib:/opt/freeware/lib/gcc/powerpc-ibm-aix5.3.0.0/4.0.0:/opt/freeware/lib/gcc/powerpc-ibm-aix5.3.0.0/4.0.0/../../..:/usr/lib:/lib ld: 0711-224 WARNING: Duplicate symbol: php_optidx ld: 0711-345 Use the -bloadmap or -bnoquiet option to obtain more information. ld: 0711-317 ERROR: Undefined symbol: .vasprintf ld: 0711-317 ERROR: Undefined symbol: .asprintf collect2: ld returned 8 exit status make: *** [sapi/cli/php] Error 1 Bad exit status from /var/opt/freeware/tmp/rpm-tmp.2294 (%build) -->8--- end excerpt --->8--- -- Edit bug report at http://bugs.php.net/?id=45740&edit=1 -- Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=45740&r=trysnapshot52 Try a CVS snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=45740&r=trysnapshot53 Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=45740&r=trysnapshot60 Fixed in CVS: http://bugs.php.net/fix.php?id=45740&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=45740&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=45740&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=45740&r=needscript Try newer version: http://bugs.php.net/fix.php?id=45740&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=45740&r=support Expected behavior: http://bugs.php.net/fix.php?id=45740&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=45740&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=45740&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=45740&r=globals PHP 4 support discontinued: http://bugs.php.net/fix.php?id=45740&r=php4 Daylight Savings: http://bugs.php.net/fix.php?id=45740&r=dst IIS Stability: http://bugs.php.net/fix.php?id=45740&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=45740&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=45740&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=45740&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=45740&r=mysqlcfg