MIPS NPTL patches

Carmelo AMOROSO carmelo.amoroso at st.com
Thu Apr 9 08:43:45 UTC 2009


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Khem Raj wrote:
> On Wednesday 08 April 2009 10:27:44 pm Dan E wrote:
>> OK, I lied.  There are 4 patches in all for this set.
>>
>> I could not get a clean build without these changes. 
> 
> what error messages do you get without this patch ?
> 
>> A better way would be nice.
>> No other arch needs these to build the NPTL branch, do they?  MIPS shouldn't
>> either, but I don't know how to do it gracefully.  Tips, flames, etc. all
>> welcome and encouraged.

Indeed, ARM ans sh4 are working without this multiple inclusions.
They will not applied to common code unless clearly explained.

Carmelo

>>
>> ---------- start patch ----------
>> Index: uClibc-nptl/libc/inet/getproto.c
>> ===================================================================
>> --- uClibc-nptl/libc/inet/getproto.c	(revision 26031)
>> +++ uClibc-nptl/libc/inet/getproto.c	(working copy)
>> @@ -71,6 +71,10 @@
>>  /* libc_hidden_proto(fclose) */
>>  /* libc_hidden_proto(abort) */
>>  
>> +#ifdef __UCLIBC_HAS_THREADS_NATIVE__
>> +#include <pthreadP.h>
>> +#endif
>> +
>>  #include <bits/uClibc_mutex.h>
>>  __UCLIBC_MUTEX_STATIC(mylock, PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP);
>>  
>> Index: uClibc-nptl/libc/inet/getnetent.c
>> ===================================================================
>> --- uClibc-nptl/libc/inet/getnetent.c	(revision 26031)
>> +++ uClibc-nptl/libc/inet/getnetent.c	(working copy)
>> @@ -30,6 +30,10 @@
>>  /* libc_hidden_proto(fgets) */
>>  /* libc_hidden_proto(abort) */
>>  
>> +#ifdef __UCLIBC_HAS_THREADS_NATIVE__
>> +#include <pthreadP.h>
>> +#endif
>> +
>>  #include <bits/uClibc_mutex.h>
>>  __UCLIBC_MUTEX_STATIC(mylock, PTHREAD_MUTEX_INITIALIZER);
>>  
>> Index: uClibc-nptl/libc/inet/resolv.c
>> ===================================================================
>> --- uClibc-nptl/libc/inet/resolv.c	(revision 26031)
>> +++ uClibc-nptl/libc/inet/resolv.c	(working copy)
>> @@ -166,6 +166,10 @@
>>  #include <bits/uClibc_mutex.h>
>>  #include <tls.h>
>>  
>> +#ifdef __UCLIBC_HAS_THREADS_NATIVE__ 
>> +#include <pthreadP.h>
>> +#endif
>> +
>>  /* poll() is not supported in kernel <= 2.0, therefore if __NR_poll is
>>   * not available, we assume an old Linux kernel is in use and we will
>>   * use select() instead. */
>> Index: uClibc-nptl/libc/inet/getservice.c
>> ===================================================================
>> --- uClibc-nptl/libc/inet/getservice.c	(revision 26031)
>> +++ uClibc-nptl/libc/inet/getservice.c	(working copy)
>> @@ -73,6 +73,10 @@
>>  /* libc_hidden_proto(fgets) */
>>  /* libc_hidden_proto(abort) */
>>  
>> +#ifdef __UCLIBC_HAS_THREADS_NATIVE__
>> +#include <pthreadP.h>
>> +#endif
>> +
>>  #include <bits/uClibc_mutex.h>
>>  __UCLIBC_MUTEX_STATIC(mylock, PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP);
>>  
>> Index: uClibc-nptl/libc/stdlib/setenv.c
>> ===================================================================
>> --- uClibc-nptl/libc/stdlib/setenv.c	(revision 26031)
>> +++ uClibc-nptl/libc/stdlib/setenv.c	(working copy)
>> @@ -32,6 +32,10 @@
>>  /* Experimentally off - libc_hidden_proto(strndup) */
>>  /* libc_hidden_proto(unsetenv) */
>>  
>> +#ifdef __UCLIBC_HAS_THREADS_NATIVE__
>> +#include <pthreadP.h>
>> +#endif
>> +
>>  #include <bits/uClibc_mutex.h>
>>  __UCLIBC_MUTEX_STATIC(mylock, PTHREAD_MUTEX_INITIALIZER);
>>  
>> Index: uClibc-nptl/libc/stdlib/_atexit.c
>> ===================================================================
>> --- uClibc-nptl/libc/stdlib/_atexit.c	(revision 26031)
>> +++ uClibc-nptl/libc/stdlib/_atexit.c	(working copy)
>> @@ -43,6 +43,10 @@
>>  #include <errno.h>
>>  #include <atomic.h>
>>  
>> +#ifdef __UCLIBC_HAS_THREADS_NATIVE__
>> +#include <pthreadP.h>
>> +#endif
>> +
>>  #include <bits/uClibc_mutex.h>
>>  __UCLIBC_MUTEX_EXTERN(__atexit_lock);
>>  
>> Index: uClibc-nptl/libc/stdlib/random.c
>> ===================================================================
>> --- uClibc-nptl/libc/stdlib/random.c	(revision 26031)
>> +++ uClibc-nptl/libc/stdlib/random.c	(working copy)
>> @@ -32,6 +32,10 @@
>>  /* libc_hidden_proto(setstate_r) */
>>  /* libc_hidden_proto(initstate_r) */
>>  
>> +#ifdef __UCLIBC_HAS_THREADS_NATIVE__
>> +#include <pthreadP.h>
>> +#endif
>> +
>>  /* POSIX.1c requires that there is mutual exclusion for the `rand' and
>>     `srand' functions to prevent concurrent calls from modifying common
>>     data.  */
>> Index: uClibc-nptl/libc/pwd_grp/pwd_grp.c
>> ===================================================================
>> --- uClibc-nptl/libc/pwd_grp/pwd_grp.c	(revision 26031)
>> +++ uClibc-nptl/libc/pwd_grp/pwd_grp.c	(working copy)
>> @@ -34,6 +34,9 @@
>>  #ifdef __UCLIBC_HAS_SHADOW__
>>  #include <shadow.h>
>>  #endif
>> +#ifdef __UCLIBC_HAS_THREADS_NATIVE__
>> +#include <pthreadP.h>
>> +#endif
>>  #include <bits/uClibc_mutex.h>
>>  
>>  /* Experimentally off - libc_hidden_proto(strchr) */
>> Index: uClibc-nptl/libc/stdio/_stdio.h
>> ===================================================================
>> --- uClibc-nptl/libc/stdio/_stdio.h	(revision 26031)
>> +++ uClibc-nptl/libc/stdio/_stdio.h	(working copy)
>> @@ -8,6 +8,11 @@
>>  #include <features.h>
>>  #include <assert.h>
>>  #include <errno.h>
>> +
>> +#ifdef __UCLIBC_HAS_THREADS_NATIVE__
>> +#include <pthreadP.h>
>> +#endif
>> +
>>  #include <fcntl.h>
>>  #include <limits.h>
>>  #include <signal.h>
>> Index: uClibc-nptl/libc/misc/syslog/syslog.c
>> ===================================================================
>> --- uClibc-nptl/libc/misc/syslog/syslog.c	(revision 26031)
>> +++ uClibc-nptl/libc/misc/syslog/syslog.c	(working copy)
>> @@ -104,6 +104,10 @@
>>  /* libc_hidden_proto(vsnprintf) */
>>  /* Experimentally off - libc_hidden_proto(time) */
>>  
>> +#ifdef __UCLIBC_HAS_THREADS_NATIVE__
>> +#include <pthreadP.h>
>> +#endif
>> +
>>  #include <bits/uClibc_mutex.h>
>>  __UCLIBC_MUTEX_STATIC(mylock, PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP);
>>  
>> Index: uClibc-nptl/libc/misc/dirent/dirstream.h
>> ===================================================================
>> --- uClibc-nptl/libc/misc/dirent/dirstream.h	(revision 26031)
>> +++ uClibc-nptl/libc/misc/dirent/dirstream.h	(working copy)
>> @@ -27,6 +27,10 @@
>>  #include <features.h>
>>  #include <sys/types.h>
>>  
>> +#ifdef __UCLIBC_HAS_THREADS_NATIVE__
>> +#include <pthreadP.h>
>> +#endif
>> +
>>  #include <bits/uClibc_mutex.h>
>>  
>>  /* For now, syscall readdir () only supports one entry at a time. It
>> Index: uClibc-nptl/libc/misc/utmp/utent.c
>> ===================================================================
>> --- uClibc-nptl/libc/misc/utmp/utent.c	(revision 26031)
>> +++ uClibc-nptl/libc/misc/utmp/utent.c	(working copy)
>> @@ -21,6 +21,7 @@
>>  #include <utmp.h>
>>  
>>  #ifdef __UCLIBC_HAS_THREADS_NATIVE__
>> +#include <pthreadP.h>
>>  #include <not-cancel.h>
>>  #endif
>>  
>> Index: uClibc-nptl/libc/misc/ttyent/getttyent.c
>> ===================================================================
>> --- uClibc-nptl/libc/misc/ttyent/getttyent.c	(revision 26031)
>> +++ uClibc-nptl/libc/misc/ttyent/getttyent.c	(working copy)
>> @@ -55,6 +55,10 @@
>>  /* libc_hidden_proto(__ctype_b) */
>>  #endif
>>  
>> +#ifdef __UCLIBC_HAS_THREADS_NATIVE__
>> +#include <pthreadP.h>
>> +#endif
>> +
>>  static char zapchar;
>>  static FILE *tf;
>>  static struct ttyent tty;
>> Index: uClibc-nptl/libc/misc/error/err.c
>> ===================================================================
>> --- uClibc-nptl/libc/misc/error/err.c	(revision 26031)
>> +++ uClibc-nptl/libc/misc/error/err.c	(working copy)
>> @@ -12,8 +12,12 @@
>>  #include <errno.h>
>>  #include <err.h>
>>  #ifdef __UCLIBC_HAS_THREADS__
>> +#ifdef __UCLIBC_HAS_THREADS_NATIVE__
>> +#include <pthreadP.h>
>> +#else
>>  #include <pthread.h>
>>  #endif
>> +#endif
>>  
>>  #ifdef __UCLIBC_MJN3_ONLY__
>>  #warning REMINDER: Deal with wide oriented stderr case.
>> Index: uClibc-nptl/libc/misc/time/time.c
>> ===================================================================
>> --- uClibc-nptl/libc/misc/time/time.c	(revision 26031)
>> +++ uClibc-nptl/libc/misc/time/time.c	(working copy)
>> @@ -144,6 +144,11 @@
>>  #include <fcntl.h>
>>  #include <unistd.h>
>>  #include <bits/uClibc_uintmaxtostr.h>
>> +
>> +#ifdef __UCLIBC_HAS_THREADS_NATIVE__
>> +#include <pthreadP.h>
>> +#endif
>> +
>>  #include <bits/uClibc_mutex.h>
>>  
>>  
>> Index: uClibc-nptl/libc/misc/mntent/mntent.c
>> ===================================================================
>> --- uClibc-nptl/libc/misc/mntent/mntent.c	(revision 26031)
>> +++ uClibc-nptl/libc/misc/mntent/mntent.c	(working copy)
>> @@ -8,6 +8,11 @@
>>  #include <stdlib.h>
>>  #include <string.h>
>>  #include <mntent.h>
>> +
>> +#ifdef __UCLIBC_HAS_THREADS_NATIVE__
>> +#include <pthreadP.h>
>> +#endif
>> +
>>  #include <bits/uClibc_mutex.h>
>>  
>>  __UCLIBC_MUTEX_STATIC(mylock, PTHREAD_MUTEX_INITIALIZER);
>> ---------- end patch ------------
>>
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> uClibc mailing list
> uClibc at uclibc.org
> http://lists.busybox.net/mailman/listinfo/uclibc

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org

iEYEARECAAYFAkndtUEACgkQoRq/3BrK1s/IyACg7a3lBWABGuoD50KTskSstQQx
9RkAnj+DXJc5M5Lr9R606zglmCAcBM4B
=qv6p
-----END PGP SIGNATURE-----


More information about the uClibc mailing list