This is the mail archive of the libc-ports@sources.redhat.com mailing list for the libc-ports 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]

[Patch]: linuxthreads on ppc64


Hi

This patch is to let linuxthreads compile in glibc 2.4
Without this patch it fails with following error.

In file included from libc-cancellation.c:24:
spinlock.h:175: error: expected identifier or '(' before '{' token
spinlock.h:187: error: expected identifier or '(' before '{' token
make[2]: *** [/home/build/BUILD/glibc-2.4.90/objdir-linuxthreads_64/linuxthreads/libc-cancellation.o] Error 1


This is because atomic_increment and atomic_decrement are already defined in sysdeps/powerpc/bits/atomic.h
and here there get replace the definitions in linuxthreads/spinlock.h and cause the above error


Is this ok?

Thanks

-Khem

2006-05-10  Khem Raj  <kraj@mvista.com>

	* linuxthreads/spinlock.h (atomic_increment): Check if already defined.
                                  (atomic_decrement): Ditto

Index: glibc-2.4.90/linuxthreads/spinlock.h
===================================================================
--- glibc-2.4.90.orig/linuxthreads/spinlock.h
+++ glibc-2.4.90/linuxthreads/spinlock.h
@@ -171,7 +171,7 @@ static inline int __pthread_alt_trylock 
 }
 
 /* Operations on pthread_atomic, which is defined in internals.h */
-
+#ifndef atomic_increment
 static inline long atomic_increment(struct pthread_atomic *pa)
 {
     long oldval;
@@ -182,8 +182,9 @@ static inline long atomic_increment(stru
 
     return oldval;
 }
+#endif /* atomic_increment */
 
-
+#ifndef atomic_decrement
 static inline long atomic_decrement(struct pthread_atomic *pa)
 {
     long oldval;
@@ -194,7 +195,7 @@ static inline long atomic_decrement(stru
 
     return oldval;
 }
-
+#endif /* atomic_decrement */
 
 static inline __attribute__((always_inline)) void
 __pthread_set_own_extricate_if (pthread_descr self, pthread_extricate_if *peif)

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