glib2 and pthread on solaris
- From: Michael Weiser <michael weiser dinsnail net>
- To: gtk-devel-list gnome org
- Subject: glib2 and pthread on solaris
- Date: Tue, 17 Jul 2007 19:33:12 +0200
Hi there,
how well tested is the following part of recent (>=2.11) glib's
configure?
*-solaris*)
# These compiler/linker flags work with both Sun Studio and gcc
# Sun Studio expands -mt to -D_REENTRANT and -lthread
# gcc expands -pthreads to -D_REENTRANT -D_PTHREADS -lpthread
G_THREAD_CFLAGS="-D_REENTRANT -D_PTHREADS"
G_THREAD_LIBS="-lpthread -lthread"
;;
On Solaris 10 SPARC64 with binutils-2.17 and gcc-4.2.0 in 64bit mode
(configured for target sparc64-sun-solaris2.10 without multilib) this
leads to the following error message:
gmake[3]: Entering directory `/var/tmp/glib-2.13.7/tests/refcount'
/bin/bash ../../libtool --mode=link gcc -O2 -pipe -I/usr/local/include
-Wall -L/usr/local/lib -Wl,-rpath,/usr/local/lib -o closures
closures.o ../../glib/libglib-2.0.la ../../gobject/libgobject-2.0.la
../../gthread/libgthread-2.0.la -lpthread -lthread -lrt -lrt
gcc -O2 -pipe -I/usr/local/include -Wall -Wl,-rpath -Wl,/usr/local/lib
-o .libs/closures closures.o -L/usr/local/lib
../../glib/.libs/libglib-2.0.so ../../gobject/.libs/libgobject-2.0.so
../../gthread/.libs/libgthread-2.0.so
/usr/tmp/glib-2.13.7/glib/.libs/libglib-2.0.so
/usr/local/libiconv-1.11/lib/libiconv.so -lpthread -lthread -lrt
-Wl,--rpath -Wl,/usr/local/lib -Wl,--rpath
-Wl,/usr/local/libiconv-1.11/lib /usr/local/binutils-2.17/bin/ld:
../../gthread/.libs/libgthread-2.0.so: pthread_mutex_unlock: invalid
version 2 (max 0) ../../gthread/.libs/libgthread-2.0.so: could not read
symbols: Bad value collect2: ld returned 1 exit status
../../libtool: line 5179: 25307 Segmentation Fault (core dumped)
gcc -O2 -pipe -I/usr/local/include -Wall -Wl,-rpath -Wl,/usr/local/lib
-o .libs/closures closures.o -L/usr/local/lib
../../glib/.libs/libglib-2.0.so ../../gobject/.libs/libgobject-2.0.so
../../gthread/.libs/libgthread-2.0.so
/usr/tmp/glib-2.13.7/glib/.libs/libglib-2.0.so
/usr/local/libiconv-1.11/lib/libiconv.so -lpthread -lthread -lrt
-Wl,--rpath -Wl,/usr/local/lib -Wl,--rpath
-Wl,/usr/local/libiconv-1.11/lib
gmake[3]: *** [closures] Error 139
When removing the above section it compiles cleanly using:
/bin/bash ../../libtool --mode=link gcc -O2 -pipe -I/usr/local/include
-Wall -L/usr/local/lib -Wl,-rpath,/usr/local/lib -o closures
closures.o ../../glib/libglib-2.0.la ../../gobject/libgobject-2.0.la
../../gthread/libgthread-2.0.la -pthread -lrt -lrt
gcc -O2 -pipe -I/usr/local/include -Wall -Wl,-rpath -Wl,/usr/local/lib
-o .libs/closures closures.o -pthread -L/usr/local/lib
../../glib/.libs/libglib-2.0.so ../../gobject/.libs/libgobject-2.0.so
../../gthread/.libs/libgthread-2.0.so
/usr/tmp/glib-2.13.7/glib/.libs/libglib-2.0.so
/usr/local/libiconv-1.11/lib/libiconv.so -lrt -Wl,--rpath
-Wl,/usr/local/lib -Wl,--rpath -Wl,/usr/local/libiconv-1.11/lib
creating closures
Additional information:
[michael nindamos refcount]$ ld -V
GNU ld version 2.17
Supported emulations:
elf64_sparc
elf32_sparc
[michael nindamos refcount]$ gcc -v
Using built-in specs.
Target: sparc64-sun-solaris2.10
Configured with: ../configure --prefix=/usr/local/gcc-4.2.0
--enable-threads --disable-shared --disable-nls --enable-languages=c,c++
--with-gnu-ld --with-ld=/usr/local/binutils-2.17/bin/ld --with-gnu-as
--with-as=/usr/local/binutils-2.17/bin/as --with-cpu=ultrasparc
--disable-multilib --target=sparc64-sun-solaris2.10
--build=sparc64-sun-solaris2.10 --host=sparc64-sun-solaris2.10
Thread model: posix
gcc version 4.2.0
--
bye, Micha
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]