Hello, All!
I've already posted a make issue here not so long time ago. Here we come
again.
For a history i'm building a desktop station based on FreeBSD 4.11-RELEASE
(GENERIC) kernel.
while building GLib-2.11.1 i've got the following errors :
http://pages-perso.esil.univ-mrs.fr/~vdoljiko/pub/make.log
+++++++ HERE COMES AN EXTRAIT ++++++++
[SNIP]
Making all in refcount
/bin/sh ../../libtool --mode=link gcc -g -O2 -Wall -lc_r -o closures
closures.o
../../glib/libglib-2.0.la ../../gobject/libgobject-2.0.la
../../gthread/libgthread-2.0.la -pthreads -lintl -lc_r
[COMMENT] Notice the presence of -lc_r option [/COMMENT]
gcc -g -O2 -Wall -o .libs/closures closures.o -pthreads
../../glib/.libs/libglib-2.0.so -L/usr/lib
../../gobject/.libs/libgobject-2.0.so
../../gthread/.libs/libgthread-2.0.so
/home/libs/glib-2.11.1/glib/.libs/libglib-2.0.so
/usr/lib/libiconv.so /usr/lib/libintl.so /usr/test/libiconv/lib/libiconv.so
-Wl,--rpath
-Wl,/usr/test/glib-2.11.1/lib -Wl,--rpath -Wl,/usr/test/libiconv/lib
[COMMENT] Notice the absence of the -lc_r option [/COMMENT]
gcc: unrecognized option `-pthreads'
../../gthread/.libs/libgthread-2.0.so: undefined reference to
`pthread_cond_signal'
../../gthread/.libs/libgthread-2.0.so: undefined reference to
`pthread_attr_destroy'
../../gthread/.libs/libgthread-2.0.so: undefined reference to
`pthread_create'
../../gthread/.libs/libgthread-2.0.so: undefined reference to
`pthread_getspecific'
../../gthread/.libs/libgthread-2.0.so: undefined reference to
`pthread_attr_init'
../../gthread/.libs/libgthread-2.0.so: undefined reference to `pthread_exit'
../../gthread/.libs/libgthread-2.0.so: undefined reference to
`pthread_equal'
../../gthread/.libs/libgthread-2.0.so: undefined reference to
`pthread_getschedparam'
../../gthread/.libs/libgthread-2.0.so: undefined reference to
`pthread_attr_setscope'
../../gthread/.libs/libgthread-2.0.so: undefined reference to
`pthread_cond_broadcast'
../../gthread/.libs/libgthread-2.0.so: undefined reference to
`pthread_setschedparam'
../../gthread/.libs/libgthread-2.0.so: undefined reference to
`pthread_key_create'
../../gthread/.libs/libgthread-2.0.so: undefined reference to
`pthread_attr_setstacksize'
../../gthread/.libs/libgthread-2.0.so: undefined reference to
`pthread_cond_init'
../../gthread/.libs/libgthread-2.0.so: undefined reference to
`pthread_mutex_unlock'
../../gthread/.libs/libgthread-2.0.so: undefined reference to `pthread_self'
../../gthread/.libs/libgthread-2.0.so: undefined reference to
`pthread_mutex_destroy'
../../gthread/.libs/libgthread-2.0.so: undefined reference to
`pthread_mutex_lock'
../../gthread/.libs/libgthread-2.0.so: undefined reference to
`pthread_cond_wait'
../../gthread/.libs/libgthread-2.0.so: undefined reference to
`pthread_mutex_trylock'
../../gthread/.libs/libgthread-2.0.so: undefined reference to
`pthread_cond_destroy'
../../gthread/.libs/libgthread-2.0.so: undefined reference to
`pthread_mutex_init'
../../gthread/.libs/libgthread-2.0.so: undefined reference to
`pthread_attr_setschedparam'
../../gthread/.libs/libgthread-2.0.so: undefined reference to
`pthread_attr_setdetachstate'
../../gthread/.libs/libgthread-2.0.so: undefined reference to `pthread_join'
../../gthread/.libs/libgthread-2.0.so: undefined reference to
`pthread_cond_timedwait'
../../gthread/.libs/libgthread-2.0.so: undefined reference to
`pthread_attr_getschedparam'
../../gthread/.libs/libgthread-2.0.so: undefined reference to
`pthread_setspecific'
*** Error code 1
Stop in /home/libs/glib-2.11.1/tests/refcount.
*** Error code 1
Stop in /home/libs/glib-2.11.1/tests.
*** Error code 1
Stop in /home/libs/glib-2.11.1.
*** Error code 1
Stop in /home/libs/glib-2.11.1.
++++++++++++++ END +++++++++++++++++++++++++++
as you can see the problem comes IMHO from badly compiled libgthread because
it was compiled without -lc_r option.
libc_r.a is the implementation of threads on FreeBSD system. During
configure of GLib-2.11.1
i've specified LIBS=-lc_r and even LDFLAGS=-lc_r (!!! :-) ) but libgthread
IMHO wasn't properly compiled. It seems that libtool and compagny line
invoked from Makefile preserves -lc_r option but the effective command
doesn't include -lc_r option as you can see in the example above.
BUT libgthread don't reference pthread functions as result we get the above
errors.
2. as you can see the line
Making all in refcount
/bin/sh ../../libtool --mode=link gcc -g -O2 -Wall -lc_r -o closures
closures.o
../../glib/libglib-2.0.la ../../gobject/libgobject-2.0.la
../../gthread/libgthread-2.0.la -pthreads -lintl -lc_r
specifies -lc_r option BUT when executing the effective command this option
is not present! WHY! i'm using GNU make latest specially build for freetype
build.
i've solved the problem by manually writing
gcc -g -O2 -Wall -o .libs/closures closures.o -pthreads
../../glib/.libs/libglib-2.0.so -L/usr/lib
../../gobject/.libs/libgobject-2.0.so
../../gthread/.libs/libgthread-2.0.so
/home/libs/glib-2.11.1/glib/.libs/libglib-2.0.so
/usr/lib/libiconv.so /usr/lib/libintl.so /usr/test/libiconv/lib/libiconv.so
-Wl,--rpath
-Wl,/usr/test/glib-2.11.1/lib -Wl,--rpath -Wl,/usr/test/libiconv/lib -lc_r
in Makefile in tests/refcount directory for each target (closures properties
signals) and it worked, but i'm wondering if there won't be any problems on
run-time ???
i should also say that the exactly the same problem occurs in test directory
whiile compiling error-mutex-something.c
what can you say about this ??? how should i proceed in order to build
"proper" glib-2.11.1 ???
p.s while compiling pkg-config early i've got the same problems but in
gthread subdirectory. was solved in the same manner by mannualy adding -lc_r
option but not in make file but on the command line. as make checks for
newer versions and dependencies it was sufficent. but in GLib-2.11.1
compiling mannually don't work because of rm -f before building each target.
--
Best Regards
Vitaly
katsuo_harada_evil_does [at] hotmail [dot] com
Marseille Nice
_________________________________________________________________
Retrouvez tout en un clin d'oeil avec la barre d'outil MSN Search !
http://desktop.msn.fr/
_______________________________________________
gtk-list mailing list
gtk-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-list