This is the mail archive of the
libc-ports@sources.redhat.com
mailing list for the libc-ports project.
[patch] hppa build failure with tls and lowlevellock.h
- From: "Jeff Bailey" <jbailey at raspberryginger dot com>
- To: libc-ports at sourceware dot org, "Carlos O'Donell" <carlos at systemhalted dot org>, parisc-linux <parisc-linux at lists dot parisc-linux dot org>, "Matthias Klose" <doko at ubuntu dot com>
- Date: Wed, 5 Dec 2007 16:23:38 -0800
- Subject: [patch] hppa build failure with tls and lowlevellock.h
Carlos,
It turns out the reason we fail and others don't is that we use an
inline function (so it's parsed right away) and everyone else uses a
#define. You're probably still right that the include is unnecessary,
but in the meantime this aligns us with everyone else and allows the
build to continue.
Okay to commit?
2007-12-05 Jeff Bailey <jeffbailey@google.com>
* sysdeps/unix/sysv/linux/hppa/nptl/lowlevellock.h
(__lll_unlock): Use define instead of inline function.
(__lll_robust_unlock): Likewise.
--
Jeff Bailey - http://www.raspberryginger.com/jbailey/
--- ports/sysdeps/unix/sysv/linux/hppa/nptl/lowlevellock.h.old 2007-12-05 19:12:32.000000000 +0000
+++ ports/sysdeps/unix/sysv/linux/hppa/nptl/lowlevellock.h 2007-12-05 19:19:35.000000000 +0000
@@ -289,22 +289,20 @@
#define lll_robust_timedlock(futex, abstime, id, private) \
__lll_robust_timedlock (&(futex), abstime, id, private)
-static inline void __attribute__ ((always_inline))
-__lll_unlock (lll_lock_t *futex, int private)
-{
- int val = atomic_exchange_rel (futex, 0);
- if (__builtin_expect (val > 1, 0))
- lll_futex_wake (futex, 1, private);
-}
+#define __lll_unlock(futex, private) \
+ (void) \
+ ({ int val = atomic_exchange_rel (futex, 0); \
+ if (__builtin_expect (val > 1, 0)) \
+ lll_futex_wake (futex, 1, private); \
+ })
#define lll_unlock(futex, private) __lll_unlock(&(futex), private)
-static inline void __attribute__ ((always_inline))
-__lll_robust_unlock (int *futex, int private)
-{
- int val = atomic_exchange_rel (futex, 0);
- if (__builtin_expect (val & FUTEX_WAITERS, 0))
- lll_futex_wake (futex, 1, private);
-}
+#define __lll_robust_unlock(futex,private) \
+ (void) \
+ ({ int val = atomic_exchange_rel (futex, 0); \
+ if (__builtin_expect (val & FUTEX_WAITERS, 0)) \
+ lll_futex_wake (futex, 1, private); \
+ })
#define lll_robust_unlock(futex, private) \
__lll_robust_unlock(&(futex), private)