[PATCH 1/3] nptl: Fix __USER_LABEL_PREFIX__ concatenation
Carmelo Amoroso
carmelo73 at gmail.com
Thu Jan 13 08:07:41 UTC 2011
Hi
What about using stringify around the label instead of defining the two macros? Could you give a try, thanks.
Cheers
Carmelo
Inviato da iPod
Il giorno 12/gen/2011, alle ore 13:05, Will Newton <will.newton at gmail.com> ha scritto:
> The current C macro magic does not correctly concatenate the
> __USER_LABEL_PREFIX__ string on architectures where it has a value. We
> need to jump through a level of indirection to get the desired
> behaviour.
>
> Signed-off-by: Matt Fleming <matthew.fleming at imgtec.com>
> ---
> libpthread/nptl/pthreadP.h | 14 ++++++++------
> 1 files changed, 8 insertions(+), 6 deletions(-)
>
> diff --git a/libpthread/nptl/pthreadP.h b/libpthread/nptl/pthreadP.h
> index c45bd11..67f253a 100644
> --- a/libpthread/nptl/pthreadP.h
> +++ b/libpthread/nptl/pthreadP.h
> @@ -274,6 +274,8 @@ __do_cancel (void)
> #define CANCEL_RESET(oldtype) \
> __pthread_disable_asynccancel (oldtype)
>
> +#define LABEL_PREFIX(x, y, z) LABEL_PREFIX1(x, y, z)
> +#define LABEL_PREFIX1(x, y, z) x #y z
> #if !defined NOT_IN_libc
> /* Same as CANCEL_ASYNC, but for use in libc.so. */
> # define LIBC_CANCEL_ASYNC() \
> @@ -282,22 +284,22 @@ __do_cancel (void)
> # define LIBC_CANCEL_RESET(oldtype) \
> __libc_disable_asynccancel (oldtype)
> # define LIBC_CANCEL_HANDLED() \
> - __asm__ (".globl " __USER_LABEL_PREFIX__ "__libc_enable_asynccancel"); \
> - __asm__ (".globl " __USER_LABEL_PREFIX__ "__libc_disable_asynccancel")
> + __asm__ (LABEL_PREFIX(".globl ", __USER_LABEL_PREFIX__,
> "__libc_enable_asynccancel")); \
> + __asm__ (LABEL_PREFIX(".globl ", __USER_LABEL_PREFIX__,
> "__libc_disable_asynccancel"))
> #elif defined NOT_IN_libc && defined IS_IN_libpthread
> # define LIBC_CANCEL_ASYNC() CANCEL_ASYNC ()
> # define LIBC_CANCEL_RESET(val) CANCEL_RESET (val)
> # define LIBC_CANCEL_HANDLED() \
> - __asm__ (".globl " __USER_LABEL_PREFIX__ "__pthread_enable_asynccancel"); \
> - __asm__ (".globl " __USER_LABEL_PREFIX__ "__pthread_disable_asynccancel")
> + __asm__ (LABEL_PREFIX(".globl ", __USER_LABEL_PREFIX__,
> "__pthread_enable_asynccancel")); \
> + __asm__ (LABEL_PREFIX(".globl ", __USER_LABEL_PREFIX__,
> "__pthread_disable_asynccancel"))
> #elif defined NOT_IN_libc && defined IS_IN_librt
> # define LIBC_CANCEL_ASYNC() \
> __librt_enable_asynccancel ()
> # define LIBC_CANCEL_RESET(val) \
> __librt_disable_asynccancel (val)
> # define LIBC_CANCEL_HANDLED() \
> - __asm__ (".globl " __USER_LABEL_PREFIX__ "__librt_enable_asynccancel"); \
> - __asm__ (".globl " __USER_LABEL_PREFIX__ "__librt_disable_asynccancel")
> + __asm__ (LABEL_PREFIX(".globl ", __USER_LABEL_PREFIX__,
> "__librt_enable_asynccancel")); \
> + __asm__ (LABEL_PREFIX(".globl ", __USER_LABEL_PREFIX__,
> "__librt_disable_asynccancel"))
> #else
> # define LIBC_CANCEL_ASYNC() 0 /* Just a dummy value. */
> # define LIBC_CANCEL_RESET(val) ((void)(val)) /* Nothing, but evaluate it. */
> --
> 1.7.2.2
> _______________________________________________
> uClibc mailing list
> uClibc at uclibc.org
> http://lists.busybox.net/mailman/listinfo/uclibc
More information about the uClibc
mailing list