#38868 [Fbk->Opn]: GD extensions needs '-lm' linker flag

From: Date: Mon, 18 Sep 2006 21:05:05 +0000
Subject: #38868 [Fbk->Opn]: GD extensions needs '-lm' linker flag
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-102373@lists.php.net to get a copy of this message
ID: 38868 User updated by: flconseil at yahoo dot fr Reported By: flconseil at yahoo dot fr -Status: Feedback +Status: Open Bug Type: Compile Failure Operating System: AIX 5.2 PHP Version: 5.1.6 New Comment: Sorry but, after fighting with GNU ld and gcc during 2 hours, I am giving up. Using GNU ld brings some new errors in the configure stage. I solved one by adding '-Wl,-rpath,/usr/lib' to LDFLAGS but, now, it is failing LDAP detection and I won't spend the night on it. Another reason why I am giving up is that ldap's configure refuses to generate dynamic libraries with GNU ld (saying that GNU ld is known not to generate correct dynamic libs on AIX). So, as I want to generate everything with the same linker, I will keep the AIX linker. But I think I know why we have unresolved references when loading gd. As you said, the PHP core is linked with GNU ld but, on AIX, if the linker does not detect any reference to a library, it does not keep it in the list of required libraries. In my configuration, as I have kept the core to the minimum, I don't have any reference from the core to libm and, when I run 'ldd' or 'dump -H' against 'php' or 'libphp5.so', the libm is not referenced. As, by default, gd is not linked with the libm, it does not have the reference and, finally, when it is loaded, the libm symbols cannot be resolved as this lib is not referenced anywhere in the installed files. That's why, as every other extension is linked against the libs it needs, I still think that gd should be linked explicitely with the libm. Previous Comments: ------------------------------------------------------------------------ [2006-09-18 16:51:32] flconseil at yahoo dot fr OK. I was using GNU make but not GNU ld. I am going to try it. ------------------------------------------------------------------------ [2006-09-18 16:48:18] tony2001@php.net Please read my previous comments. ------------------------------------------------------------------------ [2006-09-18 16:43:11] flconseil at yahoo dot fr Same problem with 5.1.2. Here are the exact error messages : PHP Warning: dl(): Unable to load dynamic library '/logi/http/php/lib/php/extensions/gd.so' - rtld: 0712-001 Symbol sqrt was referenced from module /logi/http/php/lib/php/extensions/gd.so(), but a runtime definition of the symbol was not found. rtld: 0712-001 Symbol atan2 was referenced from module /logi/http/php/lib/php/extensions/gd.so(), but a runtime definition of the symbol was not found. rtld: 0712-001 Symbol sin was referenced from module /logi/http/php/lib/php/extensions/gd.so(), but a runtime definition of the symbol was not found. rtld: 0712-001 Symbol cos was referenced from module /logi/http/php/lib/php/extensions/gd.so(), but a runtime definition of the symbol was not found. rtld: 0712-001 Symbol tan was referenced from module /logi/http/php/lib/php/extensions/gd.so(), but a runtime definition of the symbol was not found. rtld: 0712-001 Symbol floor was referenced from module /logi/http/php/lib/php/extensions/gd.so(), but a runtime definition o in /logi/http/comp/util/.data/test.php on line 22 Warning: dl(): Unable to load dynamic library '/logi/http/php/lib/php/extensions/gd.so' - rtld: 0712-001 Symbol sqrt was referenced from module /logi/http/php/lib/php/extensions/gd.so(), but a runtime definition of the symbol was not found. rtld: 0712-001 Symbol atan2 was referenced from module /logi/http/php/lib/php/extensions/gd.so(), but a runtime definition of the symbol was not found. rtld: 0712-001 Symbol sin was referenced from module /logi/http/php/lib/php/extensions/gd.so(), but a runtime definition of the symbol was not found. rtld: 0712-001 Symbol cos was referenced from module /logi/http/php/lib/php/extensions/gd.so(), but a runtime definition of the symbol was not found. rtld: 0712-001 Symbol tan was referenced from module /logi/http/php/lib/php/extensions/gd.so(), but a runtime definition of the symbol was not found. rtld: 0712-001 Symbol floor was referenced from module /logi/http/php/lib/php/extensions/gd.so(), but a runtime definition o in /logi/http/comp/util/.data/test.php on line 22 ------------------------------------------------------------------------ [2006-09-18 16:29:42] tony2001@php.net make sure you're using GNU ld and GNU buildtools. ------------------------------------------------------------------------ [2006-09-18 16:22:43] tony2001@php.net Can't reproduce on AIX 5.1. PHP itself is linked with libm, so it should not matter whether extension itself is linked or not. ------------------------------------------------------------------------ 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/38868 -- Edit this bug report at http://bugs.php.net/?id=38868&edit=1

« previous php.bugs (#102373) next »