Re: nptl 0.55

Stefan Jones <[email protected]>
Newsgroups gmane.comp.lib.phil
Organization Gentoo Linux
Message-ID <1058991798.3391.30.camel@localhost>
On Wed, 2003-07-23 at 07:36, Ulrich Drepper wrote:
> ~ use unwind code from libgcc_s.  But we avoid linking with libgcc_s
> since only a fraction of all programs need it.  This change also gives
> ia64 again a fighting chance.  Haven't tried ia64 in a week or two but
> it should now more or less work again.


This doesn't work on my system, not sure if I am unique. 

May be some strange error on my part, I am using;

$ gcc --version
gcc (GCC) 3.4 20030723 (experimental)
Copyright (C) 2003 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is
NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE.
 
with 

../gcc/configure --prefix=/opt/gcc-3.4 \
--host=i686-pc-linux-gnu \
--target=i686-pc-linux-gnu \
--enable-shared \
--with-system-zlib \
--enable-languages=c,c++ \
--enable-threads=posix \
--enable-long-long \
--disable-checking \
--enable-cstdio=stdio \
--enable-clocale=generic \
--enable-__cxa_atexit \
--enable-version-specific-runtime-libs
 
for gcc config.

Details: run xmms or other threaded app and I get:

libgcc_s.so.1 must be installed for pthread_cancel to work	

I looked at the nptl code to find:

  handle = __libc_dlopen ("libgcc_s.so.1");

  if (handle == NULL
      || (resume = __libc_dlsym (handle, "_Unwind_Resume")) == NULL
      || (personality = __libc_dlsym (handle, "__gcc_personality_v0")) == NULL
      || (forcedunwind = __libc_dlsym (handle, "_Unwind_ForcedUnwind"))
	 == NULL
      || (getcfa = __libc_dlsym (handle, "_Unwind_GetCFA")) == NULL)
    __libc_fatal ("libgcc_s.so.1 must be installed for pthread_cancel to work\n");


So I tried this test program:


#include <stdio.h>
#include <dlfcn.h>

extern int __gcc_personality_v0();

void *handle;

int findsym(char *name) {
if( dlsym (handle,name) == NULL) {
	printf("%s not found\n",name);
	puts(dlerror());
	return -1;
}
return 0;
}

int main() {

	handle = dlopen ("libgcc_s.so.1",RTLD_NOW);

    if (handle == NULL) {
	puts("Didn't open lib");
	return 1;
	}

	findsym("_Unwind_Resume");
	findsym("__gcc_personality_v0");
	findsym("_Unwind_ForcedUnwind");
	findsym("_Unwind_GetCFA");

	dlclose(handle);
	printf("got: %x\n",__gcc_personality_v0());
	return 0;
}

This gave me:

$ ./test
__gcc_personality_v0 not found
./test: undefined symbol: __gcc_personality_v0
got: 3


Strange, __gcc_personality_v0 is not defined in libgcc_s.so.1, but the
program links ok!

Related info:

$ readelf -s /usr/lib/libgcc_s.so.1 | grep personality
   273: 00006a50   481 FUNC    LOCAL  DEFAULT   11 __gcc_personality_v0

$ objdump -t /usr/lib/libgcc_s.so.1 | grep personality
00006a50 l     F .text  000001e1              __gcc_personality_v0

( but objdump -T returns nothing! )

So __gcc_personality_v0 cannot be dlopened with this gcc! ( I think)

Will continue looking ....

Stefan
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.