mirror of
https://github.com/crosstool-ng/crosstool-ng.git
synced 2025-05-31 14:50:50 +00:00
Vampirise three new patches for uClibc, coming from buildroot.
/trunk/patches/uClibc/0.9.29/600-filter-gnu99-from-assembly-flags.patch | 12 12 0 0 + /trunk/patches/uClibc/0.9.29/800-rm-whitespace.patch | 86 86 0 0 ++++++ /trunk/patches/uClibc/0.9.29/700-linuxthreads.patch | 145 145 0 0 ++++++++++ 3 files changed, 243 insertions(+)
This commit is contained in:
parent
edbd3bee45
commit
c15c2e6978
@ -0,0 +1,12 @@
|
||||
diff -ur uClibc-0.9.29/Makerules uClibc-0.9.29-patched/Makerules
|
||||
--- uClibc-0.9.29/Makerules 2006-12-10 18:25:23.000000000 -0600
|
||||
+++ uClibc-0.9.29-patched/Makerules 2008-01-26 17:04:50.965699518 -0600
|
||||
@@ -96,7 +96,7 @@
|
||||
disp_ld = $($(DISP)_disp_ld)
|
||||
|
||||
cmd_compile.c = $(CC) -c $< -o $@ $(CFLAGS) $(ARCH_CFLAGS) $(CFLAGS-$(suffix $@)) $(filter-out $(CFLAGS-OMIT-$(notdir $<)),$(CFLAGS-$(notdir $(^D)))) $(CFLAGS-$(subst $(top_srcdir),,$(dir $<))) $(CFLAGS-$(notdir $<)) $(CFLAGS-$(notdir $@))
|
||||
-cmd_compile.S = $(cmd_compile.c) -D__ASSEMBLER__ $(ASFLAGS) $(ARCH_ASFLAGS) $(ASFLAGS-$(suffix $@)) $(ASFLAGS-$(notdir $<)) $(ASFLAGS-$(notdir $@))
|
||||
+cmd_compile.S = $(filter-out -std=gnu99, $(cmd_compile.c)) -D__ASSEMBLER__ $(ASFLAGS) $(ARCH_ASFLAGS) $(ASFLAGS-$(suffix $@)) $(ASFLAGS-$(notdir $<)) $(ASFLAGS-$(notdir $@))
|
||||
cmd_compile.m = $(cmd_compile.c) -DL_$(patsubst %$(suffix $(notdir $@)),%,$(notdir $@))
|
||||
cmd_compile-m = $(CC) $^ -c -o $@ $(CFLAGS) $(ARCH_CFLAGS) $(CFLAGS-$(suffix $@)) $(CFLAGS-$(notdir $(@D))) $(CFLAGS-$(notdir $@))
|
||||
cmd_strip = $(STRIPTOOL) $(STRIP_FLAGS) $^
|
145
patches/uClibc/0.9.29/700-linuxthreads.patch
Normal file
145
patches/uClibc/0.9.29/700-linuxthreads.patch
Normal file
@ -0,0 +1,145 @@
|
||||
--- a/libpthread/linuxthreads.old/attr.c 2006-01-24 12:41:01.000000000 -0500
|
||||
+++ b/libpthread/linuxthreads.old/attr.c 2008-02-10 11:35:32.000000000 -0500
|
||||
@@ -25,6 +25,14 @@
|
||||
#include "pthread.h"
|
||||
#include "internals.h"
|
||||
|
||||
+#include <sys/resource.h>
|
||||
+#include <inttypes.h>
|
||||
+#include <stdio.h>
|
||||
+#include <stdio_ext.h>
|
||||
+#include <stdlib.h>
|
||||
+#include <sys/resource.h>
|
||||
+
|
||||
+
|
||||
/* NOTE: With uClibc I don't think we need this versioning stuff.
|
||||
* Therefore, define the function pthread_attr_init() here using
|
||||
* a strong symbol. */
|
||||
@@ -209,4 +217,94 @@ int __pthread_attr_getstacksize(const pt
|
||||
*stacksize = attr->__stacksize;
|
||||
return 0;
|
||||
}
|
||||
+
|
||||
+
|
||||
+extern int *__libc_stack_end;
|
||||
+
|
||||
weak_alias (__pthread_attr_getstacksize, pthread_attr_getstacksize)
|
||||
+void* pthread_getattr_np(pthread_t thread, pthread_attr_t *attr)
|
||||
+{
|
||||
+ static void *stackBase = 0;
|
||||
+ static size_t stackSize = 0;
|
||||
+ int ret = 0;
|
||||
+ /* Stack size limit. */
|
||||
+ struct rlimit rl;
|
||||
+
|
||||
+ /* The safest way to get the top of the stack is to read
|
||||
+ /proc/self/maps and locate the line into which
|
||||
+ __libc_stack_end falls. */
|
||||
+ FILE *fp = fopen("/proc/self/maps", "rc");
|
||||
+ if (fp == NULL)
|
||||
+ ret = errno;
|
||||
+ /* We need the limit of the stack in any case. */
|
||||
+ else if (getrlimit (RLIMIT_STACK, &rl) != 0)
|
||||
+ ret = errno;
|
||||
+ else {
|
||||
+ /* We need no locking. */
|
||||
+ __fsetlocking (fp, FSETLOCKING_BYCALLER);
|
||||
+
|
||||
+ /* Until we found an entry (which should always be the case)
|
||||
+ mark the result as a failure. */
|
||||
+ ret = ENOENT;
|
||||
+
|
||||
+ char *line = NULL;
|
||||
+ size_t linelen = 0;
|
||||
+ uintptr_t last_to = 0;
|
||||
+
|
||||
+ while (! feof_unlocked (fp)) {
|
||||
+ if (getdelim (&line, &linelen, '\n', fp) <= 0)
|
||||
+ break;
|
||||
+
|
||||
+ uintptr_t from;
|
||||
+ uintptr_t to;
|
||||
+ if (sscanf (line, "%x-%x", &from, &to) != 2)
|
||||
+ continue;
|
||||
+ if (from <= (uintptr_t) __libc_stack_end
|
||||
+ && (uintptr_t) __libc_stack_end < to) {
|
||||
+ /* Found the entry. Now we have the info we need. */
|
||||
+ attr->__stacksize = rl.rlim_cur;
|
||||
+#ifdef _STACK_GROWS_UP
|
||||
+ /* Don't check to enforce a limit on the __stacksize */
|
||||
+ attr->__stackaddr = (void *) from;
|
||||
+#else
|
||||
+ attr->__stackaddr = (void *) to;
|
||||
+
|
||||
+ /* The limit might be too high. */
|
||||
+ if ((size_t) attr->__stacksize > (size_t) attr->__stackaddr - last_to)
|
||||
+ attr->__stacksize = (size_t) attr->__stackaddr - last_to;
|
||||
+#endif
|
||||
+
|
||||
+ /* We succeed and no need to look further. */
|
||||
+ ret = 0;
|
||||
+ break;
|
||||
+ }
|
||||
+ last_to = to;
|
||||
+ }
|
||||
+
|
||||
+ fclose (fp);
|
||||
+ free (line);
|
||||
+ }
|
||||
+#ifndef _STACK_GROWS_UP
|
||||
+ stackBase = (char *) attr->__stackaddr - attr->__stacksize;
|
||||
+#else
|
||||
+ stackBase = attr->__stackaddr;
|
||||
+#endif
|
||||
+ stackSize = attr->__stacksize;
|
||||
+ return (void*)(stackBase + stackSize);
|
||||
+}
|
||||
+
|
||||
+int __pthread_attr_getstack (const pthread_attr_t *attr, void **stackaddr,
|
||||
+ size_t *stacksize)
|
||||
+{
|
||||
+ /* XXX This function has a stupid definition. The standard specifies
|
||||
+ no error value but what is if no stack address was set? We simply
|
||||
+ return the value we have in the member. */
|
||||
+#ifndef _STACK_GROWS_UP
|
||||
+ *stackaddr = (char *) attr->__stackaddr - attr->__stacksize;
|
||||
+#else
|
||||
+ *stackaddr = attr->__stackaddr;
|
||||
+#endif
|
||||
+ *stacksize = attr->__stacksize;
|
||||
+ return 0;
|
||||
+}
|
||||
+weak_alias (__pthread_attr_getstack, pthread_attr_getstack)
|
||||
|
||||
--- a/libpthread/linuxthreads.old/sysdeps/pthread/pthread.h 2006-12-07 22:19:36.000000000 -0500
|
||||
+++ b/libpthread/linuxthreads.old/sysdeps/pthread/pthread.h 2008-02-10 11:42:35.000000000 -0500
|
||||
@@ -288,15 +288,11 @@ extern int pthread_attr_getstacksize (__
|
||||
__attr, size_t *__restrict __stacksize)
|
||||
__THROW;
|
||||
|
||||
-#if 0
|
||||
-/* Not yet implemented in uClibc! */
|
||||
-
|
||||
#ifdef __USE_GNU
|
||||
/* Initialize thread attribute *ATTR with attributes corresponding to the
|
||||
already running thread TH. It shall be called on unitialized ATTR
|
||||
and destroyed with pthread_attr_destroy when no longer needed. */
|
||||
-extern int pthread_getattr_np (pthread_t __th, pthread_attr_t *__attr) __THROW;
|
||||
-#endif
|
||||
+extern void* pthread_getattr_np(pthread_t thread, pthread_attr_t *attr);
|
||||
#endif
|
||||
|
||||
/* Functions for scheduling control. */
|
||||
@@ -599,6 +595,11 @@ extern int pthread_cancel (pthread_t __c
|
||||
cancelled. */
|
||||
extern void pthread_testcancel (void);
|
||||
|
||||
+/* Return the previously set address for the stack. */
|
||||
+extern int pthread_attr_getstack (__const pthread_attr_t *__restrict __attr,
|
||||
+ void **__restrict __stackaddr,
|
||||
+ size_t *__restrict __stacksize) __THROW;
|
||||
+
|
||||
|
||||
/* Install a cleanup handler: ROUTINE will be called with arguments ARG
|
||||
when the thread is cancelled or calls pthread_exit. ROUTINE will also
|
||||
|
86
patches/uClibc/0.9.29/800-rm-whitespace.patch
Normal file
86
patches/uClibc/0.9.29/800-rm-whitespace.patch
Normal file
@ -0,0 +1,86 @@
|
||||
diff -urN uClibc-0.9.29-0rig/include/assert.h uClibc-0.9.29/include/assert.h
|
||||
--- uClibc-0.9.29-0rig/include/assert.h 2005-11-03 23:42:46.000000000 +0100
|
||||
+++ uClibc-0.9.29/include/assert.h 2007-08-13 19:10:57.000000000 +0200
|
||||
@@ -31,7 +31,7 @@
|
||||
#define _ASSERT_H 1
|
||||
#include <features.h>
|
||||
|
||||
-#if defined __cplusplus && __GNUC_PREREQ (2,95)
|
||||
+#if defined __cplusplus && __GNUC_PREREQ(2,95)
|
||||
# define __ASSERT_VOID_CAST static_cast<void>
|
||||
#else
|
||||
# define __ASSERT_VOID_CAST (void)
|
||||
@@ -59,13 +59,17 @@
|
||||
(__ASSERT_VOID_CAST ((expr) ? 0 : \
|
||||
(__assert (__STRING(expr), __FILE__, __LINE__, \
|
||||
__ASSERT_FUNCTION), 0)))
|
||||
-
|
||||
+
|
||||
+/* Define some temporaries to workaround tinyx makedepend bug */
|
||||
+#define __GNUC_PREREQ_2_6 __GNUC_PREREQ(2, 6)
|
||||
+#define __GNUC_PREREQ_2_4 __GNUC_PREREQ(2, 4)
|
||||
/* Version 2.4 and later of GCC define a magical variable `__PRETTY_FUNCTION__'
|
||||
which contains the name of the function currently being defined.
|
||||
This is broken in G++ before version 2.6.
|
||||
C9x has a similar variable called __func__, but prefer the GCC one since
|
||||
it demangles C++ function names. */
|
||||
-# if defined __cplusplus ? __GNUC_PREREQ (2, 6) : __GNUC_PREREQ (2, 4)
|
||||
+
|
||||
+# if defined __cplusplus ? __GNUC_PREREQ_2_6 : __GNUC_PREREQ_2_4
|
||||
# define __ASSERT_FUNCTION __PRETTY_FUNCTION__
|
||||
# else
|
||||
# if defined __STDC_VERSION__ && __STDC_VERSION__ >= 199901L
|
||||
diff -urN uClibc-0.9.29-0rig/include/complex.h uClibc-0.9.29/include/complex.h
|
||||
--- uClibc-0.9.29-0rig/include/complex.h 2002-05-09 10:15:21.000000000 +0200
|
||||
+++ uClibc-0.9.29/include/complex.h 2007-08-13 17:55:29.000000000 +0200
|
||||
@@ -33,7 +33,7 @@
|
||||
/* We might need to add support for more compilers here. But since ISO
|
||||
C99 is out hopefully all maintained compilers will soon provide the data
|
||||
types `float complex' and `double complex'. */
|
||||
-#if __GNUC_PREREQ (2, 7) && !__GNUC_PREREQ (2, 97)
|
||||
+#if __GNUC_PREREQ(2, 7) && !__GNUC_PREREQ(2, 97)
|
||||
# define _Complex __complex__
|
||||
#endif
|
||||
|
||||
diff -urN uClibc-0.9.29-0rig/include/features.h uClibc-0.9.29/include/features.h
|
||||
--- uClibc-0.9.29-0rig/include/features.h 2006-11-29 22:10:04.000000000 +0100
|
||||
+++ uClibc-0.9.29/include/features.h 2007-08-13 17:55:51.000000000 +0200
|
||||
@@ -143,7 +143,7 @@
|
||||
|
||||
/* Convenience macros to test the versions of glibc and gcc.
|
||||
Use them like this:
|
||||
- #if __GNUC_PREREQ (2,8)
|
||||
+ #if __GNUC_PREREQ(2,8)
|
||||
... code requiring gcc 2.8 or later ...
|
||||
#endif
|
||||
Note - they won't work for gcc1 or glibc1, since the _MINOR macros
|
||||
@@ -297,7 +297,7 @@
|
||||
/* uClibc does not support _FORTIFY_SOURCE */
|
||||
#undef _FORTIFY_SOURCE
|
||||
#if defined _FORTIFY_SOURCE && _FORTIFY_SOURCE > 0 \
|
||||
- && __GNUC_PREREQ (4, 1) && defined __OPTIMIZE__ && __OPTIMIZE__ > 0
|
||||
+ && __GNUC_PREREQ(4, 1) && defined __OPTIMIZE__ && __OPTIMIZE__ > 0
|
||||
# if _FORTIFY_SOURCE > 1
|
||||
# define __USE_FORTIFY_LEVEL 2
|
||||
# else
|
||||
@@ -366,7 +366,7 @@
|
||||
#endif /* !ASSEMBLER */
|
||||
|
||||
/* Decide whether we can define 'extern inline' functions in headers. */
|
||||
-#if __GNUC_PREREQ (2, 7) && defined __OPTIMIZE__ \
|
||||
+#if __GNUC_PREREQ(2, 7) && defined __OPTIMIZE__ \
|
||||
&& !defined __OPTIMIZE_SIZE__ && !defined __NO_INLINE__
|
||||
# define __USE_EXTERN_INLINES 1
|
||||
#endif
|
||||
diff -urN uClibc-0.9.29-0rig/include/tgmath.h uClibc-0.9.29/include/tgmath.h
|
||||
--- uClibc-0.9.29-0rig/include/tgmath.h 2002-05-09 10:15:21.000000000 +0200
|
||||
+++ uClibc-0.9.29/include/tgmath.h 2007-08-13 17:56:17.000000000 +0200
|
||||
@@ -34,7 +34,7 @@
|
||||
do not try this for now and instead concentrate only on GNU CC. Once
|
||||
we have more information support for other compilers might follow. */
|
||||
|
||||
-#if __GNUC_PREREQ (2, 7)
|
||||
+#if __GNUC_PREREQ(2, 7)
|
||||
|
||||
# ifdef __NO_LONG_DOUBLE_MATH
|
||||
# define __tgml(fct) fct
|
Loading…
x
Reference in New Issue
Block a user