libtool-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

libtool problem on FreeBSD 4.1 with -pthread


From: Peter Ekberg
Subject: libtool problem on FreeBSD 4.1 with -pthread
Date: Fri, 5 Nov 2004 08:59:09 +0100

Hello!

(I sent a message on this topic to bug-libtool a while back,
 but it went by without any response whatsoever. Since I've
 had more luck on this list lately, I'm resending here)

Background, in our project we build a library that uses
pthreads if they are detected, and falls back to signals
if pthreads are not detected. On Windows, Win32 threads are
used. This means that the user of the library will have a
hard time figuring out what to add to the link line in order
to link correctly. In the case that pthreads needs -lpthread,
everything works as expected as -lpthread is mentioned in
the .la file under dependencies. The Win32 case also works
as nothing special is needed for threads to work. However,
on FreeBSD (and other systems as well I suspect), there is
a problem, as FreeBSD needs the flag -pthread, which is not
a lib and therefore does not end up in the dependencies.

We would like -pthread to end up in the dependencies for the
generated library, at least for FreeBSD, but as stated above
the problem is probably bigger than FreeBSD/-pthread.

The attached patch adds any thread related flag to the
dependencies, on the assumption that the app using the
threaded lib will not be harmed by that flag when the
lib was built with it in the first place.

See this URL for what happens without this patch (look near
the end):
http://www.ggi-project.org/releng/libgii_current_2004-11-04_FreeBSD_4.10
-BETA_i386.log

And here's the complete success with the patch:
http://www.ggi-project.org/releng/libgii_current_2004-11-03_FreeBSD_4.10
-BETA_i386.log

This patch (against branch-2-0) works for us<tm>.

2004-11-05  Peter Ekberg  <spam.protected>

        * config/ltmain.m4sh (func_mode_link): forward thread
        related flags to dependent applications and libraries.

Attachment: freebsd-pthread.patch
Description: freebsd-pthread.patch


reply via email to

[Prev in Thread] Current Thread [Next in Thread]