]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
Update.
authorUlrich Drepper <drepper@redhat.com>
Wed, 14 Jan 2004 04:11:30 +0000 (04:11 +0000)
committerUlrich Drepper <drepper@redhat.com>
Wed, 14 Jan 2004 04:11:30 +0000 (04:11 +0000)
2004-01-13  Ulrich Drepper  <drepper@redhat.com>

* posix/regex.c: Support crappy compilers and platforms which have
problems with alloca.
* posix/regex_internal.h: Likewise.
Patch by Paolo Bonzini.

ChangeLog
linuxthreads/sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h
linuxthreads/sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h
posix/regex.c
posix/regex_internal.h

index 5dee2a9921b33e29e6185d7494621d27ccad2f23..c21b0324bb2fa1636345e8c7ed815a476994fbc1 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2004-01-13  Ulrich Drepper  <drepper@redhat.com>
+
+       * posix/regex.c: Support crappy compilers and platforms which have
+       problems with alloca.
+       * posix/regex_internal.h: Likewise.
+       Patch by Paolo Bonzini.
+
 2004-01-12  Paolo Bonzini  <bonzini@gnu.org>
 
        * posix/regcomp.c [_LIBC && !RE_ENABLE_I18N]:
index b5d0665cdac6f26e3b65adc3b76538da9fd7a0e6..0ee10c1c3a7269876595d309d68fad5981b8201b 100644 (file)
 #  define CDISABLE     bl JUMPTARGET(__librt_disable_asynccancel)
 # endif
 
-# ifndef __ASSEMBLER__
-#  define SINGLE_THREAD_P                                              \
+# ifdef HAVE_TLS_SUPPORT
+#  ifndef __ASSEMBLER__
+#   define SINGLE_THREAD_P                                             \
   __builtin_expect (THREAD_GETMEM (THREAD_SELF, p_multiple_threads) == 0, 1)
-# else
-#  define SINGLE_THREAD_P                                              \
+#  else
+#   define SINGLE_THREAD_P                                             \
   lwz 10,MULTIPLE_THREADS_OFFSET(2);                                   \
   cmpwi 10,0
+#  endif
+# else
+#  if !defined NOT_IN_libc
+#   define __local_multiple_threads __libc_multiple_threads
+#  else
+#   define __local_multiple_threads __librt_multiple_threads
+#  endif
+#  ifndef __ASSEMBLER__
+extern int __local_multiple_threads attribute_hidden;
+#   define SINGLE_THREAD_P __builtin_expect (__local_multiple_threads == 0, 1)
+#  else
+#   if !defined PIC
+#    define SINGLE_THREAD_P                                            \
+  lis 10,__local_multiple_threads@ha;                                  \
+  lwz 10,__local_multiple_threads@l(10);                               \
+  cmpwi 10,0
+#   else
+#    define SINGLE_THREAD_P                                            \
+  mflr 9;                                                              \
+  bl _GLOBAL_OFFSET_TABLE_@local-4;                                    \
+  mflr 10;                                                             \
+  mtlr 9;                                                              \
+  lwz 10,__local_multiple_threads@got(10);                             \
+  lwz 10,0(10);                                                                \
+  cmpwi 10,0
+#   endif
+#  endif
 # endif
 
 #elif !defined __ASSEMBLER__
index e789d47b9d1f333aad1cb037e441a35e3822e0c0..0c74676766cc140f1ea199f18a192579632ca59e 100644 (file)
 #  define __local_multiple_threads __librt_multiple_threads
 # endif
 
-# ifndef __ASSEMBLER__
-#  define SINGLE_THREAD_P                                              \
+# ifdef HAVE_TLS_SUPPORT
+#  ifndef __ASSEMBLER__
+#   define SINGLE_THREAD_P                                             \
   __builtin_expect (THREAD_GETMEM (THREAD_SELF, p_multiple_threads) == 0, 1)
-# else
-#  define SINGLE_THREAD_P                                              \
+#  else
+#   define SINGLE_THREAD_P                                             \
   lwz 10,MULTIPLE_THREADS_OFFSET(13);                                  \
   cmpwi 10,0
+#  endif
+# else /* !HAVE_TLS_SUPPORT */
+#  ifndef __ASSEMBLER__
+extern int __local_multiple_threads
+#   if !defined NOT_IN_libc || defined IS_IN_libpthread
+  attribute_hidden;
+#   else
+  ;
+#   endif
+#   define SINGLE_THREAD_P __builtin_expect (__local_multiple_threads == 0, 1)
+#  else
+#   define SINGLE_THREAD_P                                             \
+       .section        ".toc","aw";                                    \
+.LC__local_multiple_threads:;                                          \
+       .tc __local_multiple_threads[TC],__local_multiple_threads;      \
+  .previous;                                                           \
+  ld    10,.LC__local_multiple_threads@toc(2);                         \
+  lwz   10,0(10);                                                      \
+  cmpwi 10,0
+#  endif
 # endif
 
 #elif !defined __ASSEMBLER__
index f18178a479c16e83f698ba4477c175a967a75491..4c3826238bdf3937a18da9a2aed8359281037440 100644 (file)
    Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
    02111-1307 USA.  */
 
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#ifdef _AIX
+#pragma alloca
+#else
+# ifndef allocax           /* predefined by HP cc +Olibcalls */
+#  ifdef __GNUC__
+#   define alloca(size) __builtin_alloca (size)
+#  else
+#   if HAVE_ALLOCA_H
+#    include <alloca.h>
+#   else
+#    ifdef __hpux
+        void *alloca ();
+#    else
+#     if !defined __OS2__ && !defined WIN32
+        char *alloca ();
+#     else
+#      include <malloc.h>       /* OS/2 defines alloca in here */
+#     endif
+#    endif
+#   endif
+#  endif
+# endif
+#endif
+
 #ifdef _LIBC
 /* We have to keep the namespace clean.  */
 # define regfree(preg) __regfree (preg)
index 6cbc48eee506d5da5c724c50e92a6764ef32bc87..7a7d964bd594c9785bb057189b1048236a8c0ccb 100644 (file)
 #ifndef _REGEX_INTERNAL_H
 #define _REGEX_INTERNAL_H 1
 
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
 #include <assert.h>
 #include <ctype.h>
 #include <limits.h>