[PATCH] __libc_multiple_threads declaration should move back?

Will Newton will.newton at gmail.com
Wed Mar 11 10:58:30 UTC 2009


On Wed, Mar 11, 2009 at 2:33 AM, Austin Foxley <austinf at cetoncorp.com> wrote:
> Hello, this is my first post here.
>
> I just got the latest uClibc working with linuxthreads on sparc32 (Hooray!)
> In the process ran into a few issues. The first seems simple enough. The
> declaration of __libc_multiple_threads is currently at the top of
> libpthread/linuxthreads/libc-cancellation.c and declared extern in
> internals.h. I was getting an undefined reference to it so I moved it to
> libc_pthread_init.c where it is actually used. This is where it was in
> linuxthreads.old. I don't know why it doesn't show up since both of the
> object files end up in the same place. Maybe someone else knows why? Could
> it be that I'm linking to the static libc/libpthread? This is with
> gcc-4.3.2.

This looks ok.

I'm not sure I can provide an explanation of the behaviour you're
seeing though, I can link statically and dynamically with libpthread.
Perhaps it is some quirk of the sparc linker?

> Patch attached.
>
> Austin Foxley - Ceton Corporation - http://cetoncorp.com/
>
>
>
>
> Index: libpthread/linuxthreads/libc_pthread_init.c
> ===================================================================
> --- libpthread/linuxthreads/libc_pthread_init.c (revision 25602)
> +++ libpthread/linuxthreads/libc_pthread_init.c (working copy)
> @@ -33,6 +33,10 @@
>  /* libc_hidden_proto(uselocale) */
>  #endif
>
> +int __libc_multiple_threads attribute_hidden __attribute__((nocommon));
> +strong_alias (__libc_multiple_threads, __librt_multiple_threads)
> +
> +
>  int *
>  __libc_pthread_init (functions)
>      const struct pthread_functions *functions;
> Index: libpthread/linuxthreads/libc-cancellation.c
> ===================================================================
> --- libpthread/linuxthreads/libc-cancellation.c (revision 25602)
> +++ libpthread/linuxthreads/libc-cancellation.c (working copy)
> @@ -31,9 +31,6 @@
>  weak_extern (__pthread_do_exit)
>  # endif
>
> -int __libc_multiple_threads attribute_hidden __attribute__((nocommon));
> -strong_alias (__libc_multiple_threads, __librt_multiple_threads)
> -
>  /* The next two functions are similar to pthread_setcanceltype() but
>    more specialized for the use in the cancelable functions like write().
>    They do not need to check parameters etc.  */
>
> _______________________________________________
> uClibc mailing list
> uClibc at uclibc.org
> http://lists.busybox.net/mailman/listinfo/uclibc
>


More information about the uClibc mailing list