Bug#296774: glib2.0: FTBFS on hurd-i386: Missing -lpthread when linking libgthread

Michael Banck Michael Banck <mbanck@debian.org>, 296774@bugs.debian.org
Thu, 24 Feb 2005 16:34:12 +0100


--TB36FDmn/VVEgNH/
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline

Package: glib2.0
Severity: important
Tags: patch

There was a problem building glib on hurd-i386:

Automatic build of glib2.0_2.6.2-1 on beethoven by sbuild/hurd-i386 1.170.5
Build started at 20050222-1732
******************************************************************************
Checking available source versions...
Fetching source files...
Reading Package Lists...
Building Dependency Tree...
Need to get 3164kB of source archives.
Get:1 http://ftp2.de.debian.org unstable/main glib2.0 2.6.2-1 (dsc) [1543B]
Get:2 http://ftp2.de.debian.org unstable/main glib2.0 2.6.2-1 (tar) [3149kB]
Get:3 http://ftp2.de.debian.org unstable/main glib2.0 2.6.2-1 (diff) [13.1kB]
Fetched 3164kB in 6s (464kB/s)
Download complete and in download only mode
** Using build dependencies supplied by package:
Build-Depends: debhelper (>> 4.0.0), pkg-config (>= 0.14.0), gettext,
autotools-dev, gnome-pkg-tools
Checking for already installed source dependencies...
debhelper: already installed (in sufficient version 4.2.30 >> 4.0.0)
pkg-config: already installed (in sufficient version 0.15.0-4 >= 0.14.0)
gettext: already installed
autotools-dev: missing
gnome-pkg-tools: missing
Checking for source dependency conflicts...
[...]
Checking correctness of source dependencies...
Toolchain package versions: libc0.3-dev_2.3.2.ds1-20 gcc-3.3_1:3.3.5-2
g++-3.3_1:3.3.5-2 binutils_2.15-5 libstdc++5-3.3-dev_1:3.3.5-2
libstdc++5_1:3.3.5-2
------------------------------------------------------------------------------
dpkg-source: extracting glib2.0 in glib2.0-2.6.2
dpkg-buildpackage: source package is glib2.0
dpkg-buildpackage: source version is 2.6.2-1
dpkg-buildpackage: host architecture is hurd-i386
[...]
i386-gnu-gcc -shared  .libs/gthread-impl.o  -D__LIBTOOL_IS_A_FOOL__
	../glib/.libs/libglib-2.0.so  -Wl,-z -Wl,defs -Wl,-O1 -Wl,-soname
	-Wl,libgthread-2.0.so.0 -o .libs/libgthread-2.0.so.0.600.2
	-D__LIBTOOL_IS_A_FOOL__ ../glib/.libs/libglib-2.0.so
.libs/gthread-impl.o(.text+0xec): In function `g_mutex_free_posix_impl':
/usr/include/bits/mutex.h:92: undefined reference to `_pthread_mutex_destroy'
.libs/gthread-impl.o(.text+0x22a): In function `g_mutex_trylock_posix_impl':
/home/mbanck/tmp/tmp/glib2.0-2.6.2/build-tree/glib-2.6.2-deb/gthread/gthread-posix.c:188:
	undefined reference to `_pthread_mutex_trylock'
[...]
collect2: ld returned 1 exit status
make[3]: *** [libgthread-2.0.la] Error 1
[...]
make: *** [debian/stampdir/build-deb-stamp] Error 2
******************************************************************************
Build finished at 20050222-1807
FAILED [dpkg-buildpackage died]

The attached patch has been applied upstream to fix this problem
(#168177 in the GNOME bugzilla), please consider it for inclusion (it
requires an autoconf update of course).


Thanks,

Michael

--TB36FDmn/VVEgNH/
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename="glib2.0.diff"

2005-02-23  Matthias Clasen  <mclasen@redhat.com>

	* configure.in: Don't forget to set G_THREAD_LIBS_FOR_GTHREAD
	on non-linux platforms.  (#168177, Michael Banck)

===================================================================
RCS file: /cvs/gnome/glib/configure.in,v
retrieving revision 1.436
retrieving revision 1.437
diff -u -r1.436 -r1.437
--- configure.in	2005/02/16 16:42:20	1.436
+++ configure.in	2005/02/24 04:24:16	1.437
@@ -1867,6 +1867,9 @@
   *-*-linux*)
     G_THREAD_LIBS_FOR_GTHREAD="`echo $G_THREAD_LIBS | sed s/-pthread/-lpthread/`"
     ;;
+  *) 	 
+    G_THREAD_LIBS_FOR_GTHREAD="$G_THREAD_LIBS" 	 
+    ;;
 esac
 
 AC_DEFINE_UNQUOTED(G_THREAD_SOURCE,"gthread-$have_threads.c",

--TB36FDmn/VVEgNH/--