php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #26141 Libtool + threads = library error
Submitted: 2003-11-05 09:22 UTC Modified: 2003-11-19 10:24 UTC
From: alan at pair dot com Assigned:
Status: Closed Package: Compile Failure
PHP Version: 4.3.4 OS: FreeBSD 4.8-STABLE
Private report: No CVE-ID: None
 [2003-11-05 09:22 UTC] alan at pair dot com
Description:
------------
By default, libtool uses -pthread, but this causes a compile-time error with FreeBSD 4.8-STABLE:

libtool: Cannot find library `'

Reproduce code:
---------------
We configured as follows:

./configure --with-apache=/usr/pair/sw/apache_1.3.29 --with-config-file-path=/usr/local/etc --enable-magic-quotes --enable-bcmath --without-cdb --with-zlib-dir=                                         /usr/local --with-gd --with-ttf --without-msql --with-mysql=/usr/local --with-iodbc --with-pdflib --enable-inline-optimization --disable-memory-limit --with-db --without-gdbm --with-ndbm --without-db2 --without-dbm --with-gettext --without-readline --with-recode --without-openssl --with-mcrypt --without-db3 --enable-dba --with-curl --with-png-dir=/usr/local/lib --with-jpeg-dir=/usr/local/lib --enable-calendar --with-mhash --enable-xslt --with-xslt-sablot --with-expat-dir=/usr/local --enable-gd-lzw-gif
make

However,                                                                                I think it can be reproduced with just:                                                                                  
./configure                                                                                                              
make                                       




Expected result:
----------------
I expect it to compile.

Actual result:
--------------
It doesn't compile: it spits out a library error, instead.



A Patch:

diff -C 3 ltmain.sh ../php-4.3.3                                                                            
*** ltmain.sh   Mon Feb 10 12:12:17 2003                                                                                 
--- ../php-4.3.3/ltmain.sh      Wed Oct 29 07:56:14 2003                                                                 
***************                                                                                                          
*** 1511,1516 ****                                                                                                       
--- 1511,1519 ----                                                                                                       
          fi                                                                                                             
          continue                                                                                                       
          ;;                                                                                                             
+       -pthread) # KJM 10/29/03                                                                                         
+         continue                                                                                                       
+         ;;                                                                                                             
        %DEPLIBS%)                                                                                                       
          alldeplibs=yes                                                                                                 
          continue                                                               



Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2003-11-05 11:12 UTC] sniper@php.net
With that configure line you won't be enabling any thread stuff.

 [2003-11-06 10:31 UTC] alan at pair dot com
You are correct in the sense that phpinfo() reports "Thread Safety disabled".  But using this patch, the compilation was definitely taking place with -pthread as an option                                                to gcc, for whatever reason.

Truthfully, even if threads aren't enabled, I'd rather have it compile than not compile.
 [2003-11-06 14:38 UTC] sniper@php.net
Try this configure line:

# rm config.cache && ./configure --disable-all --disable-cgi
# make clean && make

Does it work? That -pthread option is not coming from PHP,
are you sure it's not set by some environment variable when you run configure/make ??


 [2003-11-14 10:38 UTC] alan at pair dot com
OK, with the old ltmain.sh and with those commands, PHP builds normally. So one of the configure options is triggering the pthread stuff.  configure definitely knows to try -pthread, look in the source around line 9215.                                                   
                                                                                                                         
# Create a list of thread flags to try.  Items starting with a "-" are                                                   
# C compiler flags, and other items are library names, except for "none"                                                 
# which indicates that we try without any flags at all.                                                                  
                                                                                                                         
acx_pthread_flags="pthreads none -Kthread -kthread lthread -pthread -pthreads -mthreads pthread --thread-safe -mt"       
                                                                                                                         
# The ordering *is* (sometimes) important.  Some notes on the                                                            
# individual items follow:                                                                                               
...                                                                                                                      
# -pthread: Linux/gcc (kernel threads), BSD/gcc (userland threads)                                                       
                                                                                                                         
So when it decides to use -pthread, libtool later sees that and thinks it's a library reference (e.g. -lm is libm.so) and decides to try to analyze it with ld or whatever.
 [2003-11-17 18:05 UTC] sniper@php.net
Obviously yet another libtool bug.

 [2003-11-18 13:52 UTC] alan at pair dot com
We have tried this with several different versions of libtool, and it failed with all of them.  libtool is bundled with PHP, isn't it?  

Does this mean I need to go get libtool to fix the bug, and then convince you guys to use the new version of libtool?

Alan
 [2003-11-18 15:09 UTC] sniper@php.net
First you need to stop touching the libtool stuff yourself, that doesn't help us finding what really is the problem.
Secondly, you need to find out which option in your configure line causes this. And try also using the correct option values, like for --with-jpeg-dir=/usr/local/lib <-- this /lib does NOT belong there. Same for ANY other option.

 [2003-11-19 10:24 UTC] alan at pair dot com
We touched the libtool stuff specifically to try to resolve this bug, not just because we think it's a good idea to fiddle with things until they break.

We'll look into the configure options when we have a chance.  In the mean time we have a patch which works on our servers, and if this isn't a problem for anyone else then it's obviously not a very high priority for anyone.

Thanks,
Alan
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Mon Jun 03 05:01:29 2024 UTC