This is the mail archive of the libc-alpha@sources.redhat.com mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

dcethreads - out-of-date - HELP! "hidden" __pthread_atfork symbol in linuxthreads


amongst other things.

i seek to get dcethreads - and consequently freedce - up-to-date.
i have, i believe, successfully updated freedce to cope with
flex 2.5.something: dcethreads is a different matter.

the first issue is, i believe, to do with libtool: namely that the order
in which libtool takes its .lo arguments and any other arguments is not
kept.  this:

libdcethreads.la: $(libdcethreads_la_OBJECTS) $(libdcethreads_la_DEPENDENCIES)
    $(LINK) -rpath $(libdir) $(libdcethreads_la_LDFLAGS)
	$(LIBS) $(libdcethreads_la_OBJECTS) $(libdcethreads_la_LIBADD) 

which results in this:

	/bin/sh ../libtool --mode=link --tag=CC gcc -Wall -W -pipe -g -O2   -o
	libdcethreads.la -rpath /opt/dce/lib -version-info 2:1:0
	-Wl,--version-script,./Versions -lpthread exc_handling.lo
	pthd4_libc_wrapers.lo pthread_dce_atfork.lo pthread_dce.lo
	pthread_dceexc.lo  

which results in this:

	gcc -shared  .libs/exc_handling.o .libs/pthd4_libc_wrapers.o
	.libs/pthread_dce_atfork.o .libs/pthread_dce.o .libs/pthread_dceexc.o
	-lpthread  -Wl,--version-script -Wl,./Versions  -Wall -W -pipe -g -O2
	-Wl,-soname -Wl,libdcethreads.so.2 -o .libs/libdcethreads.so.2.0.1

which results in this:

	/usr/lib/libpthread_nonshared.a(pthread_atfork.os)(.text+0x0): In
	function `__pthread_atfork':
	/disk/hdc2/glibc/debian-build/glibc_2.3.2.ds1-16.test2/glibc-2.3.2.ds1/build-tree/glibc-2.3.2/linuxthreads/pthread_atfork.c:38:
	multiple definition of `pthread_atfork'
	.libs/pthd4_libc_wrapers.o(.text+0x750):/home/lkcl/sf/freedce/dcethreads/src/pthd4_libc_wrapers.c:272:
	first defined here
	/usr/bin/ld: Warning: size of symbol `pthread_atfork' changed from 63 in
	.libs/pthd4_libc_wrapers.o to 70 in
	/usr/lib/libpthread_nonshared.a(pthread_atfork.os)
	collect2: ld returned 1 exit status
	make: *** [libdcethreads.la] Error 1

_however_, doing _this_:

	gcc -shared -lpthread  .libs/exc_handling.o .libs/pthd4_libc_wrapers.o
	.libs/pthread_dce_atfork.o .libs/pthread_dce.o .libs/pthread_dceexc.o
	 -Wl,--version-script -Wl,./Versions  -Wall -W -pipe -g -O2
	-Wl,-soname -Wl,libdcethreads.so.2 -o .libs/libdcethreads.so.2.0.1

results in a successful link.

so, there is a bug in libtool which ensures that the use of libtool
guarantees compile-time failure.

... but fixing _that_ results in this:

	lkcl@highfield:~/sf/freedce/dcethreads/tests$ make test1
	/bin/sh ../libtool --mode=link --tag=CC gcc  -g -O2   -o test1  test1.o
	../src/libdcethreads.la -lpthread 
	mkdir .libs
	gcc -g -O2 -o test1 test1.o  /opt/dce/lib/libdcethreads.so -lpthread
	/usr/bin/ld: test1: hidden symbol `__pthread_atfork' in
	/usr/lib/libpthread_nonshared.a(pthread_atfork.os) is referenced by DSO

examining glibc-2.3.2.ds1 (debian packaged source) pthread_atfork.c
shows this:

	/* Hide the symbol so that no definition but the one locally in the
	   executable or DSO is used.  */

so yeh, in fact it _is_ hidden... 

... so what do i have to do to get dcethreads (which in freedce
is a POSIX Draft 4 library emulation layer on top of linuxthreads) to
compile - and work?

should i spend months of my time learning how to rewrite linuxthreads
and some corresponding linux kernel patches?

as i understand it, the advantage of POSIX Draft 4 threads is
that signals can be sent.

e.g. such that in freedce you can ctrl-c a client-side program
and the server-side program will receive the ctrl-c... _without_
the management [server-side] thread dying [or having to be
killed, thus affecting all other clients] and without any
other unexpected side-effects.


the alternative is to replace all usage of dcethreads in freedce with
the present posix threads, but the dcethreads has some exception handling
macros and functions that would need work - something i'm not presently
knowledgeable enough to take on.

any assistance in resolving these or any issues sufficient to get
freedce up-to-date much appreciated.

l.


-- 
--
you don't have to BE MAD   | this space    | my brother wanted to join mensa,
  to work, but   IT HELPS  |   for rent    | for an ego trip - and get kicked 
 you feel better!  I AM    | can pay cash  | out for a even bigger one.
--


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]