aboutsummaryrefslogtreecommitdiffstats
path: root/recipes/glibc
diff options
context:
space:
mode:
Diffstat (limited to 'recipes/glibc')
-rw-r--r--recipes/glibc/glibc-2.10.1/PTR_MANGLE.patch183
-rw-r--r--recipes/glibc/glibc-2.10.1/arm-longlong.patch (renamed from recipes/glibc/glibc-2.4/arm-longlong.patch)0
-rw-r--r--recipes/glibc/glibc-2.10.1/arm-lowlevellock-include-tls.patch12
-rw-r--r--recipes/glibc/glibc-2.10.1/arm-memcpy.patch (renamed from recipes/glibc/glibc-2.4/arm-memcpy.patch)0
-rw-r--r--recipes/glibc/glibc-2.10.1/armv4t-interworking.patch47
-rw-r--r--recipes/glibc/glibc-2.10.1/dl-cache-libcmp.patch (renamed from recipes/glibc/glibc-2.4/dl-cache-libcmp.patch)0
-rw-r--r--recipes/glibc/glibc-2.10.1/etc/ld.so.conf (renamed from recipes/glibc/glibc-2.3.6/etc/ld.so.conf)0
-rw-r--r--recipes/glibc/glibc-2.10.1/fhs-linux-paths.patch11
-rw-r--r--recipes/glibc/glibc-2.10.1/generate-supported.mk11
-rw-r--r--recipes/glibc/glibc-2.10.1/generic-bits_select.h (renamed from recipes/glibc/glibc-2.4/generic-bits_select.h)0
-rw-r--r--recipes/glibc/glibc-2.10.1/generic-bits_time.h (renamed from recipes/glibc/glibc-2.4/generic-bits_time.h)0
-rw-r--r--recipes/glibc/glibc-2.10.1/generic-bits_types.h (renamed from recipes/glibc/glibc-2.4/generic-bits_types.h)0
-rw-r--r--recipes/glibc/glibc-2.10.1/generic-bits_typesizes.h (renamed from recipes/glibc/glibc-2.4/generic-bits_typesizes.h)0
-rw-r--r--recipes/glibc/glibc-2.10.1/glibc-arm-IO-acquire-lock-fix.diff (renamed from recipes/glibc/glibc-2.4/glibc-arm-IO-acquire-lock-fix.diff)0
-rw-r--r--recipes/glibc/glibc-2.10.1/glibc-check_pf.patch (renamed from recipes/glibc/glibc-2.4/glibc-check_pf.patch)0
-rw-r--r--recipes/glibc/glibc-2.10.1/ldd-unbash.patch (renamed from recipes/glibc/glibc-2.4/ldd-unbash.patch)0
-rw-r--r--recipes/glibc/glibc-2.10.1/ldsocache-varrun.patch (renamed from recipes/glibc/glibc-2.4/ldsocache-varrun.patch)0
-rw-r--r--recipes/glibc/glibc-2.10.1/march-i686.patch38
-rw-r--r--recipes/glibc/glibc-2.10.1/nios2-elf.patch67
-rw-r--r--recipes/glibc/glibc-2.10.1/no-z-defs.patch (renamed from recipes/glibc/glibc-2.4/no-z-defs.patch)0
-rw-r--r--recipes/glibc/glibc-2.10.1/nptl-crosscompile.patch (renamed from recipes/glibc/glibc-2.4/nptl-crosscompile.patch)0
-rw-r--r--recipes/glibc/glibc-2.10.1/nscd-init.patch39
-rw-r--r--recipes/glibc/glibc-2.10.1/powerpc-sqrt-hack.diff (renamed from recipes/glibc/glibc-2.4/powerpc-sqrt-hack.diff)0
-rw-r--r--recipes/glibc/glibc-2.10.1/sysdeps-nios2.patch4062
-rw-r--r--recipes/glibc/glibc-2.3.6/glibc-2.3.6-allow-gcc-4.1-powerpc32-initfini.s.patch28
-rw-r--r--recipes/glibc/glibc-2.3.6/glibc-2.3.6-bind-already-defined-on-powerpc.patch65
-rw-r--r--recipes/glibc/glibc-2.3.6/glibc-2.3.6-linuxthreads-allow-gcc-4.1-powerpc32-initfini.s.patch28
-rw-r--r--recipes/glibc/glibc-2.3.6/glibc-2.3.6-linuxthreads-pthread-raise.patch37
-rw-r--r--recipes/glibc/glibc-2.3.6/glibc-arm-socket-weakalias.patch45
-rw-r--r--recipes/glibc/glibc-2.3.6/glibc-cross_sunrpc.patch79
-rw-r--r--recipes/glibc/glibc-2.3.6/glibc-memusage.patch44
-rw-r--r--recipes/glibc/glibc-2.3.6/glibc-rtld-libcc-eh.patch25
-rw-r--r--recipes/glibc/glibc-2.3.6/late-install-loop-break.patch29
-rw-r--r--recipes/glibc/glibc-2.4/arm_eabi_ipc_fix.patch94
-rw-r--r--recipes/glibc/glibc-2.4/dyn-ldconfig-20041128.patch22
-rw-r--r--recipes/glibc/glibc-2.4/dyn-ldconfig.patch62
-rw-r--r--recipes/glibc/glibc-2.4/fixup-aeabi-syscalls.patch329
-rw-r--r--recipes/glibc/glibc-2.4/glibc-2.4-compile.patch29
-rw-r--r--recipes/glibc/glibc-2.4/glibc-2.4-openat-3.patch133
-rw-r--r--recipes/glibc/glibc-2.4/glibc-crunch-endian-bigword-littlebyte.patch40
-rw-r--r--recipes/glibc/glibc-2.4/glibc-crunch-oabi.patch310
-rw-r--r--recipes/glibc/glibc-2.4/glibc-crunch-oabi2.patch18
-rw-r--r--recipes/glibc/glibc-2.5/arm-longlong.patch58
-rw-r--r--recipes/glibc/glibc-2.5/arm-memcpy.patch758
-rw-r--r--recipes/glibc/glibc-2.5/dl-cache-libcmp.patch10
-rw-r--r--recipes/glibc/glibc-2.5/etc/ld.so.conf (renamed from recipes/glibc/glibc-2.4/etc/ld.so.conf)0
-rw-r--r--recipes/glibc/glibc-2.5/fhs-linux-paths.patch11
-rw-r--r--recipes/glibc/glibc-2.5/generate-supported.mk11
-rw-r--r--recipes/glibc/glibc-2.5/generic-bits_select.h35
-rw-r--r--recipes/glibc/glibc-2.5/generic-bits_time.h75
-rw-r--r--recipes/glibc/glibc-2.5/generic-bits_types.h200
-rw-r--r--recipes/glibc/glibc-2.5/generic-bits_typesizes.h66
-rw-r--r--recipes/glibc/glibc-2.5/glibc-2.5-local-dynamic-resolvconf.patch41
-rw-r--r--recipes/glibc/glibc-2.5/glibc-2.5-soft-fp-separate-strong-alias.patch205
-rw-r--r--recipes/glibc/glibc-2.5/glibc-2.6.1-use-short-for-fnstsw.patch30
-rw-r--r--recipes/glibc/glibc-2.5/glibc-arm-no-asm-page.patch (renamed from recipes/glibc/glibc-2.4/glibc-arm-no-asm-page.patch)0
-rw-r--r--recipes/glibc/glibc-2.5/ldd-unbash.patch11
-rw-r--r--recipes/glibc/glibc-2.5/ldsocache-varrun.patch18
-rw-r--r--recipes/glibc/glibc-2.5/nios2-elf.patch87
-rw-r--r--recipes/glibc/glibc-2.5/nios2-iconv.patch85
-rw-r--r--recipes/glibc/glibc-2.5/nios2-ld-collate.patch308
-rw-r--r--recipes/glibc/glibc-2.5/no-z-defs.patch9
-rw-r--r--recipes/glibc/glibc-2.5/nptl-crosscompile.patch26
-rw-r--r--recipes/glibc/glibc-2.5/powerpc-sqrt-hack.diff25
-rw-r--r--recipes/glibc/glibc-2.5/ppc-ld-nofpu-20070104.patch190
-rw-r--r--recipes/glibc/glibc-2.5/ppc-ports-ld-nofpu-20070114.patch38
-rw-r--r--recipes/glibc/glibc-2.5/ppc-sfp-machine.patch297
-rw-r--r--recipes/glibc/glibc-2.5/ppc-soft-fp-20070115.patch182
-rw-r--r--recipes/glibc/glibc-2.5/sysdeps-nios2.patch4028
-rw-r--r--recipes/glibc/glibc-2.5/zecke-sane-readelf.patch (renamed from recipes/glibc/glibc-2.4/zecke-sane-readelf.patch)0
-rw-r--r--recipes/glibc/glibc-2.6.1/arm-longlong.patch58
-rw-r--r--recipes/glibc/glibc-2.6.1/arm-memcpy.patch758
-rw-r--r--recipes/glibc/glibc-2.6.1/dl-cache-libcmp.patch10
-rw-r--r--recipes/glibc/glibc-2.6.1/etc/ld.so.conf2
-rw-r--r--recipes/glibc/glibc-2.6.1/fhs-linux-paths.patch11
-rw-r--r--recipes/glibc/glibc-2.6.1/generate-supported.mk11
-rw-r--r--recipes/glibc/glibc-2.6.1/generic-bits_select.h35
-rw-r--r--recipes/glibc/glibc-2.6.1/generic-bits_time.h75
-rw-r--r--recipes/glibc/glibc-2.6.1/generic-bits_types.h200
-rw-r--r--recipes/glibc/glibc-2.6.1/generic-bits_typesizes.h66
-rw-r--r--recipes/glibc/glibc-2.6.1/glibc-2.5-local-dynamic-resolvconf.patch41
-rw-r--r--recipes/glibc/glibc-2.6.1/glibc-2.6.1-use-short-for-fnstsw.patch30
-rw-r--r--recipes/glibc/glibc-2.6.1/glibc-arm-no-asm-page.patch15
-rw-r--r--recipes/glibc/glibc-2.6.1/glibc-check_pf.patch343
-rw-r--r--recipes/glibc/glibc-2.6.1/glibc-crunch-eabi-force.patch (renamed from recipes/glibc/glibc-2.4/glibc-crunch-eabi-force.patch)0
-rw-r--r--recipes/glibc/glibc-2.6.1/glibc-crunch-eabi-fraiseexcpt.patch (renamed from recipes/glibc/glibc-2.4/glibc-crunch-eabi-fraiseexcpt.patch)0
-rw-r--r--recipes/glibc/glibc-2.6.1/glibc-crunch-eabi-setjmp_longjmp.patch (renamed from recipes/glibc/glibc-2.4/glibc-crunch-eabi-setjmp_longjmp.patch)0
-rw-r--r--recipes/glibc/glibc-2.6.1/glibc-crunch-eabi-unwind.patch (renamed from recipes/glibc/glibc-2.4/glibc-crunch-eabi-unwind.patch)0
-rw-r--r--recipes/glibc/glibc-2.6.1/glibc-crunch-eabi.patch (renamed from recipes/glibc/glibc-2.4/glibc-crunch-eabi.patch)0
-rw-r--r--recipes/glibc/glibc-2.6.1/glibc-crunch-endian-littleword-littlebyte.patch (renamed from recipes/glibc/glibc-2.4/glibc-crunch-endian-littleword-littlebyte.patch)0
-rw-r--r--recipes/glibc/glibc-2.6.1/glibc-use-isystem-include-fixed.patch (renamed from recipes/glibc/glibc-2.4/glibc-use-isystem-include-fixed.patch)0
-rw-r--r--recipes/glibc/glibc-2.6.1/ldd-unbash.patch11
-rw-r--r--recipes/glibc/glibc-2.6.1/no-z-defs.patch9
-rw-r--r--recipes/glibc/glibc-2.6.1/nptl-crosscompile.patch26
-rw-r--r--recipes/glibc/glibc-2.6.1/powerpc-sqrt-hack.diff25
-rw-r--r--recipes/glibc/glibc-2.6.1/zecke-sane-readelf.patch243
-rw-r--r--recipes/glibc/glibc-2.7/all_glibc-i586-chk.patch33
-rw-r--r--recipes/glibc/glibc-2.9/arm-longlong.patch58
-rw-r--r--recipes/glibc/glibc-2.9/arm-lowlevellock-include-tls.patch12
-rw-r--r--recipes/glibc/glibc-2.9/arm-memcpy.patch758
-rw-r--r--recipes/glibc/glibc-2.9/dl-cache-libcmp.patch10
-rw-r--r--recipes/glibc/glibc-2.9/etc/ld.so.conf2
-rw-r--r--recipes/glibc/glibc-2.9/fhs-linux-paths.patch11
-rw-r--r--recipes/glibc/glibc-2.9/generate-supported.mk11
-rw-r--r--recipes/glibc/glibc-2.9/generic-bits_select.h35
-rw-r--r--recipes/glibc/glibc-2.9/generic-bits_time.h75
-rw-r--r--recipes/glibc/glibc-2.9/generic-bits_types.h200
-rw-r--r--recipes/glibc/glibc-2.9/generic-bits_typesizes.h66
-rw-r--r--recipes/glibc/glibc-2.9/glibc-arm-IO-acquire-lock-fix.diff13
-rw-r--r--recipes/glibc/glibc-2.9/glibc-check_pf.patch343
-rw-r--r--recipes/glibc/glibc-2.9/ldd-unbash.patch11
-rw-r--r--recipes/glibc/glibc-2.9/ldsocache-varrun.patch18
-rw-r--r--recipes/glibc/glibc-2.9/march-i686.patch38
-rw-r--r--recipes/glibc/glibc-2.9/no-z-defs.patch9
-rw-r--r--recipes/glibc/glibc-2.9/nptl-crosscompile.patch26
-rw-r--r--recipes/glibc/glibc-2.9/nscd-init.patch39
-rw-r--r--recipes/glibc/glibc-2.9/powerpc-sqrt-hack.diff25
-rw-r--r--recipes/glibc/glibc-2.9/tls_i486.patch14
-rw-r--r--recipes/glibc/glibc-initial_2.3.2+cvs20040726.bb4
-rw-r--r--recipes/glibc/glibc-initial_2.3.6.bb2
-rw-r--r--recipes/glibc/glibc-initial_2.4.bb2
-rw-r--r--recipes/glibc/glibc-initial_2.7.bb6
-rw-r--r--recipes/glibc/glibc.inc2
-rw-r--r--recipes/glibc/glibc_2.10.1.bb45
-rw-r--r--recipes/glibc/glibc_2.2.5.bb106
-rw-r--r--recipes/glibc/glibc_2.3.2+cvs20040726.bb78
-rw-r--r--recipes/glibc/glibc_2.3.2.bb124
-rw-r--r--recipes/glibc/glibc_2.3.3+cvs20041128.bb100
-rw-r--r--recipes/glibc/glibc_2.3.3+cvs20050221.bb83
-rw-r--r--recipes/glibc/glibc_2.3.3+cvs20050420.bb84
-rw-r--r--recipes/glibc/glibc_2.3.3.bb8
-rw-r--r--recipes/glibc/glibc_2.3.5+cvs20050627.bb48
-rw-r--r--recipes/glibc/glibc_2.3.6.bb118
-rw-r--r--recipes/glibc/glibc_2.4.bb156
-rw-r--r--recipes/glibc/glibc_2.5.bb53
-rw-r--r--recipes/glibc/glibc_2.6.1.bb50
-rw-r--r--recipes/glibc/glibc_2.7.bb169
-rw-r--r--recipes/glibc/glibc_2.9.bb59
-rw-r--r--recipes/glibc/glibc_cvs.bb32
139 files changed, 15286 insertions, 2510 deletions
diff --git a/recipes/glibc/glibc-2.10.1/PTR_MANGLE.patch b/recipes/glibc/glibc-2.10.1/PTR_MANGLE.patch
new file mode 100644
index 0000000000..d88cd768a3
--- /dev/null
+++ b/recipes/glibc/glibc-2.10.1/PTR_MANGLE.patch
@@ -0,0 +1,183 @@
+Index: glibc-2.10.1/csu/libc-start.c
+===================================================================
+--- glibc-2.10.1.orig/csu/libc-start.c
++++ glibc-2.10.1/csu/libc-start.c
+@@ -234,7 +234,9 @@ LIBC_START_MAIN (int (*main) (int, char
+ result = 0;
+ # ifdef SHARED
+ unsigned int *ptr = __libc_pthread_functions.ptr_nthreads;
++#ifdef PTR_DEMANGLE
+ PTR_DEMANGLE (ptr);
++#endif
+ # else
+ extern unsigned int __nptl_nthreads __attribute ((weak));
+ unsigned int *const ptr = &__nptl_nthreads;
+Index: glibc-2.10.1/inet/getnetgrent_r.c
+===================================================================
+--- glibc-2.10.1.orig/inet/getnetgrent_r.c
++++ glibc-2.10.1/inet/getnetgrent_r.c
+@@ -57,14 +57,18 @@ setup (void **fctp, service_user **nipp)
+ same result every time. So we need no locking. */
+ no_more = __nss_netgroup_lookup (nipp, "setnetgrent", fctp);
+ startp = no_more ? (service_user *) -1 : *nipp;
++#ifdef PTR_MANGLE
+ PTR_MANGLE (startp);
++#endif
+ atomic_write_barrier ();
+ startp_initialized = true;
+ }
+ else
+ {
+ service_user *nip = startp;
++#ifdef PTR_DEMANGLE
+ PTR_DEMANGLE (nip);
++#endif
+ if (nip == (service_user *) -1)
+ /* No services at all. */
+ return 1;
+Index: glibc-2.10.1/nptl/sysdeps/pthread/unwind-forcedunwind.c
+===================================================================
+--- glibc-2.10.1.orig/nptl/sysdeps/pthread/unwind-forcedunwind.c
++++ glibc-2.10.1/nptl/sysdeps/pthread/unwind-forcedunwind.c
+@@ -63,13 +63,21 @@ pthread_cancel_init (void)
+ )
+ __libc_fatal ("libgcc_s.so.1 must be installed for pthread_cancel to work\n");
+
++#ifdef PTR_MANGLE
+ PTR_MANGLE (resume);
++#endif
+ libgcc_s_resume = resume;
++#ifdef PTR_MANGLE
+ PTR_MANGLE (personality);
++#endif
+ libgcc_s_personality = personality;
++#ifdef PTR_MANGLE
+ PTR_MANGLE (forcedunwind);
++#endif
+ libgcc_s_forcedunwind = forcedunwind;
++#ifdef PTR_MANGLE
+ PTR_MANGLE (getcfa);
++#endif
+ libgcc_s_getcfa = getcfa;
+ /* Make sure libgcc_s_handle is written last. Otherwise,
+ pthread_cancel_init might return early even when the pointer the
+@@ -97,7 +105,9 @@ _Unwind_Resume (struct _Unwind_Exception
+ pthread_cancel_init ();
+
+ void (*resume) (struct _Unwind_Exception *exc) = libgcc_s_resume;
++#ifdef PTR_DEMANGLE
+ PTR_DEMANGLE (resume);
++#endif
+ resume (exc);
+ }
+
+@@ -113,7 +123,9 @@ __gcc_personality_v0 (int version, _Unwi
+ _Unwind_Reason_Code (*personality)
+ (int, _Unwind_Action, _Unwind_Exception_Class, struct _Unwind_Exception *,
+ struct _Unwind_Context *) = libgcc_s_personality;
++#ifdef PTR_DEMANGLE
+ PTR_DEMANGLE (personality);
++#endif
+ return personality (version, actions, exception_class, ue_header, context);
+ }
+
+@@ -127,7 +139,9 @@ _Unwind_ForcedUnwind (struct _Unwind_Exc
+ _Unwind_Reason_Code (*forcedunwind)
+ (struct _Unwind_Exception *, _Unwind_Stop_Fn, void *)
+ = libgcc_s_forcedunwind;
++#ifdef PTR_DEMANGLE
+ PTR_DEMANGLE (forcedunwind);
++#endif
+ return forcedunwind (exc, stop, stop_argument);
+ }
+
+@@ -138,6 +152,8 @@ _Unwind_GetCFA (struct _Unwind_Context *
+ pthread_cancel_init ();
+
+ _Unwind_Word (*getcfa) (struct _Unwind_Context *) = libgcc_s_getcfa;
++#ifdef PTR_DEMANGLE
+ PTR_DEMANGLE (getcfa);
++#endif
+ return getcfa (context);
+ }
+Index: glibc-2.10.1/nptl/sysdeps/unix/sysv/linux/libc_pthread_init.c
+===================================================================
+--- glibc-2.10.1.orig/nptl/sysdeps/unix/sysv/linux/libc_pthread_init.c
++++ glibc-2.10.1/nptl/sysdeps/unix/sysv/linux/libc_pthread_init.c
+@@ -67,7 +67,9 @@ __libc_pthread_init (ptr, reclaim, funct
+ for (size_t cnt = 0; cnt < NPTRS; ++cnt)
+ {
+ void *p = src->parr[cnt];
++#ifdef PTR_MANGLE
+ PTR_MANGLE (p);
++#endif
+ dest->parr[cnt] = p;
+ }
+ __libc_pthread_functions_init = 1;
+Index: glibc-2.10.1/nss/getXXbyYY_r.c
+===================================================================
+--- glibc-2.10.1.orig/nss/getXXbyYY_r.c
++++ glibc-2.10.1/nss/getXXbyYY_r.c
+@@ -202,7 +202,9 @@ INTERNAL (REENTRANT_NAME) (ADD_PARAMS, L
+ if (no_more)
+ {
+ void *tmp_ptr = (service_user *) -1l;
++#ifdef PTR_MANGLE
+ PTR_MANGLE (tmp_ptr);
++#endif
+ startp = tmp_ptr;
+ }
+ else
+@@ -223,10 +225,14 @@ INTERNAL (REENTRANT_NAME) (ADD_PARAMS, L
+ #endif /* need _res_hconf */
+
+ void *tmp_ptr = fct.l;
++#ifdef PTR_MANGLE
+ PTR_MANGLE (tmp_ptr);
++#endif
+ start_fct = tmp_ptr;
+ tmp_ptr = nip;
++#ifdef PTR_MANGLE
+ PTR_MANGLE (tmp_ptr);
++#endif
+ startp = tmp_ptr;
+ }
+
+@@ -238,9 +244,13 @@ INTERNAL (REENTRANT_NAME) (ADD_PARAMS, L
+ else
+ {
+ fct.l = start_fct;
++#ifdef PTR_DEMANGLE
+ PTR_DEMANGLE (fct.l);
++#endif
+ nip = startp;
++#ifdef PTR_DEMANGLE
+ PTR_DEMANGLE (nip);
++#endif
+ no_more = nip == (service_user *) -1l;
+ }
+
+Index: glibc-2.10.1/nss/nsswitch.c
+===================================================================
+--- glibc-2.10.1.orig/nss/nsswitch.c
++++ glibc-2.10.1/nss/nsswitch.c
+@@ -303,7 +303,9 @@ __nss_lookup_function (service_user *ni,
+ {
+ /* The search found an existing structure in the tree. */
+ result = ((known_function *) *found)->fct_ptr;
++#ifdef PTR_DEMANGLE
+ PTR_DEMANGLE (result);
++#endif
+ }
+ else
+ {
+@@ -427,7 +429,9 @@ __nss_lookup_function (service_user *ni,
+ /* Remember function pointer for later calls. Even if null, we
+ record it so a second try needn't search the library again. */
+ known->fct_ptr = result;
++#ifdef PTR_MANGLE
+ PTR_MANGLE (known->fct_ptr);
++#endif
+ }
+ }
+
diff --git a/recipes/glibc/glibc-2.4/arm-longlong.patch b/recipes/glibc/glibc-2.10.1/arm-longlong.patch
index 28aca83dff..28aca83dff 100644
--- a/recipes/glibc/glibc-2.4/arm-longlong.patch
+++ b/recipes/glibc/glibc-2.10.1/arm-longlong.patch
diff --git a/recipes/glibc/glibc-2.10.1/arm-lowlevellock-include-tls.patch b/recipes/glibc/glibc-2.10.1/arm-lowlevellock-include-tls.patch
new file mode 100644
index 0000000000..5c8062ecee
--- /dev/null
+++ b/recipes/glibc/glibc-2.10.1/arm-lowlevellock-include-tls.patch
@@ -0,0 +1,12 @@
+Index: glibc-2.9/ports/sysdeps/unix/sysv/linux/arm/nptl/lowlevellock.h
+===================================================================
+--- glibc-2.9.orig/ports/sysdeps/unix/sysv/linux/arm/nptl/lowlevellock.h 2009-06-19 20:54:35.446686910 +0400
++++ glibc-2.9/ports/sysdeps/unix/sysv/linux/arm/nptl/lowlevellock.h 2009-06-19 20:54:43.774683370 +0400
+@@ -25,6 +25,7 @@
+ #include <atomic.h>
+ #include <sysdep.h>
+ #include <kernel-features.h>
++#include <tls.h>
+
+ #define FUTEX_WAIT 0
+ #define FUTEX_WAKE 1
diff --git a/recipes/glibc/glibc-2.4/arm-memcpy.patch b/recipes/glibc/glibc-2.10.1/arm-memcpy.patch
index bc2b3dab84..bc2b3dab84 100644
--- a/recipes/glibc/glibc-2.4/arm-memcpy.patch
+++ b/recipes/glibc/glibc-2.10.1/arm-memcpy.patch
diff --git a/recipes/glibc/glibc-2.10.1/armv4t-interworking.patch b/recipes/glibc/glibc-2.10.1/armv4t-interworking.patch
new file mode 100644
index 0000000000..ce91ad6530
--- /dev/null
+++ b/recipes/glibc/glibc-2.10.1/armv4t-interworking.patch
@@ -0,0 +1,47 @@
+--- libc/ports/sysdeps/arm/memcpy.S~ 2006-10-31 17:07:54.000000000 +0000
++++ libc/ports/sysdeps/arm/memcpy.S 2008-10-24 11:09:34.000000000 +0100
+@@ -130,7 +130,12 @@
+ strcsb r4, [r0], #1
+ strcsb ip, [r0]
+
++#if defined (__ARM_ARCH_4T__) && defined(__THUMB_INTERWORK__)
++ ldmfd sp!, {r0, r4, lr}
++ bx lr
++#else
+ ldmfd sp!, {r0, r4, pc}
++#endif
+
+ 9: rsb ip, ip, #4
+ cmp ip, #2
+--- libc/ports/sysdeps/arm/memmove.S~ 2006-10-31 17:07:54.000000000 +0000
++++ libc/ports/sysdeps/arm/memmove.S 2008-10-24 11:09:44.000000000 +0100
+@@ -140,7 +140,12 @@
+ strneb r3, [r0, #-1]!
+ strcsb r4, [r0, #-1]!
+ strcsb ip, [r0, #-1]
++#if defined (__ARM_ARCH_4T__) && defined (__THUMB_INTERWORK__)
++ ldmfd sp!, {r0, r4, lr}
++ bx lr
++#else
+ ldmfd sp!, {r0, r4, pc}
++#endif
+
+ 9: cmp ip, #2
+ ldrgtb r3, [r1, #-1]!
+--- libc/ports/sysdeps/unix/sysv/linux/arm/clone.S~ 2005-11-16 19:03:42.000000000 +0000
++++ libc/ports/sysdeps/unix/sysv/linux/arm/clone.S 2008-10-24 11:11:05.000000000 +0100
+@@ -96,8 +96,14 @@
+ #endif
+ @ pick the function arg and call address off the stack and execute
+ ldr r0, [sp, #4]
++#if defined(__ARM_ARCH_V4T__) && defined(__THUMB_INTERWORK__)
++ ldr ip, [sp], #8
++ mov lr, pc
++ bx ip
++#else
+ mov lr, pc
+ ldr pc, [sp], #8
++#endif
+
+ @ and we are done, passing the return value through r0
+ b PLTJMP(_exit)
diff --git a/recipes/glibc/glibc-2.4/dl-cache-libcmp.patch b/recipes/glibc/glibc-2.10.1/dl-cache-libcmp.patch
index 2fedfa6db0..2fedfa6db0 100644
--- a/recipes/glibc/glibc-2.4/dl-cache-libcmp.patch
+++ b/recipes/glibc/glibc-2.10.1/dl-cache-libcmp.patch
diff --git a/recipes/glibc/glibc-2.3.6/etc/ld.so.conf b/recipes/glibc/glibc-2.10.1/etc/ld.so.conf
index 46e06d3f0a..46e06d3f0a 100644
--- a/recipes/glibc/glibc-2.3.6/etc/ld.so.conf
+++ b/recipes/glibc/glibc-2.10.1/etc/ld.so.conf
diff --git a/recipes/glibc/glibc-2.10.1/fhs-linux-paths.patch b/recipes/glibc/glibc-2.10.1/fhs-linux-paths.patch
new file mode 100644
index 0000000000..1f32f6d7f2
--- /dev/null
+++ b/recipes/glibc/glibc-2.10.1/fhs-linux-paths.patch
@@ -0,0 +1,11 @@
+--- glibc-2.1.1/sysdeps/unix/sysv/linux/paths.h~ Thu May 27 13:16:33 1999
++++ glibc-2.1.1/sysdeps/unix/sysv/linux/paths.h Thu May 27 13:17:55 1999
+@@ -71,7 +71,7 @@
+ /* Provide trailing slash, since mostly used for building pathnames. */
+ #define _PATH_DEV "/dev/"
+ #define _PATH_TMP "/tmp/"
+-#define _PATH_VARDB "/var/db/"
++#define _PATH_VARDB "/var/lib/misc/"
+ #define _PATH_VARRUN "/var/run/"
+ #define _PATH_VARTMP "/var/tmp/"
+
diff --git a/recipes/glibc/glibc-2.10.1/generate-supported.mk b/recipes/glibc/glibc-2.10.1/generate-supported.mk
new file mode 100644
index 0000000000..d2a28c2dc6
--- /dev/null
+++ b/recipes/glibc/glibc-2.10.1/generate-supported.mk
@@ -0,0 +1,11 @@
+#!/usr/bin/make
+
+include $(IN)
+
+all:
+ rm -f $(OUT)
+ touch $(OUT)
+ for locale in $(SUPPORTED-LOCALES); do \
+ [ $$locale = true ] && continue; \
+ echo $$locale | sed 's,/, ,' >> $(OUT); \
+ done
diff --git a/recipes/glibc/glibc-2.4/generic-bits_select.h b/recipes/glibc/glibc-2.10.1/generic-bits_select.h
index 47e7dedc30..47e7dedc30 100644
--- a/recipes/glibc/glibc-2.4/generic-bits_select.h
+++ b/recipes/glibc/glibc-2.10.1/generic-bits_select.h
diff --git a/recipes/glibc/glibc-2.4/generic-bits_time.h b/recipes/glibc/glibc-2.10.1/generic-bits_time.h
index b3184d1de9..b3184d1de9 100644
--- a/recipes/glibc/glibc-2.4/generic-bits_time.h
+++ b/recipes/glibc/glibc-2.10.1/generic-bits_time.h
diff --git a/recipes/glibc/glibc-2.4/generic-bits_types.h b/recipes/glibc/glibc-2.10.1/generic-bits_types.h
index 65c8a9fe90..65c8a9fe90 100644
--- a/recipes/glibc/glibc-2.4/generic-bits_types.h
+++ b/recipes/glibc/glibc-2.10.1/generic-bits_types.h
diff --git a/recipes/glibc/glibc-2.4/generic-bits_typesizes.h b/recipes/glibc/glibc-2.10.1/generic-bits_typesizes.h
index e9226c4174..e9226c4174 100644
--- a/recipes/glibc/glibc-2.4/generic-bits_typesizes.h
+++ b/recipes/glibc/glibc-2.10.1/generic-bits_typesizes.h
diff --git a/recipes/glibc/glibc-2.4/glibc-arm-IO-acquire-lock-fix.diff b/recipes/glibc/glibc-2.10.1/glibc-arm-IO-acquire-lock-fix.diff
index a552cf0d1f..a552cf0d1f 100644
--- a/recipes/glibc/glibc-2.4/glibc-arm-IO-acquire-lock-fix.diff
+++ b/recipes/glibc/glibc-2.10.1/glibc-arm-IO-acquire-lock-fix.diff
diff --git a/recipes/glibc/glibc-2.4/glibc-check_pf.patch b/recipes/glibc/glibc-2.10.1/glibc-check_pf.patch
index 3cff6bbcfa..3cff6bbcfa 100644
--- a/recipes/glibc/glibc-2.4/glibc-check_pf.patch
+++ b/recipes/glibc/glibc-2.10.1/glibc-check_pf.patch
diff --git a/recipes/glibc/glibc-2.4/ldd-unbash.patch b/recipes/glibc/glibc-2.10.1/ldd-unbash.patch
index 2fb8854b49..2fb8854b49 100644
--- a/recipes/glibc/glibc-2.4/ldd-unbash.patch
+++ b/recipes/glibc/glibc-2.10.1/ldd-unbash.patch
diff --git a/recipes/glibc/glibc-2.4/ldsocache-varrun.patch b/recipes/glibc/glibc-2.10.1/ldsocache-varrun.patch
index 9994d4f879..9994d4f879 100644
--- a/recipes/glibc/glibc-2.4/ldsocache-varrun.patch
+++ b/recipes/glibc/glibc-2.10.1/ldsocache-varrun.patch
diff --git a/recipes/glibc/glibc-2.10.1/march-i686.patch b/recipes/glibc/glibc-2.10.1/march-i686.patch
new file mode 100644
index 0000000000..04616032ad
--- /dev/null
+++ b/recipes/glibc/glibc-2.10.1/march-i686.patch
@@ -0,0 +1,38 @@
+2007-02-15 Khem Raj <kraj@xxxxxxxxxx>
+
+ * sysdeps/unix/sysv/linux/i386/sysdep.h: Re-define __i686.
+ * nptl/sysdeps/pthread/pt-initfini.c: Ditto.
+
+
+
+Index: sysdeps/unix/sysv/linux/i386/sysdep.h
+===================================================================
+--- sysdeps/unix/sysv/linux/i386/sysdep.h (revision 1469)
++++ sysdeps/unix/sysv/linux/i386/sysdep.h (working copy)
+@@ -29,6 +29,10 @@
+ #include <dl-sysdep.h>
+ #include <tls.h>
+
++#if defined __i686 && defined __ASSEMBLER__
++#undef __i686
++#define __i686 __i686
++#endif
+
+ /* For Linux we can use the system call table in the header file
+ /usr/include/asm/unistd.h
+Index: nptl/sysdeps/pthread/pt-initfini.c
+===================================================================
+--- nptl/sysdeps/pthread/pt-initfini.c (revision 1469)
++++ nptl/sysdeps/pthread/pt-initfini.c (working copy)
+@@ -45,6 +45,11 @@
+ /* Embed an #include to pull in the alignment and .end directives. */
+ asm ("\n#include \"defs.h\"");
+
++asm ("\n#if defined __i686 && defined __ASSEMBLER__");
++asm ("\n#undef __i686");
++asm ("\n#define __i686 __i686");
++asm ("\n#endif");
++
+ /* The initial common code ends here. */
+ asm ("\n/*@HEADER_ENDS*/");
+
diff --git a/recipes/glibc/glibc-2.10.1/nios2-elf.patch b/recipes/glibc/glibc-2.10.1/nios2-elf.patch
new file mode 100644
index 0000000000..194654cd17
--- /dev/null
+++ b/recipes/glibc/glibc-2.10.1/nios2-elf.patch
@@ -0,0 +1,67 @@
+*** glibc-2.5/elf/elf.h 2010-05-31 16:05:58.000000000 +0200
+--- glibc-2.5-/elf/elf.h 2008-12-19 00:35:12.000000000 +0100
+***************
+*** 250,255 ****
+--- 250,257 ----
+ #define EM_XTENSA 94 /* Tensilica Xtensa Architecture */
+ #define EM_NUM 95
+
++ #define EM_ALTERA_NIOS2 113 /* Altera Nios II */
++
+ /* If it is necessary to assign new unofficial EM_* values, please
+ pick large random numbers (0x8523, 0xa7f2, etc.) to minimize the
+ chances of collision with official or non-GNU unofficial values. */
+***************
+*** 2602,2607 ****
+--- 2605,2655 ----
+ #define R_M32R_GOTOFF_LO 64 /* Low 16 bit offset to GOT */
+ #define R_M32R_NUM 256 /* Keep this the last entry. */
+
++ /* Legal values for d_tag (dynamic entry type). */
++ #define DT_NIOS2_GP 0x70000002 /* Address of _gp. */
++
++ /* Nios II relocs. */
++ #define R_NIOS2_NONE 0 /* No reloc. */
++ #define R_NIOS2_S16 1 /* Direct signed 16 bit. */
++ #define R_NIOS2_U16 2 /* Direct unsigned 16 bit. */
++ #define R_NIOS2_PCREL16 3 /* PC relative 16 bit. */
++ #define R_NIOS2_CALL26 4
++ #define R_NIOS2_IMM5 5
++ #define R_NIOS2_CACHE_OPX 6
++ #define R_NIOS2_IMM6 7
++ #define R_NIOS2_IMM8 8
++ #define R_NIOS2_HI16 9
++ #define R_NIOS2_LO16 10
++ #define R_NIOS2_HIADJ16 11
++ #define R_NIOS2_BFD_RELOC_32 12
++ #define R_NIOS2_BFD_RELOC_16 13
++ #define R_NIOS2_BFD_RELOC_8 14
++ #define R_NIOS2_GPREL 15
++ #define R_NIOS2_GNU_VTINHERIT 16
++ #define R_NIOS2_GNU_VTENTRY 17
++ #define R_NIOS2_UJMP 18
++ #define R_NIOS2_CJMP 19
++ #define R_NIOS2_CALLR 20
++ #define R_NIOS2_ALIGN 21
++ #define R_NIOS2_GOT16 22
++ #define R_NIOS2_CALL16 23
++ #define R_NIOS2_GOTOFF_LO 24
++ #define R_NIOS2_GOTOFF_HA 25
++ #define R_NIOS2_PCREL_LO 26
++ #define R_NIOS2_PCREL_HA 27
++ #define R_NIOS2_TLS_GD16 28
++ #define R_NIOS2_TLS_LDM16 29
++ #define R_NIOS2_TLS_LDO16 30
++ #define R_NIOS2_TLS_IE16 31
++ #define R_NIOS2_TLS_LE16 32
++ #define R_NIOS2_TLS_DTPMOD 33
++ #define R_NIOS2_TLS_DTPREL 34
++ #define R_NIOS2_TLS_TPREL 35
++ #define R_NIOS2_COPY 36
++ #define R_NIOS2_GLOB_DAT 37
++ #define R_NIOS2_JUMP_SLOT 38
++ #define R_NIOS2_RELATIVE 39
++ #define R_NIOS2_GOTOFF 40
+
+ __END_DECLS
+
diff --git a/recipes/glibc/glibc-2.4/no-z-defs.patch b/recipes/glibc/glibc-2.10.1/no-z-defs.patch
index 48c6a41267..48c6a41267 100644
--- a/recipes/glibc/glibc-2.4/no-z-defs.patch
+++ b/recipes/glibc/glibc-2.10.1/no-z-defs.patch
diff --git a/recipes/glibc/glibc-2.4/nptl-crosscompile.patch b/recipes/glibc/glibc-2.10.1/nptl-crosscompile.patch
index 18a46ad4f1..18a46ad4f1 100644
--- a/recipes/glibc/glibc-2.4/nptl-crosscompile.patch
+++ b/recipes/glibc/glibc-2.10.1/nptl-crosscompile.patch
diff --git a/recipes/glibc/glibc-2.10.1/nscd-init.patch b/recipes/glibc/glibc-2.10.1/nscd-init.patch
new file mode 100644
index 0000000000..884609a5a3
--- /dev/null
+++ b/recipes/glibc/glibc-2.10.1/nscd-init.patch
@@ -0,0 +1,39 @@
+--- nscd/nscd.init
++++ nscd/nscd.init
+@@ -48,9 +48,8 @@
+
+ start () {
+ [ -d /var/run/nscd ] || mkdir /var/run/nscd
+- [ -d /var/db/nscd ] || mkdir /var/db/nscd
+ echo -n $"Starting $prog: "
+- daemon /usr/sbin/nscd
++ /usr/sbin/nscd
+ RETVAL=$?
+ echo
+ [ $RETVAL -eq 0 ] && touch /var/lock/subsys/nscd
+@@ -67,12 +66,10 @@
+ # a non-privileged user
+ rm -f /var/run/nscd/nscd.pid
+ rm -f /var/run/nscd/socket
+- success $"$prog shutdown"
+- else
+- failure $"$prog shutdown"
+ fi
+- echo
+- return $RETVAL
++ echo "Done."
++ # If nscd did not run, return 0 according to LSB.
++ return 0
+ }
+
+ restart() {
+@@ -104,7 +101,8 @@
+ ;;
+ force-reload | reload)
+ echo -n $"Reloading $prog: "
+- killproc /usr/sbin/nscd -HUP
++ # Use killall, initscripts-1.0-r115 don't support -HUP yet.
++ killall -HUP /usr/sbin/nscd
+ RETVAL=$?
+ echo
+ ;;
diff --git a/recipes/glibc/glibc-2.4/powerpc-sqrt-hack.diff b/recipes/glibc/glibc-2.10.1/powerpc-sqrt-hack.diff
index 1046efb2a1..1046efb2a1 100644
--- a/recipes/glibc/glibc-2.4/powerpc-sqrt-hack.diff
+++ b/recipes/glibc/glibc-2.10.1/powerpc-sqrt-hack.diff
diff --git a/recipes/glibc/glibc-2.10.1/sysdeps-nios2.patch b/recipes/glibc/glibc-2.10.1/sysdeps-nios2.patch
new file mode 100644
index 0000000000..f4529199e8
--- /dev/null
+++ b/recipes/glibc/glibc-2.10.1/sysdeps-nios2.patch
@@ -0,0 +1,4062 @@
+Index: glibc-2.10.1/sysdeps/nios2/Implies
+===================================================================
+--- /dev/null
++++ glibc-2.10.1/sysdeps/nios2/Implies
+@@ -0,0 +1,4 @@
++wordsize-32
++ieee754/dbl-64
++ieee754/flt-32
++nios2/soft-fp
+Index: glibc-2.10.1/sysdeps/nios2/Makefile
+===================================================================
+--- /dev/null
++++ glibc-2.10.1/sysdeps/nios2/Makefile
+@@ -0,0 +1,33 @@
++# Copyright (C) 1993, 1994, 1996, 1997, 2003, 2008 Free Software Foundation,
++# Inc.
++# This file is part of the GNU C Library.
++
++# The GNU C Library is free software; you can redistribute it and/or
++# modify it under the terms of the GNU Lesser General Public
++# License as published by the Free Software Foundation; either
++# version 2.1 of the License, or (at your option) any later version.
++
++# The GNU C Library is distributed in the hope that it will be useful,
++# but WITHOUT ANY WARRANTY; without even the implied warranty of
++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++# Lesser General Public License for more details.
++
++# You should have received a copy of the GNU Lesser General Public
++# License along with the GNU C Library; if not, write to the Free
++# Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
++# 02111-1307 USA.
++
++pic-ccflag = -fpic
++
++ifeq ($(subdir),elf)
++CFLAGS-rtld.c += -mhw-div
++endif
++
++ifeq ($(subdir),soft-fp)
++sysdep_routines += $(filter-out sqrtsf2,$(gcc-single-routines)) \
++ $(filter-out sqrtdf2,$(gcc-double-routines))
++endif
++
++ifeq ($(subdir),csu)
++gen-as-const-headers += tcb-offsets.sym
++endif
+Index: glibc-2.10.1/sysdeps/nios2/Subdirs
+===================================================================
+--- /dev/null
++++ glibc-2.10.1/sysdeps/nios2/Subdirs
+@@ -0,0 +1 @@
++soft-fp
+Index: glibc-2.10.1/sysdeps/nios2/Versions
+===================================================================
+--- /dev/null
++++ glibc-2.10.1/sysdeps/nios2/Versions
+@@ -0,0 +1,12 @@
++libc {
++ GLIBC_2.10 {
++ __adddf3; __addsf3; __divdf3; __divsf3; __eqdf2; __eqsf2; __extendsfdf2;
++ __fixdfdi; __fixdfsi; __fixsfdi; __fixsfsi;
++ __fixunsdfdi; __fixunsdfsi; __fixunssfdi; __fixunssfsi;
++ __floatdidf; __floatdisf; __floatsidf; __floatsisf;
++ __floatundidf; __floatundisf; __floatunsidf; __floatunsisf;
++ __gedf2; __gesf2; __gtdf2; __gtsf2; __ledf2; __lesf2; __ltdf2; __ltsf2;
++ __muldf3; __mulsf3; __nedf2; __nesf2; __negdf2; __negsf2;
++ __subdf3; __subsf3; __truncdfsf2; __unorddf2; __unordsf2;
++ }
++}
+Index: glibc-2.10.1/sysdeps/nios2/__longjmp.c
+===================================================================
+--- /dev/null
++++ glibc-2.10.1/sysdeps/nios2/__longjmp.c
+@@ -0,0 +1,41 @@
++/* Copyright (C) 1991, 92, 93, 94, 95, 97, 2008 Free Software Foundation, Inc.
++ This file is part of the GNU C Library.
++
++ The GNU C Library is free software; you can redistribute it and/or
++ modify it under the terms of the GNU Lesser General Public
++ License as published by the Free Software Foundation; either
++ version 2.1 of the License, or (at your option) any later version.
++
++ The GNU C Library is distributed in the hope that it will be useful,
++ but WITHOUT ANY WARRANTY; without even the implied warranty of
++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++ Lesser General Public License for more details.
++
++ You should have received a copy of the GNU Lesser General Public
++ License along with the GNU C Library; if not, write to the Free
++ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
++ 02111-1307 USA. */
++
++#include <setjmp.h>
++#include <stdlib.h>
++
++/* Jump to the position specified by ENV, causing the
++ setjmp call there to return VAL, or 1 if VAL is 0. */
++void
++__longjmp (__jmp_buf env, int val)
++{
++ if (val == 0)
++ val = 1;
++ __asm__ volatile ("mov r2, %0" : : "r" (val));
++ __asm__ volatile ("ldw r16, %0" : : "m" (env[0].__regs[0]));
++ __asm__ volatile ("ldw r17, %0" : : "m" (env[0].__regs[1]));
++ __asm__ volatile ("ldw r18, %0" : : "m" (env[0].__regs[2]));
++ __asm__ volatile ("ldw r19, %0" : : "m" (env[0].__regs[3]));
++ __asm__ volatile ("ldw r20, %0" : : "m" (env[0].__regs[4]));
++ __asm__ volatile ("ldw r21, %0" : : "m" (env[0].__regs[5]));
++ __asm__ volatile ("ldw r22, %0" : : "m" (env[0].__regs[6]));
++ __asm__ volatile ("ldw r23, %0" : : "m" (env[0].__regs[7]));
++ __asm__ volatile ("ldw sp, %0" : : "m" (env[0].__regs[8]));
++ __asm__ volatile ("ldw fp, %0" : : "m" (env[0].__regs[9]));
++ __asm__ volatile ("ldw ra, %0" : : "m" (env[0].__regs[10]));
++}
+Index: glibc-2.10.1/sysdeps/nios2/bits/endian.h
+===================================================================
+--- /dev/null
++++ glibc-2.10.1/sysdeps/nios2/bits/endian.h
+@@ -0,0 +1,12 @@
++/* The Nios II architecture has selectable endianness. */
++
++#ifndef _ENDIAN_H
++# error "Never use <bits/endian.h> directly; include <endian.h> instead."
++#endif
++
++#ifdef __nios2_big_endian__
++# define __BYTE_ORDER __BIG_ENDIAN
++#endif
++#ifdef __nios2_little_endian__
++# define __BYTE_ORDER __LITTLE_ENDIAN
++#endif
+Index: glibc-2.10.1/sysdeps/nios2/bits/link.h
+===================================================================
+--- /dev/null
++++ glibc-2.10.1/sysdeps/nios2/bits/link.h
+@@ -0,0 +1,54 @@
++/* Copyright (C) 2009 Free Software Foundation, Inc.
++ This file is part of the GNU C Library.
++
++ The GNU C Library is free software; you can redistribute it and/or
++ modify it under the terms of the GNU Lesser General Public
++ License as published by the Free Software Foundation; either
++ version 2.1 of the License, or (at your option) any later version.
++
++ The GNU C Library is distributed in the hope that it will be useful,
++ but WITHOUT ANY WARRANTY; without even the implied warranty of
++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++ Lesser General Public License for more details.
++
++ You should have received a copy of the GNU Lesser General Public
++ License along with the GNU C Library; if not, write to the Free
++ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
++ 02111-1307 USA. */
++
++#ifndef _LINK_H
++# error "Never include <bits/link.h> directly; use <link.h> instead."
++#endif
++
++/* Registers for entry into PLT on Nios II. */
++typedef struct La_nios2_regs
++{
++ uint32_t lr_reg[4]; /* r4 through r7 */
++ uint32_t lr_ra;
++ uint32_t lr_sp;
++} La_nios2_regs;
++
++/* Return values for calls from PLT on Nios II. */
++typedef struct La_nios2_retval
++{
++ uint32_t lrv_r2;
++ uint32_t lrv_r3;
++} La_nios2_retval;
++
++__BEGIN_DECLS
++
++extern Elf32_Addr la_nios2_gnu_pltenter (Elf32_Sym *__sym, unsigned int __ndx,
++ uintptr_t *__refcook,
++ uintptr_t *__defcook,
++ La_nios2_regs *__regs,
++ unsigned int *__flags,
++ const char *__symname,
++ long int *__framesizep);
++extern unsigned int la_nios2_gnu_pltexit (Elf32_Sym *__sym, unsigned int __ndx,
++ uintptr_t *__refcook,
++ uintptr_t *__defcook,
++ const La_nios2_regs *__inregs,
++ La_nios2_retval *__outregs,
++ const char *symname);
++
++__END_DECLS
+Index: glibc-2.10.1/sysdeps/nios2/bits/setjmp.h
+===================================================================
+--- /dev/null
++++ glibc-2.10.1/sysdeps/nios2/bits/setjmp.h
+@@ -0,0 +1,35 @@
++/* Define the machine-dependent type `jmp_buf'. Nios II version.
++ Copyright (C) 1992,1993,1995,1997,2000,2002,2003,2004,2005,2006,2008
++ Free Software Foundation, Inc.
++ This file is part of the GNU C Library.
++
++ The GNU C Library is free software; you can redistribute it and/or
++ modify it under the terms of the GNU Lesser General Public
++ License as published by the Free Software Foundation; either
++ version 2.1 of the License, or (at your option) any later version.
++
++ The GNU C Library is distributed in the hope that it will be useful,
++ but WITHOUT ANY WARRANTY; without even the implied warranty of
++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++ Lesser General Public License for more details.
++
++ You should have received a copy of the GNU Lesser General Public
++ License along with the GNU C Library; if not, write to the Free
++ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
++ 02111-1307 USA. */
++
++#ifndef _NIOS2_BITS_SETJMP_H
++#define _NIOS2_BITS_SETJMP_H 1
++
++#if !defined(_SETJMP_H) && !defined(_PTHREAD_H)
++# error "Never include <bits/setjmp.h> directly; use <setjmp.h> instead."
++#endif
++
++typedef struct
++ {
++ /* r16,r17,r18,r19,r20,r21,r22,r23,sp,fp,ra */
++ int __regs[11];
++
++ } __jmp_buf[1];
++
++#endif /* _NIOS2_BITS_SETJMP_H */
+Index: glibc-2.10.1/sysdeps/nios2/bsd-_setjmp.S
+===================================================================
+--- /dev/null
++++ glibc-2.10.1/sysdeps/nios2/bsd-_setjmp.S
+@@ -0,0 +1,40 @@
++/* BSD `_setjmp' entry point to `sigsetjmp (..., 1)'. NIOS2 version.
++ Copyright (C) 1996, 1997, 2000, 2008 Free Software Foundation, Inc.
++ This file is part of the GNU C Library.
++
++ The GNU C Library is free software; you can redistribute it and/or
++ modify it under the terms of the GNU Lesser General Public
++ License as published by the Free Software Foundation; either
++ version 2.1 of the License, or (at your option) any later version.
++
++ The GNU C Library is distributed in the hope that it will be useful,
++ but WITHOUT ANY WARRANTY; without even the implied warranty of
++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++ Lesser General Public License for more details.
++
++ You should have received a copy of the GNU Lesser General Public
++ License along with the GNU C Library; if not, write to the Free
++ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
++ 02111-1307 USA. */
++
++/* This just does a tail-call to `__sigsetjmp (ARG, 1)'.
++ We cannot do it in C because it must be a tail-call, so frame-unwinding
++ in setjmp doesn't clobber the state restored by longjmp. */
++
++#include <sysdep.h>
++
++ENTRY (_setjmp)
++ movi r5, 0 /* Pass a second argument of zero. */
++#if defined (__PIC__) || defined (PIC)
++ nextpc r2
++1: movhi r3, %hiadj(_GLOBAL_OFFSET_TABLE_ - 1b)
++ addi r3, r3, %lo(_GLOBAL_OFFSET_TABLE_ - 1b)
++ add r2, r2, r3
++ ldw r2, %call(C_SYMBOL_NAME(__sigsetjmp))(r2)
++ jmp r2
++#else
++ jmpi C_SYMBOL_NAME (__sigsetjmp)
++#endif
++ .size setjmp, . - setjmp
++
++libc_hidden_def (_setjmp)
+Index: glibc-2.10.1/sysdeps/nios2/bsd-setjmp.S
+===================================================================
+--- /dev/null
++++ glibc-2.10.1/sysdeps/nios2/bsd-setjmp.S
+@@ -0,0 +1,38 @@
++/* BSD `setjmp' entry point to `sigsetjmp (..., 1)'. NIOS2 version.
++ Copyright (C) 1996, 1997, 2000, 2008 Free Software Foundation, Inc.
++ This file is part of the GNU C Library.
++
++ The GNU C Library is free software; you can redistribute it and/or
++ modify it under the terms of the GNU Lesser General Public
++ License as published by the Free Software Foundation; either
++ version 2.1 of the License, or (at your option) any later version.
++
++ The GNU C Library is distributed in the hope that it will be useful,
++ but WITHOUT ANY WARRANTY; without even the implied warranty of
++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++ Lesser General Public License for more details.
++
++ You should have received a copy of the GNU Lesser General Public
++ License along with the GNU C Library; if not, write to the Free
++ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
++ 02111-1307 USA. */
++
++/* This just does a tail-call to `__sigsetjmp (ARG, 1)'.
++ We cannot do it in C because it must be a tail-call, so frame-unwinding
++ in setjmp doesn't clobber the state restored by longjmp. */
++
++#include <sysdep.h>
++
++ENTRY (setjmp)
++ movi r5, 1 /* Pass a second argument of one. */
++#if defined (__PIC__) || defined (PIC)
++ nextpc r2
++1: movhi r3, %hiadj(_GLOBAL_OFFSET_TABLE_ - 1b)
++ addi r3, r3, %lo(_GLOBAL_OFFSET_TABLE_ - 1b)
++ add r2, r2, r3
++ ldw r2, %call(C_SYMBOL_NAME(__sigsetjmp))(r2)
++ jmp r2
++#else
++ jmpi C_SYMBOL_NAME (__sigsetjmp)
++#endif
++ .size setjmp, . - setjmp
+Index: glibc-2.10.1/sysdeps/nios2/dl-init.c
+===================================================================
+--- /dev/null
++++ glibc-2.10.1/sysdeps/nios2/dl-init.c
+@@ -0,0 +1,30 @@
++/* Copyright (C) 2008 Free Software Foundation, Inc.
++ This file is part of the GNU C Library.
++
++ The GNU C Library is free software; you can redistribute it and/or
++ modify it under the terms of the GNU Lesser General Public
++ License as published by the Free Software Foundation; either
++ version 2.1 of the License, or (at your option) any later version.
++
++ The GNU C Library is distributed in the hope that it will be useful,
++ but WITHOUT ANY WARRANTY; without even the implied warranty of
++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++ Lesser General Public License for more details.
++
++ You should have received a copy of the GNU Lesser General Public
++ License along with the GNU C Library; if not, write to the Free
++ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
++ 02111-1307 USA. */
++
++#include <elf/dl-init.c>
++
++unsigned int
++internal_function
++_dl_nios2_get_gp_value (struct link_map *main_map)
++{
++ ElfW(Dyn)* dyn = main_map->l_ld;
++ for (dyn = main_map->l_ld; dyn->d_tag != DT_NULL; ++dyn)
++ if (dyn->d_tag == DT_NIOS2_GP)
++ return (unsigned int)(dyn->d_un.d_ptr);
++ return 0;
++}
+Index: glibc-2.10.1/sysdeps/nios2/dl-machine.h
+===================================================================
+--- /dev/null
++++ glibc-2.10.1/sysdeps/nios2/dl-machine.h
+@@ -0,0 +1,332 @@
++/* Machine-dependent ELF dynamic relocation inline functions. Nios II version.
++ Copyright (C) 1995, 1996, 1997, 1999, 2000, 2001, 2005
++ Free Software Foundation, Inc.
++ This file is part of the GNU C Library.
++
++ The GNU C Library is free software; you can redistribute it and/or
++ modify it under the terms of the GNU Lesser General Public
++ License as published by the Free Software Foundation; either
++ version 2.1 of the License, or (at your option) any later version.
++
++ The GNU C Library is distributed in the hope that it will be useful,
++ but WITHOUT ANY WARRANTY; without even the implied warranty of
++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++ Lesser General Public License for more details.
++
++ You should have received a copy of the GNU Lesser General Public
++ License along with the GNU C Library; if not, write to the Free
++ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
++ 02111-1307 USA. */
++
++#ifndef dl_machine_h
++#define dl_machine_h
++
++#define ELF_MACHINE_NAME "nios2"
++
++#include <string.h>
++#include <link.h>
++#include <dl-tls.h>
++
++/* Return nonzero iff ELF header is compatible with the running host. */
++static inline int
++elf_machine_matches_host (const Elf32_Ehdr *ehdr)
++{
++ return ehdr->e_machine == EM_ALTERA_NIOS2;
++}
++
++
++/* Return the link-time address of _DYNAMIC. Conveniently, this is the
++ first element of the GOT. */
++static inline Elf32_Addr
++elf_machine_dynamic (void)
++{
++ Elf32_Addr *dynamic;
++ int tmp;
++ asm("nextpc\t%0\n\t"
++ "1: movhi\t%1, %%hiadj(_GLOBAL_OFFSET_TABLE_ - 1b)\n\t"
++ "addi\t%1, %1, %%lo( _GLOBAL_OFFSET_TABLE_ - 1b)\n\t"
++ "add\t%0, %0, %1\n"
++ : "=r" (dynamic), "=r" (tmp));
++ return *dynamic;
++}
++
++
++/* Return the run-time load address of the shared object. */
++static inline Elf32_Addr
++elf_machine_load_address (void)
++{
++ Elf32_Addr result;
++ int tmp;
++ asm("nextpc\t%0\n\t"
++ "1: movhi\t%1, %%hiadj(1b)\n\t"
++ "addi\t%1, %1, %%lo(1b)\n\t"
++ "sub\t%0, %0, %1\n"
++ : "=r" (result), "=r" (tmp));
++ return result;
++}
++
++/* Set up the loaded object described by L so its unrelocated PLT
++ entries will jump to the on-demand fixup code in dl-runtime.c. */
++
++static inline int
++elf_machine_runtime_setup (struct link_map *l, int lazy, int profile)
++{
++ extern void _dl_runtime_resolve (Elf32_Word);
++
++ if (lazy)
++ {
++ /* The GOT entries for functions in the PLT have not yet been filled
++ in. Their initial contents will arrange when called to load r15 with
++ an offset into the .got section, load r14 with
++ _GLOBAL_OFFSET_TABLE_[1], and then jump to _GLOBAL_OFFSET_TABLE[2].
++ */
++ Elf32_Addr *got = (Elf32_Addr *) D_PTR (l, l_info[DT_PLTGOT]);
++ got[1] = (Elf32_Addr) l; /* Identify this shared object. */
++
++ /* This function will get called to fix up the GOT entry indicated by
++ the offset on the stack, and then jump to the resolved address. */
++ got[2] = (Elf32_Addr) &_dl_runtime_resolve;
++ }
++
++ return lazy;
++}
++
++/* Initial entry point code for the dynamic linker.
++ The C function `_dl_start' is the real entry point;
++ its return value is the user program's entry point. */
++
++#define RTLD_START asm("\
++.text\n\
++.globl _start\n\
++.type _start, %function\n\
++_start:\n\
++ /* At start time, all the args are on the stack. */\n\
++ mov r4, sp\n\
++\n\
++ /* Start the calculation of the GOT pointer. */\n\
++ nextpc r22\n\
++1: movhi r8, %hiadj(_GLOBAL_OFFSET_TABLE_ - 1b)\n\
++ addi r8, r8, %lo(_GLOBAL_OFFSET_TABLE_ - 1b)\n\
++\n\
++ /* Figure out where _dl_start will need to return to. */\n\
++ movhi ra, %hiadj(2f - 1b)\n\
++ addi ra, ra, %lo(2f - 1b)\n\
++ add ra, ra, r22\n\
++\n\
++ /* Finish the calculation of the GOT pointer. */\n\
++ add r22, r22, r8\n\
++\n\
++ br _dl_start\n\
++\n\
++ /* Save the returned user entry point. */\n\
++2: mov r16, r2\n\
++\n\
++ /* Initialize gp. */\n\
++ ldw r4, %got(_rtld_local)(r22)\n\
++ ldw r4, 0(r4)\n\
++ ldw r8, %call(_dl_nios2_get_gp_value)(r22)\n\
++ callr r8\n\
++ mov gp, r2\n\
++\n\
++ /* Find the number of arguments to skip. */\n\
++ ldw r8, %got(_dl_skip_args)(r22)\n\
++ ldw r8, 0(r8)\n\
++\n\
++ /* Find the main_map from the GOT. */\n\
++ ldw r4, %got(_rtld_local)(r22)\n\
++ ldw r4, 0(r4)\n\
++\n\
++ /* Find argc. */\n\
++ ldw r5, 0(sp)\n\
++ sub r5, r5, r8\n\
++ stw r5, 0(sp)\n\
++\n\
++ /* Find the first unskipped argument. */\n\
++ slli r8, r8, 2\n\
++ addi r6, sp, 4\n\
++ add r9, r6, r8\n\
++ mov r10, r6\n\
++\n\
++ /* Shuffle argv down. */\n\
++3: ldw r11, 0(r9)\n\
++ stw r11, 0(r10)\n\
++ addi r9, r9, 4\n\
++ addi r10, r10, 4\n\
++ bne r11, zero, 3b\n\
++\n\
++ /* Shuffle envp down. */\n\
++ mov r7, r10\n\
++4: ldw r11, 0(r9)\n\
++ stw r11, 0(r10)\n\
++ addi r9, r9, 4\n\
++ addi r10, r10, 4\n\
++ bne r11, zero, 4b\n\
++\n\
++ /* Shuffle auxv down. */\n\
++5: ldw r11, 4(r9)\n\
++ stw r11, 4(r10)\n\
++ ldw r11, 0(r9)\n\
++ stw r11, 0(r10)\n\
++ addi r9, r9, 8\n\
++ addi r10, r10, 8\n\
++ bne r11, zero, 5b\n\
++\n\
++ /* Update _dl_argv. */\n\
++ ldw r2, %got(_dl_argv)(r22)\n\
++ stw r6, 0(r2)\n\
++\n\
++ /* Call _dl_init through the PLT. */\n\
++ ldw r8, %call(_dl_init)(r22)\n\
++ callr r8\n\
++\n\
++ /* Find the finalization function. */\n\
++ ldw r4, %got(_dl_fini)(r22)\n\
++\n\
++ /* Jump to the user's entry point. */\n\
++ jmp r16\n\
++");
++
++/* ELF_RTYPE_CLASS_PLT iff TYPE describes relocation of a PLT entry, so
++ PLT entries should not be allowed to define the value.
++ ELF_RTYPE_CLASS_NOCOPY iff TYPE should not be allowed to resolve to one
++ of the main executable's symbols, as for a COPY reloc. */
++#define elf_machine_type_class(type) \
++ ((((type) == R_NIOS2_JUMP_SLOT) * ELF_RTYPE_CLASS_PLT) \
++ | (((type) == R_NIOS2_COPY) * ELF_RTYPE_CLASS_COPY))
++
++/* A reloc type used for ld.so cmdline arg lookups to reject PLT entries. */
++#define ELF_MACHINE_JMP_SLOT R_NIOS2_JUMP_SLOT
++
++/* The Nios II never uses Elf32_Rel relocations. */
++#define ELF_MACHINE_NO_REL 1
++
++/* Fixup a PLT entry to bounce directly to the function at VALUE. */
++
++static inline Elf32_Addr
++elf_machine_fixup_plt (struct link_map *map, lookup_t t,
++ const Elf32_Rel *reloc,
++ Elf32_Addr *reloc_addr, Elf32_Addr value)
++{
++ return *reloc_addr = value;
++}
++
++/* Return the final value of a plt relocation. */
++static inline Elf32_Addr
++elf_machine_plt_value (struct link_map *map, const Elf32_Rela *reloc,
++ Elf32_Addr value)
++{
++ return value;
++}
++
++/* Names of the architecture-specific auditing callback functions. */
++#define ARCH_LA_PLTENTER nios2_gnu_pltenter
++#define ARCH_LA_PLTEXIT nios2_gnu_pltexit
++
++#endif /* dl_machine_h */
++
++#ifdef RESOLVE_MAP
++
++/* Perform the relocation specified by RELOC and SYM (which is fully resolved).
++ LOADADDR is the load address of the object; INFO is an array indexed
++ by DT_* of the .dynamic section info. */
++
++auto inline void __attribute__ ((always_inline))
++elf_machine_rela (struct link_map *map, const ElfW(Rela) *reloc,
++ const ElfW(Sym) *sym, const struct r_found_version *version,
++ void *const reloc_addr_arg)
++{
++ Elf32_Addr *const reloc_addr = reloc_addr_arg;
++ const unsigned int r_type = ELF32_R_TYPE (reloc->r_info);
++
++ if (__builtin_expect (r_type == R_NIOS2_RELATIVE, 0))
++ *reloc_addr = map->l_addr + reloc->r_addend;
++ else if (__builtin_expect (r_type == R_NIOS2_NONE, 0))
++ return;
++ else
++ {
++ const Elf32_Sym *const refsym = sym;
++ struct link_map *sym_map = RESOLVE_MAP (&sym, version, r_type);
++ Elf32_Addr value = sym == NULL ? 0 : sym_map->l_addr + sym->st_value;
++
++ switch (r_type)
++ {
++ case R_NIOS2_COPY:
++ if (sym == NULL)
++ /* This can happen in trace mode if an object could not be
++ found. */
++ break;
++ if (sym->st_size > refsym->st_size
++ || (sym->st_size < refsym->st_size && GLRO(dl_verbose)))
++ {
++ const char *strtab;
++
++ strtab = (const void *) D_PTR (map, l_info[DT_STRTAB]);
++ _dl_error_printf ("\
++%s: Symbol `%s' has different size in shared object, consider re-linking\n",
++ rtld_progname ?: "<program name unknown>",
++ strtab + refsym->st_name);
++ }
++ memcpy (reloc_addr_arg, (void *) value,
++ MIN (sym->st_size, refsym->st_size));
++ break;
++ case R_NIOS2_GLOB_DAT:
++ case R_NIOS2_JUMP_SLOT:
++# ifdef RTLD_BOOTSTRAP
++ /* Fix weak undefined references. */
++ if (sym != NULL && sym->st_value == 0)
++ *reloc_addr = 0;
++ else
++# endif
++ *reloc_addr = value;
++ break;
++#if defined USE_TLS && !defined RTLD_BOOTSTRAP
++ case R_NIOS2_TLS_DTPMOD:
++ /* Get the information from the link map returned by the
++ resolv function. */
++ if (sym_map != NULL)
++ *reloc_addr = sym_map->l_tls_modid;
++ break;
++
++ case R_NIOS2_TLS_DTPREL:
++ *reloc_addr = reloc->r_addend + TLS_DTPREL_VALUE(sym);
++ break;
++
++ case R_NIOS2_TLS_TPREL:
++ if (sym != NULL)
++ {
++ CHECK_STATIC_TLS (map, sym_map);
++ *reloc_addr = reloc->r_addend + TLS_TPREL_VALUE(sym_map, sym);
++ }
++ break;
++#endif
++ case R_NIOS2_BFD_RELOC_32:
++ *reloc_addr = value + reloc->r_addend;
++ break;
++
++ default:
++ _dl_reloc_bad_type (map, r_type, 0);
++ break;
++ }
++ }
++}
++
++auto inline void __attribute__((always_inline))
++ elf_machine_rela_relative (ElfW(Addr) l_addr, const ElfW(Rela) *reloc,
++ void *const reloc_addr_arg)
++{
++ Elf32_Addr *const reloc_addr = reloc_addr_arg;
++ *reloc_addr = l_addr + reloc->r_addend;
++}
++
++auto inline void __attribute__((always_inline))
++ elf_machine_lazy_rel (struct link_map *map,
++ ElfW(Addr) l_addr, const ElfW(Rela) *reloc)
++{
++ Elf32_Addr *const reloc_addr = (void *) (l_addr + reloc->r_offset);
++ if (ELF32_R_TYPE (reloc->r_info) == R_NIOS2_JUMP_SLOT)
++ *reloc_addr += l_addr;
++ else
++ _dl_reloc_bad_type (map, ELF32_R_TYPE (reloc->r_info), 1);
++}
++
++#endif /* RESOLVE_MAP */
+Index: glibc-2.10.1/sysdeps/nios2/dl-sysdep.h
+===================================================================
+--- /dev/null
++++ glibc-2.10.1/sysdeps/nios2/dl-sysdep.h
+@@ -0,0 +1,24 @@
++/* System-specific settings for dynamic linker code. Nios II version.
++ Copyright (C) 2009 Free Software Foundation, Inc.
++ This file is part of the GNU C Library.
++
++ The GNU C Library is free software; you can redistribute it and/or
++ modify it under the terms of the GNU Lesser General Public
++ License as published by the Free Software Foundation; either
++ version 2.1 of the License, or (at your option) any later version.
++
++ The GNU C Library is distributed in the hope that it will be useful,
++ but WITHOUT ANY WARRANTY; without even the implied warranty of
++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++ Lesser General Public License for more details.
++
++ You should have received a copy of the GNU Lesser General Public
++ License along with the GNU C Library; if not, write to the Free
++ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
++ 02111-1307 USA. */
++
++#include_next <dl-sysdep.h>
++
++/* _dl_argv cannot be attribute_relro, because _dl_start_user
++ might write into it after _dl_start returns. */
++#define DL_ARGV_NOT_RELRO 1
+Index: glibc-2.10.1/sysdeps/nios2/dl-tls.h
+===================================================================
+--- /dev/null
++++ glibc-2.10.1/sysdeps/nios2/dl-tls.h
+@@ -0,0 +1,46 @@
++/* Thread-local storage handling in the ELF dynamic linker. Nios II version.
++ Copyright (C) 2005 Free Software Foundation, Inc.
++ This file is part of the GNU C Library.
++
++ The GNU C Library is free software; you can redistribute it and/or
++ modify it under the terms of the GNU Lesser General Public
++ License as published by the Free Software Foundation; either
++ version 2.1 of the License, or (at your option) any later version.
++
++ The GNU C Library is distributed in the hope that it will be useful,
++ but WITHOUT ANY WARRANTY; without even the implied warranty of
++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++ Lesser General Public License for more details.
++
++ You should have received a copy of the GNU Lesser General Public
++ License along with the GNU C Library; if not, write to the Free
++ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
++ 02111-1307 USA. */
++
++
++/* Type used for the representation of TLS information in the GOT. */
++typedef struct
++{
++ unsigned long int ti_module;
++ unsigned long int ti_offset;
++} tls_index;
++
++/* The thread pointer points 0x7000 past the first static TLS block. */
++#define TLS_TP_OFFSET 0x7000
++
++/* Dynamic thread vector pointers point 0x8000 past the start of each
++ TLS block. */
++#define TLS_DTV_OFFSET 0x8000
++
++/* Compute the value for a GOTTPREL reloc. */
++#define TLS_TPREL_VALUE(sym_map, sym) \
++ ((sym_map)->l_tls_offset + (sym)->st_value - TLS_TP_OFFSET)
++
++/* Compute the value for a DTPREL reloc. */
++#define TLS_DTPREL_VALUE(sym) \
++ ((sym)->st_value - TLS_DTV_OFFSET)
++
++extern void *__tls_get_addr (tls_index *ti);
++
++# define GET_ADDR_OFFSET (ti->ti_offset + TLS_DTV_OFFSET)
++# define __TLS_GET_ADDR(__ti) (__tls_get_addr (__ti) - TLS_DTV_OFFSET)
+Index: glibc-2.10.1/sysdeps/nios2/dl-trampoline.S
+===================================================================
+--- /dev/null
++++ glibc-2.10.1/sysdeps/nios2/dl-trampoline.S
+@@ -0,0 +1,80 @@
++/* PLT trampolines. Nios II version.
++ Copyright (C) 2005 Free Software Foundation, Inc.
++ This file is part of the GNU C Library.
++
++ The GNU C Library is free software; you can redistribute it and/or
++ modify it under the terms of the GNU Lesser General Public
++ License as published by the Free Software Foundation; either
++ version 2.1 of the License, or (at your option) any later version.
++
++ The GNU C Library is distributed in the hope that it will be useful,
++ but WITHOUT ANY WARRANTY; without even the implied warranty of
++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++ Lesser General Public License for more details.
++
++ You should have received a copy of the GNU Lesser General Public
++ License along with the GNU C Library; if not, write to the Free
++ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
++ 02111-1307 USA. */
++
++#include <sysdep.h>
++#include <libc-symbols.h>
++
++ .text
++ .globl _dl_runtime_resolve
++ cfi_startproc
++_dl_runtime_resolve:
++/* The runtime resolver receives the original function arguments in r4
++ through r7, the shared library identifier from GOT[1]? in r14, and the
++ relocation index times four in r15. It updates the corresponding PLT GOT
++ entry so that the PLT entry will transfer control directly to the target
++ in the future, and then transfers control to the target. */
++ /* Save arguments and return address. */
++ subi sp, sp, 28
++ cfi_adjust_cfa_offset (28)
++ stw r22, 24(sp)
++ cfi_rel_offset (r22, 24)
++ stw r8, 20(sp) /* save r8, because this might be a call to mcount */
++ cfi_rel_offset (r8, 20)
++ stw r7, 16(sp)
++ cfi_rel_offset (r7, 16)
++ stw r6, 12(sp)
++ cfi_rel_offset (r6, 12)
++ stw r5, 8(sp)
++ cfi_rel_offset (r5, 8)
++ stw r4, 4(sp)
++ cfi_rel_offset (r4, 4)
++ stw ra, 0(sp)
++ cfi_rel_offset (ra, 0)
++
++ /* Get pointer to linker struct. */
++ mov r4, r14
++
++ /* Get the relocation offset. We're given a multiple of 4 and
++ need a multiple of 12, so multiply by 3. */
++ slli r5, r15, 1
++ add r5, r5, r15
++
++ /* Call the fixup routine. */
++ nextpc r22
++1: movhi r2, %hiadj(_GLOBAL_OFFSET_TABLE_ - 1b)
++ addi r2, r2, %lo(_GLOBAL_OFFSET_TABLE_ - 1b)
++ add r22, r22, r2
++ ldw r2, %call(_dl_fixup)(r22)
++ callr r2
++
++ /* Restore the arguments and return address. */
++ ldw ra, 0(sp)
++ ldw r4, 4(sp)
++ ldw r5, 8(sp)
++ ldw r6, 12(sp)
++ ldw r7, 16(sp)
++ ldw r8, 20(sp)
++ ldw r22, 24(sp)
++ addi sp, sp, 28
++ cfi_adjust_cfa_offset (-28)
++
++ /* Jump to the newly found address. */
++ jmp r2
++
++ cfi_endproc
+Index: glibc-2.10.1/sysdeps/nios2/elf/start.S
+===================================================================
+--- /dev/null
++++ glibc-2.10.1/sysdeps/nios2/elf/start.S
+@@ -0,0 +1,132 @@
++/* Startup code for Nios II
++ Copyright (C) 1995, 1996, 1997, 1998, 2001, 2002, 2005
++ Free Software Foundation, Inc.
++ This file is part of the GNU C Library.
++
++ The GNU C Library is free software; you can redistribute it and/or
++ modify it under the terms of the GNU Lesser General Public
++ License as published by the Free Software Foundation; either
++ version 2.1 of the License, or (at your option) any later version.
++
++ In addition to the permissions in the GNU Lesser General Public
++ License, the Free Software Foundation gives you unlimited
++ permission to link the compiled version of this file with other
++ programs, and to distribute those programs without any restriction
++ coming from the use of this file. (The GNU Lesser General Public
++ License restrictions do apply in other respects; for example, they
++ cover modification of the file, and distribution when not linked
++ into another program.)
++
++ Note that people who make modified versions of this file are not
++ obligated to grant this special exception for their modified
++ versions; it is their choice whether to do so. The GNU Lesser
++ General Public License gives permission to release a modified
++ version without this exception; this exception also makes it
++ possible to release a modified version which carries forward this
++ exception.
++
++ The GNU C Library is distributed in the hope that it will be useful,
++ but WITHOUT ANY WARRANTY; without even the implied warranty of
++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++ Lesser General Public License for more details.
++
++ You should have received a copy of the GNU Lesser General Public
++ License along with the GNU C Library; if not, write to the Free
++ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
++ 02111-1307 USA. */
++
++/* This is the canonical entry point, usually the first thing in the text
++ segment.
++
++ Note that the code in the .init section has already been run.
++ This includes _init and _libc_init
++
++ The stack pointer, sp, will point to the argument count on the stack.
++ The initial state of the stack when a userspace process is started is:
++
++ Purpose Start Address Length
++ Unspecified High Addresses
++ Referenced strings, etc. Varies
++ Unspecified
++ Null auxilliary vector entry 4bytes
++ Auxilliary vector entries 8bytes each
++ NULL terminator for envp 4bytes
++ Environment pointers sp+8+4*argc 4bytes each
++ NULL terminator for argv sp+4+4*argc 4bytes
++ Argument pointers sp+4 4bytes each
++ Argument count sp 4bytes
++ Unspecified Low Addresses
++
++ If the application should register a destructor function with atexit,
++ the pointer will be placed in r4. Otherwise r4 will be zero.
++
++ The contents of all other registers are unspecified. User code should
++ set fp to zero to mark the end of the frame chain.
++
++ The auxilliary vector is a series of pairs of 32-bit tag and 32-bit
++ value, terminated by an AT_NULL tag.
++*/
++
++ .text
++ .globl _start
++_start:
++ /* Set up the global pointer. */
++ movhi gp, %hiadj(_gp)
++ addi gp, gp, %lo(_gp)
++
++ /* Save the stack pointer. */
++ mov r2, sp
++
++ /* Create room on the stack for the fini, rtld_fini and stack_end args
++ to __libc_start_main. */
++ subi sp, sp, 12
++
++ /* Push stack_end */
++ stw r2, 8(sp)
++
++ /* Push rtld_fini */
++ stw r4, 4(sp)
++
++ /* Set up the GOT pointer. */
++ nextpc r22
++1: movhi r2, %hiadj(_GLOBAL_OFFSET_TABLE_ - 1b)
++ addi r2, r2, %lo(_GLOBAL_OFFSET_TABLE_ - 1b)
++ add r22, r22, r2
++
++ /* Push fini */
++ ldw r8, %call(__libc_csu_fini)(r22)
++ stw r8, 0(sp)
++
++ /* r7 == init */
++ ldw r7, %call(__libc_csu_init)(r22)
++
++ /* r6 == argv */
++ addi r6, sp, 16
++
++ /* r5 == argc */
++ ldw r5, 12(sp)
++
++ /* r4 == main */
++ ldw r4, %call(main)(r22)
++
++ /* fp == 0 */
++ mov fp, zero
++
++ /* __libc_start_main (main, argc, argv, init, fini, rtld_fini,
++ stack_end) */
++
++ /* Let the libc call main and exit with its return code. */
++ ldw r2, %call(__libc_start_main)(r22)
++ callr r2
++
++ /* should never get here....*/
++ ldw r2, %call(abort)(r22)
++ callr r2
++
++/* Define a symbol for the first piece of initialized data. */
++ .data
++ .globl __data_start
++__data_start:
++ .long 0
++ .weak data_start
++ data_start = __data_start
+Index: glibc-2.10.1/sysdeps/nios2/jmpbuf-offsets.h
+===================================================================
+--- /dev/null
++++ glibc-2.10.1/sysdeps/nios2/jmpbuf-offsets.h
+@@ -0,0 +1,20 @@
++/* Private macros for accessing __jmp_buf contents. Nios II version.
++ Copyright (C) 2006, 2008 Free Software Foundation, Inc.
++ This file is part of the GNU C Library.
++
++ The GNU C Library is free software; you can redistribute it and/or
++ modify it under the terms of the GNU Lesser General Public
++ License as published by the Free Software Foundation; either
++ version 2.1 of the License, or (at your option) any later version.
++
++ The GNU C Library is distributed in the hope that it will be useful,
++ but WITHOUT ANY WARRANTY; without even the implied warranty of
++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++ Lesser General Public License for more details.
++
++ You should have received a copy of the GNU Lesser General Public
++ License along with the GNU C Library; if not, write to the Free
++ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
++ 02111-1307 USA. */
++
++#define __JMP_BUF_SP 8
+Index: glibc-2.10.1/sysdeps/nios2/jmpbuf-unwind.h
+===================================================================
+--- /dev/null
++++ glibc-2.10.1/sysdeps/nios2/jmpbuf-unwind.h
+@@ -0,0 +1,36 @@
++/* Copyright (C) 2005,2006 Free Software Foundation, Inc.
++ This file is part of the GNU C Library.
++
++ The GNU C Library is free software; you can redistribute it and/or
++ modify it under the terms of the GNU Lesser General Public
++ License as published by the Free Software Foundation; either
++ version 2.1 of the License, or (at your option) any later version.
++
++ The GNU C Library is distributed in the hope that it will be useful,
++ but WITHOUT ANY WARRANTY; without even the implied warranty of
++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++ Lesser General Public License for more details.
++
++ You should have received a copy of the GNU Lesser General Public
++ License along with the GNU C Library; if not, write to the Free
++ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
++ 02111-1307 USA. */
++
++#include <setjmp.h>
++#include <jmpbuf-offsets.h>
++#include <stdint.h>
++#include <unwind.h>
++
++/* Test if longjmp to JMPBUF would unwind the frame
++ containing a local variable at ADDRESS. */
++#define _JMPBUF_UNWINDS(jmpbuf, address, demangle) \
++ ((void *) (address) < (void *) demangle ((jmpbuf)->__regs[__JMP_BUF_SP]))
++
++#define _JMPBUF_CFA_UNWINDS_ADJ(_jmpbuf, _context, _adj) \
++ _JMPBUF_UNWINDS_ADJ (_jmpbuf, (void *) _Unwind_GetCFA (_context), _adj)
++
++#define _JMPBUF_UNWINDS_ADJ(_jmpbuf, _address, _adj) \
++ ((uintptr_t) (_address) - (_adj) < (uintptr_t) (_jmpbuf)->__regs[__JMP_BUF_SP] - (_adj))
++
++/* We use the normal longjmp for unwinding. */
++#define __libc_unwind_longjmp(buf, val) __libc_longjmp (buf, val)
+Index: glibc-2.10.1/sysdeps/nios2/ldsodefs.h
+===================================================================
+--- /dev/null
++++ glibc-2.10.1/sysdeps/nios2/ldsodefs.h
+@@ -0,0 +1,42 @@
++/* Run-time dynamic linker data structures for loaded ELF shared objects.
++ Copyright (C) 2000, 2002, 2003, 2006, 2007 Free Software Foundation, Inc.
++ This file is part of the GNU C Library.
++
++ The GNU C Library is free software; you can redistribute it and/or
++ modify it under the terms of the GNU Lesser General Public
++ License as published by the Free Software Foundation; either
++ version 2.1 of the License, or (at your option) any later version.
++
++ The GNU C Library is distributed in the hope that it will be useful,
++ but WITHOUT ANY WARRANTY; without even the implied warranty of
++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++ Lesser General Public License for more details.
++
++ You should have received a copy of the GNU Lesser General Public
++ License along with the GNU C Library; if not, write to the Free
++ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
++ 02111-1307 USA. */
++
++#ifndef _NIOS2_LDSODEFS_H
++#define _NIOS2_LDSODEFS_H 1
++
++struct La_nios2_regs;
++struct La_nios2_retval;
++
++#define ARCH_PLTENTER_MEMBERS \
++ Elf32_Addr (*nios2_gnu_pltenter) (Elf32_Sym *, unsigned int, \
++ uintptr_t *, uintptr_t *, \
++ const struct La_nios2_regs *, \
++ unsigned int *, const char *name, \
++ long int *framesizep);
++
++#define ARCH_PLTEXIT_MEMBERS \
++ unsigned int (*nios2_gnu_pltexit) (Elf64_Sym *, unsigned int, \
++ uintptr_t *, uintptr_t *, \
++ const struct La_nios2_regs *, \
++ struct La_nios2_retval *, \
++ const char *);
++
++#include_next <ldsodefs.h>
++
++#endif
+Index: glibc-2.10.1/sysdeps/nios2/libc-tls.c
+===================================================================
+--- /dev/null
++++ glibc-2.10.1/sysdeps/nios2/libc-tls.c
+@@ -0,0 +1,37 @@
++/* Thread-local storage handling in the ELF dynamic linker. Nios II version.
++ Copyright (C) 2005, 2008 Free Software Foundation, Inc.
++ This file is part of the GNU C Library.
++
++ The GNU C Library is free software; you can redistribute it and/or
++ modify it under the terms of the GNU Lesser General Public
++ License as published by the Free Software Foundation; either
++ version 2.1 of the License, or (at your option) any later version.
++
++ The GNU C Library is distributed in the hope that it will be useful,
++ but WITHOUT ANY WARRANTY; without even the implied warranty of
++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++ Lesser General Public License for more details.
++
++ You should have received a copy of the GNU Lesser General Public
++ License along with the GNU C Library; if not, write to the Free
++ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
++ 02111-1307 USA. */
++
++#include <csu/libc-tls.c>
++#include <dl-tls.h>
++
++#if USE_TLS
++
++/* On Nios II, linker optimizations are not required, so __tls_get_addr
++ can be called even in statically linked binaries. In this case module
++ must be always 1 and PT_TLS segment exist in the binary, otherwise it
++ would not link. */
++
++void *
++__tls_get_addr (tls_index *ti)
++{
++ dtv_t *dtv = THREAD_DTV ();
++ return (char *) dtv[1].pointer.val + GET_ADDR_OFFSET;
++}
++
++#endif
+Index: glibc-2.10.1/sysdeps/nios2/machine-gmon.h
+===================================================================
+--- /dev/null
++++ glibc-2.10.1/sysdeps/nios2/machine-gmon.h
+@@ -0,0 +1,67 @@
++/* Machine-dependent definitions for profiling support. Nios II version.
++ Copyright (C) 1996, 1997, 1998, 2008 Free Software Foundation, Inc.
++ This file is part of the GNU C Library.
++
++ The GNU C Library is free software; you can redistribute it and/or
++ modify it under the terms of the GNU Lesser General Public
++ License as published by the Free Software Foundation; either
++ version 2.1 of the License, or (at your option) any later version.
++
++ The GNU C Library is distributed in the hope that it will be useful,
++ but WITHOUT ANY WARRANTY; without even the implied warranty of
++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++ Lesser General Public License for more details.
++
++ You should have received a copy of the GNU Lesser General Public
++ License along with the GNU C Library; if not, write to the Free
++ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
++ 02111-1307 USA. */
++
++#include <sysdep.h>
++
++#define _MCOUNT_DECL(frompc, selfpc) \
++static void __attribute_used__ mcount_internal (u_long frompc, u_long selfpc)
++
++/* This macro/func MUST save r4, r5, r6, r7 and r8 because the compiler inserts
++ blind calls to mcount(), ignoring the fact that mcount may clobber
++ registers; therefore, mcount may NOT clobber registers. */
++
++#if defined(__PIC__) || defined(PIC)
++#define NIOS2_MCOUNT_CALL \
++ "nextpc r3\n\t" \
++ "1: movhi r2, %hiadj(_GLOBAL_OFFSET_TABLE_ - 1b)\n\t" \
++ "addi r2, r2, %lo(_GLOBAL_OFFSET_TABLE_ - 1b)\n\t" \
++ "add r2, r2, r3\n\t" \
++ "ldw r2, %call(mcount_internal)(r2)\n\t" \
++ "callr r2\n\t"
++#else
++#define NIOS2_MCOUNT_CALL \
++ "call\tmcount_internal\n\t"
++#endif
++
++#define MCOUNT \
++asm( \
++ ".globl _mcount\n\t" \
++ ".type _mcount,@function\n\t" \
++ "_mcount:\n\t" \
++ "subi sp, sp, 24\n\t" \
++ "stw ra, 20(sp)\n\t" \
++ "stw r8, 16(sp)\n\t" \
++ "stw r7, 12(sp)\n\t" \
++ "stw r6, 8(sp)\n\t" \
++ "stw r5, 4(sp)\n\t" \
++ "stw r4, 0(sp)\n\t" \
++ "mov r4, r8\n\t" \
++ "mov r5, ra\n\t" \
++ NIOS2_MCOUNT_CALL \
++ "ldw ra, 20(sp)\n\t" \
++ "ldw r8, 16(sp)\n\t" \
++ "ldw r7, 12(sp)\n\t" \
++ "ldw r6, 8(sp)\n\t" \
++ "ldw r5, 4(sp)\n\t" \
++ "ldw r4, 0(sp)\n\t" \
++ "addi sp, sp, 24\n\t" \
++ "ret\n\t" \
++ ".size _mcount, . - _mcount\n\t" \
++);
++
+Index: glibc-2.10.1/sysdeps/nios2/memusage.h
+===================================================================
+--- /dev/null
++++ glibc-2.10.1/sysdeps/nios2/memusage.h
+@@ -0,0 +1,24 @@
++/* Copyright (C) 2000 Free Software Foundation, Inc.
++ This file is part of the GNU C Library.
++
++ The GNU C Library is free software; you can redistribute it and/or
++ modify it under the terms of the GNU Lesser General Public
++ License as published by the Free Software Foundation; either
++ version 2.1 of the License, or (at your option) any later version.
++
++ The GNU C Library is distributed in the hope that it will be useful,
++ but WITHOUT ANY WARRANTY; without even the implied warranty of
++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++ Lesser General Public License for more details.
++
++ You should have received a copy of the GNU Lesser General Public
++ License along with the GNU C Library; if not, write to the Free
++ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
++ 02111-1307 USA. */
++
++
++#define GETSP() ({ register uintptr_t stack_ptr asm ("%sp"); stack_ptr; })
++
++#define uatomic32_t unsigned int
++
++#include <sysdeps/generic/memusage.h>
+Index: glibc-2.10.1/sysdeps/nios2/nptl/pthread_spin_lock.c
+===================================================================
+--- /dev/null
++++ glibc-2.10.1/sysdeps/nios2/nptl/pthread_spin_lock.c
+@@ -0,0 +1,30 @@
++/* Copyright (C) 2005, 2007 Free Software Foundation, Inc.
++ This file is part of the GNU C Library.
++
++ The GNU C Library is free software; you can redistribute it and/or
++ modify it under the terms of the GNU Lesser General Public
++ License as published by the Free Software Foundation; either
++ version 2.1 of the License, or (at your option) any later version.
++
++ The GNU C Library is distributed in the hope that it will be useful,
++ but WITHOUT ANY WARRANTY; without even the implied warranty of
++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++ Lesser General Public License for more details.
++
++ You should have received a copy of the GNU Lesser General Public
++ License along with the GNU C Library; if not, write to the Free
++ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
++ 02111-1307 USA. */
++
++#include <atomic.h>
++#include "pthreadP.h"
++
++int
++pthread_spin_lock (pthread_spinlock_t *lock)
++{
++ while (atomic_compare_and_exchange_val_acq(lock, 1, 0) != 0)
++ while (*lock != 0)
++ ;
++
++ return 0;
++}
+Index: glibc-2.10.1/sysdeps/nios2/nptl/pthread_spin_trylock.c
+===================================================================
+--- /dev/null
++++ glibc-2.10.1/sysdeps/nios2/nptl/pthread_spin_trylock.c
+@@ -0,0 +1,27 @@
++/* Copyright (C) 2005, 2007 Free Software Foundation, Inc.
++ This file is part of the GNU C Library.
++
++ The GNU C Library is free software; you can redistribute it and/or
++ modify it under the terms of the GNU Lesser General Public
++ License as published by the Free Software Foundation; either
++ version 2.1 of the License, or (at your option) any later version.
++
++ The GNU C Library is distributed in the hope that it will be useful,
++ but WITHOUT ANY WARRANTY; without even the implied warranty of
++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++ Lesser General Public License for more details.
++
++ You should have received a copy of the GNU Lesser General Public
++ License along with the GNU C Library; if not, write to the Free
++ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
++ 02111-1307 USA. */
++
++#include <errno.h>
++#include <atomic.h>
++#include "pthreadP.h"
++
++int
++pthread_spin_trylock (pthread_spinlock_t *lock)
++{
++ return atomic_compare_and_exchange_val_acq(lock, 1, 0) ? EBUSY : 0;
++}
+Index: glibc-2.10.1/sysdeps/nios2/nptl/pthreaddef.h
+===================================================================
+--- /dev/null
++++ glibc-2.10.1/sysdeps/nios2/nptl/pthreaddef.h
+@@ -0,0 +1,46 @@
++/* Copyright (C) 2002, 2003, 2005 Free Software Foundation, Inc.
++ This file is part of the GNU C Library.
++
++ The GNU C Library is free software; you can redistribute it and/or
++ modify it under the terms of the GNU Lesser General Public
++ License as published by the Free Software Foundation; either
++ version 2.1 of the License, or (at your option) any later version.
++
++ The GNU C Library is distributed in the hope that it will be useful,
++ but WITHOUT ANY WARRANTY; without even the implied warranty of
++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++ Lesser General Public License for more details.
++
++ You should have received a copy of the GNU Lesser General Public
++ License along with the GNU C Library; if not, write to the Free
++ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
++ 02111-1307 USA. */
++
++/* Default stack size. */
++#define ARCH_STACK_DEFAULT_SIZE (2 * 1024 * 1024)
++
++/* Required stack pointer alignment at beginning. */
++#define STACK_ALIGN 4
++
++/* Minimal stack size after allocating thread descriptor and guard size. */
++#define MINIMAL_REST_STACK 2048
++
++/* Alignment requirement for TCB. */
++#define TCB_ALIGNMENT 4
++
++
++/* Location of current stack frame.
++
++ __builtin_frame_address (0) returns the value of the hard frame
++ pointer, which will point at the location of the saved PC on the
++ stack. Below this in memory is the remainder of the linkage info,
++ occupying 12 bytes. Therefore in order to address from
++ CURRENT_STACK_FRAME using "struct layout", we need to have the macro
++ return the hard FP minus 12. Of course, this makes no sense
++ without the obsolete APCS stack layout... */
++#define CURRENT_STACK_FRAME (__builtin_frame_address (0) - 12)
++
++
++/* XXX Until we have a better place keep the definitions here. */
++#define __exit_thread_inline(val) \
++ INLINE_SYSCALL (exit, 1, (val))
+Index: glibc-2.10.1/sysdeps/nios2/nptl/tcb-offsets.sym
+===================================================================
+--- /dev/null
++++ glibc-2.10.1/sysdeps/nios2/nptl/tcb-offsets.sym
+@@ -0,0 +1,13 @@
++#include <sysdep.h>
++#include <tls.h>
++
++--
++
++-- Abuse tls.h macros to derive offsets relative to the thread register.
++# undef __thread_self
++# define __thread_self ((void *) 0)
++# define thread_offsetof(mem) ((ptrdiff_t) THREAD_SELF + offsetof (struct pthread, mem))
++
++MULTIPLE_THREADS_OFFSET thread_offsetof (header.multiple_threads)
++PID_OFFSET thread_offsetof (pid)
++TID_OFFSET thread_offsetof (tid)
+Index: glibc-2.10.1/sysdeps/nios2/nptl/tls.h
+===================================================================
+--- /dev/null
++++ glibc-2.10.1/sysdeps/nios2/nptl/tls.h
+@@ -0,0 +1,161 @@
++/* Definition for thread-local data handling. NPTL/Nios II version.
++ Copyright (C) 2005 Free Software Foundation, Inc.
++ This file is part of the GNU C Library.
++
++ The GNU C Library is free software; you can redistribute it and/or
++ modify it under the terms of the GNU Lesser General Public
++ License as published by the Free Software Foundation; either
++ version 2.1 of the License, or (at your option) any later version.
++
++ The GNU C Library is distributed in the hope that it will be useful,
++ but WITHOUT ANY WARRANTY; without even the implied warranty of
++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++ Lesser General Public License for more details.
++
++ You should have received a copy of the GNU Lesser General Public
++ License along with the GNU C Library; if not, write to the Free
++ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
++ 02111-1307 USA. */
++
++#ifndef _TLS_H
++#define _TLS_H 1
++
++#include <dl-sysdep.h>
++
++#ifndef __ASSEMBLER__
++# include <stdbool.h>
++# include <stddef.h>
++# include <stdint.h>
++
++/* Type for the dtv. */
++typedef union dtv
++{
++ size_t counter;
++ struct
++ {
++ void *val;
++ bool is_static;
++ } pointer;
++} dtv_t;
++
++#else /* __ASSEMBLER__ */
++# include <tcb-offsets.h>
++#endif /* __ASSEMBLER__ */
++
++
++/* Signal that TLS support is available. */
++# define USE_TLS 1
++
++#ifndef __ASSEMBLER__
++
++/* Get system call information. */
++# include <sysdep.h>
++
++/* The TP points to the start of the thread blocks. */
++# define TLS_DTV_AT_TP 1
++
++/* Get the thread descriptor definition. */
++# include <nptl/descr.h>
++
++typedef struct
++{
++ dtv_t *dtv;
++ void *private;
++} tcbhead_t;
++
++register struct pthread *__thread_self __asm__("r23");
++
++/* This is the size of the initial TCB. Because our TCB is before the thread
++ pointer, we don't need this. */
++# define TLS_INIT_TCB_SIZE 0
++
++/* Alignment requirements for the initial TCB. */
++# define TLS_INIT_TCB_ALIGN __alignof__ (struct pthread)
++
++/* This is the size of the TCB. Because our TCB is before the thread
++ pointer, we don't need this. */
++# define TLS_TCB_SIZE 0
++
++/* This is the size we need before TCB - actually, it includes the TCB. */
++# define TLS_PRE_TCB_SIZE \
++ (sizeof (struct pthread) \
++ + ((sizeof (tcbhead_t) + TLS_TCB_ALIGN - 1) & ~(TLS_TCB_ALIGN - 1)))
++
++/* The thread pointer (in hardware register r23) points to the end of
++ the TCB + 0x7000, as for PowerPC and MIPS. */
++# define TLS_TCB_OFFSET 0x7000
++
++/* Alignment requirements for the TCB. */
++# define TLS_TCB_ALIGN __alignof__ (struct pthread)
++
++/* Install the dtv pointer. The pointer passed is to the element with
++ index -1 which contain the length. */
++# define INSTALL_DTV(tcbp, dtvp) \
++ (((tcbhead_t *) (tcbp))[-1].dtv = (dtvp) + 1)
++
++/* Install new dtv for current thread. */
++# define INSTALL_NEW_DTV(dtv) \
++ (THREAD_DTV() = (dtv))
++
++/* Return dtv of given thread descriptor. */
++# define GET_DTV(tcbp) \
++ (((tcbhead_t *) (tcbp))[-1].dtv)
++
++/* Code to initially initialize the thread pointer. */
++# define TLS_INIT_TP(tcbp, secondcall) \
++ (__thread_self = (struct pthread *) ((char *) tcbp + TLS_TCB_OFFSET), NULL)
++
++/* Return the address of the dtv for the current thread. */
++# define THREAD_DTV() \
++ (((tcbhead_t *) ((struct pthread *) ((char *) __thread_self \
++ - TLS_TCB_OFFSET)))[-1].dtv)
++
++/* Return the thread descriptor for the current thread. */
++# define THREAD_SELF \
++ ((struct pthread *) ((char *) __thread_self - TLS_TCB_OFFSET - \
++ TLS_PRE_TCB_SIZE))
++
++/* Magic for libthread_db to know how to do THREAD_SELF. */
++# define DB_THREAD_SELF \
++ REGISTER (32, 32, 23 * 4, -TLS_PRE_TCB_SIZE - TLS_TCB_OFFSET)
++
++/* Access to data in the thread descriptor is easy. */
++#define THREAD_GETMEM(descr, member) \
++ descr->member
++#define THREAD_GETMEM_NC(descr, member, idx) \
++ descr->member[idx]
++#define THREAD_SETMEM(descr, member, value) \
++ descr->member = (value)
++#define THREAD_SETMEM_NC(descr, member, idx, value) \
++ descr->member[idx] = (value)
++
++/* Initializing the thread pointer will generate a SIGILL if the syscall
++ is not available. */
++#define TLS_INIT_TP_EXPENSIVE 1
++
++/* Get and set the global scope generation counter in struct pthread. */
++#define THREAD_GSCOPE_FLAG_UNUSED 0
++#define THREAD_GSCOPE_FLAG_USED 1
++#define THREAD_GSCOPE_FLAG_WAIT 2
++#define THREAD_GSCOPE_RESET_FLAG() \
++ do \
++ { int __res \
++ = atomic_exchange_rel (&THREAD_SELF->header.gscope_flag, \
++ THREAD_GSCOPE_FLAG_UNUSED); \
++ if (__res == THREAD_GSCOPE_FLAG_WAIT) \
++ lll_futex_wake (&THREAD_SELF->header.gscope_flag, 1, LLL_PRIVATE); \
++ } \
++ while (0)
++#define THREAD_GSCOPE_SET_FLAG() \
++ do \
++ { \
++ THREAD_SELF->header.gscope_flag = THREAD_GSCOPE_FLAG_USED; \
++ atomic_write_barrier (); \
++ } \
++ while (0)
++#define THREAD_GSCOPE_WAIT() \
++ GL(dl_wait_lookup_done) ()
++
++#endif /* __ASSEMBLER__ */
++
++#endif /* tls.h */
+Index: glibc-2.10.1/sysdeps/nios2/setjmp.S
+===================================================================
+--- /dev/null
++++ glibc-2.10.1/sysdeps/nios2/setjmp.S
+@@ -0,0 +1,53 @@
++/* Copyright (C) 1991, 1992, 1994, 1997, 2008 Free Software Foundation, Inc.
++ This file is part of the GNU C Library.
++
++ The GNU C Library is free software; you can redistribute it and/or
++ modify it under the terms of the GNU Lesser General Public
++ License as published by the Free Software Foundation; either
++ version 2.1 of the License, or (at your option) any later version.
++
++ The GNU C Library is distributed in the hope that it will be useful,
++ but WITHOUT ANY WARRANTY; without even the implied warranty of
++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++ Lesser General Public License for more details.
++
++ You should have received a copy of the GNU Lesser General Public
++ License along with the GNU C Library; if not, write to the Free
++ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
++ 02111-1307 USA.
++*/
++
++/* Save the current program position in ENV and return 0. */
++ .text
++ .globl __sigsetjmp
++__sigsetjmp:
++ stw r16, 0(r4)
++ stw r17, 4(r4)
++ stw r18, 8(r4)
++ stw r19, 12(r4)
++ stw r20, 16(r4)
++ stw r21, 20(r4)
++ stw r22, 24(r4)
++ stw r23, 28(r4)
++ stw sp, 32(r4)
++ stw fp, 36(r4)
++ stw ra, 40(r4)
++#if defined NOT_IN_libc && defined IS_IN_rtld
++ /* In ld.so we never save the signal mask. */
++ mov r2, zero
++ ret
++#else
++ /* Save the signal mask if requested. */
++#if defined(__PIC__) || defined(PIC)
++ nextpc r2
++1: movhi r3, %hiadj(_GLOBAL_OFFSET_TABLE_ - 1b)
++ addi r3, r3, %lo(_GLOBAL_OFFSET_TABLE_ - 1b)
++ add r2, r2, r3
++ ldw r2, %call(__sigjmp_save)(r2)
++ jmp r2
++#else
++ jmpi __sigjmp_save
++#endif
++#endif
++
++libc_hidden_def (__sigsetjmp)
+Index: glibc-2.10.1/sysdeps/nios2/shlib-versions
+===================================================================
+--- /dev/null
++++ glibc-2.10.1/sysdeps/nios2/shlib-versions
+@@ -0,0 +1 @@
++nios2-.*-linux.* DEFAULT GLIBC_2.10
+Index: glibc-2.10.1/sysdeps/nios2/soft-fp/sfp-machine.h
+===================================================================
+--- /dev/null
++++ glibc-2.10.1/sysdeps/nios2/soft-fp/sfp-machine.h
+@@ -0,0 +1,41 @@
++#define _FP_W_TYPE_SIZE 32
++#define _FP_W_TYPE unsigned long
++#define _FP_WS_TYPE signed long
++#define _FP_I_TYPE long
++
++#define _FP_MUL_MEAT_S(R,X,Y) \
++ _FP_MUL_MEAT_1_wide(_FP_WFRACBITS_S,R,X,Y,umul_ppmm)
++#define _FP_MUL_MEAT_D(R,X,Y) \
++ _FP_MUL_MEAT_2_wide(_FP_WFRACBITS_D,R,X,Y,umul_ppmm)
++#define _FP_MUL_MEAT_Q(R,X,Y) \
++ _FP_MUL_MEAT_4_wide(_FP_WFRACBITS_Q,R,X,Y,umul_ppmm)
++
++#define _FP_DIV_MEAT_S(R,X,Y) _FP_DIV_MEAT_1_loop(S,R,X,Y)
++#define _FP_DIV_MEAT_D(R,X,Y) _FP_DIV_MEAT_2_udiv(D,R,X,Y)
++#define _FP_DIV_MEAT_Q(R,X,Y) _FP_DIV_MEAT_4_udiv(Q,R,X,Y)
++
++#define _FP_NANFRAC_S ((_FP_QNANBIT_S << 1) - 1)
++#define _FP_NANFRAC_D ((_FP_QNANBIT_D << 1) - 1), -1
++#define _FP_NANFRAC_Q ((_FP_QNANBIT_Q << 1) - 1), -1, -1, -1
++#define _FP_NANSIGN_S 0
++#define _FP_NANSIGN_D 0
++#define _FP_NANSIGN_Q 0
++
++#define _FP_KEEPNANFRACP 1
++
++/* This is arbitrarily taken from the PowerPC version. */
++#define _FP_CHOOSENAN(fs, wc, R, X, Y, OP) \
++ do { \
++ if ((_FP_FRAC_HIGH_RAW_##fs(X) & _FP_QNANBIT_##fs) \
++ && !(_FP_FRAC_HIGH_RAW_##fs(Y) & _FP_QNANBIT_##fs)) \
++ { \
++ R##_s = Y##_s; \
++ _FP_FRAC_COPY_##wc(R,Y); \
++ } \
++ else \
++ { \
++ R##_s = X##_s; \
++ _FP_FRAC_COPY_##wc(R,X); \
++ } \
++ R##_c = FP_CLS_NAN; \
++ } while (0)
+Index: glibc-2.10.1/sysdeps/nios2/stackinfo.h
+===================================================================
+--- /dev/null
++++ glibc-2.10.1/sysdeps/nios2/stackinfo.h
+@@ -0,0 +1,28 @@
++/* Copyright (C) 2001, 2008 Free Software Foundation, Inc.
++ This file is part of the GNU C Library.
++
++ The GNU C Library is free software; you can redistribute it and/or
++ modify it under the terms of the GNU Lesser General Public
++ License as published by the Free Software Foundation; either
++ version 2.1 of the License, or (at your option) any later version.
++
++ The GNU C Library is distributed in the hope that it will be useful,
++ but WITHOUT ANY WARRANTY; without even the implied warranty of
++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++ Lesser General Public License for more details.
++
++ You should have received a copy of the GNU Lesser General Public
++ License along with the GNU C Library; if not, write to the Free
++ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
++ 02111-1307 USA. */
++
++/* This file contains a bit of information about the stack allocation
++ of the processor. */
++
++#ifndef _STACKINFO_H
++#define _STACKINFO_H 1
++
++/* On Nios II the stack grows down. */
++#define _STACK_GROWS_DOWN 1
++
++#endif /* stackinfo.h */
+Index: glibc-2.10.1/sysdeps/nios2/tls-macros.h
+===================================================================
+--- /dev/null
++++ glibc-2.10.1/sysdeps/nios2/tls-macros.h
+@@ -0,0 +1,46 @@
++#define TLS_LE(x) \
++ ({ int *__result; \
++ asm ("addi %0, r23, %%tls_le(" #x ")" \
++ : "=r" (__result)); \
++ __result; })
++
++#define TLS_IE(x) \
++ ({ int *__result; \
++ int __tmp; \
++ asm ("nextpc %0 ; " \
++ "1: movhi %1, %%hiadj(_GLOBAL_OFFSET_TABLE_ - 1b) ; " \
++ "addi %1, %1, %%lo(_GLOBAL_OFFSET_TABLE_ - 1b) ; " \
++ "add %0, %0, %1 ; " \
++ "ldw %1, %%tls_ie(" #x ")(%0) ; " \
++ "add %1, r23, %1" \
++ : "=&r" (__tmp), "=&r" (__result)); \
++ __result; })
++
++#define TLS_LD(x) \
++ ({ char *__result; \
++ char *__result2; \
++ int *__result3; \
++ int __tmp; \
++ extern void *__tls_get_addr (void *); \
++ asm ("nextpc %0 ; " \
++ "1: movhi %1, %%hiadj(_GLOBAL_OFFSET_TABLE_ - 1b) ; " \
++ "addi %1, %1, %%lo(_GLOBAL_OFFSET_TABLE_ - 1b) ; " \
++ "add %0, %0, %1 ; " \
++ "addi %0, %0, %%tls_ldm(" #x ")" \
++ : "=r" (__result), "=r" (__tmp)); \
++ __result2 = (char *)__tls_get_addr (__result); \
++ asm ("addi %0, %1, %%tls_ldo(" #x ")" \
++ : "=r" (__result3) : "r" (__result2)); \
++ __result3; })
++
++#define TLS_GD(x) \
++ ({ int *__result; \
++ int __tmp; \
++ extern void *__tls_get_addr (void *); \
++ asm ("nextpc %0 ; " \
++ "1: movhi %1, %%hiadj(_GLOBAL_OFFSET_TABLE_ - 1b) ; " \
++ "addi %1, %1, %%lo(_GLOBAL_OFFSET_TABLE_ - 1b) ; " \
++ "add %0, %0, %1 ; " \
++ "addi %0, %0, %%tls_gd(" #x ")" \
++ : "=r" (__result), "=r" (__tmp)); \
++ (int *)__tls_get_addr (__result); })
+Index: glibc-2.10.1/sysdeps/nios2/tst-audit.h
+===================================================================
+--- /dev/null
++++ glibc-2.10.1/sysdeps/nios2/tst-audit.h
+@@ -0,0 +1,26 @@
++/* Definitions for testing PLT entry/exit auditing. Nios II version.
++
++ Copyright (C) 2009 Free Software Foundation, Inc.
++
++ This file is part of the GNU C Library.
++
++ The GNU C Library is free software; you can redistribute it and/or
++ modify it under the terms of the GNU Lesser General Public
++ License as published by the Free Software Foundation; either
++ version 2.1 of the License, or (at your option) any later version.
++
++ The GNU C Library is distributed in the hope that it will be useful,
++ but WITHOUT ANY WARRANTY; without even the implied warranty of
++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++ Lesser General Public License for more details.
++
++ You should have received a copy of the GNU Lesser General Public
++ License along with the GNU C Library; if not, write to the Free
++ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
++ 02111-1307 USA. */
++
++#define pltenter la_nios2_gnu_pltenter
++#define pltexit la_nios2_gnu_pltexit
++#define La_regs La_nios2_regs
++#define La_retval La_nios2_retval
++#define int_retval lrv_r2
+Index: glibc-2.10.1/sysdeps/unix/sysv/linux/nios2/bits/atomic.h
+===================================================================
+--- /dev/null
++++ glibc-2.10.1/sysdeps/unix/sysv/linux/nios2/bits/atomic.h
+@@ -0,0 +1,113 @@
++/* Copyright (C) 2003, 2008 Free Software Foundation, Inc.
++ This file is part of the GNU C Library.
++
++ The GNU C Library is free software; you can redistribute it and/or
++ modify it under the terms of the GNU Lesser General Public
++ License as published by the Free Software Foundation; either
++ version 2.1 of the License, or (at your option) any later version.
++
++ The GNU C Library is distributed in the hope that it will be useful,
++ but WITHOUT ANY WARRANTY; without even the implied warranty of
++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++ Lesser General Public License for more details.
++
++ You should have received a copy of the GNU Lesser General Public
++ License along with the GNU C Library; if not, write to the Free
++ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
++ 02111-1307 USA. */
++
++#include <stdint.h>
++
++typedef int8_t atomic8_t;
++typedef uint8_t uatomic8_t;
++typedef int_fast8_t atomic_fast8_t;
++typedef uint_fast8_t uatomic_fast8_t;
++
++typedef int16_t atomic16_t;
++typedef uint16_t uatomic16_t;
++typedef int_fast16_t atomic_fast16_t;
++typedef uint_fast16_t uatomic_fast16_t;
++
++typedef int32_t atomic32_t;
++typedef uint32_t uatomic32_t;
++typedef int_fast32_t atomic_fast32_t;
++typedef uint_fast32_t uatomic_fast32_t;
++
++typedef intptr_t atomicptr_t;
++typedef uintptr_t uatomicptr_t;
++typedef intmax_t atomic_max_t;
++typedef uintmax_t uatomic_max_t;
++
++void __nios2_link_error (void);
++
++#define __arch_compare_and_exchange_bool_8_acq(mem, newval, oldval) \
++ (abort (), 0)
++
++#define __arch_compare_and_exchange_bool_16_acq(mem, newval, oldval) \
++ (abort (), 0)
++
++#define __arch_compare_and_exchange_bool_32_acq(mem, newval, oldval) \
++ (!__sync_bool_compare_and_swap ((mem), (int) (long) (oldval), \
++ (int) (long) (newval)))
++
++#define __arch_compare_and_exchange_bool_64_acq(mem, newval, oldval) \
++ ({ __nios2_link_error (); oldval; })
++
++#define __arch_compare_and_exchange_val_8_acq(mem, newval, oldval) \
++ (abort (), (__typeof (*mem)) 0)
++
++#define __arch_compare_and_exchange_val_16_acq(mem, newval, oldval) \
++ (abort (), (__typeof (*mem)) 0)
++
++#define __arch_compare_and_exchange_val_32_acq(mem, newval, oldval) \
++ __sync_val_compare_and_swap ((mem), (int) (long) (oldval), \
++ (int) (long) (newval))
++
++#define __arch_compare_and_exchange_val_64_acq(mem, newval, oldval) \
++ ({ __nios2_link_error (); oldval; })
++
++/* Atomically store newval and return the old value. */
++#define atomic_exchange_acq(mem, value) \
++ __sync_lock_test_and_set (mem, value)
++
++#define atomic_exchange_rel(mem, value) \
++ (__sync_synchronize (), __sync_lock_test_and_set (mem, value))
++
++#define atomic_exchange_and_add(mem, value) \
++ ({ __typeof (*mem) __result; \
++ __result = __sync_fetch_and_add ((mem), (int) (value)); \
++ __result; })
++
++#define atomic_decrement_if_positive(mem) \
++ ({ __typeof (*mem) __oldval, __val; \
++ __typeof (mem) __memp = (mem); \
++ \
++ __val = (*__memp); \
++ do \
++ { \
++ __oldval = __val; \
++ if (__builtin_expect (__val <= 0, 0)) \
++ break; \
++ __val = atomic_compare_and_exchange_val_acq (__memp, __oldval - 1, \
++ __oldval); \
++ } \
++ while (__builtin_expect (__val != __oldval, 0)); \
++ __oldval; })
++
++#define atomic_bit_test_set(mem, bit) \
++ ({ __typeof (*mem) __oldval, __val; \
++ __typeof (mem) __memp = (mem); \
++ __typeof (*mem) __mask = ((__typeof (*mem)) 1 << (bit)); \
++ \
++ __val = (*__memp); \
++ do \
++ { \
++ __oldval = __val; \
++ __val = atomic_compare_and_exchange_val_acq (__memp, \
++ __oldval | __mask, \
++ __oldval); \
++ } \
++ while (__builtin_expect (__val != __oldval, 0)); \
++ __oldval & __mask; })
++
++#define atomic_full_barrier() __sync_synchronize ()
+Index: glibc-2.10.1/sysdeps/unix/sysv/linux/nios2/bits/fcntl.h
+===================================================================
+--- /dev/null
++++ glibc-2.10.1/sysdeps/unix/sysv/linux/nios2/bits/fcntl.h
+@@ -0,0 +1,238 @@
++/* O_*, F_*, FD_* bit values for Linux.
++ Copyright (C) 1995-1998, 2000, 2004, 2006, 2008 Free Software Foundation,
++ Inc.
++ This file is part of the GNU C Library.
++
++ The GNU C Library is free software; you can redistribute it and/or
++ modify it under the terms of the GNU Lesser General Public
++ License as published by the Free Software Foundation; either
++ version 2.1 of the License, or (at your option) any later version.
++
++ The GNU C Library is distributed in the hope that it will be useful,
++ but WITHOUT ANY WARRANTY; without even the implied warranty of
++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++ Lesser General Public License for more details.
++
++ You should have received a copy of the GNU Lesser General Public
++ License along with the GNU C Library; if not, write to the Free
++ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
++ 02111-1307 USA. */
++
++#ifndef _FCNTL_H
++# error "Never use <bits/fcntl.h> directly; include <fcntl.h> instead."
++#endif
++
++#include <sys/types.h>
++#ifdef __USE_GNU
++# include <bits/uio.h>
++#endif
++
++
++/* open/fcntl - O_SYNC is only implemented on blocks devices and on files
++ located on an ext2 file system */
++#define O_ACCMODE 0003
++#define O_RDONLY 00
++#define O_WRONLY 01
++#define O_RDWR 02
++#define O_CREAT 0100 /* not fcntl */
++#define O_EXCL 0200 /* not fcntl */
++#define O_NOCTTY 0400 /* not fcntl */
++#define O_TRUNC 01000 /* not fcntl */
++#define O_APPEND 02000
++#define O_NONBLOCK 04000
++#define O_NDELAY O_NONBLOCK
++#define O_SYNC 010000
++#define O_FSYNC O_SYNC
++#define O_ASYNC 020000
++
++#ifdef __USE_GNU
++# define O_DIRECTORY 040000 /* Must be a directory. */
++# define O_NOFOLLOW 0100000 /* Do not follow links. */
++# define O_DIRECT 0200000 /* Direct disk access. */
++# define O_NOATIME 01000000 /* Do not set atime. */
++# define O_CLOEXEC 02000000 /* Set close_on_exec. */
++#endif
++
++/* For now Linux has synchronisity options for data and read operations.
++ We define the symbols here but let them do the same as O_SYNC since
++ this is a superset. */
++#if defined __USE_POSIX199309 || defined __USE_UNIX98
++# define O_DSYNC O_SYNC /* Synchronize data. */
++# define O_RSYNC O_SYNC /* Synchronize read operations. */
++#endif
++
++#ifdef __USE_LARGEFILE64
++# define O_LARGEFILE 0400000
++#endif
++
++/* Values for the second argument to `fcntl'. */
++#define F_DUPFD 0 /* Duplicate file descriptor. */
++#define F_GETFD 1 /* Get file descriptor flags. */
++#define F_SETFD 2 /* Set file descriptor flags. */
++#define F_GETFL 3 /* Get file status flags. */
++#define F_SETFL 4 /* Set file status flags. */
++#ifndef __USE_FILE_OFFSET64
++# define F_GETLK 5 /* Get record locking info. */
++# define F_SETLK 6 /* Set record locking info (non-blocking). */
++# define F_SETLKW 7 /* Set record locking info (blocking). */
++#else
++# define F_GETLK F_GETLK64 /* Get record locking info. */
++# define F_SETLK F_SETLK64 /* Set record locking info (non-blocking).*/
++# define F_SETLKW F_SETLKW64 /* Set record locking info (blocking). */
++#endif
++#define F_GETLK64 12 /* Get record locking info. */
++#define F_SETLK64 13 /* Set record locking info (non-blocking). */
++#define F_SETLKW64 14 /* Set record locking info (blocking). */
++
++#if defined __USE_BSD || defined __USE_UNIX98
++# define F_SETOWN 8 /* Get owner of socket (receiver of SIGIO). */
++# define F_GETOWN 9 /* Set owner of socket (receiver of SIGIO). */
++#endif
++
++#ifdef __USE_GNU
++# define F_SETSIG 10 /* Set number of signal to be sent. */
++# define F_GETSIG 11 /* Get number of signal to be sent. */
++#endif
++
++#ifdef __USE_GNU
++# define F_SETLEASE 1024 /* Set a lease. */
++# define F_GETLEASE 1025 /* Enquire what lease is active. */
++# define F_NOTIFY 1026 /* Request notfications on a directory. */
++#endif
++
++/* For F_[GET|SET]FL. */
++#define FD_CLOEXEC 1 /* actually anything with low bit set goes */
++
++/* For posix fcntl() and `l_type' field of a `struct flock' for lockf(). */
++#define F_RDLCK 0 /* Read lock. */
++#define F_WRLCK 1 /* Write lock. */
++#define F_UNLCK 2 /* Remove lock. */
++
++/* For old implementation of bsd flock(). */
++#define F_EXLCK 4 /* or 3 */
++#define F_SHLCK 8 /* or 4 */
++
++#ifdef __USE_BSD
++/* Operations for bsd flock(), also used by the kernel implementation. */
++# define LOCK_SH 1 /* shared lock */
++# define LOCK_EX 2 /* exclusive lock */
++# define LOCK_NB 4 /* or'd with one of the above to prevent
++ blocking */
++# define LOCK_UN 8 /* remove lock */
++#endif
++
++#ifdef __USE_GNU
++# define LOCK_MAND 32 /* This is a mandatory flock: */
++# define LOCK_READ 64 /* ... which allows concurrent read operations. */
++# define LOCK_WRITE 128 /* ... which allows concurrent write operations. */
++# define LOCK_RW 192 /* ... Which allows concurrent read & write operations. */
++#endif
++
++#ifdef __USE_GNU
++/* Types of directory notifications that may be requested with F_NOTIFY. */
++# define DN_ACCESS 0x00000001 /* File accessed. */
++# define DN_MODIFY 0x00000002 /* File modified. */
++# define DN_CREATE 0x00000004 /* File created. */
++# define DN_DELETE 0x00000008 /* File removed. */
++# define DN_RENAME 0x00000010 /* File renamed. */
++# define DN_ATTRIB 0x00000020 /* File changed attibutes. */
++# define DN_MULTISHOT 0x80000000 /* Don't remove notifier. */
++#endif
++
++struct flock
++ {
++ short int l_type; /* Type of lock: F_RDLCK, F_WRLCK, or F_UNLCK. */
++ short int l_whence; /* Where `l_start' is relative to (like `lseek'). */
++#ifndef __USE_FILE_OFFSET64
++ __off_t l_start; /* Offset where the lock begins. */
++ __off_t l_len; /* Size of the locked area; zero means until EOF. */
++#else
++ __off64_t l_start; /* Offset where the lock begins. */
++ __off64_t l_len; /* Size of the locked area; zero means until EOF. */
++#endif
++ __pid_t l_pid; /* Process holding the lock. */
++ };
++
++#ifdef __USE_LARGEFILE64
++struct flock64
++ {
++ short int l_type; /* Type of lock: F_RDLCK, F_WRLCK, or F_UNLCK. */
++ short int l_whence; /* Where `l_start' is relative to (like `lseek'). */
++ __off64_t l_start; /* Offset where the lock begins. */
++ __off64_t l_len; /* Size of the locked area; zero means until EOF. */
++ __pid_t l_pid; /* Process holding the lock. */
++ };
++#endif
++
++/* Define some more compatibility macros to be backward compatible with
++ BSD systems which did not managed to hide these kernel macros. */
++#ifdef __USE_BSD
++# define FAPPEND O_APPEND
++# define FFSYNC O_FSYNC
++# define FASYNC O_ASYNC
++# define FNONBLOCK O_NONBLOCK
++# define FNDELAY O_NDELAY
++#endif /* Use BSD. */
++
++/* Advise to `posix_fadvise'. */
++#ifdef __USE_XOPEN2K
++# define POSIX_FADV_NORMAL 0 /* No further special treatment. */
++# define POSIX_FADV_RANDOM 1 /* Expect random page references. */
++# define POSIX_FADV_SEQUENTIAL 2 /* Expect sequential page references. */
++# define POSIX_FADV_WILLNEED 3 /* Will need these pages. */
++# define POSIX_FADV_DONTNEED 4 /* Don't need these pages. */
++# define POSIX_FADV_NOREUSE 5 /* Data will be accessed once. */
++#endif
++
++
++#ifdef __USE_GNU
++/* Flags for SYNC_FILE_RANGE. */
++# define SYNC_FILE_RANGE_WAIT_BEFORE 1 /* Wait upon writeout of all pages
++ in the range before performing the
++ write. */
++# define SYNC_FILE_RANGE_WRITE 2 /* Initiate writeout of all those
++ dirty pages in the range which are
++ not presently under writeback. */
++# define SYNC_FILE_RANGE_WAIT_AFTER 4 /* Wait upon writeout of all pages in
++ the range after performing the
++ write. */
++
++/* Flags for SPLICE and VMSPLICE. */
++# define SPLICE_F_MOVE 1 /* Move pages instead of copying. */
++# define SPLICE_F_NONBLOCK 2 /* Don't block on the pipe splicing
++ (but we may still block on the fd
++ we splice from/to). */
++# define SPLICE_F_MORE 4 /* Expect more data. */
++# define SPLICE_F_GIFT 8 /* Pages passed in are a gift. */
++#endif
++
++__BEGIN_DECLS
++
++#ifdef __USE_GNU
++
++/* Provide kernel hint to read ahead. */
++extern ssize_t readahead (int __fd, __off64_t __offset, size_t __count)
++ __THROW;
++
++
++/* Selective file content synch'ing. */
++extern int sync_file_range (int __fd, __off64_t __from, __off64_t __to,
++ unsigned int __flags);
++
++
++/* Splice address range into a pipe. */
++extern int vmsplice (int __fdout, const struct iovec *__iov, size_t __count,
++ unsigned int __flags);
++
++/* Splice two files together. */
++extern int splice (int __fdin, __off64_t *__offin, int __fdout,
++ __off64_t *__offout, size_t __len, unsigned int __flags)
++ __THROW;
++
++/* In-kernel implementation of tee for pipe buffers. */
++extern int tee (int __fdin, int __fdout, size_t __len, unsigned int __flags)
++ __THROW;
++
++#endif
++
++__END_DECLS
+Index: glibc-2.10.1/sysdeps/unix/sysv/linux/nios2/bits/mman.h
+===================================================================
+--- /dev/null
++++ glibc-2.10.1/sysdeps/unix/sysv/linux/nios2/bits/mman.h
+@@ -0,0 +1,106 @@
++/* Definitions for POSIX memory map interface. Linux/Nios II version.
++ Copyright (C) 1997, 2000, 2003, 2004, 2005, 2006, 2008
++ Free Software Foundation, Inc.
++ This file is part of the GNU C Library.
++
++ The GNU C Library is free software; you can redistribute it and/or
++ modify it under the terms of the GNU Lesser General Public
++ License as published by the Free Software Foundation; either
++ version 2.1 of the License, or (at your option) any later version.
++
++ The GNU C Library is distributed in the hope that it will be useful,
++ but WITHOUT ANY WARRANTY; without even the implied warranty of
++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++ Lesser General Public License for more details.
++
++ You should have received a copy of the GNU Lesser General Public
++ License along with the GNU C Library; if not, write to the Free
++ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
++ 02111-1307 USA. */
++
++#ifndef _SYS_MMAN_H
++# error "Never use <bits/mman.h> directly; include <sys/mman.h> instead."
++#endif
++
++/* The following definitions basically come from the kernel headers.
++ But the kernel header is not namespace clean. */
++
++
++/* Protections are chosen from these bits, OR'd together. The
++ implementation does not necessarily support PROT_EXEC or PROT_WRITE
++ without PROT_READ. The only guarantees are that no writing will be
++ allowed without PROT_WRITE and no access will be allowed for PROT_NONE. */
++
++#define PROT_READ 0x1 /* Page can be read. */
++#define PROT_WRITE 0x2 /* Page can be written. */
++#define PROT_EXEC 0x4 /* Page can be executed. */
++#define PROT_NONE 0x0 /* Page can not be accessed. */
++#define PROT_GROWSDOWN 0x01000000 /* Extend change to start of
++ growsdown vma (mprotect only). */
++#define PROT_GROWSUP 0x02000000 /* Extend change to start of
++ growsup vma (mprotect only). */
++
++/* Sharing types (must choose one and only one of these). */
++#define MAP_SHARED 0x01 /* Share changes. */
++#define MAP_PRIVATE 0x02 /* Changes are private. */
++#ifdef __USE_MISC
++# define MAP_TYPE 0x0f /* Mask for type of mapping. */
++#endif
++
++/* Other flags. */
++#define MAP_FIXED 0x10 /* Interpret addr exactly. */
++#ifdef __USE_MISC
++# define MAP_FILE 0
++# define MAP_ANONYMOUS 0x0020 /* Don't use a file. */
++# define MAP_ANON MAP_ANONYMOUS
++# define MAP_RENAME MAP_ANONYMOUS
++#endif
++
++/* These are Linux-specific. */
++#ifdef __USE_MISC
++# define MAP_NORESERVE 0x4000 /* don't check for reservations */
++# define MAP_ANONYMOUS 0x0020 /* don't use a file */
++# define MAP_GROWSDOWN 0x0100 /* stack-like segment */
++# define MAP_DENYWRITE 0x0800 /* ETXTBSY */
++# define MAP_EXECUTABLE 0x1000 /* mark it as an executable */
++# define MAP_LOCKED 0x2000 /* pages are locked */
++# define MAP_POPULATE 0x8000 /* populate (prefault) pagetables */
++# define MAP_NONBLOCK 0x10000 /* do not block on IO */
++#endif
++
++/* Flags to `msync'. */
++#define MS_ASYNC 1 /* Sync memory asynchronously. */
++#define MS_SYNC 4 /* Synchronous memory sync. */
++#define MS_INVALIDATE 2 /* Invalidate the caches. */
++
++/* Flags for `mlockall'. */
++#define MCL_CURRENT 1 /* Lock all currently mapped pages. */
++#define MCL_FUTURE 2 /* Lock all additions to address
++ space. */
++
++/* Flags for `mremap'. */
++#ifdef __USE_GNU
++# define MREMAP_MAYMOVE 1
++# define MREMAP_FIXED 2
++#endif
++
++/* Advice to `madvise'. */
++#ifdef __USE_BSD
++# define MADV_NORMAL 0 /* No further special treatment. */
++# define MADV_RANDOM 1 /* Expect random page references. */
++# define MADV_SEQUENTIAL 2 /* Expect sequential page references. */
++# define MADV_WILLNEED 3 /* Will need these pages. */
++# define MADV_DONTNEED 4 /* Don't need these pages. */
++# define MADV_REMOVE 9 /* Remove these pages and resources. */
++# define MADV_DONTFORK 10 /* Do not inherit across fork. */
++# define MADV_DOFORK 11 /* Do inherit across fork. */
++#endif
++
++/* The POSIX people had to invent similar names for the same things. */
++#ifdef __USE_XOPEN2K
++# define POSIX_MADV_NORMAL 0 /* No further special treatment. */
++# define POSIX_MADV_RANDOM 1 /* Expect random page references. */
++# define POSIX_MADV_SEQUENTIAL 2 /* Expect sequential page references. */
++# define POSIX_MADV_WILLNEED 3 /* Will need these pages. */
++# define POSIX_MADV_DONTNEED 4 /* Don't need these pages. */
++#endif
+Index: glibc-2.10.1/sysdeps/unix/sysv/linux/nios2/bits/poll.h
+===================================================================
+--- /dev/null
++++ glibc-2.10.1/sysdeps/unix/sysv/linux/nios2/bits/poll.h
+@@ -0,0 +1,50 @@
++/* Copyright (C) 1997, 2001, 2006 Free Software Foundation, Inc.
++ This file is part of the GNU C Library.
++
++ The GNU C Library is free software; you can redistribute it and/or
++ modify it under the terms of the GNU Lesser General Public
++ License as published by the Free Software Foundation; either
++ version 2.1 of the License, or (at your option) any later version.
++
++ The GNU C Library is distributed in the hope that it will be useful,
++ but WITHOUT ANY WARRANTY; without even the implied warranty of
++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++ Lesser General Public License for more details.
++
++ You should have received a copy of the GNU Lesser General Public
++ License along with the GNU C Library; if not, write to the Free
++ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
++ 02111-1307 USA. */
++
++#ifndef _SYS_POLL_H
++# error "Never use <bits/poll.h> directly; include <sys/poll.h> instead."
++#endif
++
++/* Event types that can be polled for. These bits may be set in `events'
++ to indicate the interesting event types; they will appear in `revents'
++ to indicate the status of the file descriptor. */
++#define POLLIN 0x001 /* There is data to read. */
++#define POLLPRI 0x002 /* There is urgent data to read. */
++#define POLLOUT 0x004 /* Writing now will not block. */
++
++#ifdef __USE_XOPEN
++/* These values are defined in XPG4.2. */
++# define POLLRDNORM 0x040 /* Normal data may be read. */
++# define POLLRDBAND 0x080 /* Priority data may be read. */
++# define POLLWRNORM POLLOUT /* Writing now will not block. */
++# define POLLWRBAND 0x100 /* Priority data may be written. */
++#endif
++
++#ifdef __USE_GNU
++/* These are extensions for Linux. */
++# define POLLMSG 0x400
++# define POLLREMOVE 0x1000
++# define POLLRDHUP 0x2000
++#endif
++
++/* Event types always implicitly polled for. These bits need not be set in
++ `events', but they will appear in `revents' to indicate the status of
++ the file descriptor. */
++#define POLLERR 0x008 /* Error condition. */
++#define POLLHUP 0x010 /* Hung up. */
++#define POLLNVAL 0x020 /* Invalid polling request. */
+Index: glibc-2.10.1/sysdeps/unix/sysv/linux/nios2/brk.c
+===================================================================
+--- /dev/null
++++ glibc-2.10.1/sysdeps/unix/sysv/linux/nios2/brk.c
+@@ -0,0 +1,58 @@
++/* brk system call for Linux/Nios II.
++ Copyright (C) 1995, 1996, 2005 Free Software Foundation, Inc.
++ This file is part of the GNU C Library.
++
++ The GNU C Library is free software; you can redistribute it and/or
++ modify it under the terms of the GNU Lesser General Public
++ License as published by the Free Software Foundation; either
++ version 2.1 of the License, or (at your option) any later version.
++
++ The GNU C Library is distributed in the hope that it will be useful,
++ but WITHOUT ANY WARRANTY; without even the implied warranty of
++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++ Lesser General Public License for more details.
++
++ You should have received a copy of the GNU Lesser General Public
++ License along with the GNU C Library; if not, write to the Free
++ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
++ 02111-1307 USA. */
++
++#include <errno.h>
++#include <unistd.h>
++#include <sysdep.h>
++
++/* This must be initialized data because commons can't have aliases. */
++void *__curbrk = 0;
++
++int
++__brk (void *addr)
++{
++ void *newbrk;
++
++ /* We can't use the INLINE_SYSCALL macro here because on non-optimized
++ builds it loads the address of errno even if no error occurred. __brk
++ is called during process initialization, before errno is set up. */
++ {
++ register int _r2 asm ("r2") = (int)(SYS_ify (brk));
++ register int _err asm ("r7");
++ register int _r4 asm ("r4") = (int)(addr);
++ asm volatile ("trap"
++ : "=r" (_r2), "=r" (_err)
++ : "r" (_r2), "r" (_r4)
++ : __SYSCALL_CLOBBERS);
++ newbrk = (void *) _r2;
++ if (_err)
++ newbrk = 0;
++ }
++
++ __curbrk = newbrk;
++
++ if (newbrk < addr)
++ {
++ __set_errno (ENOMEM);
++ return -1;
++ }
++
++ return 0;
++}
++weak_alias (__brk, brk)
+Index: glibc-2.10.1/sysdeps/unix/sysv/linux/nios2/clone.S
+===================================================================
+--- /dev/null
++++ glibc-2.10.1/sysdeps/unix/sysv/linux/nios2/clone.S
+@@ -0,0 +1,102 @@
++/* Copyright (C) 2008 Free Software Foundation, Inc.
++ This file is part of the GNU C Library.
++ Contributed by Andrew Jenner <andrew@codesourcery.com>, 2008.
++
++ The GNU C Library is free software; you can redistribute it and/or
++ modify it under the terms of the GNU Lesser General Public
++ License as published by the Free Software Foundation; either
++ version 2.1 of the License, or (at your option) any later version.
++
++ The GNU C Library is distributed in the hope that it will be useful,
++ but WITHOUT ANY WARRANTY; without even the implied warranty of
++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++ Lesser General Public License for more details.
++
++ You should have received a copy of the GNU Lesser General Public
++ License along with the GNU C Library; if not, write to the Free
++ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
++ 02111-1307 USA. */
++
++/* clone() is even more special than fork() as it mucks with stacks
++ and invokes a function in the right context after its all over. */
++
++#include <sysdep.h>
++#define _ERRNO_H 1
++#include <bits/errno.h>
++#include <tcb-offsets.h>
++
++#define CLONE_VM 0x00000100
++#define CLONE_THREAD 0x00010000
++
++/* int clone(int (*fn)(void *arg), void *child_stack, int flags, void *arg,
++ void *parent_tidptr, void *tls, void *child_tidptr) */
++
++ .text
++ENTRY(__clone)
++ /* Sanity check arguments. */
++ movi r2,EINVAL
++ /* No NULL function pointers. */
++ beq r4,zero,SYSCALL_ERROR_LABEL
++ /* No NULL stack pointers. */
++ beq r5,zero,SYSCALL_ERROR_LABEL
++
++ subi r5,r5,12 /* Reserve argument save space. */
++ stw r6,8(r5) /* Save flags. */
++ stw r4,4(r5) /* Save function pointer. */
++ stw r7,0(r5) /* Save argument pointer. */
++
++ /* Load arguments. */
++ mov r4,r6
++ ldw r6,0(sp)
++ ldw r7,4(sp)
++ ldw r8,8(sp)
++
++ /* Do the system call. */
++ movi r2,__NR_clone
++ trap
++
++ /* Check for errors. */
++ bne r7,zero,SYSCALL_ERROR_LABEL
++
++ /* See if we're on the newly created thread. */
++ beq r2,zero,thread_start
++
++ /* Successful return from the parent */
++ ret
++
++thread_start:
++ ldw r4,8(sp)
++
++ andi r2,r4,CLONE_THREAD
++ bne r2,zero,2f
++ andi r3,r4,CLONE_VM
++ movi r2,-1
++ bne r3,zero,3f
++ DO_CALL (getpid, 0)
++3:
++ stw r2,PID_OFFSET(r23)
++ stw r2,TID_OFFSET(r23)
++2:
++ ldw r5,4(sp) /* Function pointer. */
++ ldw r4,0(sp) /* Argument pointer. */
++ addi sp,sp,12
++
++ /* Call the user's function. */
++ callr r5
++
++ /* _exit with the result. */
++ mov r4,r2
++
++#ifdef PIC
++ nextpc r22
++1: movhi r8, %hiadj(_GLOBAL_OFFSET_TABLE_ - 1b)
++ addi r8, r8, %lo(_GLOBAL_OFFSET_TABLE_ - 1b)
++ add r22, r22, r8
++ ldw r8, %call(_exit)(r22)
++ jmp r8
++#else
++ jmpi _exit
++#endif
++PSEUDO_END (__clone)
++
++weak_alias (__clone, clone)
+Index: glibc-2.10.1/sysdeps/unix/sysv/linux/nios2/configure
+===================================================================
+--- /dev/null
++++ glibc-2.10.1/sysdeps/unix/sysv/linux/nios2/configure
+@@ -0,0 +1,4 @@
++# This file is generated from configure.in by Autoconf. DO NOT EDIT!
++ # Local configure fragment for sysdeps/unix/sysv/linux/nios2.
++
++arch_minimum_kernel=2.6.21
+Index: glibc-2.10.1/sysdeps/unix/sysv/linux/nios2/configure.in
+===================================================================
+--- /dev/null
++++ glibc-2.10.1/sysdeps/unix/sysv/linux/nios2/configure.in
+@@ -0,0 +1,4 @@
++GLIBC_PROVIDES dnl See aclocal.m4 in the top level source directory.
++# Local configure fragment for sysdeps/unix/sysv/linux/nios2.
++
++arch_minimum_kernel=2.6.21
+Index: glibc-2.10.1/sysdeps/unix/sysv/linux/nios2/fxstatat.c
+===================================================================
+--- /dev/null
++++ glibc-2.10.1/sysdeps/unix/sysv/linux/nios2/fxstatat.c
+@@ -0,0 +1 @@
++#include <sysdeps/unix/sysv/linux/i386/fxstatat.c>
+Index: glibc-2.10.1/sysdeps/unix/sysv/linux/nios2/getrlimit.c
+===================================================================
+--- /dev/null
++++ glibc-2.10.1/sysdeps/unix/sysv/linux/nios2/getrlimit.c
+@@ -0,0 +1 @@
++#include <sysdeps/unix/sysv/linux/i386/getrlimit.c>
+Index: glibc-2.10.1/sysdeps/unix/sysv/linux/nios2/kernel-features.h
+===================================================================
+--- /dev/null
++++ glibc-2.10.1/sysdeps/unix/sysv/linux/nios2/kernel-features.h
+@@ -0,0 +1,26 @@
++/* Set flags signalling availability of kernel features based on given
++ kernel version number.
++ Copyright (C) 2006, 2008 Free Software Foundation, Inc.
++ This file is part of the GNU C Library.
++
++ The GNU C Library is free software; you can redistribute it and/or
++ modify it under the terms of the GNU Lesser General Public
++ License as published by the Free Software Foundation; either
++ version 2.1 of the License, or (at your option) any later version.
++
++ The GNU C Library is distributed in the hope that it will be useful,
++ but WITHOUT ANY WARRANTY; without even the implied warranty of
++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++ Lesser General Public License for more details.
++
++ You should have received a copy of the GNU Lesser General Public
++ License along with the GNU C Library; if not, write to the Free
++ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
++ 02111-1307 USA. */
++
++#define __ASSUME_NEW_GETRLIMIT_SYSCALL 1
++
++#include_next <kernel-features.h>
++
++#undef __ASSUME_PSELECT
++#undef __ASSUME_PPOLL
+Index: glibc-2.10.1/sysdeps/unix/sysv/linux/nios2/nptl/bits/pthreadtypes.h
+===================================================================
+--- /dev/null
++++ glibc-2.10.1/sysdeps/unix/sysv/linux/nios2/nptl/bits/pthreadtypes.h
+@@ -0,0 +1,181 @@
++/* Copyright (C) 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
++ This file is part of the GNU C Library.
++
++ The GNU C Library is free software; you can redistribute it and/or
++ modify it under the terms of the GNU Lesser General Public
++ License as published by the Free Software Foundation; either
++ version 2.1 of the License, or (at your option) any later version.
++
++ The GNU C Library is distributed in the hope that it will be useful,
++ but WITHOUT ANY WARRANTY; without even the implied warranty of
++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++ Lesser General Public License for more details.
++
++ You should have received a copy of the GNU Lesser General Public
++ License along with the GNU C Library; if not, write to the Free
++ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
++ 02111-1307 USA. */
++
++#ifndef _BITS_PTHREADTYPES_H
++#define _BITS_PTHREADTYPES_H 1
++
++#include <endian.h>
++
++#define __SIZEOF_PTHREAD_ATTR_T 36
++#define __SIZEOF_PTHREAD_MUTEX_T 24
++#define __SIZEOF_PTHREAD_MUTEXATTR_T 4
++#define __SIZEOF_PTHREAD_COND_T 48
++#define __SIZEOF_PTHREAD_COND_COMPAT_T 12
++#define __SIZEOF_PTHREAD_CONDATTR_T 4
++#define __SIZEOF_PTHREAD_RWLOCK_T 32
++#define __SIZEOF_PTHREAD_RWLOCKATTR_T 8
++#define __SIZEOF_PTHREAD_BARRIER_T 20
++#define __SIZEOF_PTHREAD_BARRIERATTR_T 4
++
++
++/* Thread identifiers. The structure of the attribute type is not
++ exposed on purpose. */
++typedef unsigned long int pthread_t;
++
++
++typedef union
++{
++ char __size[__SIZEOF_PTHREAD_ATTR_T];
++ long int __align;
++} pthread_attr_t;
++
++
++typedef struct __pthread_internal_slist
++{
++ struct __pthread_internal_slist *__next;
++} __pthread_slist_t;
++
++
++/* Data structures for mutex handling. The structure of the attribute
++ type is not exposed on purpose. */
++typedef union
++{
++ struct __pthread_mutex_s
++ {
++ int __lock;
++ unsigned int __count;
++ int __owner;
++ /* KIND must stay at this position in the structure to maintain
++ binary compatibility. */
++ int __kind;
++ unsigned int __nusers;
++ __extension__ union
++ {
++ int __spins;
++ __pthread_slist_t __list;
++ };
++ } __data;
++ char __size[__SIZEOF_PTHREAD_MUTEX_T];
++ long int __align;
++} pthread_mutex_t;
++
++typedef union
++{
++ char __size[__SIZEOF_PTHREAD_MUTEXATTR_T];
++ long int __align;
++} pthread_mutexattr_t;
++
++
++/* Data structure for conditional variable handling. The structure of
++ the attribute type is not exposed on purpose. */
++typedef union
++{
++ struct
++ {
++ int __lock;
++ unsigned int __futex;
++ __extension__ unsigned long long int __total_seq;
++ __extension__ unsigned long long int __wakeup_seq;
++ __extension__ unsigned long long int __woken_seq;
++ void *__mutex;
++ unsigned int __nwaiters;
++ unsigned int __broadcast_seq;
++ } __data;
++ char __size[__SIZEOF_PTHREAD_COND_T];
++ __extension__ long long int __align;
++} pthread_cond_t;
++
++typedef union
++{
++ char __size[__SIZEOF_PTHREAD_CONDATTR_T];
++ long int __align;
++} pthread_condattr_t;
++
++
++/* Keys for thread-specific data */
++typedef unsigned int pthread_key_t;
++
++
++/* Once-only execution */
++typedef int pthread_once_t;
++
++
++#if defined __USE_UNIX98 || defined __USE_XOPEN2K
++/* Data structure for read-write lock variable handling. The
++ structure of the attribute type is not exposed on purpose. */
++typedef union
++{
++ struct
++ {
++ int __lock;
++ unsigned int __nr_readers;
++ unsigned int __readers_wakeup;
++ unsigned int __writer_wakeup;
++ unsigned int __nr_readers_queued;
++ unsigned int __nr_writers_queued;
++#if __BYTE_ORDER == __BIG_ENDIAN
++ unsigned char __pad1;
++ unsigned char __pad2;
++ unsigned char __shared;
++ /* FLAGS must stay at this position in the structure to maintain
++ binary compatibility. */
++ unsigned char __flags;
++#else
++ /* FLAGS must stay at this position in the structure to maintain
++ binary compatibility. */
++ unsigned char __flags;
++ unsigned char __shared;
++ unsigned char __pad1;
++ unsigned char __pad2;
++#endif
++ int __writer;
++ } __data;
++ char __size[__SIZEOF_PTHREAD_RWLOCK_T];
++ long int __align;
++} pthread_rwlock_t;
++
++typedef union
++{
++ char __size[__SIZEOF_PTHREAD_RWLOCKATTR_T];
++ long int __align;
++} pthread_rwlockattr_t;
++#endif
++
++
++#ifdef __USE_XOPEN2K
++/* POSIX spinlock data type. */
++typedef volatile int pthread_spinlock_t;
++
++
++/* POSIX barriers data type. The structure of the type is
++ deliberately not exposed. */
++typedef union
++{
++ char __size[__SIZEOF_PTHREAD_BARRIER_T];
++ long int __align;
++} pthread_barrier_t;
++
++typedef union
++{
++ char __size[__SIZEOF_PTHREAD_BARRIERATTR_T];
++ int __align;
++} pthread_barrierattr_t;
++#endif
++
++
++#endif /* bits/pthreadtypes.h */
+Index: glibc-2.10.1/sysdeps/unix/sysv/linux/nios2/nptl/bits/semaphore.h
+===================================================================
+--- /dev/null
++++ glibc-2.10.1/sysdeps/unix/sysv/linux/nios2/nptl/bits/semaphore.h
+@@ -0,0 +1,38 @@
++/* Copyright (C) 2002, 2005 Free Software Foundation, Inc.
++ This file is part of the GNU C Library.
++
++ The GNU C Library is free software; you can redistribute it and/or
++ modify it under the terms of the GNU Lesser General Public
++ License as published by the Free Software Foundation; either
++ version 2.1 of the License, or (at your option) any later version.
++
++ The GNU C Library is distributed in the hope that it will be useful,
++ but WITHOUT ANY WARRANTY; without even the implied warranty of
++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++ Lesser General Public License for more details.
++
++ You should have received a copy of the GNU Lesser General Public
++ License along with the GNU C Library; if not, write to the Free
++ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
++ 02111-1307 USA. */
++
++#ifndef _SEMAPHORE_H
++# error "Never use <bits/semaphore.h> directly; include <semaphore.h> instead."
++#endif
++
++
++#define __SIZEOF_SEM_T 16
++
++
++/* Value returned if `sem_open' failed. */
++#define SEM_FAILED ((sem_t *) 0)
++
++/* Maximum value the semaphore can have. */
++#define SEM_VALUE_MAX ((int) ((~0u) >> 1))
++
++
++typedef union
++{
++ char __size[__SIZEOF_SEM_T];
++ long int __align;
++} sem_t;
+Index: glibc-2.10.1/sysdeps/unix/sysv/linux/nios2/nptl/createthread.c
+===================================================================
+--- /dev/null
++++ glibc-2.10.1/sysdeps/unix/sysv/linux/nios2/nptl/createthread.c
+@@ -0,0 +1,24 @@
++/* Copyright (C) 2005 Free Software Foundation, Inc.
++ This file is part of the GNU C Library.
++
++ The GNU C Library is free software; you can redistribute it and/or
++ modify it under the terms of the GNU Lesser General Public
++ License as published by the Free Software Foundation; either
++ version 2.1 of the License, or (at your option) any later version.
++
++ The GNU C Library is distributed in the hope that it will be useful,
++ but WITHOUT ANY WARRANTY; without even the implied warranty of
++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++ Lesser General Public License for more details.
++
++ You should have received a copy of the GNU Lesser General Public
++ License along with the GNU C Library; if not, write to the Free
++ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
++ 02111-1307 USA. */
++
++/* Value passed to 'clone' for initialization of the thread register. */
++#define TLS_VALUE ((void *) (pd) \
++ + TLS_TCB_OFFSET + TLS_PRE_TCB_SIZE)
++
++/* Get the real implementation. */
++#include <nptl/sysdeps/pthread/createthread.c>
+Index: glibc-2.10.1/sysdeps/unix/sysv/linux/nios2/nptl/fork.c
+===================================================================
+--- /dev/null
++++ glibc-2.10.1/sysdeps/unix/sysv/linux/nios2/nptl/fork.c
+@@ -0,0 +1,34 @@
++/* Copyright (C) 2005 Free Software Foundation, Inc.
++ This file is part of the GNU C Library.
++
++ The GNU C Library is free software; you can redistribute it and/or
++ modify it under the terms of the GNU Lesser General Public
++ License as published by the Free Software Foundation; either
++ version 2.1 of the License, or (at your option) any later version.
++
++ The GNU C Library is distributed in the hope that it will be useful,
++ but WITHOUT ANY WARRANTY; without even the implied warranty of
++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++ Lesser General Public License for more details.
++
++ You should have received a copy of the GNU Lesser General Public
++ License along with the GNU C Library; if not, write to the Free
++ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
++ 02111-1307 USA. */
++
++#include <sched.h>
++#include <signal.h>
++#include <sysdep.h>
++#include <tls.h>
++
++/* Argument 1 - Clone flags.
++ 2 - Child stack pointer.
++ 3 - Parent tid pointer.
++ 4 - New TLS area pointer.
++ 5 - Child tid pointer. */
++#define ARCH_FORK() \
++ INLINE_SYSCALL (clone, 5, \
++ CLONE_CHILD_SETTID | CLONE_CHILD_CLEARTID | SIGCHLD, \
++ NULL, NULL, NULL, &THREAD_SELF->tid)
++
++#include <nptl/sysdeps/unix/sysv/linux/fork.c>
+Index: glibc-2.10.1/sysdeps/unix/sysv/linux/nios2/nptl/lowlevellock.h
+===================================================================
+--- /dev/null
++++ glibc-2.10.1/sysdeps/unix/sysv/linux/nios2/nptl/lowlevellock.h
+@@ -0,0 +1,283 @@
++/* Copyright (C) 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
++ This file is part of the GNU C Library.
++
++ The GNU C Library is free software; you can redistribute it and/or
++ modify it under the terms of the GNU Lesser General Public
++ License as published by the Free Software Foundation; either
++ version 2.1 of the License, or (at your option) any later version.
++
++ The GNU C Library is distributed in the hope that it will be useful,
++ but WITHOUT ANY WARRANTY; without even the implied warranty of
++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++ Lesser General Public License for more details.
++
++ You should have received a copy of the GNU Lesser General Public
++ License along with the GNU C Library; if not, write to the Free
++ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
++ 02111-1307 USA. */
++
++#ifndef _LOWLEVELLOCK_H
++#define _LOWLEVELLOCK_H 1
++
++#include <time.h>
++#include <sys/param.h>
++#include <bits/pthreadtypes.h>
++#include <atomic.h>
++#include <sysdep.h>
++#include <kernel-features.h>
++#include <tls.h>
++
++#define FUTEX_WAIT 0
++#define FUTEX_WAKE 1
++#define FUTEX_REQUEUE 3
++#define FUTEX_CMP_REQUEUE 4
++#define FUTEX_WAKE_OP 5
++#define FUTEX_OP_CLEAR_WAKE_IF_GT_ONE ((4 << 24) | 1)
++#define FUTEX_LOCK_PI 6
++#define FUTEX_UNLOCK_PI 7
++#define FUTEX_TRYLOCK_PI 8
++#define FUTEX_WAIT_BITSET 9
++#define FUTEX_WAKE_BITSET 10
++#define FUTEX_PRIVATE_FLAG 128
++#define FUTEX_CLOCK_REALTIME 256
++
++#define FUTEX_BITSET_MATCH_ANY 0xffffffff
++
++/* Values for 'private' parameter of locking macros. Yes, the
++ definition seems to be backwards. But it is not. The bit will be
++ reversed before passing to the system call. */
++#define LLL_PRIVATE 0
++#define LLL_SHARED FUTEX_PRIVATE_FLAG
++
++
++#if !defined NOT_IN_libc || defined IS_IN_rtld
++/* In libc.so or ld.so all futexes are private. */
++# ifdef __ASSUME_PRIVATE_FUTEX
++# define __lll_private_flag(fl, private) \
++ ((fl) | FUTEX_PRIVATE_FLAG)
++# else
++# define __lll_private_flag(fl, private) \
++ ((fl) | THREAD_GETMEM (THREAD_SELF, header.private_futex))
++# endif
++#else
++# ifdef __ASSUME_PRIVATE_FUTEX
++# define __lll_private_flag(fl, private) \
++ (((fl) | FUTEX_PRIVATE_FLAG) ^ (private))
++# else
++# define __lll_private_flag(fl, private) \
++ (__builtin_constant_p (private) \
++ ? ((private) == 0 \
++ ? ((fl) | THREAD_GETMEM (THREAD_SELF, header.private_futex)) \
++ : (fl)) \
++ : ((fl) | (((private) ^ FUTEX_PRIVATE_FLAG) \
++ & THREAD_GETMEM (THREAD_SELF, header.private_futex))))
++# endif
++#endif
++
++
++#define lll_futex_wait(futexp, val, private) \
++ lll_futex_timed_wait(futexp, val, NULL, private)
++
++#define lll_futex_timed_wait(futexp, val, timespec, private) \
++ ({ \
++ INTERNAL_SYSCALL_DECL (__err); \
++ long int __ret; \
++ __ret = INTERNAL_SYSCALL (futex, __err, 4, (futexp), \
++ __lll_private_flag (FUTEX_WAIT, private), \
++ (val), (timespec)); \
++ __ret; \
++ })
++
++#define lll_futex_wake(futexp, nr, private) \
++ ({ \
++ INTERNAL_SYSCALL_DECL (__err); \
++ long int __ret; \
++ __ret = INTERNAL_SYSCALL (futex, __err, 4, (futexp), \
++ __lll_private_flag (FUTEX_WAKE, private), \
++ (nr), 0); \
++ __ret; \
++ })
++
++#define lll_robust_dead(futexv, private) \
++ do \
++ { \
++ int *__futexp = &(futexv); \
++ atomic_or (__futexp, FUTEX_OWNER_DIED); \
++ lll_futex_wake (__futexp, 1, private); \
++ } \
++ while (0)
++
++/* Returns non-zero if error happened, zero if success. */
++#define lll_futex_requeue(futexp, nr_wake, nr_move, mutex, val, private) \
++ ({ \
++ INTERNAL_SYSCALL_DECL (__err); \
++ long int __ret; \
++ __ret = INTERNAL_SYSCALL (futex, __err, 6, (futexp), \
++ __lll_private_flag (FUTEX_CMP_REQUEUE, private),\
++ (nr_wake), (nr_move), (mutex), (val)); \
++ INTERNAL_SYSCALL_ERROR_P (__ret, __err); \
++ })
++
++
++/* Returns non-zero if error happened, zero if success. */
++#define lll_futex_wake_unlock(futexp, nr_wake, nr_wake2, futexp2, private) \
++ ({ \
++ INTERNAL_SYSCALL_DECL (__err); \
++ long int __ret; \
++ __ret = INTERNAL_SYSCALL (futex, __err, 6, (futexp), \
++ __lll_private_flag (FUTEX_WAKE_OP, private), \
++ (nr_wake), (nr_wake2), (futexp2), \
++ FUTEX_OP_CLEAR_WAKE_IF_GT_ONE); \
++ INTERNAL_SYSCALL_ERROR_P (__ret, __err); \
++ })
++
++
++#define lll_trylock(lock) \
++ atomic_compare_and_exchange_val_acq(&(lock), 1, 0)
++
++#define lll_cond_trylock(lock) \
++ atomic_compare_and_exchange_val_acq(&(lock), 2, 0)
++
++#define __lll_robust_trylock(futex, id) \
++ (atomic_compare_and_exchange_val_acq (futex, id, 0) != 0)
++#define lll_robust_trylock(lock, id) \
++ __lll_robust_trylock (&(lock), id)
++
++extern void __lll_lock_wait_private (int *futex) attribute_hidden;
++extern void __lll_lock_wait (int *futex, int private) attribute_hidden;
++extern int __lll_robust_lock_wait (int *futex, int private) attribute_hidden;
++
++#define __lll_lock(futex, private) \
++ ((void) ({ \
++ int *__futex = (futex); \
++ if (__builtin_expect (atomic_compare_and_exchange_val_acq (__futex, \
++ 1, 0), 0)) \
++ { \
++ if (__builtin_constant_p (private) && (private) == LLL_PRIVATE) \
++ __lll_lock_wait_private (__futex); \
++ else \
++ __lll_lock_wait (__futex, private); \
++ } \
++ }))
++#define lll_lock(futex, private) __lll_lock (&(futex), private)
++
++
++#define __lll_robust_lock(futex, id, private) \
++ ({ \
++ int *__futex = (futex); \
++ int __val = 0; \
++ \
++ if (__builtin_expect (atomic_compare_and_exchange_bool_acq (__futex, id, \
++ 0), 0)) \
++ __val = __lll_robust_lock_wait (__futex, private); \
++ __val; \
++ })
++#define lll_robust_lock(futex, id, private) \
++ __lll_robust_lock (&(futex), id, private)
++
++
++#define __lll_cond_lock(futex, private) \
++ ((void) ({ \
++ int *__futex = (futex); \
++ if (__builtin_expect (atomic_exchange_acq (__futex, 2), 0)) \
++ __lll_lock_wait (__futex, private); \
++ }))
++#define lll_cond_lock(futex, private) __lll_cond_lock (&(futex), private)
++
++
++#define lll_robust_cond_lock(futex, id, private) \
++ __lll_robust_lock (&(futex), (id) | FUTEX_WAITERS, private)
++
++
++extern int __lll_timedlock_wait (int *futex, const struct timespec *,
++ int private) attribute_hidden;
++extern int __lll_robust_timedlock_wait (int *futex, const struct timespec *,
++ int private) attribute_hidden;
++
++#define __lll_timedlock(futex, abstime, private) \
++ ({ \
++ int *__futex = (futex); \
++ int __val = 0; \
++ \
++ if (__builtin_expect (atomic_exchange_acq (__futex, 1), 0)) \
++ __val = __lll_timedlock_wait (__futex, abstime, private); \
++ __val; \
++ })
++#define lll_timedlock(futex, abstime, private) \
++ __lll_timedlock (&(futex), abstime, private)
++
++
++#define __lll_robust_timedlock(futex, abstime, id, private) \
++ ({ \
++ int *__futex = (futex); \
++ int __val = 0; \
++ \
++ if (__builtin_expect (atomic_compare_and_exchange_bool_acq (__futex, id, \
++ 0), 0)) \
++ __val = __lll_robust_timedlock_wait (__futex, abstime, private); \
++ __val; \
++ })
++#define lll_robust_timedlock(futex, abstime, id, private) \
++ __lll_robust_timedlock (&(futex), abstime, id, private)
++
++
++#define __lll_unlock(futex, private) \
++ (void) \
++ ({ int *__futex = (futex); \
++ int __oldval = atomic_exchange_rel (__futex, 0); \
++ if (__builtin_expect (__oldval > 1, 0)) \
++ lll_futex_wake (__futex, 1, private); \
++ })
++#define lll_unlock(futex, private) __lll_unlock(&(futex), private)
++
++
++#define __lll_robust_unlock(futex, private) \
++ (void) \
++ ({ int *__futex = (futex); \
++ int __oldval = atomic_exchange_rel (__futex, 0); \
++ if (__builtin_expect (__oldval & FUTEX_WAITERS, 0)) \
++ lll_futex_wake (__futex, 1, private); \
++ })
++#define lll_robust_unlock(futex, private) \
++ __lll_robust_unlock(&(futex), private)
++
++
++#define lll_islocked(futex) \
++ (futex != 0)
++
++
++/* Our internal lock implementation is identical to the binary-compatible
++ mutex implementation. */
++
++/* Initializers for lock. */
++#define LLL_LOCK_INITIALIZER (0)
++#define LLL_LOCK_INITIALIZER_LOCKED (1)
++
++/* The states of a lock are:
++ 0 - untaken
++ 1 - taken by one user
++ >1 - taken by more users */
++
++/* The kernel notifies a process which uses CLONE_CLEARTID via futex
++ wakeup when the clone terminates. The memory location contains the
++ thread ID while the clone is running and is reset to zero
++ afterwards. */
++#define lll_wait_tid(tid) \
++ do { \
++ __typeof (tid) __tid; \
++ while ((__tid = (tid)) != 0) \
++ lll_futex_wait (&(tid), __tid, LLL_SHARED);\
++ } while (0)
++
++extern int __lll_timedwait_tid (int *, const struct timespec *)
++ attribute_hidden;
++
++#define lll_timedwait_tid(tid, abstime) \
++ ({ \
++ int __res = 0; \
++ if ((tid) != 0) \
++ __res = __lll_timedwait_tid (&(tid), (abstime)); \
++ __res; \
++ })
++
++#endif /* lowlevellock.h */
+Index: glibc-2.10.1/sysdeps/unix/sysv/linux/nios2/nptl/pt-vfork.S
+===================================================================
+--- /dev/null
++++ glibc-2.10.1/sysdeps/unix/sysv/linux/nios2/nptl/pt-vfork.S
+@@ -0,0 +1,42 @@
++/* Copyright (C) 2005, 2008 Free Software Foundation, Inc.
++ This file is part of the GNU C Library.
++
++ The GNU C Library is free software; you can redistribute it and/or
++ modify it under the terms of the GNU Lesser General Public
++ License as published by the Free Software Foundation; either
++ version 2.1 of the License, or (at your option) any later version.
++
++ The GNU C Library is distributed in the hope that it will be useful,
++ but WITHOUT ANY WARRANTY; without even the implied warranty of
++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++ Lesser General Public License for more details.
++
++ You should have received a copy of the GNU Lesser General Public
++ License along with the GNU C Library; if not, write to the Free
++ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
++ 02111-1307 USA. */
++
++#include <sysdep.h>
++#include <tcb-offsets.h>
++
++ENTRY (__vfork)
++
++ ldw r4, PID_OFFSET(r23)
++ sub r4, zero, r4
++ stw r4, PID_OFFSET(r23)
++
++ DO_CALL (vfork, 0)
++
++ beq r2, zero, 1f
++ ldw r4, PID_OFFSET(r23)
++ sub r4, zero, r4
++ stw r4, PID_OFFSET(r23)
++1:
++
++ bne r7, zero, SYSCALL_ERROR_LABEL
++ ret
++
++PSEUDO_END (__vfork)
++libc_hidden_def (__vfork)
++
++weak_alias (__vfork, vfork)
+Index: glibc-2.10.1/sysdeps/unix/sysv/linux/nios2/nptl/pthread_once.c
+===================================================================
+--- /dev/null
++++ glibc-2.10.1/sysdeps/unix/sysv/linux/nios2/nptl/pthread_once.c
+@@ -0,0 +1,94 @@
++/* Copyright (C) 2003, 2004, 2007 Free Software Foundation, Inc.
++ This file is part of the GNU C Library.
++ Contributed by Jakub Jelinek <jakub@redhat.com>, 2003.
++
++ The GNU C Library is free software; you can redistribute it and/or
++ modify it under the terms of the GNU Lesser General Public
++ License as published by the Free Software Foundation; either
++ version 2.1 of the License, or (at your option) any later version.
++
++ The GNU C Library is distributed in the hope that it will be useful,
++ but WITHOUT ANY WARRANTY; without even the implied warranty of
++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++ Lesser General Public License for more details.
++
++ You should have received a copy of the GNU Lesser General Public
++ License along with the GNU C Library; if not, write to the Free
++ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
++ 02111-1307 USA. */
++
++#include "pthreadP.h"
++#include <lowlevellock.h>
++
++
++unsigned long int __fork_generation attribute_hidden;
++
++
++static void
++clear_once_control (void *arg)
++{
++ pthread_once_t *once_control = (pthread_once_t *) arg;
++
++ *once_control = 0;
++ lll_futex_wake (once_control, INT_MAX, LLL_PRIVATE);
++}
++
++
++int
++__pthread_once (once_control, init_routine)
++ pthread_once_t *once_control;
++ void (*init_routine) (void);
++{
++ while (1)
++ {
++ int oldval, val, newval;
++
++ val = *once_control;
++ do
++ {
++ /* Check if the initialized has already been done. */
++ if ((val & 2) != 0)
++ return 0;
++
++ oldval = val;
++ newval = (oldval & 3) | __fork_generation | 1;
++ val = atomic_compare_and_exchange_val_acq (once_control, newval,
++ oldval);
++ }
++ while (__builtin_expect (val != oldval, 0));
++
++ /* Check if another thread already runs the initializer. */
++ if ((oldval & 1) != 0)
++ {
++ /* Check whether the initializer execution was interrupted
++ by a fork. */
++ if (((oldval ^ newval) & -4) == 0)
++ {
++ /* Same generation, some other thread was faster. Wait. */
++ lll_futex_wait (once_control, newval, LLL_PRIVATE);
++ continue;
++ }
++ }
++
++ /* This thread is the first here. Do the initialization.
++ Register a cleanup handler so that in case the thread gets
++ interrupted the initialization can be restarted. */
++ pthread_cleanup_push (clear_once_control, once_control);
++
++ init_routine ();
++
++ pthread_cleanup_pop (0);
++
++
++ /* Add one to *once_control. */
++ atomic_increment (once_control);
++
++ /* Wake up all other threads. */
++ lll_futex_wake (once_control, INT_MAX, LLL_PRIVATE);
++ break;
++ }
++
++ return 0;
++}
++weak_alias (__pthread_once, pthread_once)
++strong_alias (__pthread_once, __pthread_once_internal)
+Index: glibc-2.10.1/sysdeps/unix/sysv/linux/nios2/nptl/sysdep-cancel.h
+===================================================================
+--- /dev/null
++++ glibc-2.10.1/sysdeps/unix/sysv/linux/nios2/nptl/sysdep-cancel.h
+@@ -0,0 +1,140 @@
++/* Copyright (C) 2003, 2004, 2005, 2008 Free Software Foundation, Inc.
++ This file is part of the GNU C Library.
++
++ The GNU C Library is free software; you can redistribute it and/or
++ modify it under the terms of the GNU Lesser General Public
++ License as published by the Free Software Foundation; either
++ version 2.1 of the License, or (at your option) any later version.
++
++ The GNU C Library is distributed in the hope that it will be useful,
++ but WITHOUT ANY WARRANTY; without even the implied warranty of
++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++ Lesser General Public License for more details.
++
++ You should have received a copy of the GNU Lesser General Public
++ License along with the GNU C Library; if not, write to the Free
++ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
++ 02111-1307 USA. */
++
++#include <sysdep.h>
++#include <sysdeps/generic/sysdep.h>
++#include <tls.h>
++#ifndef __ASSEMBLER__
++# include <nptl/pthreadP.h>
++#endif
++
++#if !defined NOT_IN_libc || defined IS_IN_libpthread || defined IS_IN_librt
++
++# undef PSEUDO
++# define PSEUDO(name, syscall_name, args) \
++ .type __##syscall_name##_nocancel, @function; \
++ .globl __##syscall_name##_nocancel; \
++ __##syscall_name##_nocancel: \
++ DO_CALL (syscall_name, args); \
++ bne r7, zero, SYSCALL_ERROR_LABEL; \
++ ret; \
++ .size __##syscall_name##_nocancel,.-__##syscall_name##_nocancel; \
++ ENTRY (name) \
++ cfi_startproc; \
++ SINGLE_THREAD_P(r2); \
++ bne r2, zero, pseudo_cancel; \
++ DO_CALL (syscall_name, args); \
++ bne r7, zero, SYSCALL_ERROR_LABEL; \
++ ret; \
++ pseudo_cancel: \
++ SAVESTK_##args; /* save syscall args and adjust stack */ \
++ SAVEREG(ra, 0); /* save return address */ \
++ SAVEREG(r22, 4); /* save GOT pointer */ \
++ nextpc r22; \
++1: movhi r2, %hiadj(_GLOBAL_OFFSET_TABLE_ - 1b); \
++ addi r2, r2, %lo(_GLOBAL_OFFSET_TABLE_ - 1b); \
++ add r22, r22, r2; \
++ CENABLE; \
++ callr r3; \
++ stw r2, 8(sp); /* save mask */ \
++ LOADARGS_##args; \
++ movi r2, SYS_ify(syscall_name); \
++ trap; \
++ stw r2, 12(sp); /* save syscall result */ \
++ stw r7, 16(sp); /* save syscall error flag */ \
++ ldw r4, 8(sp); /* pass mask as argument 1 */ \
++ CDISABLE; \
++ callr r3; \
++ ldw r7, 16(sp); /* restore syscall error flag */ \
++ ldw r2, 12(sp); /* restore syscall result */ \
++ ldw ra, 0(sp); /* restore return address */ \
++ ldw r22, 4(sp); /* restore GOT pointer */ \
++ RESTORESTK_##args; \
++ bne r7, zero, SYSCALL_ERROR_LABEL; \
++ cfi_endproc;
++
++# undef PSEUDO_END
++# define PSEUDO_END(sym) \
++ SYSCALL_ERROR_HANDLER \
++ END (sym)
++
++#define SAVEREG(REG, LOC) stw REG, LOC(sp); cfi_rel_offset (REG, LOC)
++#define SAVESTK(X) subi sp, sp, X; cfi_adjust_cfa_offset(X)
++#define SAVESTK_0 SAVESTK(20)
++#define SAVEARG_1 SAVEREG(r4, 20)
++#define SAVESTK_1 SAVESTK(24); SAVEARG_1
++#define SAVEARG_2 SAVEREG(r5, 24); SAVEARG_1
++#define SAVESTK_2 SAVESTK(28); SAVEARG_2
++#define SAVEARG_3 SAVEREG(r6, 28); SAVEARG_2
++#define SAVESTK_3 SAVESTK(32); SAVEARG_3
++#define SAVEARG_4 SAVEREG(r7, 32); SAVEARG_3
++#define SAVESTK_4 SAVESTK(36); SAVEARG_4
++#define SAVESTK_5 SAVESTK_4
++#define SAVESTK_6 SAVESTK_5
++
++#define LOADARGS_0
++#define LOADARGS_1 ldw r4, 20(sp)
++#define LOADARGS_2 LOADARGS_1; ldw r5, 24(sp)
++#define LOADARGS_3 LOADARGS_2; ldw r6, 28(sp)
++#define LOADARGS_4 LOADARGS_3; ldw r7, 32(sp)
++#define LOADARGS_5 LOADARGS_4; ldw r8, 36(sp)
++#define LOADARGS_6 LOADARGS_5; ldw r9, 40(sp)
++
++#define RESTORESTK(X) addi sp, sp, X; cfi_adjust_cfa_offset(-X)
++#define RESTORESTK_0 RESTORESTK(20)
++#define RESTORESTK_1 RESTORESTK(24)
++#define RESTORESTK_2 RESTORESTK(28)
++#define RESTORESTK_3 RESTORESTK(32)
++#define RESTORESTK_4 RESTORESTK(36)
++#define RESTORESTK_5 RESTORESTK(36)
++#define RESTORESTK_6 RESTORESTK(36)
++
++# ifdef IS_IN_libpthread
++# define CENABLE ldw r3, %call(__pthread_enable_asynccancel)(r22)
++# define CDISABLE ldw r3, %call(__pthread_disable_asynccancel)(r22)
++# elif defined IS_IN_librt
++# define CENABLE ldw r3, %call(__librt_enable_asynccancel)(r22)
++# define CDISABLE ldw r3, %call(__librt_disable_asynccancel)(r22)
++# else
++# define CENABLE ldw r3, %call(__libc_enable_asynccancel)(r22)
++# define CDISABLE ldw r3, %call(__libc_disable_asynccancel)(r22)
++# endif
++
++# ifndef __ASSEMBLER__
++# define SINGLE_THREAD_P \
++ __builtin_expect (THREAD_GETMEM (THREAD_SELF, \
++ header.multiple_threads) \
++ == 0, 1)
++# else
++# define SINGLE_THREAD_P(reg) \
++ ldw reg, MULTIPLE_THREADS_OFFSET(r23)
++#endif
++
++#elif !defined __ASSEMBLER__
++
++/* For rtld, et cetera. */
++# define SINGLE_THREAD_P 1
++# define NO_CANCELLATION 1
++
++#endif
++
++#ifndef __ASSEMBLER__
++# define RTLD_SINGLE_THREAD_P \
++ __builtin_expect (THREAD_GETMEM (THREAD_SELF, \
++ header.multiple_threads) == 0, 1)
++#endif
+Index: glibc-2.10.1/sysdeps/unix/sysv/linux/nios2/nptl/vfork.S
+===================================================================
+--- /dev/null
++++ glibc-2.10.1/sysdeps/unix/sysv/linux/nios2/nptl/vfork.S
+@@ -0,0 +1,42 @@
++/* Copyright (C) 2005, 2008 Free Software Foundation, Inc.
++ This file is part of the GNU C Library.
++
++ The GNU C Library is free software; you can redistribute it and/or
++ modify it under the terms of the GNU Lesser General Public
++ License as published by the Free Software Foundation; either
++ version 2.1 of the License, or (at your option) any later version.
++
++ The GNU C Library is distributed in the hope that it will be useful,
++ but WITHOUT ANY WARRANTY; without even the implied warranty of
++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++ Lesser General Public License for more details.
++
++ You should have received a copy of the GNU Lesser General Public
++ License along with the GNU C Library; if not, write to the Free
++ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
++ 02111-1307 USA. */
++
++#include <sysdep.h>
++#include <tcb-offsets.h>
++
++ENTRY (__vfork)
++
++ ldw r4, PID_OFFSET(r23)
++ sub r4, zero, r4
++ stw r4, PID_OFFSET(r23)
++
++ DO_CALL (vfork, 0)
++
++ beq r2, zero, 1f
++ ldw r4, PID_OFFSET(r23)
++ sub r4, zero, r4
++ stw r4, PID_OFFSET(r23)
++1:
++
++ bne r7, zero, SYSCALL_ERROR_LABEL
++ ret
++
++PSEUDO_END (__vfork)
++libc_hidden_def (__vfork)
++
++weak_alias (__vfork, vfork)
+Index: glibc-2.10.1/sysdeps/unix/sysv/linux/nios2/profil-counter.h
+===================================================================
+--- /dev/null
++++ glibc-2.10.1/sysdeps/unix/sysv/linux/nios2/profil-counter.h
+@@ -0,0 +1,2 @@
++/* We can use the ix86 version. */
++#include <sysdeps/unix/sysv/linux/i386/profil-counter.h>
+Index: glibc-2.10.1/sysdeps/unix/sysv/linux/nios2/socket.S
+===================================================================
+--- /dev/null
++++ glibc-2.10.1/sysdeps/unix/sysv/linux/nios2/socket.S
+@@ -0,0 +1,136 @@
++/* Copyright (C) 1995, 1996, 1997, 1998, 2003, 2004, 2005
++ Free Software Foundation, Inc.
++
++ This file is part of the GNU C Library.
++
++ The GNU C Library is free software; you can redistribute it and/or
++ modify it under the terms of the GNU Lesser General Public
++ License as published by the Free Software Foundation; either
++ version 2.1 of the License, or (at your option) any later version.
++
++ The GNU C Library is distributed in the hope that it will be useful,
++ but WITHOUT ANY WARRANTY; without even the implied warranty of
++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++ Lesser General Public License for more details.
++
++ You should have received a copy of the GNU Lesser General Public
++ License along with the GNU C Library; if not, write to the Free
++ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
++ 02111-1307 USA. */
++
++#include <sysdep-cancel.h>
++#include <socketcall.h>
++
++#define P(a, b) P2(a, b)
++#define P2(a, b) a##b
++
++ .text
++/* The socket-oriented system calls are handled unusally in Linux.
++ They are all gated through the single `socketcall' system call number.
++ `socketcall' takes two arguments: the first is the subcode, specifying
++ which socket function is being called; and the second is a pointer to
++ the arguments to the specific function.
++
++ The .S files for the other calls just #define socket and #include this. */
++
++#ifndef __socket
++# ifndef NO_WEAK_ALIAS
++# define __socket P(__,socket)
++# else
++# define __socket socket
++# endif
++#endif
++
++#define PUSHARGS_1 subi sp, sp, 4 ; \
++ stw r4, 0(sp)
++#define PUSHARGS_2 subi sp, sp, 8 ; \
++ stw r5, 4(sp) ; \
++ stw r4, 0(sp)
++#define PUSHARGS_3 subi sp, sp, 12 ; \
++ stw r6, 8(sp) ; \
++ stw r5, 4(sp) ; \
++ stw r4, 0(sp)
++#define PUSHARGS_4 subi sp, sp, 16 ; \
++ stw r7, 12(sp) ; \
++ stw r6, 8(sp) ; \
++ stw r5, 4(sp) ; \
++ stw r4, 0(sp)
++#define PUSHARGS_5 PUSHARGS_4 /* Caller has already pushed arg 5 */
++#define PUSHARGS_6 PUSHARGS_4
++
++#define POPARGS_1 addi sp, sp, 4
++#define POPARGS_2 addi sp, sp, 8
++#define POPARGS_3 addi sp, sp, 12
++#define POPARGS_4 addi sp, sp, 16
++#define POPARGS_5 addi sp, sp, 16
++#define POPARGS_6 addi sp, sp, 16
++
++#ifndef NARGS
++#define NARGS 3 /* If we were called with no wrapper, this is really socket() */
++#endif
++
++.globl __socket
++ENTRY (__socket)
++ /* Push args onto the stack. */
++ P(PUSHARGS_,NARGS)
++
++#if defined NEED_CANCELLATION && defined CENABLE
++ SINGLE_THREAD_P(r2)
++ bne r2,zero,2f
++#endif
++
++ /* Do the system call trap. */
++ movi r4, P(SOCKOP_,socket)
++ mov r5, sp
++ movi r2, SYS_ify(socketcall)
++ trap
++
++ /* Pop args off the stack. */
++ P(POPARGS_,NARGS)
++
++ /* Check for errors. */
++ bne r7,zero,SYSCALL_ERROR_LABEL
++
++ ret
++#if defined NEED_CANCELLATION && defined CENABLE
++
++2: subi sp, sp, 20
++ stw ra, 0(sp)
++ stw r22, 4(sp)
++
++ nextpc r22
++1: movhi r2, %hiadj(_GLOBAL_OFFSET_TABLE_ - 1b)
++ addi r2, r2, %lo(_GLOBAL_OFFSET_TABLE_ - 1b)
++ add r22, r22, r2
++
++ CENABLE
++ callr r3
++ stw r16, 8(sp)
++
++ movi r4, P(SOCKOP_,socket)
++ addi r5, sp, 20
++ movi r2, SYS_ify(socketcall)
++ trap
++
++ stw r2, 12(sp)
++ stw r7, 16(sp)
++ ldw r4, 8(sp)
++ CDISABLE
++ callr r3
++ ldw r7, 16(sp)
++ ldw r2, 12(sp)
++ ldw r22, 4(sp)
++ ldw ra, 0(sp)
++ addi sp, sp, 20
++
++ P(POPARGS_,NARGS)
++
++ bne r7, zero, SYSCALL_ERROR_LABEL
++ ret
++#endif
++
++PSEUDO_END (__socket)
++
++#ifndef NO_WEAK_ALIAS
++weak_alias (__socket, socket)
++#endif
+Index: glibc-2.10.1/sysdeps/unix/sysv/linux/nios2/sys/procfs.h
+===================================================================
+--- /dev/null
++++ glibc-2.10.1/sysdeps/unix/sysv/linux/nios2/sys/procfs.h
+@@ -0,0 +1,123 @@
++/* Copyright (C) 1996, 1997, 1999, 2001 Free Software Foundation, Inc.
++ This file is part of the GNU C Library.
++
++ The GNU C Library is free software; you can redistribute it and/or
++ modify it under the terms of the GNU Lesser General Public
++ License as published by the Free Software Foundation; either
++ version 2.1 of the License, or (at your option) any later version.
++
++ The GNU C Library is distributed in the hope that it will be useful,
++ but WITHOUT ANY WARRANTY; without even the implied warranty of
++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++ Lesser General Public License for more details.
++
++ You should have received a copy of the GNU Lesser General Public
++ License along with the GNU C Library; if not, write to the Free
++ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
++ 02111-1307 USA. */
++
++#ifndef _SYS_PROCFS_H
++#define _SYS_PROCFS_H 1
++
++/* This is somewhat modelled after the file of the same name on SVR4
++ systems. It provides a definition of the core file format for ELF
++ used on Linux. It doesn't have anything to do with the /proc file
++ system, even though Linux has one.
++
++ Anyway, the whole purpose of this file is for GDB and GDB only.
++ Don't read too much into it. Don't use it for anything other than
++ GDB unless you know what you are doing. */
++
++#include <features.h>
++#include <sys/time.h>
++#include <sys/types.h>
++#include <sys/user.h>
++
++__BEGIN_DECLS
++
++/* Type for a general-purpose register. */
++typedef unsigned long elf_greg_t;
++
++/* And the whole bunch of them. We could have used `struct
++ user_regs' directly in the typedef, but tradition says that
++ the register set is an array, which does have some peculiar
++ semantics, so leave it that way. */
++#define ELF_NGREG (sizeof (struct user_regs) / sizeof(elf_greg_t))
++typedef elf_greg_t elf_gregset_t[ELF_NGREG];
++
++/* Register set for the floating-point registers. */
++typedef struct user_fpregs elf_fpregset_t;
++
++/* Signal info. */
++struct elf_siginfo
++ {
++ int si_signo; /* Signal number. */
++ int si_code; /* Extra code. */
++ int si_errno; /* Errno. */
++ };
++
++/* Definitions to generate Intel SVR4-like core files. These mostly
++ have the same names as the SVR4 types with "elf_" tacked on the
++ front to prevent clashes with Linux definitions, and the typedef
++ forms have been avoided. This is mostly like the SVR4 structure,
++ but more Linuxy, with things that Linux does not support and which
++ GDB doesn't really use excluded. */
++
++struct elf_prstatus
++ {
++ struct elf_siginfo pr_info; /* Info associated with signal. */
++ short int pr_cursig; /* Current signal. */
++ unsigned long int pr_sigpend; /* Set of pending signals. */
++ unsigned long int pr_sighold; /* Set of held signals. */
++ __pid_t pr_pid;
++ __pid_t pr_ppid;
++ __pid_t pr_pgrp;
++ __pid_t pr_sid;
++ struct timeval pr_utime; /* User time. */
++ struct timeval pr_stime; /* System time. */
++ struct timeval pr_cutime; /* Cumulative user time. */
++ struct timeval pr_cstime; /* Cumulative system time. */
++ elf_gregset_t pr_reg; /* GP registers. */
++ int pr_fpvalid; /* True if math copro being used. */
++ };
++
++
++#define ELF_PRARGSZ (80) /* Number of chars for args. */
++
++struct elf_prpsinfo
++ {
++ char pr_state; /* Numeric process state. */
++ char pr_sname; /* Char for pr_state. */
++ char pr_zomb; /* Zombie. */
++ char pr_nice; /* Nice val. */
++ unsigned long int pr_flag; /* Flags. */
++ unsigned short int pr_uid;
++ unsigned short int pr_gid;
++ int pr_pid, pr_ppid, pr_pgrp, pr_sid;
++ /* Lots missing */
++ char pr_fname[16]; /* Filename of executable. */
++ char pr_psargs[ELF_PRARGSZ]; /* Initial part of arg list. */
++ };
++
++/* The rest of this file provides the types for emulation of the
++ Solaris <proc_service.h> interfaces that should be implemented by
++ users of libthread_db. */
++
++/* Addresses. */
++typedef void *psaddr_t;
++
++/* Register sets. Linux has different names. */
++typedef elf_gregset_t prgregset_t;
++typedef elf_fpregset_t prfpregset_t;
++
++/* We don't have any differences between processes and threads,
++ therefore have only one PID type. */
++typedef __pid_t lwpid_t;
++
++/* Process status and info. In the end we do provide typedefs for them. */
++typedef struct elf_prstatus prstatus_t;
++typedef struct elf_prpsinfo prpsinfo_t;
++
++__END_DECLS
++
++#endif /* sys/procfs.h */
+Index: glibc-2.10.1/sysdeps/unix/sysv/linux/nios2/sys/user.h
+===================================================================
+--- /dev/null
++++ glibc-2.10.1/sysdeps/unix/sysv/linux/nios2/sys/user.h
+@@ -0,0 +1,58 @@
++/* Copyright (C) 1998, 1999, 2000, 2001 Free Software Foundation, Inc.
++ This file is part of the GNU C Library.
++
++ The GNU C Library is free software; you can redistribute it and/or
++ modify it under the terms of the GNU Lesser General Public
++ License as published by the Free Software Foundation; either
++ version 2.1 of the License, or (at your option) any later version.
++
++ The GNU C Library is distributed in the hope that it will be useful,
++ but WITHOUT ANY WARRANTY; without even the implied warranty of
++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++ Lesser General Public License for more details.
++
++ You should have received a copy of the GNU Lesser General Public
++ License along with the GNU C Library; if not, write to the Free
++ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
++ 02111-1307 USA. */
++
++#ifndef _SYS_USER_H
++#define _SYS_USER_H 1
++
++/* The whole purpose of this file is for GDB and GDB only. Don't read
++ too much into it. Don't use it for anything other than GDB unless
++ you know what you are doing. */
++
++struct user_fpregs
++{
++};
++
++struct user_regs
++{
++ unsigned long int uregs[32];
++};
++
++struct user
++{
++ struct user_regs regs; /* General registers */
++ int u_fpvalid; /* True if math co-processor being used. */
++
++ unsigned long int u_tsize; /* Text segment size (pages). */
++ unsigned long int u_dsize; /* Data segment size (pages). */
++ unsigned long int u_ssize; /* Stack segment size (pages). */
++
++ unsigned long start_code; /* Starting virtual address of text. */
++ unsigned long start_stack; /* Starting virtual address of stack. */
++
++ long int signal; /* Signal that caused the core dump. */
++ int reserved; /* No longer used */
++ struct user_regs *u_ar0; /* help gdb to find the general registers. */
++
++ unsigned long magic; /* uniquely identify a core file */
++ char u_comm[32]; /* User command that was responsible */
++ int u_debugreg[8];
++ struct user_fpregs u_fp; /* Floating point registers */
++ struct user_fpregs *u_fp0; /* help gdb to find the FP registers. */
++};
++
++#endif /* sys/user.h */
+Index: glibc-2.10.1/sysdeps/unix/sysv/linux/nios2/syscall.S
+===================================================================
+--- /dev/null
++++ glibc-2.10.1/sysdeps/unix/sysv/linux/nios2/syscall.S
+@@ -0,0 +1,36 @@
++/* Copyright (C) 2005, 2008 Free Software Foundation, Inc.
++ This file is part of the GNU C Library.
++
++ The GNU C Library is free software; you can redistribute it and/or
++ modify it under the terms of the GNU Lesser General Public
++ License as published by the Free Software Foundation; either
++ version 2.1 of the License, or (at your option) any later version.
++
++ The GNU C Library is distributed in the hope that it will be useful,
++ but WITHOUT ANY WARRANTY; without even the implied warranty of
++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++ Lesser General Public License for more details.
++
++ You should have received a copy of the GNU Lesser General Public
++ License along with the GNU C Library; if not, write to the Free
++ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
++ 02111-1307 USA. */
++
++#include <sysdep.h>
++
++/* We don't need a special syscall to implement syscall(). It won't work
++ reliably with 64-bit arguments (but that is true on many modern platforms).
++*/
++
++ENTRY (syscall)
++ mov r2, r4
++ mov r4, r5
++ mov r5, r6
++ mov r6, r7
++ ldw r7, 0(sp)
++ ldw r8, 4(sp)
++ ldw r9, 8(sp)
++ trap
++ bne r7, zero, SYSCALL_ERROR_LABEL
++ ret
++PSEUDO_END (syscall)
+Index: glibc-2.10.1/sysdeps/unix/sysv/linux/nios2/sysdep.h
+===================================================================
+--- /dev/null
++++ glibc-2.10.1/sysdeps/unix/sysv/linux/nios2/sysdep.h
+@@ -0,0 +1,219 @@
++/* Copyright (C) 2000, 2002, 2003, 2004, 2005, 2008 Free Software Foundation,
++ Inc.
++ This file is part of the GNU C Library.
++
++ The GNU C Library is free software; you can redistribute it and/or
++ modify it under the terms of the GNU Lesser General Public
++ License as published by the Free Software Foundation; either
++ version 2.1 of the License, or (at your option) any later version.
++
++ The GNU C Library is distributed in the hope that it will be useful,
++ but WITHOUT ANY WARRANTY; without even the implied warranty of
++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++ Lesser General Public License for more details.
++
++ You should have received a copy of the GNU Lesser General Public
++ License along with the GNU C Library; if not, write to the Free
++ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
++ 02111-1307 USA. */
++
++#ifndef _LINUX_NIOS2_SYSDEP_H
++#define _LINUX_NIOS2_SYSDEP_H 1
++
++#include <sysdeps/unix/sysdep.h>
++
++/* For Linux we can use the system call table in the header file
++ /usr/include/asm/unistd.h
++ of the kernel. But these symbols do not follow the SYS_* syntax
++ so we have to redefine the `SYS_ify' macro here. */
++#undef SYS_ify
++#define SYS_ify(syscall_name) __NR_##syscall_name
++
++#ifdef __ASSEMBLER__
++
++#define ASM_TYPE_DIRECTIVE(name,typearg) .type name,%##typearg;
++#define ASM_SIZE_DIRECTIVE(name) .size name,.-name
++
++#define ENTRY(name) \
++ ASM_GLOBAL_DIRECTIVE C_SYMBOL_NAME(name); \
++ ASM_TYPE_DIRECTIVE (C_SYMBOL_NAME(name),function) \
++ C_LABEL(name)
++
++#undef END
++#define END(name) \
++ ASM_SIZE_DIRECTIVE(name)
++
++#define SYSCALL_ERROR_LABEL __syscall_error
++
++#undef PSEUDO
++#define PSEUDO(name, syscall_name, args) \
++ ENTRY (name) \
++ DO_CALL (syscall_name, args) \
++ bne r7, zero, SYSCALL_ERROR_LABEL; \
++
++#undef PSEUDO_END
++#define PSEUDO_END(name) \
++ SYSCALL_ERROR_HANDLER \
++ END (name)
++
++#undef PSEUDO_NOERRNO
++#define PSEUDO_NOERRNO(name, syscall_name, args) \
++ ENTRY (name) \
++ DO_CALL (syscall_name, args)
++
++#undef PSEUDO_END_NOERRNO
++#define PSEUDO_END_NOERRNO(name) \
++ END (name)
++
++#undef ret_NOERRNO
++#define ret_NOERRNO ret
++
++#undef DO_CALL
++#define DO_CALL(syscall_name, args) \
++ DOARGS_##args \
++ movi r2, SYS_ify(syscall_name); \
++ trap;
++
++#if defined(__PIC__) || defined(PIC)
++
++#define SYSCALL_ERROR_HANDLER \
++SYSCALL_ERROR_LABEL: \
++ subi sp, sp, 12; \
++ stw r22, 8(sp); \
++ stw r2, 4(sp); \
++ stw ra, 0(sp); \
++ nextpc r22; \
++1: movhi r8, %hiadj(_GLOBAL_OFFSET_TABLE_ - 1b); \
++ addi r8, r8, %lo(_GLOBAL_OFFSET_TABLE_ - 1b); \
++ add r22, r22, r8; \
++ ldw r3, %call(__errno_location)(r22); \
++ callr r3; \
++ ldw ra, 0(sp); \
++ ldw r10, 4(sp); \
++ ldw r22, 8(sp); \
++ addi sp, sp, 12; \
++ stw r10, 0(r2); \
++ movi r2, -1; \
++ ret;
++
++#else
++
++#define SYSCALL_ERROR_HANDLER \
++SYSCALL_ERROR_LABEL: \
++ subi sp, sp, 8; \
++ stw r2, 4(sp); \
++ stw ra, 0(sp); \
++ call __errno_location; \
++ ldw ra, 0(sp); \
++ ldw r10, 4(sp); \
++ addi sp, sp, 8; \
++ stw r10, 0(r2); \
++ movi r2, -1; \
++ ret;
++
++#endif
++
++#define DOARGS_0 /* nothing */
++#define DOARGS_1 /* nothing */
++#define DOARGS_2 /* nothing */
++#define DOARGS_3 /* nothing */
++#define DOARGS_4 /* nothing */
++#define DOARGS_5 ldw r8, 0(sp);
++#define DOARGS_6 ldw r9, 4(sp); ldw r8, 0(sp);
++
++/* The function has to return the error code. */
++#undef PSEUDO_ERRVAL
++#define PSEUDO_ERRVAL(name, syscall_name, args) \
++ ENTRY (name) \
++ DO_CALL (syscall_name, args)
++
++#undef PSEUDO_END_ERRVAL
++#define PSEUDO_END_ERRVAL(name) \
++ END (name)
++
++#define ret_ERRVAL ret
++
++#else /* __ASSEMBLER__ */
++
++#include <asm/unistd.h>
++
++/* Define a macro which expands into the inline wrapper code for a system
++ call. */
++#undef INLINE_SYSCALL
++#define INLINE_SYSCALL(name, nr, args...) \
++ ({ INTERNAL_SYSCALL_DECL(err); \
++ unsigned int result_var = INTERNAL_SYSCALL (name, err, nr, args); \
++ if ( INTERNAL_SYSCALL_ERROR_P (result_var, err) ) \
++ { \
++ __set_errno (INTERNAL_SYSCALL_ERRNO (result_var, err)); \
++ result_var = -1L; \
++ } \
++ (int) result_var; })
++
++#undef INTERNAL_SYSCALL_DECL
++#define INTERNAL_SYSCALL_DECL(err) unsigned int err
++
++#undef INTERNAL_SYSCALL_ERROR_P
++#define INTERNAL_SYSCALL_ERROR_P(val, err) ((unsigned int) (err))
++
++#undef INTERNAL_SYSCALL_ERRNO
++#define INTERNAL_SYSCALL_ERRNO(val, err) (val)
++
++#undef INTERNAL_SYSCALL_RAW
++#define INTERNAL_SYSCALL_RAW(name, err, nr, args...) \
++ ({ unsigned int _sys_result; \
++ { \
++ register int _r2 asm ("r2") = (int)(name); \
++ register int _err asm ("r7"); \
++ LOAD_ARGS_##nr (args) \
++ asm volatile ("trap" \
++ : "=r" (_r2), "=r" (_err) \
++ : ASM_ARGS_##nr \
++ : __SYSCALL_CLOBBERS); \
++ _sys_result = _r2; \
++ err = _err; \
++ } \
++ (int) _sys_result; })
++
++#undef INTERNAL_SYSCALL
++#define INTERNAL_SYSCALL(name, err, nr, args...) \
++ INTERNAL_SYSCALL_RAW(SYS_ify(name), err, nr, args)
++
++#undef INTERNAL_SYSCALL_NCS
++#define INTERNAL_SYSCALL_NCS(number, err, nr, args...) \
++ INTERNAL_SYSCALL_RAW(number, err, nr, args)
++
++#define LOAD_ARGS_0()
++#define ASM_ARGS_0 "r" (_r2)
++#define LOAD_ARGS_1(a1) \
++ register int _r4 asm ("r4") = (int) (a1); \
++ LOAD_ARGS_0 ()
++#define ASM_ARGS_1 ASM_ARGS_0, "r" (_r4)
++#define LOAD_ARGS_2(a1, a2) \
++ register int _r5 asm ("r5") = (int) (a2); \
++ LOAD_ARGS_1 (a1)
++#define ASM_ARGS_2 ASM_ARGS_1, "r" (_r5)
++#define LOAD_ARGS_3(a1, a2, a3) \
++ register int _r6 asm ("r6") = (int) (a3); \
++ LOAD_ARGS_2 (a1, a2)
++#define ASM_ARGS_3 ASM_ARGS_2, "r" (_r6)
++#define LOAD_ARGS_4(a1, a2, a3, a4) \
++ register int _r7 asm ("r7") = (int) (a4); \
++ LOAD_ARGS_3 (a1, a2, a3)
++#define ASM_ARGS_4 ASM_ARGS_3, "r" (_r7)
++#define LOAD_ARGS_5(a1, a2, a3, a4, a5) \
++ register int _r8 asm ("r8") = (int) (a5); \
++ LOAD_ARGS_4 (a1, a2, a3, a4)
++#define ASM_ARGS_5 ASM_ARGS_4, "r" (_r8)
++#define LOAD_ARGS_6(a1, a2, a3, a4, a5, a6) \
++ register int _r9 asm ("r9") = (int) (a6); \
++ LOAD_ARGS_5 (a1, a2, a3, a4, a5)
++#define ASM_ARGS_6 ASM_ARGS_5, "r" (_r9)
++
++
++#define __SYSCALL_CLOBBERS "r1", "r3", "r10", "r11", "r12", "r13", "r14", \
++ "r15", "r29", "memory"
++
++#endif /* __ASSEMBLER__ */
++
++#endif /* linux/nios2/sysdep.h */
diff --git a/recipes/glibc/glibc-2.3.6/glibc-2.3.6-allow-gcc-4.1-powerpc32-initfini.s.patch b/recipes/glibc/glibc-2.3.6/glibc-2.3.6-allow-gcc-4.1-powerpc32-initfini.s.patch
deleted file mode 100644
index 4348d6f5d0..0000000000
--- a/recipes/glibc/glibc-2.3.6/glibc-2.3.6-allow-gcc-4.1-powerpc32-initfini.s.patch
+++ /dev/null
@@ -1,28 +0,0 @@
-fixes
-
-{BUILD_DIR}/build-glibc/csu/crtn.o: In function "dummy":
-{BUILD_DIR}/build-glibc/csu/crtn.S:14: multiple definition of "dummy"
-{BUILD_DIR}/build-glibc/csu/crti.o:{BUILD_DIR}/build-glibc/csu/crti.S:33: first defined here
-{BUILD_DIR}/build-glibc/csu/crtn.o: In function "_init":
-{BUILD_DIR}/build-glibc/csu/crtn.S:30: multiple definition of "_init"
-{BUILD_DIR}/build-glibc/csu/crti.o:{BUILD_DIR}/build-glibc/csu/crti.S:65: first defined here
-{BUILD_DIR}/build-glibc/csu/crtn.o: In function "_fini":
-{BUILD_DIR}/build-glibc/csu/crtn.S:25: multiple definition of "_fini"
-{BUILD_DIR}/build-glibc/csu/crti.o:{BUILD_DIR}/build-glibc/csu/crti.S:38: first defined here
-{BUILD_DIR}/build-glibc/csu/crti.o: In function "_fini":
-{BUILD_DIR}/build-glibc/csu/crti.S:(.init+0x20): undefined reference to "i_am_not_a_leaf"
-{BUILD_DIR}/build-glibc/csu/crtn.o: In function "_fini":
-{BUILD_DIR}/build-glibc/csu/crtn.S:(.init+0x40): undefined reference to "i_am_not_a_leaf"
-{BUILD_DIR}/build-glibc/csu/crtn.S:(.init+0x44): undefined reference to "i_am_not_a_leaf"
-
---- glibc-2.3.6/sysdeps/powerpc/powerpc32/Makefile.org 2006-08-21 19:03:01.000000000 -0700
-+++ glibc-2.3.6/sysdeps/powerpc/powerpc32/Makefile 2006-08-21 19:03:19.000000000 -0700
-@@ -21,7 +21,7 @@
- ifneq ($(elf),no)
- # The initfini generation code doesn't work in the presence of -fPIC, so
- # we use -fpic instead which is much better.
--CFLAGS-initfini.s = -g0 -fpic -O1
-+CFLAGS-initfini.s = -g0 -fpic -O1 $(fno-unit-at-a-time)
-
- # There is no benefit to using sdata for these objects, and the user
- # of the library should be able to control what goes into sdata.
diff --git a/recipes/glibc/glibc-2.3.6/glibc-2.3.6-bind-already-defined-on-powerpc.patch b/recipes/glibc/glibc-2.3.6/glibc-2.3.6-bind-already-defined-on-powerpc.patch
deleted file mode 100644
index 9938ef6973..0000000000
--- a/recipes/glibc/glibc-2.3.6/glibc-2.3.6-bind-already-defined-on-powerpc.patch
+++ /dev/null
@@ -1,65 +0,0 @@
-Fixes "Error: symbol `__bind' is already defined" error when building for PowerPC
-
-Patch taken from http://bugs.debian.org/343571
-
-
---- x/sysdeps/powerpc/powerpc32/fpu/s_lround.S 2004-06-30 17:29:12.000000000 -0500
-+++ x/sysdeps/powerpc/powerpc32/fpu/s_lround.S 2005-11-18 16:48:11.000000000 -0600
-@@ -88,7 +79,6 @@
- b .L9
- END (__lround)
-
--strong_alias (__lround, __lround)
- weak_alias (__lround, lround)
-
- strong_alias (__lround, __lroundf)
---- x/sysdeps/unix/sysv/linux/powerpc/powerpc32/socket.S 2005-12-16 01:04:21.000000000 -0600
-+++ x/sysdeps/unix/sysv/linux/powerpc/powerpc32/socket.S 2005-12-16 01:06:26.000000000 -0600
-@@ -42,7 +42,11 @@
- #define stackblock 20
-
- #ifndef __socket
--#define __socket P(__,socket)
-+# ifndef NO_WEAK_ALIAS
-+# define __socket P(__,socket)
-+# else
-+# define __socket socket
-+# endif
- #endif
-
- .text
-@@ -116,4 +120,6 @@
-
- PSEUDO_END (__socket)
-
-+#ifndef NO_WEAK_ALIAS
- weak_alias (__socket, socket)
-+#endif
---- x/sysdeps/unix/sysv/linux/powerpc/powerpc64/socket.S 2005-12-16 01:08:45.000000000 -0600
-+++ x/sysdeps/unix/sysv/linux/powerpc/powerpc64/socket.S 2005-12-16 01:09:32.000000000 -0600
-@@ -41,12 +41,12 @@
-
- #define stackblock 80 /* offset to socket parm area. */
-
--#ifndef socket
--/* If this is just socket.S leave it alone! */
--#else
- #ifndef __socket
--#define __socket P(__,socket)
--#endif
-+# ifndef NO_WEAK_ALIAS
-+# define __socket P(__,socket)
-+# else
-+# define __socket socket
-+# endif
- #endif
-
- .text
-@@ -120,4 +120,6 @@
- cfi_endproc
- PSEUDO_END (__socket)
-
-+#ifndef NO_WEAK_ALIAS
- weak_alias (__socket, socket)
-+#endif
-
diff --git a/recipes/glibc/glibc-2.3.6/glibc-2.3.6-linuxthreads-allow-gcc-4.1-powerpc32-initfini.s.patch b/recipes/glibc/glibc-2.3.6/glibc-2.3.6-linuxthreads-allow-gcc-4.1-powerpc32-initfini.s.patch
deleted file mode 100644
index 9976eccef9..0000000000
--- a/recipes/glibc/glibc-2.3.6/glibc-2.3.6-linuxthreads-allow-gcc-4.1-powerpc32-initfini.s.patch
+++ /dev/null
@@ -1,28 +0,0 @@
-fixes
-
-{BUILD_DIR}/build-glibc/linuxthreads/crtn.o: In function "dummy":
-{BUILD_DIR}/build-glibc/linuxthreads/crtn.S:14: multiple definition of "dummy"
-{BUILD_DIR}/build-glibc/linuxthreads/crti.o:{BUILD_DIR}/build-glibc/linuxthreads/crti.S:33: first defined here
-{BUILD_DIR}/build-glibc/linuxthreads/crtn.o: In function "_fini":
-{BUILD_DIR}/build-glibc/linuxthreads/crtn.S:30: multiple definition of "_fini"
-{BUILD_DIR}/build-glibc/linuxthreads/crti.o:{BUILD_DIR}/build-glibc/linuxthreads/crti.S:65: first defined here
-{BUILD_DIR}/build-glibc/linuxthreads/crtn.o: In function "_init":
-{BUILD_DIR}/build-glibc/linuxthreads/crtn.S:23: multiple definition of "_init"
-{BUILD_DIR}/build-glibc/linuxthreads/crti.o:{BUILD_DIR}/build-glibc/linuxthreads/crti.S:37: first defined here
-{BUILD_DIR}/build-glibc/linuxthreads/crti.o: In function "_fini":
-{BUILD_DIR}/build-glibc/linuxthreads/crti.S:(.text+0x70): undefined reference to "i_am_not_a_leaf"
-{BUILD_DIR}/build-glibc/linuxthreads/crtn.o: In function "_fini":
-{BUILD_DIR}/build-glibc/linuxthreads/crtn.S:(.text+0x38): undefined reference to "i_am_not_a_leaf"
-collect2: ld returned 1 exit status
-
---- glibc-2.3.6/linuxthreads/sysdeps/powerpc/Makefile.org 2003-02-17 20:33:17.000000000 +0000
-+++ glibc-2.3.6/linuxthreads/sysdeps/powerpc/Makefile 2007-04-04 16:26:01.969067632 +0100
-@@ -1,6 +1,6 @@
- ifeq ($(subdir):$(elf),linuxthreads:yes)
- # See CFLAGS-initfini.s above; this is the same code.
--CFLAGS-pt-initfini.s = -g0 -fpic -O1
-+CFLAGS-pt-initfini.s = -g0 -fpic -O1 $(fno-unit-at-a-time)
- endif
- ifeq ($(subdir),csu)
- gen-as-const-headers += tcb-offsets.sym
-
diff --git a/recipes/glibc/glibc-2.3.6/glibc-2.3.6-linuxthreads-pthread-raise.patch b/recipes/glibc/glibc-2.3.6/glibc-2.3.6-linuxthreads-pthread-raise.patch
deleted file mode 100644
index dae5db3846..0000000000
--- a/recipes/glibc/glibc-2.3.6/glibc-2.3.6-linuxthreads-pthread-raise.patch
+++ /dev/null
@@ -1,37 +0,0 @@
---- glibc-2.3.6/linuxthreads/sysdeps/unix/sysv/linux/raise.c.org 2008-07-16 22:57:58.000000000 -0700
-+++ glibc-2.3.6/linuxthreads/sysdeps/unix/sysv/linux/raise.c 2008-07-16 22:58:26.000000000 -0700
-@@ -1,4 +1,4 @@
--/* Copyright (C) 1991, 1996, 2002, 2003 Free Software Foundation, Inc.
-+/* Copyright (C) 1991, 1996, 2002, 2003, 2005 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
-
- The GNU C Library is free software; you can redistribute it and/or
-@@ -18,10 +18,13 @@
-
- #include <signal.h>
- #include <unistd.h>
--#include <bits/libc-lock.h>
-
--#ifndef SHARED
-+#ifndef IS_IN_rtld
-+# include <bits/libc-lock.h>
-+
-+# ifndef SHARED
- weak_extern (__pthread_raise)
-+# endif
- #endif
-
- /* Raise the signal SIG. */
-@@ -29,8 +32,12 @@ int
- raise (sig)
- int sig;
- {
-+#ifdef IS_IN_rtld
-+ return __kill (__getpid (), sig);
-+#else
- return __libc_maybe_call2 (pthread_raise, (sig),
- __kill (__getpid (), sig));
-+#endif
- }
- libc_hidden_def (raise)
- weak_alias (raise, gsignal)
diff --git a/recipes/glibc/glibc-2.3.6/glibc-arm-socket-weakalias.patch b/recipes/glibc/glibc-2.3.6/glibc-arm-socket-weakalias.patch
deleted file mode 100644
index 722365f122..0000000000
--- a/recipes/glibc/glibc-2.3.6/glibc-arm-socket-weakalias.patch
+++ /dev/null
@@ -1,45 +0,0 @@
-This one was taken from debian.
-
-# DP: Description: Fix __bind redefinition problem
-# DP: Related bugs:
-# DP: Dpatch author: Phil Blundell
-# DP: Patch author: Daniel Jacobowitz
-# DP: Upstream status: In CVS
-# DP: Status Details:
-# DP: Date: 2005-12-25
-
-Index: sysdeps/unix/sysv/linux/arm/socket.S
-===================================================================
-RCS file: /cvs/glibc/ports/sysdeps/unix/sysv/linux/arm/socket.S,v
-retrieving revision 1.12
-retrieving revision 1.13
-diff -u -r1.12 -r1.13
---- glibc-2.3.6.ds1.orig/sysdeps/unix/sysv/linux/arm/socket.S 4 Dec 2004 21:20:16 -0000 1.12
-+++ glibc-2.3.6.ds1/sysdeps/unix/sysv/linux/arm/socket.S 27 Oct 2005 18:50:12 -0000 1.13
-@@ -1,4 +1,6 @@
--/* Copyright (C) 1995, 1996, 1997, 1998, 2003 Free Software Foundation, Inc.
-+/* Copyright (C) 1995, 1996, 1997, 1998, 2003, 2004, 2005
-+ Free Software Foundation, Inc.
-+
- This file is part of the GNU C Library.
-
- The GNU C Library is free software; you can redistribute it and/or
-@@ -32,7 +34,11 @@
- The .S files for the other calls just #define socket and #include this. */
-
- #ifndef __socket
-+#ifndef NO_WEAK_ALIAS
- #define __socket P(__,socket)
-+#else
-+#define __socket socket
-+#endif
- #endif
-
- #define PUSHARGS_1 str a1, [sp, $-4]!
-@@ -120,4 +126,6 @@
-
- PSEUDO_END (__socket)
-
-+#ifndef NO_WEAK_ALIAS
- weak_alias (__socket, socket)
-+#endif
diff --git a/recipes/glibc/glibc-2.3.6/glibc-cross_sunrpc.patch b/recipes/glibc/glibc-2.3.6/glibc-cross_sunrpc.patch
deleted file mode 100644
index 8e24a831b0..0000000000
--- a/recipes/glibc/glibc-2.3.6/glibc-cross_sunrpc.patch
+++ /dev/null
@@ -1,79 +0,0 @@
-Fix rpcsvc headers missing from glibc, also
-allows glibc to produce the rpc headers when cross compiling,
-And fix for glibc-bootstrap package doesn't currently build because the
-generated sunrpc headers are not available
-
-
----
- sunrpc/Makefile | 28 ++++++++++++++++++++++++----
- 1 file changed, 24 insertions(+), 4 deletions(-)
-
-Index: glibc-2.3.6/sunrpc/Makefile
-===================================================================
---- glibc-2.3.6.orig/sunrpc/Makefile 2005-07-17 20:03:49.000000000 -0700
-+++ glibc-2.3.6/sunrpc/Makefile 2008-07-17 15:28:04.000000000 -0700
-@@ -75,6 +75,8 @@ install-sbin := rpcinfo
- rpcgen-objs = rpc_main.o rpc_hout.o rpc_cout.o rpc_parse.o \
- rpc_scan.o rpc_util.o rpc_svcout.o rpc_clntout.o \
- rpc_tblout.o rpc_sample.o
-+host-rpcgen-objs = $(addprefix host-,$(rpcgen-objs))
-+
- # These headers are part of rpcgen.
- distribute := proto.h rpc_util.h rpc_parse.h rpc_scan.h \
- $(rpcgen-objs:.o=.c) etc.rpc \
-@@ -98,8 +100,8 @@ otherlibs += $(nssobjdir)/libnss_files.a
- $(resolvobjdir)/libresolv.a
- endif
-
--ifeq (no,$(cross-compiling))
--# We can only build this library if we can run the rpcgen we build.
-+ifneq (,$(findstring subdir_install,$(MAKECMDGOALS)))
-+## We can only build this library if we can run the rpcgen we build.
- headers += $(rpcsvc:%.x=rpcsvc/%.h)
- extra-libs := librpcsvc
- extra-libs-others := librpcsvc # Make it in `others' pass, not `lib' pass.
-@@ -144,8 +146,26 @@ cpp-srcs-left := $(rpcgen-objs:.o=.c)
- lib := nonlib
- include $(patsubst %,$(..)cppflags-iterator.mk,$(cpp-srcs-left))
-
-+# Rely on the target rpcgen objects for dependency information.
-+$(objpfx)host-%.o: %.c $(objpfx)%.o
-+ $(patsubst %/,cd % &&,$(objpfx)) \
-+ $(BUILD_CC) $($(basename $(<F))-CFLAGS) \
-+ -I$(shell cd .. && pwd) \
-+ -Dattribute_hidden= \
-+ -include $(shell cd ../include && pwd)/libintl.h \
-+ -O2 $(ALL_BUILD_CFLAGS) $(shell pwd)/$(<F) -c -o $(@F)
-+
-+$(objpfx)host-rpcgen: $(addprefix $(objpfx),$(host-rpcgen-objs))
-+ $(BUILD_CC) $(BUILD_CFLAGS) $+ -o $(objpfx)host-rpcgen
-+
- # Tell rpcgen where to find the C preprocessor.
-+ifeq ($(cross-compiling),no)
- rpcgen-cmd = CPP='$(CC) -E -x c-header' $(built-program-cmd) -Y ../scripts
-+rpcgen-prog = $(objpfx)rpcgen
-+else
-+rpcgen-cmd = CPP='$(CC) -E -x c-header' $(objpfx)host-rpcgen -Y ../scripts
-+rpcgen-prog = $(objpfx)host-rpcgen
-+endif
-
- # Install the rpc data base file.
- $(inst_sysconfdir)/rpc: etc.rpc $(+force)
-@@ -156,7 +176,7 @@ $(inst_sysconfdir)/rpc: etc.rpc $(+force
- # relinked.
- $(rpcsvc:%.x=$(objpfx)rpcsvc/%.h): $(objpfx)rpcsvc/%.h: $(objpfx)rpcsvc/%.stmp
- @:
--$(objpfx)rpcsvc/%.stmp: rpcsvc/%.x $(objpfx)rpcgen
-+$(objpfx)rpcsvc/%.stmp: rpcsvc/%.x $(rpcgen-prog)
- $(make-target-directory)
- -@rm -f ${@:stmp=T} $@
- $(rpcgen-cmd) -h $< -o ${@:stmp=T}
-@@ -166,7 +186,7 @@ $(objpfx)rpcsvc/%.stmp: rpcsvc/%.x $(obj
- # Generate the rpcsvc XDR functions with rpcgen.
- $(rpcsvc:%.x=$(objpfx)x%.c): $(objpfx)x%.c: $(objpfx)x%.stmp
- @:
--$(objpfx)x%.stmp: rpcsvc/%.x $(objpfx)rpcgen
-+$(objpfx)x%.stmp: rpcsvc/%.x $(rpcgen-prog)
- -@rm -f ${@:stmp=T} $@
- $(rpcgen-cmd) -c $< -o ${@:stmp=T}
- $(move-if-change) $(@:stmp=T) $(@:stmp=c)
diff --git a/recipes/glibc/glibc-2.3.6/glibc-memusage.patch b/recipes/glibc/glibc-2.3.6/glibc-memusage.patch
deleted file mode 100644
index 39ca1a77b5..0000000000
--- a/recipes/glibc/glibc-2.3.6/glibc-memusage.patch
+++ /dev/null
@@ -1,44 +0,0 @@
----
- malloc/Makefile | 4 +++-
- malloc/memusage.sh | 6 ++++++
- 2 files changed, 9 insertions(+), 1 deletion(-)
-
-Index: glibc-2.3.6/malloc/Makefile
-===================================================================
---- glibc-2.3.6.orig/malloc/Makefile 2008-07-17 14:40:54.000000000 -0700
-+++ glibc-2.3.6/malloc/Makefile 2008-07-17 14:42:07.000000000 -0700
-@@ -80,7 +80,7 @@ ifneq ($(cross-compiling),yes)
- ifneq ($(LIBGD),no)
- install-bin = memusagestat
- install-bin-script += memusage
--generated += memusagestat memusage
-+generated += memusagestat
- extra-objs += memusagestat.o
-
- # The configure.in check for libgd and its headers did not use $SYSINCLUDES.
-@@ -90,6 +90,8 @@ extra-objs += memusagestat.o
- $(objpfx)memusagestat.o: sysincludes = # nothing
- endif
- endif
-+install-bin-script += memusage
-+generated += memusage
-
- # Another goal which can be used to override the configure decision.
- .PHONY: do-memusagestat
-Index: glibc-2.3.6/malloc/memusage.sh
-===================================================================
---- glibc-2.3.6.orig/malloc/memusage.sh 2008-07-17 14:42:17.000000000 -0700
-+++ glibc-2.3.6/malloc/memusage.sh 2008-07-17 14:42:54.000000000 -0700
-@@ -205,6 +205,12 @@ if test $# -eq 0; then
- do_usage
- fi
-
-+# Find memusagestat.
-+if test -n "$png" -a ! -x $memusagestat; then
-+ echo >&2 $"PNG generation is not supported."
-+ png=""
-+fi
-+
- # This will be in the environment.
- add_env="LD_PRELOAD=$memusageso"
-
diff --git a/recipes/glibc/glibc-2.3.6/glibc-rtld-libcc-eh.patch b/recipes/glibc/glibc-2.3.6/glibc-rtld-libcc-eh.patch
deleted file mode 100644
index a3658f4cd6..0000000000
--- a/recipes/glibc/glibc-2.3.6/glibc-rtld-libcc-eh.patch
+++ /dev/null
@@ -1,25 +0,0 @@
----
- elf/Makefile | 3 ++-
- 1 file changed, 2 insertions(+), 1 deletion(-)
-
-Index: glibc-2.3.6/elf/Makefile
-===================================================================
---- glibc-2.3.6.orig/elf/Makefile 2008-07-17 01:10:39.000000000 -0700
-+++ glibc-2.3.6/elf/Makefile 2008-07-17 01:17:18.000000000 -0700
-@@ -279,7 +279,7 @@ $(objpfx)rtld-libc.a: $(objpfx)librtld.m
- $(MAKE) -f $< -f rtld-Rules
-
- $(objpfx)librtld.os: $(objpfx)dl-allobjs.os $(objpfx)rtld-libc.a
-- $(LINK.o) -nostdlib -nostartfiles -r -o $@ '-Wl,-(' $^ -lgcc '-Wl,-)' \
-+ $(LINK.o) -nostdlib -nostartfiles -r -o $@ '-Wl,-(' $^ -lgcc -lgcc_eh '-Wl,-)' \
- -Wl,-Map,$@.map
-
- generated += librtld.map librtld.mk rtld-libc.a librtld.os.map
-@@ -295,6 +295,7 @@ $(objpfx)ld.so: $(objpfx)librtld.os $(ld
- -e 's/\. = 0 + SIZEOF_HEADERS;/& _begin = . - SIZEOF_HEADERS;/' \
- > $@.lds
- $(LINK.o) -nostdlib -nostartfiles -shared -o $@ \
-+ -lgcc -lgcc_eh \
- $(LDFLAGS-rtld) -Wl,-z,defs $(z-now-$(bind-now)) \
- $(filter-out $(map-file),$^) $(load-map-file) \
- -Wl,-soname=$(rtld-installed-name) -T $@.lds
diff --git a/recipes/glibc/glibc-2.3.6/late-install-loop-break.patch b/recipes/glibc/glibc-2.3.6/late-install-loop-break.patch
deleted file mode 100644
index fc7d8b31e6..0000000000
--- a/recipes/glibc/glibc-2.3.6/late-install-loop-break.patch
+++ /dev/null
@@ -1,29 +0,0 @@
---- glibc-2.3.6/Makerules Sat Sep 8 22:59:54 2007
-+++ glibc-2.3.6/Makerules Sun Sep 9 01:04:29 2007
-@@ -154,26 +154,6 @@
- common-before-compile = $(before-compile)
- endif
-
--ifndef subdir
--# If a makefile needs to do something conditional on something that
--# can only be figured out from headers, write a FOO.make.c input
--# file that uses cpp contructs and contains @@@ LINE @@@ for each LINE
--# to emit in the generated makefile, and use -include $(common-objpfx)FOO.make.
--#
--# We only generate these in the top-level makefile, to avoid any weirdness
--# from subdir-specific makefile tweaks creeping in on an update.
--$(common-objpfx)%.make: $(..)%.make.c $(..)Makerules $(common-before-compile)
-- rm -f $@T $@.dT
-- (echo '# Generated from $*.make.c by Makerules.'; \
-- $(CC) $(CFLAGS) $(CPPFLAGS) -E $< \
-- -MD -MP -MT '$$(common-objpfx)$*.make' -MF $@.dT \
-- | sed -n '/@@@/{s/@@@[ ]*\(.*\)@@@/\1/;s/[ ]*$$//p;}'; \
-- echo 'common-generated += $(@F)'; \
-- sed $(sed-remove-objpfx) $(sed-remove-dotdot) $@.dT; \
-- rm -f $@.dT) > $@T
-- mv -f $@T $@
--endif
--
- ifdef subdir
- sed-remove-dotdot := -e 's@ *\.\.\/\([^ \]*\)@ $$(..)\1@g' \
- -e 's@^\.\.\/\([^ \]*\)@$$(..)\1@g'
diff --git a/recipes/glibc/glibc-2.4/arm_eabi_ipc_fix.patch b/recipes/glibc/glibc-2.4/arm_eabi_ipc_fix.patch
deleted file mode 100644
index 8b36960b04..0000000000
--- a/recipes/glibc/glibc-2.4/arm_eabi_ipc_fix.patch
+++ /dev/null
@@ -1,94 +0,0 @@
-From libc-ports-return-430-listarch-libc-ports=sources dot redhat dot com at sourceware dot org Mon Aug 21 20:08:57 2006
-Return-Path: <libc-ports-return-430-listarch-libc-ports=sources dot redhat dot com at sourceware dot org>
-Delivered-To: listarch-libc-ports at sources dot redhat dot com
-Received: (qmail 9913 invoked by alias); 21 Aug 2006 20:08:56 -0000
-Received: (qmail 9893 invoked by uid 22791); 21 Aug 2006 20:08:53 -0000
-X-Spam-Status: No, hits=-2.5 required=5.0 tests=AWL,BAYES_00,TW_HM,TW_SG,TW_SN
-X-Spam-Check-By: sourceware.org
-Received: from nevyn.them.org (HELO nevyn.them.org) (66.93.172.17) by sourceware.org (qpsmtpd/0.31.1) with ESMTP; Mon, 21 Aug 2006 20:08:44 +0000
-Received: from drow by nevyn.them.org with local (Exim 4.54) id 1GFG4f-0007gO-TW for libc-ports@sourceware.org; Mon, 21 Aug 2006 16:08:42 -0400
-Date: Mon, 21 Aug 2006 16:08:41 -0400
-From: Daniel Jacobowitz <drow at false dot org>
-To: libc-ports at sourceware dot org
-Subject: ARM IPC fix
-Message-ID: <20060821200841.GA29502@nevyn.them.org>
-MIME-Version: 1.0
-Content-Type: text/plain; charset=us-ascii
-Content-Disposition: inline
-User-Agent: Mutt/1.5.11+cvs20060403
-X-IsSubscribed: yes
-Mailing-List: contact libc-ports-help at sourceware dot org; run by ezmlm
-Precedence: bulk
-List-Subscribe: <mailto:libc-ports-subscribe at sourceware dot org>
-List-Post: <mailto:libc-ports at sourceware dot org>
-List-Help: <mailto:libc-ports-help at sourceware dot org>, <http://sourceware dot org/lists dot html#faqs>
-Sender: libc-ports-owner at sourceware dot org
-Delivered-To: mailing list libc-ports at sourceware dot org
-
-We can't treat msgctl as a real syscall; if we don't add __IPC_64, we'll get
-a mismatched type for ipc_perm. Fixed by using the Alpha implementation,
-which is similar to the standard i386 implementation but doesn't use
-the multiplexer syscall.
-
---
-Daniel Jacobowitz
-CodeSourcery
-
-2006-08-21 Daniel Jacobowitz <dan@codesourcery.com>
-
- * sysdeps/unix/sysv/linux/arm/eabi/syscalls.list: Remove msgctl,
- shmctl, and semctl.
- * sysdeps/unix/sysv/linux/arm/eabi/semctl.c,
- sysdeps/unix/sysv/linux/arm/eabi/shmctl.c,
- sysdeps/unix/sysv/linux/arm/eabi/msgctl.c: New files.
-
-Index: a/ports/sysdeps/unix/sysv/linux/arm/eabi/syscalls.list
-===================================================================
---- a/ports/sysdeps/unix/sysv/linux/arm/eabi/syscalls.list (revision 147209)
-+++ b/ports/sysdeps/unix/sysv/linux/arm/eabi/syscalls.list (working copy)
-@@ -1,18 +1,16 @@
- # File name Caller Syscall name # args Strong name Weak names
-
--# semaphore and shm system calls
--msgctl - msgctl i:iip __msgctl msgctl
-+# Semaphore and shm system calls. msgctl, shmctl, and semctl have C
-+# wrappers (to set __IPC_64).
- msgget - msgget i:ii __msgget msgget
- msgrcv - msgrcv Ci:ibnii __msgrcv msgrcv
- msgsnd - msgsnd Ci:ibni __msgsnd msgsnd
- shmat - shmat i:ipi __shmat shmat
--shmctl - shmctl i:iip __shmctl shmctl
- shmdt - shmdt i:s __shmdt shmdt
- shmget - shmget i:iii __shmget shmget
- semop - semop i:ipi __semop semop
- semtimedop - semtimedop i:ipip semtimedop
- semget - semget i:iii __semget semget
--semctl - semctl i:iiii __semctl semctl
-
- # proper socket implementations:
- accept - accept Ci:iBN __libc_accept __accept accept
-
-Property changes on: sysdeps/unix/sysv/linux/arm/eabi/syscalls.list
-___________________________________________________________________
-Name: svn:mime-type
- - application/octet-stream
-
-Index: a/ports/sysdeps/unix/sysv/linux/arm/eabi/semctl.c
-===================================================================
---- a/ports/sysdeps/unix/sysv/linux/arm/eabi/semctl.c (revision 0)
-+++ b/ports/sysdeps/unix/sysv/linux/arm/eabi/semctl.c (revision 0)
-@@ -0,0 +1 @@
-+#include <sysdeps/unix/sysv/linux/alpha/semctl.c>
-Index: a/ports/sysdeps/unix/sysv/linux/arm/eabi/msgctl.c
-===================================================================
---- a/ports/sysdeps/unix/sysv/linux/arm/eabi/msgctl.c (revision 0)
-+++ b/ports/sysdeps/unix/sysv/linux/arm/eabi/msgctl.c (revision 0)
-@@ -0,0 +1 @@
-+#include <sysdeps/unix/sysv/linux/alpha/msgctl.c>
-Index: a/ports/sysdeps/unix/sysv/linux/arm/eabi/shmctl.c
-===================================================================
---- a/ports/sysdeps/unix/sysv/linux/arm/eabi/shmctl.c (revision 0)
-+++ b/ports/sysdeps/unix/sysv/linux/arm/eabi/shmctl.c (revision 0)
-@@ -0,0 +1 @@
-+#include <sysdeps/unix/sysv/linux/alpha/shmctl.c>
-
diff --git a/recipes/glibc/glibc-2.4/dyn-ldconfig-20041128.patch b/recipes/glibc/glibc-2.4/dyn-ldconfig-20041128.patch
deleted file mode 100644
index 451b6d4afc..0000000000
--- a/recipes/glibc/glibc-2.4/dyn-ldconfig-20041128.patch
+++ /dev/null
@@ -1,22 +0,0 @@
-
-#
-# Patch managed by http://www.holgerschurig.de/patcher.html
-#
-
---- libc/elf/Makefile~dyn-ldconfig-20041128
-+++ libc/elf/Makefile
-@@ -118,12 +118,13 @@
-
- ifeq (yes,$(use-ldconfig))
- ifeq (yes,$(build-shared))
--others-static += ldconfig
-+#others-static += ldconfig
- others += ldconfig
- install-rootsbin += ldconfig
-
- ldconfig-modules := cache readlib xmalloc xstrdup chroot_canon
- extra-objs += $(ldconfig-modules:=.o)
-+CPPFLAGS-readlib.c = -DNOT_IN_libc=1
-
- # To find xmalloc.c and xstrdup.c
- vpath %.c ../locale/programs
diff --git a/recipes/glibc/glibc-2.4/dyn-ldconfig.patch b/recipes/glibc/glibc-2.4/dyn-ldconfig.patch
deleted file mode 100644
index 1041965d05..0000000000
--- a/recipes/glibc/glibc-2.4/dyn-ldconfig.patch
+++ /dev/null
@@ -1,62 +0,0 @@
---- elf/Makefile 13 Mar 2003 21:50:57 -0000 1.258
-+++ elf/Makefile 27 Mar 2003 20:36:07 -0000
-@@ -109,12 +109,13 @@
-
- ifeq (yes,$(use-ldconfig))
- ifeq (yes,$(build-shared))
--others-static += ldconfig
-+#others-static += ldconfig
- others += ldconfig
- install-rootsbin += ldconfig
-
- ldconfig-modules := cache readlib xmalloc xstrdup chroot_canon
- extra-objs += $(ldconfig-modules:=.o)
-+CPPFLAGS-readlib.c = -DNOT_IN_libc=1
-
- # To find xmalloc.c and xstrdup.c
- vpath %.c ../locale/programs
---- elf/ldconfig.c 13 Jan 2003 08:53:14 -0000 1.31
-+++ elf/ldconfig.c 27 Mar 2003 20:36:09 -0000
-@@ -149,6 +149,9 @@
- static int
- is_hwcap_platform (const char *name)
- {
-+#if 1
-+ return 0;
-+#else
- int hwcap_idx = _dl_string_hwcap (name);
-
- if (hwcap_idx != -1 && ((1 << hwcap_idx) & hwcap_mask))
-@@ -164,6 +167,7 @@
- #endif
-
- return 0;
-+#endif
- }
-
- /* Get hwcap (including platform) encoding of path. */
-@@ -175,6 +179,7 @@
- uint64_t hwcap = 0;
- uint64_t h;
-
-+#if 0
- size_t len;
-
- len = strlen (str);
-@@ -210,6 +215,7 @@
- *ptr = '\0';
- }
-
-+#endif
- free (str);
- return hwcap;
- }
---- elf/Versions.old 2004-06-26 13:18:35.000000000 +0100
-+++ elf/Versions 2004-06-26 14:41:09.000000000 +0100
-@@ -54,5 +54,6 @@
- _dl_get_tls_static_info; _dl_allocate_tls_init;
- _dl_tls_setup; _dl_rtld_di_serinfo;
- _dl_make_stack_executable;
-+ _dl_cache_libcmp;
- }
- }
diff --git a/recipes/glibc/glibc-2.4/fixup-aeabi-syscalls.patch b/recipes/glibc/glibc-2.4/fixup-aeabi-syscalls.patch
deleted file mode 100644
index fb733b9194..0000000000
--- a/recipes/glibc/glibc-2.4/fixup-aeabi-syscalls.patch
+++ /dev/null
@@ -1,329 +0,0 @@
-Fix up ARM EABI for removed syscalls
-http://sourceware.org/ml/libc-ports/2006-03/msg00029.html
-
-Index: glibc/ports/sysdeps/unix/sysv/linux/arm/eabi/socket.S
-===================================================================
---- glibc.orig/ports/sysdeps/unix/sysv/linux/arm/eabi/socket.S 2006-03-21 15:58:10.000000000 -0500
-+++ /dev/null 1970-01-01 00:00:00.000000000 +0000
-@@ -1,131 +0,0 @@
--/* Copyright (C) 1995, 1996, 1997, 1998, 2003, 2005
-- Free Software Foundation, Inc.
-- This file is part of the GNU C Library.
--
-- The GNU C Library is free software; you can redistribute it and/or
-- modify it under the terms of the GNU Lesser General Public
-- License as published by the Free Software Foundation; either
-- version 2.1 of the License, or (at your option) any later version.
--
-- The GNU C Library is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-- Lesser General Public License for more details.
--
-- You should have received a copy of the GNU Lesser General Public
-- License along with the GNU C Library; if not, write to the Free
-- Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
-- 02111-1307 USA. */
--
--#include <sysdep-cancel.h>
--#include <socketcall.h>
--
--#define P(a, b) P2(a, b)
--#define P2(a, b) a##b
--
-- .text
--/* The socket-oriented system calls are handled unusally in Linux.
-- They are all gated through the single `socketcall' system call number.
-- `socketcall' takes two arguments: the first is the subcode, specifying
-- which socket function is being called; and the second is a pointer to
-- the arguments to the specific function.
--
-- The .S files for the other calls just #define socket and #include this. */
--
--#ifndef __socket
--# ifndef NO_WEAK_ALIAS
--# define __socket P(__,socket)
--# else
--# define __socket socket
--# endif
--#endif
--
--#define PUSHARGS_1 str a1, [sp, $-8]!; .pad #8
--#define PUSHARGS_2 stmfd sp!, {a1, a2}; .pad #8
--#define PUSHARGS_3 stmfd sp!, {a1, a2, a3, a4}; .pad #16 /* a4 pushed for padding */
--#define PUSHARGS_4 stmfd sp!, {a1, a2, a3, a4}; .pad #16
--#define PUSHARGS_5 stmfd sp!, {a1, a2, a3, a4}; .pad #16 /* Caller has already pushed arg 5 */
--#define PUSHARGS_6 stmfd sp!, {a1, a2, a3, a4}; .pad #16
--
--#define POPARGS_1 add sp, sp, #8
--#define POPARGS_2 add sp, sp, #8
--#define POPARGS_3 add sp, sp, #16
--#define POPARGS_4 add sp, sp, #16
--#define POPARGS_5 add sp, sp, #16
--#define POPARGS_6 add sp, sp, #16
--
--#ifndef NARGS
--#define NARGS 3 /* If we were called with no wrapper, this is really socket() */
--#endif
--
--#if defined NEED_CANCELLATION && defined CENABLE
-- PSEUDO_PROLOGUE
--#endif
--
--.globl __socket
--ENTRY (__socket)
-- .fnstart
--
-- /* This code previously moved sp into ip and stored the args using
-- stmdb ip!, {a1-a4}. It did not modify sp, so the stack never had
-- to be restored after the syscall completed. It saved an
-- instruction and meant no stack cleanup work was required.
--
-- This will not work in the case of a socket call being interrupted
-- by a signal. If the signal handler uses any stack the arguments
-- to socket will be trashed. The results of a restart of any
-- socket call are then unpredictable. */
--
-- /* Push args onto the stack. */
-- P(PUSHARGS_,NARGS)
--
--#if defined NEED_CANCELLATION && defined CENABLE
-- SINGLE_THREAD_P
-- bne 1f
--#endif
--
-- /* Do the system call trap. */
-- mov a1, $P(SOCKOP_,socket)
-- mov a2, sp
-- DO_CALL (socketcall, 0)
--
-- /* Pop args off the stack */
-- P(POPARGS_,NARGS)
--
-- /* r0 is < 0 if there was an error. */
-- cmn r0, $124
-- RETINSTR(cc, r14)
-- b PLTJMP(SYSCALL_ERROR)
--
--#if defined NEED_CANCELLATION && defined CENABLE
--1:
-- stmfd sp!, {r7, lr}
-- .save {r7, lr}
-- CENABLE
-- mov ip, r0
--
-- mov r0, #P(SOCKOP_,socket)
-- add r1, sp, #8
-- mov r7, #SYS_ify(socketcall)
-- swi 0x0
--
-- mov r7, r0
-- mov r0, ip
-- CDISABLE
-- mov r0, r7
-- ldmfd sp!, {r7, lr}
--
-- P(POPARGS_,NARGS)
--
-- /* r0 is < 0 if there was an error. */
-- cmn r0, $124
-- RETINSTR(cc, r14)
-- b PLTJMP(SYSCALL_ERROR)
--#endif
--
-- .fnend
--PSEUDO_END (__socket)
--
--#ifndef NO_WEAK_ALIAS
--weak_alias (__socket, socket)
--#endif
-Index: glibc/ports/sysdeps/unix/sysv/linux/arm/eabi/syscalls.list
-===================================================================
---- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ glibc/ports/sysdeps/unix/sysv/linux/arm/eabi/syscalls.list 2006-03-21 15:58:46.000000000 -0500
-@@ -0,0 +1,34 @@
-+# File name Caller Syscall name # args Strong name Weak names
-+
-+# semaphore and shm system calls
-+msgctl - msgctl i:iip __msgctl msgctl
-+msgget - msgget i:ii __msgget msgget
-+msgrcv - msgrcv Ci:ibnii __msgrcv msgrcv
-+msgsnd - msgsnd Ci:ibni __msgsnd msgsnd
-+shmat - shmat i:ipi __shmat shmat
-+shmctl - shmctl i:iip __shmctl shmctl
-+shmdt - shmdt i:s __shmdt shmdt
-+shmget - shmget i:iii __shmget shmget
-+semop - semop i:ipi __semop semop
-+semtimedop - semtimedop i:ipip semtimedop
-+semget - semget i:iii __semget semget
-+semctl - semctl i:iiii __semctl semctl
-+
-+# proper socket implementations:
-+accept - accept Ci:iBN __libc_accept __accept accept
-+bind - bind i:ipi __bind bind
-+connect - connect Ci:ipi __libc_connect __connect_internal __connect connect
-+getpeername - getpeername i:ipp __getpeername getpeername
-+getsockname - getsockname i:ipp __getsockname getsockname
-+getsockopt - getsockopt i:iiiBN __getsockopt getsockopt
-+listen - listen i:ii __listen listen
-+recv - recv Ci:ibni __libc_recv __recv recv
-+recvfrom - recvfrom Ci:ibniBN __libc_recvfrom __recvfrom recvfrom
-+recvmsg - recvmsg Ci:ipi __libc_recvmsg __recvmsg recvmsg
-+send - send Ci:ibni __libc_send __send send
-+sendmsg - sendmsg Ci:ipi __libc_sendmsg __sendmsg sendmsg
-+sendto - sendto Ci:ibnibn __libc_sendto __sendto sendto
-+setsockopt - setsockopt i:iiibn __setsockopt setsockopt
-+shutdown - shutdown i:ii __shutdown shutdown
-+socket - socket i:iii __socket socket
-+socketpair - socketpair i:iiif __socketpair socketpair
-Index: glibc/ports/sysdeps/unix/sysv/linux/arm/eabi/linuxthreads/sysdep-cancel.h
-===================================================================
---- glibc.orig/ports/sysdeps/unix/sysv/linux/arm/eabi/linuxthreads/sysdep-cancel.h 2006-03-21 15:58:10.000000000 -0500
-+++ glibc/ports/sysdeps/unix/sysv/linux/arm/eabi/linuxthreads/sysdep-cancel.h 2006-03-21 15:58:46.000000000 -0500
-@@ -53,9 +53,9 @@
- UNDOARGS_##args; \
- cmn r0, $4096;
-
--/* DOARGS pushes four bytes on the stack for five arguments, and nothing
-- otherwise. In order to preserve doubleword alignment, sometimes we must
-- save an extra register. */
-+/* DOARGS pushes four bytes on the stack for five arguments, eight bytes for
-+ six arguments, and nothing for fewer. In order to preserve doubleword
-+ alignment, sometimes we must save an extra register. */
-
- # define DOCARGS_0 stmfd sp!, {r7, lr}
- # define UNDOCARGS_0
-@@ -81,6 +81,10 @@
- # define UNDOCARGS_5 ldmfd sp!, {r0, r1, r2, r3}
- # define RESTORE_LR_5 ldmfd sp!, {r4, r7, lr}
-
-+# define DOCARGS_6 stmfd sp!, {r0, r1, r2, r3, r7, lr}
-+# define UNDOCARGS_6 ldmfd sp!, {r0, r1, r2, r3}
-+# define RESTORE_LR_6 RESTORE_LR_0
-+
- # ifdef IS_IN_libpthread
- # define CENABLE bl PLTJMP(__pthread_enable_asynccancel)
- # define CDISABLE bl PLTJMP(__pthread_disable_asynccancel)
-Index: glibc/ports/sysdeps/unix/sysv/linux/arm/eabi/nptl/sysdep-cancel.h
-===================================================================
---- glibc.orig/ports/sysdeps/unix/sysv/linux/arm/eabi/nptl/sysdep-cancel.h 2006-03-21 15:58:10.000000000 -0500
-+++ glibc/ports/sysdeps/unix/sysv/linux/arm/eabi/nptl/sysdep-cancel.h 2006-03-21 15:58:46.000000000 -0500
-@@ -64,9 +64,9 @@
- UNDOARGS_##args; \
- cmn r0, $4096;
-
--/* DOARGS pushes four bytes on the stack for five arguments, and nothing
-- otherwise. In order to preserve doubleword alignment, sometimes we must
-- save an extra register. */
-+/* DOARGS pushes four bytes on the stack for five arguments, eight bytes for
-+ six arguments, and nothing for fewer. In order to preserve doubleword
-+ alignment, sometimes we must save an extra register. */
-
- # define RESTART_UNWIND .fnend; .fnstart; .save {r7, lr}
-
-@@ -94,6 +94,10 @@
- # define UNDOCARGS_5 ldmfd sp!, {r0, r1, r2, r3}; .fnend; .fnstart; .save {r4}; .save {r7, lr}; .pad #4
- # define RESTORE_LR_5 ldmfd sp!, {r4, r7, lr}
-
-+# define DOCARGS_6 .save {r4, r5}; stmfd sp!, {r0, r1, r2, r3, r7, lr}; .save {r7, lr}; .pad #20
-+# define UNDOCARGS_6 ldmfd sp!, {r0, r1, r2, r3}; .fnend; .fnstart; .save {r4, r5}; .save {r7, lr}
-+# define RESTORE_LR_6 RESTORE_LR_0
-+
- # ifdef IS_IN_libpthread
- # define CENABLE bl PLTJMP(__pthread_enable_asynccancel)
- # define CDISABLE bl PLTJMP(__pthread_disable_asynccancel)
-Index: glibc/ports/sysdeps/unix/sysv/linux/arm/eabi/sysdep.h
-===================================================================
---- glibc.orig/ports/sysdeps/unix/sysv/linux/arm/eabi/sysdep.h 2006-03-21 15:58:10.000000000 -0500
-+++ glibc/ports/sysdeps/unix/sysv/linux/arm/eabi/sysdep.h 2006-03-21 15:58:46.000000000 -0500
-@@ -1,4 +1,4 @@
--/* Copyright (C) 2005
-+/* Copyright (C) 2005, 2006
- Free Software Foundation, Inc.
-
- This file is part of the GNU C Library.
-@@ -29,6 +29,12 @@
- # error Kernel headers are too old
- #endif
-
-+/* Don't use stime, even if the kernel headers define it. We have
-+ settimeofday, and some EABI kernels have removed stime. Similarly
-+ use setitimer to implement alarm. */
-+#undef __NR_stime
-+#undef __NR_alarm
-+
- /* The ARM EABI user interface passes the syscall number in r7, instead
- of in the swi. This is more efficient, because the kernel does not need
- to fetch the swi from memory to find out the number; which can be painful
-Index: glibc/ports/sysdeps/unix/sysv/linux/arm/eabi/umount.c
-===================================================================
---- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ glibc/ports/sysdeps/unix/sysv/linux/arm/eabi/umount.c 2006-03-21 15:58:46.000000000 -0500
-@@ -0,0 +1,31 @@
-+/* Copyright (C) 2000, 2001 Free Software Foundation, Inc.
-+ This file is part of the GNU C Library.
-+ Contributed by David Huggins-Daines <dhd@debian.org>, 2000.
-+
-+ The GNU C Library is free software; you can redistribute it and/or
-+ modify it under the terms of the GNU Lesser General Public
-+ License as published by the Free Software Foundation; either
-+ version 2.1 of the License, or (at your option) any later version.
-+
-+ The GNU C Library is distributed in the hope that it will be useful,
-+ but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-+ Lesser General Public License for more details.
-+
-+ You should have received a copy of the GNU Lesser General Public
-+ License along with the GNU C Library; if not, write to the Free
-+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
-+ 02111-1307 USA. */
-+
-+/* Since we don't have an oldumount system call, do what the kernel
-+ does down here. */
-+
-+extern long int __umount2 (const char *name, int flags);
-+
-+long int
-+__umount (const char *name)
-+{
-+ return __umount2 (name, 0);
-+}
-+
-+weak_alias (__umount, umount);
-Index: glibc/ports/sysdeps/unix/sysv/linux/arm/kernel-features.h
-===================================================================
---- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ glibc/ports/sysdeps/unix/sysv/linux/arm/kernel-features.h 2006-03-20 17:26:58.000000000 -0500
-@@ -0,0 +1,31 @@
-+/* Set flags signalling availability of kernel features based on given
-+ kernel version number.
-+ Copyright (C) 2006 Free Software Foundation, Inc.
-+ This file is part of the GNU C Library.
-+
-+ The GNU C Library is free software; you can redistribute it and/or
-+ modify it under the terms of the GNU Lesser General Public
-+ License as published by the Free Software Foundation; either
-+ version 2.1 of the License, or (at your option) any later version.
-+
-+ The GNU C Library is distributed in the hope that it will be useful,
-+ but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-+ Lesser General Public License for more details.
-+
-+ You should have received a copy of the GNU Lesser General Public
-+ License along with the GNU C Library; if not, write to the Free
-+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
-+ 02111-1307 USA. */
-+
-+/* The utimes syscall was added before 2.6.1. */
-+#if __LINUX_KERNEL_VERSION >= 132609
-+# define __ASSUME_UTIMES 1
-+#endif
-+
-+/* The new getrlimit syscall was added sometime before 2.4.6. */
-+#if __LINUX_KERNEL_VERSION >= 132102
-+#define __ASSUME_NEW_GETRLIMIT_SYSCALL 1
-+#endif
-+
-+#include_next <kernel-features.h>
diff --git a/recipes/glibc/glibc-2.4/glibc-2.4-compile.patch b/recipes/glibc/glibc-2.4/glibc-2.4-compile.patch
deleted file mode 100644
index ea9f55ae7f..0000000000
--- a/recipes/glibc/glibc-2.4/glibc-2.4-compile.patch
+++ /dev/null
@@ -1,29 +0,0 @@
---- glibc-2.4/csu/libc-start.c.ark 2006-03-13 03:07:15.000000000 +0100
-+++ glibc-2.4/csu/libc-start.c 2006-03-13 03:08:51.000000000 +0100
-@@ -59,6 +59,11 @@
- # define LIBC_START_MAIN BP_SYM (__libc_start_main)
- #endif
-
-+#ifdef SHARED
-+#include <pthread-functions.h>
-+extern struct pthread_functions __libc_pthread_functions;
-+#endif
-+
- #ifdef MAIN_AUXVEC_ARG
- /* main gets passed a pointer to the auxiliary. */
- # define MAIN_AUXVEC_DECL , void *
---- glibc-2.4/nscd/Makefile.ark 2006-03-13 14:05:47.000000000 +0100
-+++ glibc-2.4/nscd/Makefile 2006-03-13 14:06:12.000000000 +0100
-@@ -67,8 +67,10 @@
- # contains only the basic kernel interface headers, not something like
- # libselinux. So the simplest thing is to presume that the standard
- # system headers will be ok for this file.
--$(objpfx)nscd_stat.o: sysincludes = # nothing
--$(objpfx)selinux.o: sysincludes = # nothing
-+# Except, of course, this breaks crosscompiling with kernel headers in
-+# a nonstandard location...
-+#$(objpfx)nscd_stat.o: sysincludes = # nothing
-+#$(objpfx)selinux.o: sysincludes = # nothing
-
- distribute := nscd.h nscd-client.h dbg_log.h \
- $(addsuffix .c, $(filter-out xmalloc,$(all-nscd-modules))) \
diff --git a/recipes/glibc/glibc-2.4/glibc-2.4-openat-3.patch b/recipes/glibc/glibc-2.4/glibc-2.4-openat-3.patch
deleted file mode 100644
index d3f37f6c36..0000000000
--- a/recipes/glibc/glibc-2.4/glibc-2.4-openat-3.patch
+++ /dev/null
@@ -1,133 +0,0 @@
-Submitted By: Jim Gifford (patches at jg555 dot com)
-Date: 2006-08-18
-Initial Package Version: 2.4
-Origin: http://sourceware.org/bugzilla/show_bug.cgi?id=2873
-Upstream Status: Applied
-Description: Fixes http://sourceware.org/bugzilla/show_bug.cgi?id=2873
- http://sourceware.org/bugzilla/show_bug.cgi?id=3040
- http://linuxfromscratch.org/pipermail/lfs-dev/2006-June/057562.html
- Updated by Joe Ciccone
-
-diff -Naur glibc-2.4.orig/sysdeps/unix/sysv/linux/i386/fchownat.c glibc-2.4/sysdeps/unix/sysv/linux/i386/fchownat.c
---- glibc-2.4.orig/sysdeps/unix/sysv/linux/i386/fchownat.c 2006-02-23 14:50:21.000000000 -0800
-+++ glibc-2.4/sysdeps/unix/sysv/linux/i386/fchownat.c 2006-08-18 20:38:21.773288795 -0700
-@@ -61,6 +61,24 @@
- int
- fchownat (int fd, const char *file, uid_t owner, gid_t group, int flag)
- {
-+ int result;
-+
-+#ifdef __NR_fchownat
-+# ifndef __ASSUME_ATFCTS
-+ if (__have_atfcts >= 0)
-+# endif
-+ {
-+ result = INLINE_SYSCALL (fchownat, 5, fd, file, owner, group, flag);
-+# ifndef __ASSUME_ATFCTS
-+ if (result == -1 && errno == ENOSYS)
-+ __have_atfcts = -1;
-+ else
-+# endif
-+ return result;
-+ }
-+#endif
-+
-+#ifndef __ASSUME_ATFCTS
- if (flag & ~AT_SYMLINK_NOFOLLOW)
- {
- __set_errno (EINVAL);
-@@ -87,14 +105,13 @@
- file = buf;
- }
-
-- int result;
- INTERNAL_SYSCALL_DECL (err);
-
--#if defined __NR_lchown || __ASSUME_LCHOWN_SYSCALL > 0
--# if __ASSUME_LCHOWN_SYSCALL == 0
-+# if defined __NR_lchown || __ASSUME_LCHOWN_SYSCALL > 0
-+# if __ASSUME_LCHOWN_SYSCALL == 0
- static int __libc_old_chown;
-
--# ifdef __NR_chown32
-+# ifdef __NR_chown32
- if (__libc_missing_32bit_uids <= 0)
- {
- if (flag & AT_SYMLINK_NOFOLLOW)
-@@ -111,7 +128,7 @@
-
- __libc_missing_32bit_uids = 1;
- }
--# endif /* __NR_chown32 */
-+# endif /* __NR_chown32 */
-
- if (((owner + 1) > (uid_t) ((__kernel_uid_t) -1U))
- || ((group + 1) > (gid_t) ((__kernel_gid_t) -1U)))
-@@ -135,13 +152,13 @@
-
- result = INTERNAL_SYSCALL (lchown, err, 3, CHECK_STRING (file), owner,
- group);
--# elif __ASSUME_32BITUIDS
-+# elif __ASSUME_32BITUIDS
- /* This implies __ASSUME_LCHOWN_SYSCALL. */
- result = INTERNAL_SYSCALL (chown32, err, 3, CHECK_STRING (file), owner,
- group);
--# else
-+# else
- /* !__ASSUME_32BITUIDS && ASSUME_LCHOWN_SYSCALL */
--# ifdef __NR_chown32
-+# ifdef __NR_chown32
- if (__libc_missing_32bit_uids <= 0)
- {
- result = INTERNAL_SYSCALL (chown32, err, 3, CHECK_STRING (file), owner,
-@@ -153,7 +170,7 @@
-
- __libc_missing_32bit_uids = 1;
- }
--# endif /* __NR_chown32 */
-+# endif /* __NR_chown32 */
- if (((owner + 1) > (uid_t) ((__kernel_uid_t) -1U))
- || ((group + 1) > (gid_t) ((__kernel_gid_t) -1U)))
- {
-@@ -162,10 +179,10 @@
- }
-
- result = INTERNAL_SYSCALL (chown, err, 3, CHECK_STRING (file), owner, group);
--# endif
--#else
-+# endif
-+# else
- result = INTERNAL_SYSCALL (chown, err, 3, CHECK_STRING (file), owner, group);
--#endif
-+# endif
-
- if (__builtin_expect (INTERNAL_SYSCALL_ERROR_P (result, err), 0))
- goto fail;
-@@ -175,4 +192,5 @@
- fail:
- __atfct_seterrno (INTERNAL_SYSCALL_ERRNO (result, err), fd, buf);
- return -1;
-+#endif
- }
-diff -Naur glibc-2.4.orig/sysdeps/unix/sysv/linux/openat.c glibc-2.4/sysdeps/unix/sysv/linux/openat.c
---- glibc-2.4.orig/sysdeps/unix/sysv/linux/openat.c 2006-02-28 21:32:42.000000000 -0800
-+++ glibc-2.4/sysdeps/unix/sysv/linux/openat.c 2006-08-18 20:39:14.360012706 -0700
-@@ -29,8 +29,6 @@
-
-
- #if !defined OPENAT && !defined __ASSUME_ATFCTS
--# define OPENAT openat
--
- /* Set errno after a failed call. If BUF is not null,
- it is a /proc/self/fd/ path name we just tried to use. */
- void
-@@ -63,6 +61,9 @@
- int __have_atfcts;
- #endif
-
-+#ifndef OPENAT
-+# define OPENAT openat
-+#endif
-
- #define OPENAT_NOT_CANCEL CONCAT (OPENAT)
- #define CONCAT(name) CONCAT2 (name)
diff --git a/recipes/glibc/glibc-2.4/glibc-crunch-endian-bigword-littlebyte.patch b/recipes/glibc/glibc-2.4/glibc-crunch-endian-bigword-littlebyte.patch
deleted file mode 100644
index e181e97ca5..0000000000
--- a/recipes/glibc/glibc-2.4/glibc-crunch-endian-bigword-littlebyte.patch
+++ /dev/null
@@ -1,40 +0,0 @@
-diff -urN glibc-2.5/ports/sysdeps/arm/bits/endian.h glibc-2.5/ports/sysdeps/arm/bits/endian.h
---- glibc-2.5/ports/sysdeps/arm/bits/endian.h 2005-06-13 20:11:47.000000000 +1000
-+++ glibc-2.5/ports/sysdeps/arm/bits/endian.h 2007-05-18 08:41:52.000000000 +1000
-@@ -15,5 +15,9 @@
- #ifdef __VFP_FP__
- #define __FLOAT_WORD_ORDER __BYTE_ORDER
- #else
-+#ifdef __MAVERICK__
-+#define __FLOAT_WORD_ORDER __BIG_ENDIAN
-+#else
- #define __FLOAT_WORD_ORDER __BIG_ENDIAN
- #endif
-+#endif
-diff -urN glibc-2.5/ports/sysdeps/arm/gccframe.h glibc-2.5/ports/sysdeps/arm/gccframe.h
---- glibc-2.5/ports/sysdeps/arm/gccframe.h 2001-11-16 11:07:20.000000000 +1000
-+++ glibc-2.5/ports/sysdeps/arm/gccframe.h 2007-05-18 08:53:38.000000000 +1000
-@@ -17,6 +17,10 @@
- Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
- 02111-1307 USA. */
-
-+#ifdef __MAVERICK__
-+#define FIRST_PSEUDO_REGISTER 43
-+#else
- #define FIRST_PSEUDO_REGISTER 27
-+#endif
-
- #include <sysdeps/generic/gccframe.h>
-diff -urN glibc-2.5/ports/sysdeps/arm/gmp-mparam.h glibc-2.5/ports/sysdeps/arm/gmp-mparam.h
---- glibc-2.5/ports/sysdeps/arm/gmp-mparam.h 2005-06-13 20:11:47.000000000 +1000
-+++ glibc-2.5/ports/sysdeps/arm/gmp-mparam.h 2007-05-18 08:54:21.000000000 +1000
-@@ -29,6 +29,9 @@
- #if defined(__ARMEB__)
- # define IEEE_DOUBLE_MIXED_ENDIAN 0
- # define IEEE_DOUBLE_BIG_ENDIAN 1
-+#elif defined(__MAVERICK__)
-+#define IEEE_DOUBLE_MIXED_ENDIAN 0
-+#define IEEE_DOUBLE_BIG_ENDIAN 1
- #elif defined(__VFP_FP__)
- # define IEEE_DOUBLE_MIXED_ENDIAN 0
- # define IEEE_DOUBLE_BIG_ENDIAN 0
diff --git a/recipes/glibc/glibc-2.4/glibc-crunch-oabi.patch b/recipes/glibc/glibc-2.4/glibc-crunch-oabi.patch
deleted file mode 100644
index 964abb46d6..0000000000
--- a/recipes/glibc/glibc-2.4/glibc-crunch-oabi.patch
+++ /dev/null
@@ -1,310 +0,0 @@
-diff -urN glibc-2.5/ports/sysdeps/arm/fpu/bits/fenv.h glibc-2.5/ports/sysdeps/arm/fpu/bits/fenv.h
---- glibc-2.5/ports/sysdeps/arm/fpu/bits/fenv.h 2001-07-06 14:55:48.000000000 +1000
-+++ glibc-2.5/ports/sysdeps/arm/fpu/bits/fenv.h 2007-05-18 08:44:33.000000000 +1000
-@@ -20,6 +20,45 @@
- # error "Never use <bits/fenv.h> directly; include <fenv.h> instead."
- #endif
-
-+#if defined(__MAVERICK__)
-+
-+/* Define bits representing exceptions in the FPU status word. */
-+enum
-+ {
-+ FE_INVALID = 1,
-+#define FE_INVALID FE_INVALID
-+ FE_OVERFLOW = 4,
-+#define FE_OVERFLOW FE_OVERFLOW
-+ FE_UNDERFLOW = 8,
-+#define FE_UNDERFLOW FE_UNDERFLOW
-+ FE_INEXACT = 16,
-+#define FE_INEXACT FE_INEXACT
-+ };
-+
-+/* Amount to shift by to convert an exception to a mask bit. */
-+#define FE_EXCEPT_SHIFT 5
-+
-+/* All supported exceptions. */
-+#define FE_ALL_EXCEPT \
-+ (FE_INVALID | FE_OVERFLOW | FE_UNDERFLOW | FE_INEXACT)
-+
-+/* IEEE rounding modes. */
-+enum
-+ {
-+ FE_TONEAREST = 0,
-+#define FE_TONEAREST FE_TONEAREST
-+ FE_TOWARDZERO = 0x400,
-+#define FE_TOWARDZERO FE_TOWARDZERO
-+ FE_DOWNWARD = 0x800,
-+#define FE_DOWNWARD FE_DOWNWARD
-+ FE_UPWARD = 0xc00,
-+#define FE_UPWARD FE_UPWARD
-+ };
-+
-+#define FE_ROUND_MASK (FE_UPWARD)
-+
-+#else /* FPA */
-+
- /* Define bits representing exceptions in the FPU status word. */
- enum
- {
-@@ -31,6 +70,7 @@
- #define FE_OVERFLOW FE_OVERFLOW
- FE_UNDERFLOW = 8,
- #define FE_UNDERFLOW FE_UNDERFLOW
-+
- };
-
- /* Amount to shift by to convert an exception to a mask bit. */
-@@ -44,6 +84,8 @@
- modes exist, but you have to encode them in the actual instruction. */
- #define FE_TONEAREST 0
-
-+#endif /* FPA */
-+
- /* Type representing exception flags. */
- typedef unsigned long int fexcept_t;
-
-diff -urN glibc-2.5/ports/sysdeps/arm/fpu/bits/setjmp.h glibc-2.5/ports/sysdeps/arm/fpu/bits/setjmp.h
---- glibc-2.5/ports/sysdeps/arm/fpu/bits/setjmp.h 2006-01-10 19:22:16.000000000 +1000
-+++ glibc-2.5/ports/sysdeps/arm/fpu/bits/setjmp.h 2007-05-18 08:45:22.000000000 +1000
-@@ -28,7 +28,11 @@
- #ifndef _ASM
- /* Jump buffer contains v1-v6, sl, fp, sp and pc. Other registers are not
- saved. */
-+#ifdef __MAVERICK__
-+typedef int __jmp_buf[34];
-+#else
- typedef int __jmp_buf[22];
- #endif
-+#endif
-
- #endif
-diff -urN glibc-2.5/ports/sysdeps/arm/fpu/fegetround.c glibc-2.5/ports/sysdeps/arm/fpu/fegetround.c
---- glibc-2.5/ports/sysdeps/arm/fpu/fegetround.c 2001-07-06 14:55:48.000000000 +1000
-+++ glibc-2.5/ports/sysdeps/arm/fpu/fegetround.c 2007-05-18 08:47:52.000000000 +1000
-@@ -18,9 +18,21 @@
- 02111-1307 USA. */
-
- #include <fenv.h>
-+#include <fpu_control.h>
-
- int
- fegetround (void)
- {
-+#if defined(__MAVERICK__)
-+
-+ unsigned long temp;
-+
-+ _FPU_GETCW (temp);
-+ return temp & FE_ROUND_MASK;
-+
-+#else /* FPA */
-+
- return FE_TONEAREST; /* Easy. :-) */
-+
-+#endif
- }
-diff -urN glibc-2.5/ports/sysdeps/arm/fpu/fesetround.c glibc-2.5/ports/sysdeps/arm/fpu/fesetround.c
---- glibc-2.5/ports/sysdeps/arm/fpu/fesetround.c 2005-10-11 01:29:32.000000000 +1000
-+++ glibc-2.5/ports/sysdeps/arm/fpu/fesetround.c 2007-05-18 08:48:32.000000000 +1000
-@@ -20,10 +20,26 @@
- #include <fenv.h>
-+#include <fpu_control.h>
-
- int
- fesetround (int round)
- {
-+#if defined(__MAVERICK__)
-+ unsigned long temp;
-+
-+ if (round & ~FE_ROUND_MASK)
-+ return 1;
-+
-+ _FPU_GETCW (temp);
-+ temp = (temp & ~FE_ROUND_MASK) | round;
-+ _FPU_SETCW (temp);
-+ return 0;
-+
-+#else /* FPA */
-+
- /* We only support FE_TONEAREST, so there is no need for any work. */
- return (round == FE_TONEAREST)?0:1;
-+
-+#endif
- }
-
- libm_hidden_def (fesetround)
-diff -urN glibc-2.5/ports/sysdeps/arm/fpu/fpu_control.h glibc-2.5/ports/sysdeps/arm/fpu/fpu_control.h
---- glibc-2.5/ports/sysdeps/arm/fpu/fpu_control.h 2001-07-06 14:55:48.000000000 +1000
-+++ glibc-2.5/ports/sysdeps/arm/fpu/fpu_control.h 2007-05-18 08:50:28.000000000 +1000
-@@ -20,6 +20,81 @@
- #ifndef _FPU_CONTROL_H
- #define _FPU_CONTROL_H
-
-+#if defined(__MAVERICK__)
-+
-+/* DSPSC register: (from EP9312 User's Guide)
-+ *
-+ * bits 31..29 - DAID
-+ * bits 28..26 - HVID
-+ * bits 25..24 - RSVD
-+ * bit 23 - ISAT
-+ * bit 22 - UI
-+ * bit 21 - INT
-+ * bit 20 - AEXC
-+ * bits 19..18 - SAT
-+ * bits 17..16 - FCC
-+ * bit 15 - V
-+ * bit 14 - FWDEN
-+ * bit 13 - Invalid
-+ * bit 12 - Denorm
-+ * bits 11..10 - RM
-+ * bits 9..5 - IXE, UFE, OFE, RSVD, IOE
-+ * bits 4..0 - IX, UF, OF, RSVD, IO
-+ */
-+
-+/* masking of interrupts */
-+#define _FPU_MASK_IM (1 << 5) /* invalid operation */
-+#define _FPU_MASK_ZM 0 /* divide by zero */
-+#define _FPU_MASK_OM (1 << 7) /* overflow */
-+#define _FPU_MASK_UM (1 << 8) /* underflow */
-+#define _FPU_MASK_PM (1 << 9) /* inexact */
-+#define _FPU_MASK_DM 0 /* denormalized operation */
-+
-+#define _FPU_RESERVED 0xfffff000 /* These bits are reserved. */
-+
-+#define _FPU_DEFAULT 0x00b00000 /* Default value. */
-+#define _FPU_IEEE 0x00b003a0 /* Default + exceptions enabled. */
-+
-+/* Type of the control word. */
-+typedef unsigned int fpu_control_t;
-+
-+/* Macros for accessing the hardware control word. */
-+#define _FPU_GETCW(cw) ({ \
-+ register int __t1, __t2; \
-+ \
-+ __asm__ volatile ( \
-+ "cfmvr64l %1, mvdx0\n\t" \
-+ "cfmvr64h %2, mvdx0\n\t" \
-+ "cfmv32sc mvdx0, dspsc\n\t" \
-+ "cfmvr64l %0, mvdx0\n\t" \
-+ "cfmv64lr mvdx0, %1\n\t" \
-+ "cfmv64hr mvdx0, %2" \
-+ : "=r" (cw), "=r" (__t1), "=r" (__t2) \
-+ ); \
-+})
-+
-+#define _FPU_SETCW(cw) ({ \
-+ register int __t0, __t1, __t2; \
-+ \
-+ __asm__ volatile ( \
-+ "cfmvr64l %1, mvdx0\n\t" \
-+ "cfmvr64h %2, mvdx0\n\t" \
-+ "cfmv64lr mvdx0, %0\n\t" \
-+ "cfmvsc32 dspsc, mvdx0\n\t" \
-+ "cfmv64lr mvdx0, %1\n\t" \
-+ "cfmv64hr mvdx0, %2" \
-+ : "=r" (__t0), "=r" (__t1), "=r" (__t2) \
-+ : "0" (cw) \
-+ ); \
-+})
-+
-+/* Default control word set at startup. */
-+extern fpu_control_t __fpu_control;
-+
-+#else /* FPA */
-+
-+
-+
- /* We have a slight terminology confusion here. On the ARM, the register
- * we're interested in is actually the FPU status word - the FPU control
- * word is something different (which is implementation-defined and only
-@@ -99,4 +174,6 @@
- /* Default control word set at startup. */
- extern fpu_control_t __fpu_control;
-
-+#endif /* FPA */
-+
- #endif /* _FPU_CONTROL_H */
-diff -urN glibc-2.5/ports/sysdeps/arm/fpu/__longjmp.S glibc-2.5/ports/sysdeps/arm/fpu/__longjmp.S
---- glibc-2.5/ports/sysdeps/arm/fpu/__longjmp.S 2001-07-06 14:55:48.000000000 +1000
-+++ glibc-2.5/ports/sysdeps/arm/fpu/__longjmp.S 2007-05-18 08:51:36.000000000 +1000
-@@ -30,7 +30,33 @@
- movs r0, r1 /* get the return value in place */
- moveq r0, #1 /* can't let setjmp() return zero! */
-
-+#ifdef __MAVERICK__
-+ cfldrd mvd4, [ip], #8
-+ nop
-+ cfldrd mvd5, [ip], #8
-+ nop
-+ cfldrd mvd6, [ip], #8
-+ nop
-+ cfldrd mvd7, [ip], #8
-+ nop
-+ cfldrd mvd8, [ip], #8
-+ nop
-+ cfldrd mvd9, [ip], #8
-+ nop
-+ cfldrd mvd10, [ip], #8
-+ nop
-+ cfldrd mvd11, [ip], #8
-+ nop
-+ cfldrd mvd12, [ip], #8
-+ nop
-+ cfldrd mvd13, [ip], #8
-+ nop
-+ cfldrd mvd14, [ip], #8
-+ nop
-+ cfldrd mvd15, [ip], #8
-+#else
- lfmfd f4, 4, [ip] ! /* load the floating point regs */
-+#endif
-
- LOADREGS(ia, ip, {v1-v6, sl, fp, sp, pc})
- END (__longjmp)
-diff -urN glibc-2.5/ports/sysdeps/arm/fpu/setjmp.S glibc-2.5/ports/sysdeps/arm/fpu/setjmp.S
---- glibc-2.5/ports/sysdeps/arm/fpu/setjmp.S 2001-07-06 14:55:48.000000000 +1000
-+++ glibc-2.5/ports/sysdeps/arm/fpu/setjmp.S 2007-05-18 08:53:00.000000000 +1000
-@@ -24,11 +24,41 @@
-
- ENTRY (__sigsetjmp)
- /* Save registers */
-+#ifdef __MAVERICK__
-+ cfstrd mvd4, [r0], #8
-+ nop
-+ cfstrd mvd5, [r0], #8
-+ nop
-+ cfstrd mvd6, [r0], #8
-+ nop
-+ cfstrd mvd7, [r0], #8
-+ nop
-+ cfstrd mvd8, [r0], #8
-+ nop
-+ cfstrd mvd9, [r0], #8
-+ nop
-+ cfstrd mvd10, [r0], #8
-+ nop
-+ cfstrd mvd11, [r0], #8
-+ nop
-+ cfstrd mvd12, [r0], #8
-+ nop
-+ cfstrd mvd13, [r0], #8
-+ nop
-+ cfstrd mvd14, [r0], #8
-+ nop
-+ cfstrd mvd15, [r0], #8
-+#else
- sfmea f4, 4, [r0]!
-+#endif
- stmia r0, {v1-v6, sl, fp, sp, lr}
-
- /* Restore pointer to jmp_buf */
-+#ifdef __MAVERICK__
-+ sub r0, r0, #96
-+#else
- sub r0, r0, #48
-+#endif
-
- /* Make a tail call to __sigjmp_save; it takes the same args. */
- B PLTJMP(C_SYMBOL_NAME(__sigjmp_save))
diff --git a/recipes/glibc/glibc-2.4/glibc-crunch-oabi2.patch b/recipes/glibc/glibc-2.4/glibc-crunch-oabi2.patch
deleted file mode 100644
index fe5a05014f..0000000000
--- a/recipes/glibc/glibc-2.4/glibc-crunch-oabi2.patch
+++ /dev/null
@@ -1,18 +0,0 @@
---- glibc-2.5/ports/sysdeps/arm/sysdep.h 2007-07-02 13:05:53.000000000 +1000
-+++ glibc-2.5/ports/sysdeps/arm/sysdep.h 2007-07-02 13:06:26.000000000 +1000
-@@ -51,6 +51,7 @@
-
- #endif
-
-+#if 0 // ndef __MAVERICK__
- /* APCS-32 doesn't preserve the condition codes across function call. */
- #ifdef __APCS_32__
- #define LOADREGS(cond, base, reglist...)\
-@@ -74,6 +75,7 @@
- #define DO_RET(_reg) \
- movs pc, _reg
- #endif
-+#endif
-
- /* Define an entry point visible from C. */
- #define ENTRY(name) \
diff --git a/recipes/glibc/glibc-2.5/arm-longlong.patch b/recipes/glibc/glibc-2.5/arm-longlong.patch
new file mode 100644
index 0000000000..28aca83dff
--- /dev/null
+++ b/recipes/glibc/glibc-2.5/arm-longlong.patch
@@ -0,0 +1,58 @@
+--- glibc-2.4/stdlib/longlong.h.ark 2006-03-11 22:49:27.000000000 +0100
++++ glibc-2.4/stdlib/longlong.h 2006-03-11 22:55:12.000000000 +0100
+@@ -206,6 +206,14 @@
+ "rI" ((USItype) (bh)), \
+ "r" ((USItype) (al)), \
+ "rI" ((USItype) (bl)) __CLOBBER_CC)
++/* v3m and all higher arches have long multiply support. */
++#if !defined(__ARM_ARCH_2__) && !defined(__ARM_ARCH_3__)
++#define umul_ppmm(xh, xl, a, b) \
++ __asm__ ("umull %0,%1,%2,%3" : "=&r" (xl), "=&r" (xh) : "r" (a), "r" (b))
++#define UMUL_TIME 5
++#define smul_ppmm(xh, xl, a, b) \
++ __asm__ ("smull %0,%1,%2,%3" : "=&r" (xl), "=&r" (xh) : "r" (a), "r" (b))
++#else
+ #define umul_ppmm(xh, xl, a, b) \
+ {register USItype __t0, __t1, __t2; \
+ __asm__ ("%@ Inlined umul_ppmm\n" \
+@@ -227,7 +235,13 @@
+ : "r" ((USItype) (a)), \
+ "r" ((USItype) (b)) __CLOBBER_CC );}
+ #define UMUL_TIME 20
++#endif
+ #define UDIV_TIME 100
++#if defined(__ARM_ARCH_5__) || defined(__ARM_ARCH_5T__) || defined(__ARM_ARCH_5TE__)
++#define count_leading_zeros(COUNT,X) ((COUNT) = __builtin_clz (X))
++#define COUNT_LEADING_ZEROS_0 32
++#endif
++
+ #endif /* __arm__ */
+
+ #if defined (__hppa) && W_TYPE_SIZE == 32
+--- glibc-2.4/ports/sysdeps/arm/mp_clz_tab.c.ark 2006-03-11 22:56:43.000000000 +0100
++++ glibc-2.4/ports/sysdeps/arm/mp_clz_tab.c 2006-03-11 22:58:19.000000000 +0100
+@@ -0,0 +1,24 @@
++/* __clz_tab -- support for longlong.h
++ Copyright (C) 2004 Free Software Foundation, Inc.
++ This file is part of the GNU C Library.
++
++ The GNU C Library is free software; you can redistribute it and/or
++ modify it under the terms of the GNU Lesser General Public
++ License as published by the Free Software Foundation; either
++ version 2.1 of the License, or (at your option) any later version.
++
++ The GNU C Library is distributed in the hope that it will be useful,
++ but WITHOUT ANY WARRANTY; without even the implied warranty of
++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++ Lesser General Public License for more details.
++
++ You should have received a copy of the GNU Lesser General Public
++ License along with the GNU C Library; if not, write to the Free
++ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
++ 02111-1307 USA. */
++
++#if defined(__ARM_ARCH_5__) || defined(__ARM_ARCH_5T__) || defined(__ARM_ARCH_5TE__)
++/* Nothing required. */
++#else
++#include <stdlib/mp_clz_tab.c>
++#endif
diff --git a/recipes/glibc/glibc-2.5/arm-memcpy.patch b/recipes/glibc/glibc-2.5/arm-memcpy.patch
new file mode 100644
index 0000000000..bc2b3dab84
--- /dev/null
+++ b/recipes/glibc/glibc-2.5/arm-memcpy.patch
@@ -0,0 +1,758 @@
+--- /dev/null 2004-02-02 20:32:13.000000000 +0000
++++ sysdeps/arm/memmove.S 2004-03-20 18:37:23.000000000 +0000
+@@ -0,0 +1,251 @@
++/*
++ * Optimized memmove implementation for ARM processors
++ *
++ * Author: Nicolas Pitre
++ * Created: Dec 23, 2003
++ * Copyright: (C) MontaVista Software, Inc.
++ *
++ * This file is free software; you can redistribute it and/or
++ * modify it under the terms of the GNU Lesser General Public
++ * License as published by the Free Software Foundation; either
++ * version 2.1 of the License, or (at your option) any later version.
++ *
++ * This file is distributed in the hope that it will be useful,
++ * but WITHOUT ANY WARRANTY; without even the implied warranty of
++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++ * Lesser General Public License for more details.
++ */
++
++#include <sysdep.h>
++
++
++/*
++ * Endian independent macros for shifting bytes within registers.
++ */
++#ifndef __ARMEB__
++#define pull lsr
++#define push lsl
++#else
++#define pull lsl
++#define push lsr
++#endif
++
++/*
++ * Enable data preload for architectures that support it (ARMv5 and above)
++ */
++#if defined(__ARM_ARCH_5__) || \
++ defined(__ARM_ARCH_5T__) || \
++ defined(__ARM_ARCH_5TE__)
++#define PLD(code...) code
++#else
++#define PLD(code...)
++#endif
++
++
++/* char * memmove (char *dst, const char *src) */
++ENTRY(memmove)
++ subs ip, r0, r1
++ cmphi r2, ip
++ bls memcpy(PLT)
++
++ stmfd sp!, {r0, r4, lr}
++ add r1, r1, r2
++ add r0, r0, r2
++ subs r2, r2, #4
++ blt 25f
++ ands ip, r0, #3
++ PLD( pld [r1, #-4] )
++ bne 26f
++ ands ip, r1, #3
++ bne 27f
++
++19: subs r2, r2, #4
++ blt 24f
++ subs r2, r2, #8
++ blt 23f
++ subs r2, r2, #16
++ blt 22f
++
++ PLD( pld [r1, #-32] )
++ PLD( subs r2, r2, #96 )
++ stmfd sp!, {r5 - r8}
++ PLD( blt 21f )
++
++ PLD( @ cache alignment )
++ PLD( ands ip, r1, #31 )
++ PLD( pld [r1, #-64] )
++ PLD( beq 20f )
++ PLD( cmp r2, ip )
++ PLD( pld [r1, #-96] )
++ PLD( blt 20f )
++ PLD( cmp ip, #16 )
++ PLD( sub r2, r2, ip )
++ PLD( ldmgedb r1!, {r3 - r6} )
++ PLD( stmgedb r0!, {r3 - r6} )
++ PLD( beq 20f )
++ PLD( and ip, ip, #15 )
++ PLD( cmp ip, #8 )
++ PLD( ldr r3, [r1, #-4]! )
++ PLD( ldrge r4, [r1, #-4]! )
++ PLD( ldrgt r5, [r1, #-4]! )
++ PLD( str r3, [r0, #-4]! )
++ PLD( strge r4, [r0, #-4]! )
++ PLD( strgt r5, [r0, #-4]! )
++
++20: PLD( pld [r1, #-96] )
++ PLD( pld [r1, #-128] )
++21: ldmdb r1!, {r3, r4, ip, lr}
++ subs r2, r2, #32
++ stmdb r0!, {r3, r4, ip, lr}
++ ldmdb r1!, {r3, r4, ip, lr}
++ stmgedb r0!, {r3, r4, ip, lr}
++ ldmgedb r1!, {r3, r4, ip, lr}
++ stmgedb r0!, {r3, r4, ip, lr}
++ ldmgedb r1!, {r3, r4, ip, lr}
++ subges r2, r2, #32
++ stmdb r0!, {r3, r4, ip, lr}
++ bge 20b
++ PLD( cmn r2, #96 )
++ PLD( bge 21b )
++ PLD( add r2, r2, #96 )
++ tst r2, #31
++ ldmfd sp!, {r5 - r8}
++ ldmeqfd sp!, {r0, r4, pc}
++
++ tst r2, #16
++22: ldmnedb r1!, {r3, r4, ip, lr}
++ stmnedb r0!, {r3, r4, ip, lr}
++
++ tst r2, #8
++23: ldmnedb r1!, {r3, r4}
++ stmnedb r0!, {r3, r4}
++
++ tst r2, #4
++24: ldrne r3, [r1, #-4]!
++ strne r3, [r0, #-4]!
++
++25: ands r2, r2, #3
++ ldmeqfd sp!, {r0, r4, pc}
++
++ cmp r2, #2
++ ldrb r3, [r1, #-1]
++ ldrgeb r4, [r1, #-2]
++ ldrgtb ip, [r1, #-3]
++ strb r3, [r0, #-1]
++ strgeb r4, [r0, #-2]
++ strgtb ip, [r0, #-3]
++ ldmfd sp!, {r0, r4, pc}
++
++26: cmp ip, #2
++ ldrb r3, [r1, #-1]!
++ ldrgeb r4, [r1, #-1]!
++ ldrgtb lr, [r1, #-1]!
++ strb r3, [r0, #-1]!
++ strgeb r4, [r0, #-1]!
++ strgtb lr, [r0, #-1]!
++ subs r2, r2, ip
++ blt 25b
++ ands ip, r1, #3
++ beq 19b
++
++27: bic r1, r1, #3
++ cmp ip, #2
++ ldr r3, [r1]
++ beq 35f
++ blt 36f
++
++
++ .macro backward_copy_shift push pull
++
++ cmp r2, #12
++ PLD( pld [r1, #-4] )
++ blt 33f
++ subs r2, r2, #28
++ stmfd sp!, {r5 - r9}
++ blt 31f
++
++ PLD( subs r2, r2, #96 )
++ PLD( pld [r1, #-32] )
++ PLD( blt 30f )
++ PLD( pld [r1, #-64] )
++
++ PLD( @ cache alignment )
++ PLD( ands ip, r1, #31 )
++ PLD( pld [r1, #-96] )
++ PLD( beq 29f )
++ PLD( cmp r2, ip )
++ PLD( pld [r1, #-128] )
++ PLD( blt 29f )
++ PLD( sub r2, r2, ip )
++28: PLD( mov r4, r3, push #\push )
++ PLD( ldr r3, [r1, #-4]! )
++ PLD( subs ip, ip, #4 )
++ PLD( orr r4, r4, r3, pull #\pull )
++ PLD( str r4, [r0, #-4]! )
++ PLD( bgt 28b )
++
++29: PLD( pld [r1, #-128] )
++30: mov lr, r3, push #\push
++ ldmdb r1!, {r3 - r9, ip}
++ subs r2, r2, #32
++ orr lr, lr, ip, pull #\pull
++ mov ip, ip, push #\push
++ orr ip, ip, r9, pull #\pull
++ mov r9, r9, push #\push
++ orr r9, r9, r8, pull #\pull
++ mov r8, r8, push #\push
++ orr r8, r8, r7, pull #\pull
++ mov r7, r7, push #\push
++ orr r7, r7, r6, pull #\pull
++ mov r6, r6, push #\push
++ orr r6, r6, r5, pull #\pull
++ mov r5, r5, push #\push
++ orr r5, r5, r4, pull #\pull
++ mov r4, r4, push #\push
++ orr r4, r4, r3, pull #\pull
++ stmdb r0!, {r4 - r9, ip, lr}
++ bge 29b
++ PLD( cmn r2, #96 )
++ PLD( bge 30b )
++ PLD( add r2, r2, #96 )
++ cmn r2, #16
++ blt 32f
++31: mov r7, r3, push #\push
++ ldmdb r1!, {r3 - r6}
++ sub r2, r2, #16
++ orr r7, r7, r6, pull #\pull
++ mov r6, r6, push #\push
++ orr r6, r6, r5, pull #\pull
++ mov r5, r5, push #\push
++ orr r5, r5, r4, pull #\pull
++ mov r4, r4, push #\push
++ orr r4, r4, r3, pull #\pull
++ stmdb r0!, {r4 - r7}
++32: adds r2, r2, #28
++ ldmfd sp!, {r5 - r9}
++ blt 34f
++33: mov r4, r3, push #\push
++ ldr r3, [r1, #-4]!
++ subs r2, r2, #4
++ orr r4, r4, r3, pull #\pull
++ str r4, [r0, #-4]!
++ bge 33b
++34:
++ .endm
++
++
++ backward_copy_shift push=8 pull=24
++ add r1, r1, #3
++ b 25b
++
++35: backward_copy_shift push=16 pull=16
++ add r1, r1, #2
++ b 25b
++
++36: backward_copy_shift push=24 pull=8
++ add r1, r1, #1
++ b 25b
++
++ .size memmove, . - memmove
++END(memmove)
++libc_hidden_builtin_def (memmove)
+--- /dev/null 2004-02-02 20:32:13.000000000 +0000
++++ sysdeps/arm/bcopy.S 2004-03-20 18:37:48.000000000 +0000
+@@ -0,0 +1,255 @@
++/*
++ * Optimized memmove implementation for ARM processors
++ *
++ * Author: Nicolas Pitre
++ * Created: Dec 23, 2003
++ * Copyright: (C) MontaVista Software, Inc.
++ *
++ * This file is free software; you can redistribute it and/or
++ * modify it under the terms of the GNU Lesser General Public
++ * License as published by the Free Software Foundation; either
++ * version 2.1 of the License, or (at your option) any later version.
++ *
++ * This file is distributed in the hope that it will be useful,
++ * but WITHOUT ANY WARRANTY; without even the implied warranty of
++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++ * Lesser General Public License for more details.
++ */
++
++#include <sysdep.h>
++
++
++/*
++ * Endian independent macros for shifting bytes within registers.
++ */
++#ifndef __ARMEB__
++#define pull lsr
++#define push lsl
++#else
++#define pull lsl
++#define push lsr
++#endif
++
++/*
++ * Enable data preload for architectures that support it (ARMv5 and above)
++ */
++#if defined(__ARM_ARCH_5__) || \
++ defined(__ARM_ARCH_5T__) || \
++ defined(__ARM_ARCH_5TE__)
++#define PLD(code...) code
++#else
++#define PLD(code...)
++#endif
++
++dst .req r1
++src .req r0
++
++/* void *bcopy (const char *src, char *dst, size_t size) */
++ENTRY(bcopy)
++ subs ip, dst, src
++ cmphi r2, ip
++ movls r3, r0
++ movls r0, r1
++ movls r1, r3
++ bls memcpy(PLT)
++
++ stmfd sp!, {r4, lr}
++ add src, src, r2
++ add dst, dst, r2
++ subs r2, r2, #4
++ blt 25f
++ ands ip, dst, #3
++ PLD( pld [src, #-4] )
++ bne 26f
++ ands ip, src, #3
++ bne 27f
++
++19: subs r2, r2, #4
++ blt 24f
++ subs r2, r2, #8
++ blt 23f
++ subs r2, r2, #16
++ blt 22f
++
++ PLD( pld [src, #-32] )
++ PLD( subs r2, r2, #96 )
++ stmfd sp!, {r5 - r8}
++ PLD( blt 21f )
++
++ PLD( @ cache alignment )
++ PLD( ands ip, src, #31 )
++ PLD( pld [src, #-64] )
++ PLD( beq 20f )
++ PLD( cmp r2, ip )
++ PLD( pld [src, #-96] )
++ PLD( blt 20f )
++ PLD( cmp ip, #16 )
++ PLD( sub r2, r2, ip )
++ PLD( ldmgedb src!, {r3 - r6} )
++ PLD( stmgedb dst!, {r3 - r6} )
++ PLD( beq 20f )
++ PLD( and ip, ip, #15 )
++ PLD( cmp ip, #8 )
++ PLD( ldr r3, [src, #-4]! )
++ PLD( ldrge r4, [src, #-4]! )
++ PLD( ldrgt r5, [src, #-4]! )
++ PLD( str r3, [dst, #-4]! )
++ PLD( strge r4, [dst, #-4]! )
++ PLD( strgt r5, [dst, #-4]! )
++
++20: PLD( pld [src, #-96] )
++ PLD( pld [src, #-128] )
++21: ldmdb src!, {r3, r4, ip, lr}
++ subs r2, r2, #32
++ stmdb dst!, {r3, r4, ip, lr}
++ ldmdb src!, {r3, r4, ip, lr}
++ stmgedb dst!, {r3, r4, ip, lr}
++ ldmgedb src!, {r3, r4, ip, lr}
++ stmgedb dst!, {r3, r4, ip, lr}
++ ldmgedb src!, {r3, r4, ip, lr}
++ subges r2, r2, #32
++ stmdb dst!, {r3, r4, ip, lr}
++ bge 20b
++ PLD( cmn r2, #96 )
++ PLD( bge 21b )
++ PLD( add r2, r2, #96 )
++ tst r2, #31
++ ldmfd sp!, {r5 - r8}
++ ldmeqfd sp!, {r4, pc}
++
++ tst r2, #16
++22: ldmnedb src!, {r3, r4, ip, lr}
++ stmnedb dst!, {r3, r4, ip, lr}
++
++ tst r2, #8
++23: ldmnedb src!, {r3, r4}
++ stmnedb dst!, {r3, r4}
++
++ tst r2, #4
++24: ldrne r3, [src, #-4]!
++ strne r3, [dst, #-4]!
++
++25: ands r2, r2, #3
++ ldmeqfd sp!, {dst, r4, pc}
++
++ cmp r2, #2
++ ldrb r3, [src, #-1]
++ ldrgeb r4, [src, #-2]
++ ldrgtb ip, [src, #-3]
++ strb r3, [dst, #-1]
++ strgeb r4, [dst, #-2]
++ strgtb ip, [dst, #-3]
++ ldmfd sp!, {dst, r4, pc}
++
++26: cmp ip, #2
++ ldrb r3, [src, #-1]!
++ ldrgeb r4, [src, #-1]!
++ ldrgtb lr, [src, #-1]!
++ strb r3, [dst, #-1]!
++ strgeb r4, [dst, #-1]!
++ strgtb lr, [dst, #-1]!
++ subs r2, r2, ip
++ blt 25b
++ ands ip, src, #3
++ beq 19b
++
++27: bic src, src, #3
++ cmp ip, #2
++ ldr r3, [src]
++ beq 35f
++ blt 36f
++
++
++ .macro backward_copy_shift push pull
++
++ cmp r2, #12
++ PLD( pld [src, #-4] )
++ blt 33f
++ subs r2, r2, #28
++ stmfd sp!, {r5 - r9}
++ blt 31f
++
++ PLD( subs r2, r2, #96 )
++ PLD( pld [src, #-32] )
++ PLD( blt 30f )
++ PLD( pld [src, #-64] )
++
++ PLD( @ cache alignment )
++ PLD( ands ip, src, #31 )
++ PLD( pld [src, #-96] )
++ PLD( beq 29f )
++ PLD( cmp r2, ip )
++ PLD( pld [src, #-128] )
++ PLD( blt 29f )
++ PLD( sub r2, r2, ip )
++28: PLD( mov r4, r3, push #\push )
++ PLD( ldr r3, [src, #-4]! )
++ PLD( subs ip, ip, #4 )
++ PLD( orr r4, r4, r3, pull #\pull )
++ PLD( str r4, [dst, #-4]! )
++ PLD( bgt 28b )
++
++29: PLD( pld [src, #-128] )
++30: mov lr, r3, push #\push
++ ldmdb src!, {r3 - r9, ip}
++ subs r2, r2, #32
++ orr lr, lr, ip, pull #\pull
++ mov ip, ip, push #\push
++ orr ip, ip, r9, pull #\pull
++ mov r9, r9, push #\push
++ orr r9, r9, r8, pull #\pull
++ mov r8, r8, push #\push
++ orr r8, r8, r7, pull #\pull
++ mov r7, r7, push #\push
++ orr r7, r7, r6, pull #\pull
++ mov r6, r6, push #\push
++ orr r6, r6, r5, pull #\pull
++ mov r5, r5, push #\push
++ orr r5, r5, r4, pull #\pull
++ mov r4, r4, push #\push
++ orr r4, r4, r3, pull #\pull
++ stmdb dst!, {r4 - r9, ip, lr}
++ bge 29b
++ PLD( cmn r2, #96 )
++ PLD( bge 30b )
++ PLD( add r2, r2, #96 )
++ cmn r2, #16
++ blt 32f
++31: mov r7, r3, push #\push
++ ldmdb src!, {r3 - r6}
++ sub r2, r2, #16
++ orr r7, r7, r6, pull #\pull
++ mov r6, r6, push #\push
++ orr r6, r6, r5, pull #\pull
++ mov r5, r5, push #\push
++ orr r5, r5, r4, pull #\pull
++ mov r4, r4, push #\push
++ orr r4, r4, r3, pull #\pull
++ stmdb dst!, {r4 - r7}
++32: adds r2, r2, #28
++ ldmfd sp!, {r5 - r9}
++ blt 34f
++33: mov r4, r3, push #\push
++ ldr r3, [src, #-4]!
++ subs r2, r2, #4
++ orr r4, r4, r3, pull #\pull
++ str r4, [dst, #-4]!
++ bge 33b
++34:
++ .endm
++
++
++ backward_copy_shift push=8 pull=24
++ add src, src, #3
++ b 25b
++
++35: backward_copy_shift push=16 pull=16
++ add src, src, #2
++ b 25b
++
++36: backward_copy_shift push=24 pull=8
++ add src, src, #1
++ b 25b
++
++ .size bcopy, . - bcopy
++END(bcopy)
+
+--- /dev/null 2004-02-02 20:32:13.000000000 +0000
++++ sysdeps/arm/memcpy.S 2004-05-02 14:33:22.000000000 +0100
+@@ -0,0 +1,242 @@
++/*
++ * Optimized memcpy implementation for ARM processors
++ *
++ * Author: Nicolas Pitre
++ * Created: Dec 23, 2003
++ * Copyright: (C) MontaVista Software, Inc.
++ *
++ * This file is free software; you can redistribute it and/or
++ * modify it under the terms of the GNU Lesser General Public
++ * License as published by the Free Software Foundation; either
++ * version 2.1 of the License, or (at your option) any later version.
++ *
++ * This file is distributed in the hope that it will be useful,
++ * but WITHOUT ANY WARRANTY; without even the implied warranty of
++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++ * Lesser General Public License for more details.
++ */
++
++#include <sysdep.h>
++
++
++/*
++ * Endian independent macros for shifting bytes within registers.
++ */
++#ifndef __ARMEB__
++#define pull lsr
++#define push lsl
++#else
++#define pull lsl
++#define push lsr
++#endif
++
++/*
++ * Enable data preload for architectures that support it (ARMv5 and above)
++ */
++#if defined(__ARM_ARCH_5__) || \
++ defined(__ARM_ARCH_5T__) || \
++ defined(__ARM_ARCH_5TE__)
++#define PLD(code...) code
++#else
++#define PLD(code...)
++#endif
++
++
++/* char * memcpy (char *dst, const char *src) */
++
++ENTRY(memcpy)
++ subs r2, r2, #4
++ stmfd sp!, {r0, r4, lr}
++ blt 7f
++ ands ip, r0, #3
++ PLD( pld [r1, #0] )
++ bne 8f
++ ands ip, r1, #3
++ bne 9f
++
++1: subs r2, r2, #4
++ blt 6f
++ subs r2, r2, #8
++ blt 5f
++ subs r2, r2, #16
++ blt 4f
++
++ PLD( subs r2, r2, #65 )
++ stmfd sp!, {r5 - r8}
++ PLD( blt 3f )
++ PLD( pld [r1, #32] )
++
++ PLD( @ cache alignment )
++ PLD( ands ip, r1, #31 )
++ PLD( pld [r1, #64] )
++ PLD( beq 2f )
++ PLD( rsb ip, ip, #32 )
++ PLD( cmp r2, ip )
++ PLD( pld [r1, #96] )
++ PLD( blt 2f )
++ PLD( cmp ip, #16 )
++ PLD( sub r2, r2, ip )
++ PLD( ldmgeia r1!, {r3 - r6} )
++ PLD( stmgeia r0!, {r3 - r6} )
++ PLD( beq 2f )
++ PLD( and ip, ip, #15 )
++ PLD( cmp ip, #8 )
++ PLD( ldr r3, [r1], #4 )
++ PLD( ldrge r4, [r1], #4 )
++ PLD( ldrgt r5, [r1], #4 )
++ PLD( str r3, [r0], #4 )
++ PLD( strge r4, [r0], #4 )
++ PLD( strgt r5, [r0], #4 )
++
++2: PLD( pld [r1, #96] )
++3: ldmia r1!, {r3 - r8, ip, lr}
++ subs r2, r2, #32
++ stmia r0!, {r3 - r8, ip, lr}
++ bge 2b
++ PLD( cmn r2, #65 )
++ PLD( bge 3b )
++ PLD( add r2, r2, #65 )
++ tst r2, #31
++ ldmfd sp!, {r5 - r8}
++ ldmeqfd sp!, {r0, r4, pc}
++
++ tst r2, #16
++4: ldmneia r1!, {r3, r4, ip, lr}
++ stmneia r0!, {r3, r4, ip, lr}
++
++ tst r2, #8
++5: ldmneia r1!, {r3, r4}
++ stmneia r0!, {r3, r4}
++
++ tst r2, #4
++6: ldrne r3, [r1], #4
++ strne r3, [r0], #4
++
++7: ands r2, r2, #3
++ ldmeqfd sp!, {r0, r4, pc}
++
++ cmp r2, #2
++ ldrb r3, [r1], #1
++ ldrgeb r4, [r1], #1
++ ldrgtb ip, [r1]
++ strb r3, [r0], #1
++ strgeb r4, [r0], #1
++ strgtb ip, [r0]
++ ldmfd sp!, {r0, r4, pc}
++
++8: rsb ip, ip, #4
++ cmp ip, #2
++ ldrb r3, [r1], #1
++ ldrgeb r4, [r1], #1
++ ldrgtb lr, [r1], #1
++ strb r3, [r0], #1
++ strgeb r4, [r0], #1
++ strgtb lr, [r0], #1
++ subs r2, r2, ip
++ blt 7b
++ ands ip, r1, #3
++ beq 1b
++
++9: bic r1, r1, #3
++ cmp ip, #2
++ ldr lr, [r1], #4
++ beq 17f
++ bgt 18f
++
++
++ .macro forward_copy_shift pull push
++
++ cmp r2, #12
++ PLD( pld [r1, #0] )
++ blt 15f
++ subs r2, r2, #28
++ stmfd sp!, {r5 - r9}
++ blt 13f
++
++ PLD( subs r2, r2, #97 )
++ PLD( blt 12f )
++ PLD( pld [r1, #32] )
++
++ PLD( @ cache alignment )
++ PLD( rsb ip, r1, #36 )
++ PLD( pld [r1, #64] )
++ PLD( ands ip, ip, #31 )
++ PLD( pld [r1, #96] )
++ PLD( beq 11f )
++ PLD( cmp r2, ip )
++ PLD( pld [r1, #128] )
++ PLD( blt 11f )
++ PLD( sub r2, r2, ip )
++10: PLD( mov r3, lr, pull #\pull )
++ PLD( ldr lr, [r1], #4 )
++ PLD( subs ip, ip, #4 )
++ PLD( orr r3, r3, lr, push #\push )
++ PLD( str r3, [r0], #4 )
++ PLD( bgt 10b )
++
++11: PLD( pld [r1, #128] )
++12: mov r3, lr, pull #\pull
++ ldmia r1!, {r4 - r9, ip, lr}
++ subs r2, r2, #32
++ orr r3, r3, r4, push #\push
++ mov r4, r4, pull #\pull
++ orr r4, r4, r5, push #\push
++ mov r5, r5, pull #\pull
++ orr r5, r5, r6, push #\push
++ mov r6, r6, pull #\pull
++ orr r6, r6, r7, push #\push
++ mov r7, r7, pull #\pull
++ orr r7, r7, r8, push #\push
++ mov r8, r8, pull #\pull
++ orr r8, r8, r9, push #\push
++ mov r9, r9, pull #\pull
++ orr r9, r9, ip, push #\push
++ mov ip, ip, pull #\pull
++ orr ip, ip, lr, push #\push
++ stmia r0!, {r3 - r9, ip}
++ bge 11b
++ PLD( cmn r2, #97 )
++ PLD( bge 12b )
++ PLD( add r2, r2, #97 )
++ cmn r2, #16
++ blt 14f
++13: mov r3, lr, pull #\pull
++ ldmia r1!, {r4 - r6, lr}
++ sub r2, r2, #16
++ orr r3, r3, r4, push #\push
++ mov r4, r4, pull #\pull
++ orr r4, r4, r5, push #\push
++ mov r5, r5, pull #\pull
++ orr r5, r5, r6, push #\push
++ mov r6, r6, pull #\pull
++ orr r6, r6, lr, push #\push
++ stmia r0!, {r3 - r6}
++14: adds r2, r2, #28
++ ldmfd sp!, {r5 - r9}
++ blt 16f
++15: mov r3, lr, pull #\pull
++ ldr lr, [r1], #4
++ subs r2, r2, #4
++ orr r3, r3, lr, push #\push
++ str r3, [r0], #4
++ bge 15b
++16:
++ .endm
++
++
++ forward_copy_shift pull=8 push=24
++ sub r1, r1, #3
++ b 7b
++
++17: forward_copy_shift pull=16 push=16
++ sub r1, r1, #2
++ b 7b
++
++18: forward_copy_shift pull=24 push=8
++ sub r1, r1, #1
++ b 7b
++
++ .size memcpy, . - memcpy
++END(memcpy)
++libc_hidden_builtin_def (memcpy)
++
diff --git a/recipes/glibc/glibc-2.5/dl-cache-libcmp.patch b/recipes/glibc/glibc-2.5/dl-cache-libcmp.patch
new file mode 100644
index 0000000000..2fedfa6db0
--- /dev/null
+++ b/recipes/glibc/glibc-2.5/dl-cache-libcmp.patch
@@ -0,0 +1,10 @@
+--- glibc-2.4/elf/Versions.ark 2006-03-11 23:30:09.000000000 +0100
++++ glibc-2.4/elf/Versions 2006-03-11 23:31:44.000000000 +0100
+@@ -63,5 +63,7 @@
+ _dl_debug_state;
+ # Pointer protection.
+ __pointer_chk_guard;
++ # for ldconfig
++ _dl_cache_libcmp;
+ }
+ }
diff --git a/recipes/glibc/glibc-2.4/etc/ld.so.conf b/recipes/glibc/glibc-2.5/etc/ld.so.conf
index 46e06d3f0a..46e06d3f0a 100644
--- a/recipes/glibc/glibc-2.4/etc/ld.so.conf
+++ b/recipes/glibc/glibc-2.5/etc/ld.so.conf
diff --git a/recipes/glibc/glibc-2.5/fhs-linux-paths.patch b/recipes/glibc/glibc-2.5/fhs-linux-paths.patch
new file mode 100644
index 0000000000..1f32f6d7f2
--- /dev/null
+++ b/recipes/glibc/glibc-2.5/fhs-linux-paths.patch
@@ -0,0 +1,11 @@
+--- glibc-2.1.1/sysdeps/unix/sysv/linux/paths.h~ Thu May 27 13:16:33 1999
++++ glibc-2.1.1/sysdeps/unix/sysv/linux/paths.h Thu May 27 13:17:55 1999
+@@ -71,7 +71,7 @@
+ /* Provide trailing slash, since mostly used for building pathnames. */
+ #define _PATH_DEV "/dev/"
+ #define _PATH_TMP "/tmp/"
+-#define _PATH_VARDB "/var/db/"
++#define _PATH_VARDB "/var/lib/misc/"
+ #define _PATH_VARRUN "/var/run/"
+ #define _PATH_VARTMP "/var/tmp/"
+
diff --git a/recipes/glibc/glibc-2.5/generate-supported.mk b/recipes/glibc/glibc-2.5/generate-supported.mk
new file mode 100644
index 0000000000..d2a28c2dc6
--- /dev/null
+++ b/recipes/glibc/glibc-2.5/generate-supported.mk
@@ -0,0 +1,11 @@
+#!/usr/bin/make
+
+include $(IN)
+
+all:
+ rm -f $(OUT)
+ touch $(OUT)
+ for locale in $(SUPPORTED-LOCALES); do \
+ [ $$locale = true ] && continue; \
+ echo $$locale | sed 's,/, ,' >> $(OUT); \
+ done
diff --git a/recipes/glibc/glibc-2.5/generic-bits_select.h b/recipes/glibc/glibc-2.5/generic-bits_select.h
new file mode 100644
index 0000000000..47e7dedc30
--- /dev/null
+++ b/recipes/glibc/glibc-2.5/generic-bits_select.h
@@ -0,0 +1,35 @@
+/* Copyright (C) 1997, 1998, 2001 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _SYS_SELECT_H
+# error "Never use <bits/select.h> directly; include <sys/select.h> instead."
+#endif
+
+
+/* We don't use `memset' because this would require a prototype and
+ the array isn't too big. */
+#define __FD_ZERO(s) \
+ do { \
+ unsigned int __i; \
+ fd_set *__arr = (s); \
+ for (__i = 0; __i < sizeof (fd_set) / sizeof (__fd_mask); ++__i) \
+ __FDS_BITS (__arr)[__i] = 0; \
+ } while (0)
+#define __FD_SET(d, s) (__FDS_BITS (s)[__FDELT(d)] |= __FDMASK(d))
+#define __FD_CLR(d, s) (__FDS_BITS (s)[__FDELT(d)] &= ~__FDMASK(d))
+#define __FD_ISSET(d, s) ((__FDS_BITS (s)[__FDELT(d)] & __FDMASK(d)) != 0)
diff --git a/recipes/glibc/glibc-2.5/generic-bits_time.h b/recipes/glibc/glibc-2.5/generic-bits_time.h
new file mode 100644
index 0000000000..b3184d1de9
--- /dev/null
+++ b/recipes/glibc/glibc-2.5/generic-bits_time.h
@@ -0,0 +1,75 @@
+/* System-dependent timing definitions. Generic version.
+ Copyright (C) 1996,1997,1999-2002,2003 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+/*
+ * Never include this file directly; use <time.h> instead.
+ */
+
+#ifndef __need_timeval
+# ifndef _BITS_TIME_H
+# define _BITS_TIME_H 1
+
+/* ISO/IEC 9899:1990 7.12.1: <time.h>
+ The macro `CLOCKS_PER_SEC' is the number per second of the value
+ returned by the `clock' function. */
+/* CAE XSH, Issue 4, Version 2: <time.h>
+ The value of CLOCKS_PER_SEC is required to be 1 million on all
+ XSI-conformant systems. */
+# define CLOCKS_PER_SEC 1000000l
+
+# if !defined __STRICT_ANSI__ && !defined __USE_XOPEN2K
+/* Even though CLOCKS_PER_SEC has such a strange value CLK_TCK
+ presents the real value for clock ticks per second for the system. */
+# include <bits/types.h>
+extern long int __sysconf (int);
+# define CLK_TCK ((__clock_t) __sysconf (2)) /* 2 is _SC_CLK_TCK */
+# endif
+
+# ifdef __USE_POSIX199309
+/* Identifier for system-wide realtime clock. */
+# define CLOCK_REALTIME 0
+/* Monotonic system-wide clock. */
+# define CLOCK_MONOTONIC 1
+/* High-resolution timer from the CPU. */
+# define CLOCK_PROCESS_CPUTIME_ID 2
+/* Thread-specific CPU-time clock. */
+# define CLOCK_THREAD_CPUTIME_ID 3
+
+/* Flag to indicate time is absolute. */
+# define TIMER_ABSTIME 1
+# endif
+
+# endif /* bits/time.h */
+#endif
+
+#ifdef __need_timeval
+# undef __need_timeval
+# ifndef _STRUCT_TIMEVAL
+# define _STRUCT_TIMEVAL 1
+# include <bits/types.h>
+
+/* A time value that is accurate to the nearest
+ microsecond but also has a range of years. */
+struct timeval
+ {
+ __time_t tv_sec; /* Seconds. */
+ __suseconds_t tv_usec; /* Microseconds. */
+ };
+# endif /* struct timeval */
+#endif /* need timeval */
diff --git a/recipes/glibc/glibc-2.5/generic-bits_types.h b/recipes/glibc/glibc-2.5/generic-bits_types.h
new file mode 100644
index 0000000000..65c8a9fe90
--- /dev/null
+++ b/recipes/glibc/glibc-2.5/generic-bits_types.h
@@ -0,0 +1,200 @@
+/* bits/types.h -- definitions of __*_t types underlying *_t types.
+ Copyright (C) 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+/*
+ * Never include this file directly; use <sys/types.h> instead.
+ */
+
+#ifndef _BITS_TYPES_H
+#define _BITS_TYPES_H 1
+
+#include <features.h>
+#include <bits/wordsize.h>
+
+#define __need_size_t
+#include <stddef.h>
+
+/* Convenience types. */
+typedef unsigned char __u_char;
+typedef unsigned short int __u_short;
+typedef unsigned int __u_int;
+typedef unsigned long int __u_long;
+
+/* Fixed-size types, underlying types depend on word size and compiler. */
+typedef signed char __int8_t;
+typedef unsigned char __uint8_t;
+typedef signed short int __int16_t;
+typedef unsigned short int __uint16_t;
+typedef signed int __int32_t;
+typedef unsigned int __uint32_t;
+#if __WORDSIZE == 64
+typedef signed long int __int64_t;
+typedef unsigned long int __uint64_t;
+#elif defined __GLIBC_HAVE_LONG_LONG
+__extension__ typedef signed long long int __int64_t;
+__extension__ typedef unsigned long long int __uint64_t;
+#endif
+
+/* quad_t is also 64 bits. */
+#if __WORDSIZE == 64
+typedef long int __quad_t;
+typedef unsigned long int __u_quad_t;
+#elif defined __GLIBC_HAVE_LONG_LONG
+__extension__ typedef long long int __quad_t;
+__extension__ typedef unsigned long long int __u_quad_t;
+#else
+typedef struct
+{
+ long __val[2];
+} __quad_t;
+typedef struct
+{
+ __u_long __val[2];
+} __u_quad_t;
+#endif
+
+
+/* The machine-dependent file <bits/typesizes.h> defines __*_T_TYPE
+ macros for each of the OS types we define below. The definitions
+ of those macros must use the following macros for underlying types.
+ We define __S<SIZE>_TYPE and __U<SIZE>_TYPE for the signed and unsigned
+ variants of each of the following integer types on this machine.
+
+ 16 -- "natural" 16-bit type (always short)
+ 32 -- "natural" 32-bit type (always int)
+ 64 -- "natural" 64-bit type (long or long long)
+ LONG32 -- 32-bit type, traditionally long
+ QUAD -- 64-bit type, always long long
+ WORD -- natural type of __WORDSIZE bits (int or long)
+ LONGWORD -- type of __WORDSIZE bits, traditionally long
+
+ We distinguish WORD/LONGWORD, 32/LONG32, and 64/QUAD so that the
+ conventional uses of `long' or `long long' type modifiers match the
+ types we define, even when a less-adorned type would be the same size.
+ This matters for (somewhat) portably writing printf/scanf formats for
+ these types, where using the appropriate l or ll format modifiers can
+ make the typedefs and the formats match up across all GNU platforms. If
+ we used `long' when it's 64 bits where `long long' is expected, then the
+ compiler would warn about the formats not matching the argument types,
+ and the programmer changing them to shut up the compiler would break the
+ program's portability.
+
+ Here we assume what is presently the case in all the GCC configurations
+ we support: long long is always 64 bits, long is always word/address size,
+ and int is always 32 bits. */
+
+#define __S16_TYPE short int
+#define __U16_TYPE unsigned short int
+#define __S32_TYPE int
+#define __U32_TYPE unsigned int
+#define __SLONGWORD_TYPE long int
+#define __ULONGWORD_TYPE unsigned long int
+#if __WORDSIZE == 32
+# define __SQUAD_TYPE __quad_t
+# define __UQUAD_TYPE __u_quad_t
+# define __SWORD_TYPE int
+# define __UWORD_TYPE unsigned int
+# define __SLONG32_TYPE long int
+# define __ULONG32_TYPE unsigned long int
+# define __S64_TYPE __quad_t
+# define __U64_TYPE __u_quad_t
+/* We want __extension__ before typedef's that use nonstandard base types
+ such as `long long' in C89 mode. */
+# define __STD_TYPE __extension__ typedef
+#elif __WORDSIZE == 64
+# define __SQUAD_TYPE long int
+# define __UQUAD_TYPE unsigned long int
+# define __SWORD_TYPE long int
+# define __UWORD_TYPE unsigned long int
+# define __SLONG32_TYPE int
+# define __ULONG32_TYPE unsigned int
+# define __S64_TYPE long int
+# define __U64_TYPE unsigned long int
+/* No need to mark the typedef with __extension__. */
+# define __STD_TYPE typedef
+#else
+# error
+#endif
+#include <bits/typesizes.h> /* Defines __*_T_TYPE macros. */
+
+
+__STD_TYPE __DEV_T_TYPE __dev_t; /* Type of device numbers. */
+__STD_TYPE __UID_T_TYPE __uid_t; /* Type of user identifications. */
+__STD_TYPE __GID_T_TYPE __gid_t; /* Type of group identifications. */
+__STD_TYPE __INO_T_TYPE __ino_t; /* Type of file serial numbers. */
+__STD_TYPE __INO64_T_TYPE __ino64_t; /* Type of file serial numbers (LFS).*/
+__STD_TYPE __MODE_T_TYPE __mode_t; /* Type of file attribute bitmasks. */
+__STD_TYPE __NLINK_T_TYPE __nlink_t; /* Type of file link counts. */
+__STD_TYPE __OFF_T_TYPE __off_t; /* Type of file sizes and offsets. */
+__STD_TYPE __OFF64_T_TYPE __off64_t; /* Type of file sizes and offsets (LFS). */
+__STD_TYPE __PID_T_TYPE __pid_t; /* Type of process identifications. */
+__STD_TYPE __FSID_T_TYPE __fsid_t; /* Type of file system IDs. */
+__STD_TYPE __CLOCK_T_TYPE __clock_t; /* Type of CPU usage counts. */
+__STD_TYPE __RLIM_T_TYPE __rlim_t; /* Type for resource measurement. */
+__STD_TYPE __RLIM64_T_TYPE __rlim64_t; /* Type for resource measurement (LFS). */
+__STD_TYPE __ID_T_TYPE __id_t; /* General type for IDs. */
+__STD_TYPE __TIME_T_TYPE __time_t; /* Seconds since the Epoch. */
+__STD_TYPE __USECONDS_T_TYPE __useconds_t; /* Count of microseconds. */
+__STD_TYPE __SUSECONDS_T_TYPE __suseconds_t; /* Signed count of microseconds. */
+
+__STD_TYPE __DADDR_T_TYPE __daddr_t; /* The type of a disk address. */
+__STD_TYPE __SWBLK_T_TYPE __swblk_t; /* Type of a swap block maybe? */
+__STD_TYPE __KEY_T_TYPE __key_t; /* Type of an IPC key. */
+
+/* Clock ID used in clock and timer functions. */
+__STD_TYPE __CLOCKID_T_TYPE __clockid_t;
+
+/* Timer ID returned by `timer_create'. */
+__STD_TYPE __TIMER_T_TYPE __timer_t;
+
+/* Type to represent block size. */
+__STD_TYPE __BLKSIZE_T_TYPE __blksize_t;
+
+/* Types from the Large File Support interface. */
+
+/* Type to count number of disk blocks. */
+__STD_TYPE __BLKCNT_T_TYPE __blkcnt_t;
+__STD_TYPE __BLKCNT64_T_TYPE __blkcnt64_t;
+
+/* Type to count file system blocks. */
+__STD_TYPE __FSBLKCNT_T_TYPE __fsblkcnt_t;
+__STD_TYPE __FSBLKCNT64_T_TYPE __fsblkcnt64_t;
+
+/* Type to count file system nodes. */
+__STD_TYPE __FSFILCNT_T_TYPE __fsfilcnt_t;
+__STD_TYPE __FSFILCNT64_T_TYPE __fsfilcnt64_t;
+
+__STD_TYPE __SSIZE_T_TYPE __ssize_t; /* Type of a byte count, or error. */
+
+/* These few don't really vary by system, they always correspond
+ to one of the other defined types. */
+typedef __off64_t __loff_t; /* Type of file sizes and offsets (LFS). */
+typedef __quad_t *__qaddr_t;
+typedef char *__caddr_t;
+
+/* Duplicates info from stdint.h but this is used in unistd.h. */
+__STD_TYPE __SWORD_TYPE __intptr_t;
+
+/* Duplicate info from sys/socket.h. */
+__STD_TYPE __U32_TYPE __socklen_t;
+
+
+#undef __STD_TYPE
+
+#endif /* bits/types.h */
diff --git a/recipes/glibc/glibc-2.5/generic-bits_typesizes.h b/recipes/glibc/glibc-2.5/generic-bits_typesizes.h
new file mode 100644
index 0000000000..e9226c4174
--- /dev/null
+++ b/recipes/glibc/glibc-2.5/generic-bits_typesizes.h
@@ -0,0 +1,66 @@
+/* bits/typesizes.h -- underlying types for *_t. Generic version.
+ Copyright (C) 2002, 2003 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _BITS_TYPES_H
+# error "Never include <bits/typesizes.h> directly; use <sys/types.h> instead."
+#endif
+
+#ifndef _BITS_TYPESIZES_H
+#define _BITS_TYPESIZES_H 1
+
+/* See <bits/types.h> for the meaning of these macros. This file exists so
+ that <bits/types.h> need not vary across different GNU platforms. */
+
+#define __DEV_T_TYPE __UQUAD_TYPE
+#define __UID_T_TYPE __U32_TYPE
+#define __GID_T_TYPE __U32_TYPE
+#define __INO_T_TYPE __ULONGWORD_TYPE
+#define __INO64_T_TYPE __UQUAD_TYPE
+#define __MODE_T_TYPE __U32_TYPE
+#define __NLINK_T_TYPE __UWORD_TYPE
+#define __OFF_T_TYPE __SLONGWORD_TYPE
+#define __OFF64_T_TYPE __SQUAD_TYPE
+#define __PID_T_TYPE __S32_TYPE
+#define __RLIM_T_TYPE __ULONGWORD_TYPE
+#define __RLIM64_T_TYPE __UQUAD_TYPE
+#define __BLKCNT_T_TYPE __SLONGWORD_TYPE
+#define __BLKCNT64_T_TYPE __SQUAD_TYPE
+#define __FSBLKCNT_T_TYPE __ULONGWORD_TYPE
+#define __FSBLKCNT64_T_TYPE __UQUAD_TYPE
+#define __FSFILCNT_T_TYPE __ULONGWORD_TYPE
+#define __FSFILCNT64_T_TYPE __UQUAD_TYPE
+#define __ID_T_TYPE __U32_TYPE
+#define __CLOCK_T_TYPE __SLONGWORD_TYPE
+#define __TIME_T_TYPE __SLONGWORD_TYPE
+#define __USECONDS_T_TYPE __U32_TYPE
+#define __SUSECONDS_T_TYPE __SLONGWORD_TYPE
+#define __DADDR_T_TYPE __S32_TYPE
+#define __SWBLK_T_TYPE __SLONGWORD_TYPE
+#define __KEY_T_TYPE __S32_TYPE
+#define __CLOCKID_T_TYPE __S32_TYPE
+#define __TIMER_T_TYPE void *
+#define __BLKSIZE_T_TYPE __SLONGWORD_TYPE
+#define __FSID_T_TYPE struct { int __val[2]; }
+#define __SSIZE_T_TYPE __SWORD_TYPE
+
+/* Number of descriptors that can fit in an `fd_set'. */
+#define __FD_SETSIZE 1024
+
+
+#endif /* bits/typesizes.h */
diff --git a/recipes/glibc/glibc-2.5/glibc-2.5-local-dynamic-resolvconf.patch b/recipes/glibc/glibc-2.5/glibc-2.5-local-dynamic-resolvconf.patch
new file mode 100644
index 0000000000..e137287dd1
--- /dev/null
+++ b/recipes/glibc/glibc-2.5/glibc-2.5-local-dynamic-resolvconf.patch
@@ -0,0 +1,41 @@
+# All lines beginning with `# DP:' are a description of the patch.
+# DP: Description: allow dynamic long-running processes to
+# DP: re-read a dynamically updated resolv.conf on the fly
+# DP: Dpatch author: Adam Conrad <adconrad@ubuntu.com>
+# DP: Patch author: Thorsten Kukuk <kukuk@suse.de>
+# DP: Upstream status: Ubuntu-Specific
+# DP: Date: 2006-01-13 08:14:21 UTC
+
+Index: resolv/res_libc.c
+===================================================================
+--- resolv/res_libc.c.orig
++++ resolv/res_libc.c
+@@ -22,7 +22,7 @@
+ #include <arpa/nameser.h>
+ #include <resolv.h>
+ #include <bits/libc-lock.h>
+-
++#include <sys/stat.h>
+
+ /* The following bit is copied from res_data.c (where it is #ifdef'ed
+ out) since res_init() should go into libc.so but the rest of that
+@@ -94,8 +94,17 @@
+ int
+ __res_maybe_init (res_state resp, int preinit)
+ {
+- if (resp->options & RES_INIT) {
+- if (__res_initstamp != resp->_u._ext.initstamp) {
++ static time_t last_mtime;
++ struct stat statbuf;
++ int ret;
++
++
++ if (resp->options & RES_INIT) {
++ ret = stat (_PATH_RESCONF, &statbuf);
++ if (__res_initstamp != resp->_u._ext.initstamp
++ || (ret == 0) && (last_mtime != statbuf.st_mtime))
++ {
++ last_mtime = statbuf.st_mtime;
+ if (resp->nscount > 0) {
+ __res_iclose (resp, true);
+ return __res_vinit (resp, 1);
diff --git a/recipes/glibc/glibc-2.5/glibc-2.5-soft-fp-separate-strong-alias.patch b/recipes/glibc/glibc-2.5/glibc-2.5-soft-fp-separate-strong-alias.patch
new file mode 100644
index 0000000000..e41c1b7d96
--- /dev/null
+++ b/recipes/glibc/glibc-2.5/glibc-2.5-soft-fp-separate-strong-alias.patch
@@ -0,0 +1,205 @@
+Index: glibc-2.5-tls-ppc-04/soft-fp/eqdf2.c
+===================================================================
+--- glibc-2.5-tls-ppc-04.orig/soft-fp/eqdf2.c
++++ glibc-2.5-tls-ppc-04/soft-fp/eqdf2.c
+@@ -48,4 +48,3 @@ int __eqdf2(DFtype a, DFtype b)
+ return r;
+ }
+
+-strong_alias(__eqdf2, __nedf2);
+Index: glibc-2.5-tls-ppc-04/soft-fp/gedf2.c
+===================================================================
+--- glibc-2.5-tls-ppc-04.orig/soft-fp/gedf2.c
++++ glibc-2.5-tls-ppc-04/soft-fp/gedf2.c
+@@ -47,5 +47,3 @@ int __gedf2(DFtype a, DFtype b)
+
+ return r;
+ }
+-
+-strong_alias(__gedf2, __gtdf2);
+Index: glibc-2.5-tls-ppc-04/soft-fp/gtdf2.c
+===================================================================
+--- /dev/null
++++ glibc-2.5-tls-ppc-04/soft-fp/gtdf2.c
+@@ -0,0 +1,49 @@
++/* Software floating-point emulation.
++ Return 0 iff a == b, 1 iff a > b, -2 iff a ? b, -1 iff a < b
++ Copyright (C) 1997,1999,2006 Free Software Foundation, Inc.
++ This file is part of the GNU C Library.
++ Contributed by Richard Henderson (rth@cygnus.com) and
++ Jakub Jelinek (jj@ultra.linux.cz).
++
++ The GNU C Library is free software; you can redistribute it and/or
++ modify it under the terms of the GNU Lesser General Public
++ License as published by the Free Software Foundation; either
++ version 2.1 of the License, or (at your option) any later version.
++
++ In addition to the permissions in the GNU Lesser General Public
++ License, the Free Software Foundation gives you unlimited
++ permission to link the compiled version of this file into
++ combinations with other programs, and to distribute those
++ combinations without any restriction coming from the use of this
++ file. (The Lesser General Public License restrictions do apply in
++ other respects; for example, they cover modification of the file,
++ and distribution when not linked into a combine executable.)
++
++ The GNU C Library is distributed in the hope that it will be useful,
++ but WITHOUT ANY WARRANTY; without even the implied warranty of
++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++ Lesser General Public License for more details.
++
++ You should have received a copy of the GNU Lesser General Public
++ License along with the GNU C Library; if not, write to the Free
++ Software Foundation, 51 Franklin Street, Fifth Floor, Boston,
++ MA 02110-1301, USA. */
++
++#include "soft-fp.h"
++#include "double.h"
++
++int __gtdf2(DFtype a, DFtype b)
++{
++ FP_DECL_EX;
++ FP_DECL_D(A); FP_DECL_D(B);
++ int r;
++
++ FP_UNPACK_RAW_D(A, a);
++ FP_UNPACK_RAW_D(B, b);
++ FP_CMP_D(r, A, B, -2);
++ if (r == -2 && (FP_ISSIGNAN_D(A) || FP_ISSIGNAN_D(B)))
++ FP_SET_EXCEPTION(FP_EX_INVALID);
++ FP_HANDLE_EXCEPTIONS;
++
++ return r;
++}
+Index: glibc-2.5-tls-ppc-04/soft-fp/ledf2.c
+===================================================================
+--- glibc-2.5-tls-ppc-04.orig/soft-fp/ledf2.c
++++ glibc-2.5-tls-ppc-04/soft-fp/ledf2.c
+@@ -48,4 +48,3 @@ int __ledf2(DFtype a, DFtype b)
+ return r;
+ }
+
+-strong_alias(__ledf2, __ltdf2);
+Index: glibc-2.5-tls-ppc-04/soft-fp/ltdf2.c
+===================================================================
+--- /dev/null
++++ glibc-2.5-tls-ppc-04/soft-fp/ltdf2.c
+@@ -0,0 +1,49 @@
++/* Software floating-point emulation.
++ Return 0 iff a == b, 1 iff a > b, 2 iff a ? b, -1 iff a < b
++ Copyright (C) 1997,1999,2006 Free Software Foundation, Inc.
++ This file is part of the GNU C Library.
++ Contributed by Richard Henderson (rth@cygnus.com) and
++ Jakub Jelinek (jj@ultra.linux.cz).
++
++ The GNU C Library is free software; you can redistribute it and/or
++ modify it under the terms of the GNU Lesser General Public
++ License as published by the Free Software Foundation; either
++ version 2.1 of the License, or (at your option) any later version.
++
++ In addition to the permissions in the GNU Lesser General Public
++ License, the Free Software Foundation gives you unlimited
++ permission to link the compiled version of this file into
++ combinations with other programs, and to distribute those
++ combinations without any restriction coming from the use of this
++ file. (The Lesser General Public License restrictions do apply in
++ other respects; for example, they cover modification of the file,
++ and distribution when not linked into a combine executable.)
++
++ The GNU C Library is distributed in the hope that it will be useful,
++ but WITHOUT ANY WARRANTY; without even the implied warranty of
++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++ Lesser General Public License for more details.
++
++ You should have received a copy of the GNU Lesser General Public
++ License along with the GNU C Library; if not, write to the Free
++ Software Foundation, 51 Franklin Street, Fifth Floor, Boston,
++ MA 02110-1301, USA. */
++
++#include "soft-fp.h"
++#include "double.h"
++
++int __ltdf2(DFtype a, DFtype b)
++{
++ FP_DECL_EX;
++ FP_DECL_D(A); FP_DECL_D(B);
++ int r;
++
++ FP_UNPACK_RAW_D(A, a);
++ FP_UNPACK_RAW_D(B, b);
++ FP_CMP_D(r, A, B, 2);
++ if (r == 2 && (FP_ISSIGNAN_D(A) || FP_ISSIGNAN_D(B)))
++ FP_SET_EXCEPTION(FP_EX_INVALID);
++ FP_HANDLE_EXCEPTIONS;
++
++ return r;
++}
+Index: glibc-2.5-tls-ppc-04/soft-fp/nedf2.c
+===================================================================
+--- /dev/null
++++ glibc-2.5-tls-ppc-04/soft-fp/nedf2.c
+@@ -0,0 +1,49 @@
++/* Software floating-point emulation.
++ Return 0 iff a == b, 1 otherwise
++ Copyright (C) 1997,1999,2006 Free Software Foundation, Inc.
++ This file is part of the GNU C Library.
++ Contributed by Richard Henderson (rth@cygnus.com) and
++ Jakub Jelinek (jj@ultra.linux.cz).
++
++ The GNU C Library is free software; you can redistribute it and/or
++ modify it under the terms of the GNU Lesser General Public
++ License as published by the Free Software Foundation; either
++ version 2.1 of the License, or (at your option) any later version.
++
++ In addition to the permissions in the GNU Lesser General Public
++ License, the Free Software Foundation gives you unlimited
++ permission to link the compiled version of this file into
++ combinations with other programs, and to distribute those
++ combinations without any restriction coming from the use of this
++ file. (The Lesser General Public License restrictions do apply in
++ other respects; for example, they cover modification of the file,
++ and distribution when not linked into a combine executable.)
++
++ The GNU C Library is distributed in the hope that it will be useful,
++ but WITHOUT ANY WARRANTY; without even the implied warranty of
++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++ Lesser General Public License for more details.
++
++ You should have received a copy of the GNU Lesser General Public
++ License along with the GNU C Library; if not, write to the Free
++ Software Foundation, 51 Franklin Street, Fifth Floor, Boston,
++ MA 02110-1301, USA. */
++
++#include "soft-fp.h"
++#include "double.h"
++
++int __nedf2(DFtype a, DFtype b)
++{
++ FP_DECL_EX;
++ FP_DECL_D(A); FP_DECL_D(B);
++ int r;
++
++ FP_UNPACK_RAW_D(A, a);
++ FP_UNPACK_RAW_D(B, b);
++ FP_CMP_EQ_D(r, A, B);
++ if (r && (FP_ISSIGNAN_D(A) || FP_ISSIGNAN_D(B)))
++ FP_SET_EXCEPTION(FP_EX_INVALID);
++ FP_HANDLE_EXCEPTIONS;
++
++ return r;
++}
+Index: glibc-2.5-tls-ppc-04/soft-fp/Makefile
+===================================================================
+--- glibc-2.5-tls-ppc-04.orig/soft-fp/Makefile
++++ glibc-2.5-tls-ppc-04/soft-fp/Makefile
+@@ -27,8 +27,8 @@ gcc-single-routines := negsf2 addsf3 sub
+ fixunssfdi floatdisf sqrtsf2 floatunsisf floatundisf \
+ fmasf4
+
+-gcc-double-routines := negdf2 adddf3 subdf3 muldf3 divdf3 eqdf2 \
+- ledf2 gedf2 unorddf2 fixdfsi fixunsdfsi floatsidf fixdfdi \
++gcc-double-routines := negdf2 adddf3 subdf3 muldf3 divdf3 eqdf2 nedf2 \
++ ledf2 ltdf2 gedf2 gtdf2 unorddf2 fixdfsi fixunsdfsi floatsidf fixdfdi \
+ fixunsdfdi floatdidf extendsfdf2 truncdfsf2 sqrtdf2 floatunsidf \
+ floatundidf fmadf4
+
diff --git a/recipes/glibc/glibc-2.5/glibc-2.6.1-use-short-for-fnstsw.patch b/recipes/glibc/glibc-2.5/glibc-2.6.1-use-short-for-fnstsw.patch
new file mode 100644
index 0000000000..6979229279
--- /dev/null
+++ b/recipes/glibc/glibc-2.5/glibc-2.6.1-use-short-for-fnstsw.patch
@@ -0,0 +1,30 @@
+Source: http://sourceware.org/ml/libc-alpha/2008-01/msg00017.html
+
+I am checking this x86 assembler patch:
+
+http://sourceware.org/ml/binutils/2008-01/msg00148.html
+
+to check operand size. fnstsw stores 16bit into %ax. The upper
+16bit of %eax is unchanged. The new assembler will disallow
+"fnstsw %eax". Here is a patch for glibc.
+
+
+H.J.
+
+---
+ sysdeps/i386/fpu/ftestexcept.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+Index: glibc-2.6.1/sysdeps/i386/fpu/ftestexcept.c
+===================================================================
+--- glibc-2.6.1.orig/sysdeps/i386/fpu/ftestexcept.c 2008-07-19 11:00:45.000000000 -0700
++++ glibc-2.6.1/sysdeps/i386/fpu/ftestexcept.c 2008-07-19 11:01:25.000000000 -0700
+@@ -26,7 +26,7 @@
+ int
+ fetestexcept (int excepts)
+ {
+- int temp;
++ short temp;
+ int xtemp = 0;
+
+ /* Get current exceptions. */
diff --git a/recipes/glibc/glibc-2.4/glibc-arm-no-asm-page.patch b/recipes/glibc/glibc-2.5/glibc-arm-no-asm-page.patch
index 7eb17179ba..7eb17179ba 100644
--- a/recipes/glibc/glibc-2.4/glibc-arm-no-asm-page.patch
+++ b/recipes/glibc/glibc-2.5/glibc-arm-no-asm-page.patch
diff --git a/recipes/glibc/glibc-2.5/ldd-unbash.patch b/recipes/glibc/glibc-2.5/ldd-unbash.patch
new file mode 100644
index 0000000000..2fb8854b49
--- /dev/null
+++ b/recipes/glibc/glibc-2.5/ldd-unbash.patch
@@ -0,0 +1,11 @@
+--- glibc-2.5/elf/ldd.bash.in.org 2006-04-30 16:06:20.000000000 +0000
++++ glibc-2.5/elf/ldd.bash.in 2007-03-30 19:18:57.000000000 +0000
+@@ -110,7 +110,7 @@
+ # environments where the executed program might not have permissions
+ # to write to the console/tty. But only bash 3.x supports the pipefail
+ # option, and we don't bother to handle the case for older bash versions.
+-if set -o pipefail 2> /dev/null; then
++if false; then
+ try_trace() {
+ eval $add_env '"$@"' | cat
+ }
diff --git a/recipes/glibc/glibc-2.5/ldsocache-varrun.patch b/recipes/glibc/glibc-2.5/ldsocache-varrun.patch
new file mode 100644
index 0000000000..9994d4f879
--- /dev/null
+++ b/recipes/glibc/glibc-2.5/ldsocache-varrun.patch
@@ -0,0 +1,18 @@
+This patch moves ld.so.cache from /etc to /var/run. This is for devices
+where /etc is JFFS2 or CRAMFS but /var is a ramdisk.
+
+#
+# Patch managed by http://www.mn-logistik.de/unsupported/pxa250/patcher
+#
+
+--- libc/sysdeps/generic/dl-cache.h~ldsocache-varrun
++++ libc/sysdeps/generic/dl-cache.h
+@@ -29,7 +29,7 @@
+ #endif
+
+ #ifndef LD_SO_CACHE
+-# define LD_SO_CACHE SYSCONFDIR "/ld.so.cache"
++# define LD_SO_CACHE "/var/run/ld.so.cache"
+ #endif
+
+ #ifndef add_system_dir
diff --git a/recipes/glibc/glibc-2.5/nios2-elf.patch b/recipes/glibc/glibc-2.5/nios2-elf.patch
new file mode 100644
index 0000000000..240bbeca8a
--- /dev/null
+++ b/recipes/glibc/glibc-2.5/nios2-elf.patch
@@ -0,0 +1,87 @@
+*** glibc-2.5/elf/elf.h 2010-05-31 16:05:58.000000000 +0200
+--- glibc-2.5-/elf/elf.h 2008-12-19 00:35:12.000000000 +0100
+***************
+*** 250,255 ****
+--- 250,257 ----
+ #define EM_XTENSA 94 /* Tensilica Xtensa Architecture */
+ #define EM_NUM 95
+
++ #define EM_ALTERA_NIOS2 113 /* Altera Nios II */
++
+ /* If it is necessary to assign new unofficial EM_* values, please
+ pick large random numbers (0x8523, 0xa7f2, etc.) to minimize the
+ chances of collision with official or non-GNU unofficial values. */
+***************
+*** 1511,1518 ****
+ #define R_MIPS_TLS_TPREL64 48 /* TP-relative offset, 64 bit */
+ #define R_MIPS_TLS_TPREL_HI16 49 /* TP-relative offset, high 16 bits */
+ #define R_MIPS_TLS_TPREL_LO16 50 /* TP-relative offset, low 16 bits */
+ /* Keep this the last entry. */
+! #define R_MIPS_NUM 51
+
+ /* Legal values for p_type field of Elf32_Phdr. */
+
+--- 1513,1521 ----
+ #define R_MIPS_TLS_TPREL64 48 /* TP-relative offset, 64 bit */
+ #define R_MIPS_TLS_TPREL_HI16 49 /* TP-relative offset, high 16 bits */
+ #define R_MIPS_TLS_TPREL_LO16 50 /* TP-relative offset, low 16 bits */
++ #define R_MIPS_GLOB_DAT 51
+ /* Keep this the last entry. */
+! #define R_MIPS_NUM 52
+
+ /* Legal values for p_type field of Elf32_Phdr. */
+
+***************
+*** 2602,2607 ****
+--- 2605,2655 ----
+ #define R_M32R_GOTOFF_LO 64 /* Low 16 bit offset to GOT */
+ #define R_M32R_NUM 256 /* Keep this the last entry. */
+
++ /* Legal values for d_tag (dynamic entry type). */
++ #define DT_NIOS2_GP 0x70000002 /* Address of _gp. */
++
++ /* Nios II relocs. */
++ #define R_NIOS2_NONE 0 /* No reloc. */
++ #define R_NIOS2_S16 1 /* Direct signed 16 bit. */
++ #define R_NIOS2_U16 2 /* Direct unsigned 16 bit. */
++ #define R_NIOS2_PCREL16 3 /* PC relative 16 bit. */
++ #define R_NIOS2_CALL26 4
++ #define R_NIOS2_IMM5 5
++ #define R_NIOS2_CACHE_OPX 6
++ #define R_NIOS2_IMM6 7
++ #define R_NIOS2_IMM8 8
++ #define R_NIOS2_HI16 9
++ #define R_NIOS2_LO16 10
++ #define R_NIOS2_HIADJ16 11
++ #define R_NIOS2_BFD_RELOC_32 12
++ #define R_NIOS2_BFD_RELOC_16 13
++ #define R_NIOS2_BFD_RELOC_8 14
++ #define R_NIOS2_GPREL 15
++ #define R_NIOS2_GNU_VTINHERIT 16
++ #define R_NIOS2_GNU_VTENTRY 17
++ #define R_NIOS2_UJMP 18
++ #define R_NIOS2_CJMP 19
++ #define R_NIOS2_CALLR 20
++ #define R_NIOS2_ALIGN 21
++ #define R_NIOS2_GOT16 22
++ #define R_NIOS2_CALL16 23
++ #define R_NIOS2_GOTOFF_LO 24
++ #define R_NIOS2_GOTOFF_HA 25
++ #define R_NIOS2_PCREL_LO 26
++ #define R_NIOS2_PCREL_HA 27
++ #define R_NIOS2_TLS_GD16 28
++ #define R_NIOS2_TLS_LDM16 29
++ #define R_NIOS2_TLS_LDO16 30
++ #define R_NIOS2_TLS_IE16 31
++ #define R_NIOS2_TLS_LE16 32
++ #define R_NIOS2_TLS_DTPMOD 33
++ #define R_NIOS2_TLS_DTPREL 34
++ #define R_NIOS2_TLS_TPREL 35
++ #define R_NIOS2_COPY 36
++ #define R_NIOS2_GLOB_DAT 37
++ #define R_NIOS2_JUMP_SLOT 38
++ #define R_NIOS2_RELATIVE 39
++ #define R_NIOS2_GOTOFF 40
+
+ __END_DECLS
+
diff --git a/recipes/glibc/glibc-2.5/nios2-iconv.patch b/recipes/glibc/glibc-2.5/nios2-iconv.patch
new file mode 100644
index 0000000000..7aa574816f
--- /dev/null
+++ b/recipes/glibc/glibc-2.5/nios2-iconv.patch
@@ -0,0 +1,85 @@
+*** glibc-2.5/iconv/iconvconfig.c 2006-09-21 05:57:30.000000000 +0200
+--- /home/frans/workspace/nios2/wrs-linux-4.1-176-nios2-wrs-linux-gnu/glibc-2.5/iconv/iconvconfig.c 2008-11-18 18:43:02.000000000 +0100
+***************
+*** 1011,1016 ****
+--- 1011,1045 ----
+ module name offset
+ (following last entry with step count 0)
+ */
++
++ struct hash_entry *hash_table;
++ size_t hash_size;
++
++ /* Function to insert the names. */
++ static void
++ name_insert (const void *nodep, VISIT value, int level)
++ {
++ struct name *name;
++ unsigned int idx;
++ unsigned int hval2;
++
++ if (value != leaf && value != postorder)
++ return;
++
++ name = *(struct name **) nodep;
++ idx = name->hashval % hash_size;
++ hval2 = 1 + name->hashval % (hash_size - 2);
++
++ while (hash_table[idx].string_offset != 0)
++ if ((idx += hval2) >= hash_size)
++ idx -= hash_size;
++
++ hash_table[idx].string_offset = strtaboffset (name->strent);
++
++ assert (name->module_idx != -1);
++ hash_table[idx].module_idx = name->module_idx;
++ }
++
+ static int
+ write_output (void)
+ {
+***************
+*** 1018,1025 ****
+ char *string_table;
+ size_t string_table_size;
+ struct gconvcache_header header;
+- struct hash_entry *hash_table;
+- size_t hash_size;
+ struct module_entry *module_table;
+ char *extra_table;
+ char *cur_extra_table;
+--- 1047,1052 ----
+***************
+*** 1032,1062 ****
+ char tmpfname[(output_file == NULL ? sizeof finalname : output_file_len + 1)
+ + strlen (".XXXXXX")];
+
+- /* Function to insert the names. */
+- auto void
+- name_insert (const void *nodep, VISIT value, int level)
+- {
+- struct name *name;
+- unsigned int idx;
+- unsigned int hval2;
+-
+- if (value != leaf && value != postorder)
+- return;
+-
+- name = *(struct name **) nodep;
+- idx = name->hashval % hash_size;
+- hval2 = 1 + name->hashval % (hash_size - 2);
+-
+- while (hash_table[idx].string_offset != 0)
+- if ((idx += hval2) >= hash_size)
+- idx -= hash_size;
+-
+- hash_table[idx].string_offset = strtaboffset (name->strent);
+-
+- assert (name->module_idx != -1);
+- hash_table[idx].module_idx = name->module_idx;
+- }
+-
+ /* Open the output file. */
+ if (output_file == NULL)
+ {
+--- 1059,1064 ----
diff --git a/recipes/glibc/glibc-2.5/nios2-ld-collate.patch b/recipes/glibc/glibc-2.5/nios2-ld-collate.patch
new file mode 100644
index 0000000000..abdc7d9667
--- /dev/null
+++ b/recipes/glibc/glibc-2.5/nios2-ld-collate.patch
@@ -0,0 +1,308 @@
+*** glibc-2.5/./locale/programs/ld-collate.c- 2006-09-21 05:57:30.000000000 +0200
+--- glibc-2.5/./locale/programs/ld-collate.c 2010-06-01 10:00:50.000000000 +0200
+***************
+*** 1934,1945 ****
+ return retval | ((elem->section->ruleidx & 0x7f) << 24);
+ }
+
+
+ void
+ collate_output (struct localedef_t *locale, const struct charmap_t *charmap,
+ const char *output_path)
+ {
+- struct locale_collate_t *collate = locale->categories[LC_COLLATE].collate;
+ const size_t nelems = _NL_ITEM_INDEX (_NL_NUM_LC_COLLATE);
+ struct iovec iov[2 + nelems];
+ struct locale_file data;
+--- 1934,2066 ----
+ return retval | ((elem->section->ruleidx & 0x7f) << 24);
+ }
+
++ /* If localedef is every threaded, these would need to be __thread var. */
++ struct obstack weightpool;
++ struct obstack extrapool;
++ struct obstack indirectpool;
++ struct collidx_table tablewc;
++ struct locale_collate_t *collate;
++
++ static void
++ add_to_tablewc (uint32_t ch, struct element_t *runp)
++ {
++ if (runp->wcnext == NULL && runp->nwcs == 1)
++ {
++ int32_t weigthidx = output_weightwc (&weightpool, collate, runp);
++ collidx_table_add (&tablewc, ch, weigthidx);
++ }
++ else
++ {
++ /* As for the singlebyte table, we recognize sequences and
++ compress them. */
++ struct element_t *lastp;
++
++ collidx_table_add (&tablewc, ch,
++ -(obstack_object_size (&extrapool) / sizeof (uint32_t)));
++
++ do
++ {
++ /* Store the current index in the weight table. We know that
++ the current position in the `extrapool' is aligned on a
++ 32-bit address. */
++ int32_t weightidx;
++ int added;
++
++ /* Find out wether this is a single entry or we have more than
++ one consecutive entry. */
++ if (runp->wcnext != NULL
++ && runp->nwcs == runp->wcnext->nwcs
++ && wmemcmp ((wchar_t *) runp->wcs,
++ (wchar_t *)runp->wcnext->wcs,
++ runp->nwcs - 1) == 0
++ && (runp->wcs[runp->nwcs - 1]
++ == runp->wcnext->wcs[runp->nwcs - 1] + 1))
++ {
++ int i;
++ struct element_t *series_startp = runp;
++ struct element_t *curp;
++
++ /* Now add first the initial byte sequence. */
++ added = (1 + 1 + 2 * (runp->nwcs - 1)) * sizeof (int32_t);
++ if (sizeof (int32_t) == sizeof (int))
++ obstack_make_room (&extrapool, added);
++
++ /* More than one consecutive entry. We mark this by having
++ a negative index into the indirect table. */
++ obstack_int32_grow_fast (&extrapool,
++ -(obstack_object_size (&indirectpool)
++ / sizeof (int32_t)));
++ obstack_int32_grow_fast (&extrapool, runp->nwcs - 1);
++
++ do
++ runp = runp->wcnext;
++ while (runp->wcnext != NULL
++ && runp->nwcs == runp->wcnext->nwcs
++ && wmemcmp ((wchar_t *) runp->wcs,
++ (wchar_t *)runp->wcnext->wcs,
++ runp->nwcs - 1) == 0
++ && (runp->wcs[runp->nwcs - 1]
++ == runp->wcnext->wcs[runp->nwcs - 1] + 1));
++
++ /* Now walk backward from here to the beginning. */
++ curp = runp;
++
++ for (i = 1; i < runp->nwcs; ++i)
++ obstack_int32_grow_fast (&extrapool, curp->wcs[i]);
++
++ /* Now find the end of the consecutive sequence and
++ add all the indeces in the indirect pool. */
++ do
++ {
++ weightidx = output_weightwc (&weightpool, collate,
++ curp);
++ obstack_int32_grow (&indirectpool, weightidx);
++
++ curp = curp->wclast;
++ }
++ while (curp != series_startp);
++
++ /* Add the final weight. */
++ weightidx = output_weightwc (&weightpool, collate, curp);
++ obstack_int32_grow (&indirectpool, weightidx);
++
++ /* And add the end byte sequence. Without length this
++ time. */
++ for (i = 1; i < curp->nwcs; ++i)
++ obstack_int32_grow (&extrapool, curp->wcs[i]);
++ }
++ else
++ {
++ /* A single entry. Simply add the index and the length and
++ string (except for the first character which is already
++ tested for). */
++ int i;
++
++ /* Output the weight info. */
++ weightidx = output_weightwc (&weightpool, collate, runp);
++
++ added = (1 + 1 + runp->nwcs - 1) * sizeof (int32_t);
++ if (sizeof (int) == sizeof (int32_t))
++ obstack_make_room (&extrapool, added);
++
++ obstack_int32_grow_fast (&extrapool, weightidx);
++ obstack_int32_grow_fast (&extrapool, runp->nwcs - 1);
++ for (i = 1; i < runp->nwcs; ++i)
++ obstack_int32_grow_fast (&extrapool, runp->wcs[i]);
++ }
++
++ /* Next entry. */
++ lastp = runp;
++ runp = runp->wcnext;
++ }
++ while (runp != NULL);
++ }
++ }
+
+ void
+ collate_output (struct localedef_t *locale, const struct charmap_t *charmap,
+ const char *output_path)
+ {
+ const size_t nelems = _NL_ITEM_INDEX (_NL_NUM_LC_COLLATE);
+ struct iovec iov[2 + nelems];
+ struct locale_file data;
+***************
+*** 1947,1962 ****
+ size_t cnt;
+ size_t ch;
+ int32_t tablemb[256];
+- struct obstack weightpool;
+- struct obstack extrapool;
+- struct obstack indirectpool;
+ struct section_list *sect;
+- struct collidx_table tablewc;
+ uint32_t elem_size;
+ uint32_t *elem_table;
+ int i;
+ struct element_t *runp;
+
+ data.magic = LIMAGIC (LC_COLLATE);
+ data.n = nelems;
+ iov[0].iov_base = (void *) &data;
+--- 2068,2080 ----
+ size_t cnt;
+ size_t ch;
+ int32_t tablemb[256];
+ struct section_list *sect;
+ uint32_t elem_size;
+ uint32_t *elem_table;
+ int i;
+ struct element_t *runp;
+
++ collate = locale->categories[LC_COLLATE].collate;
+ data.magic = LIMAGIC (LC_COLLATE);
+ data.n = nelems;
+ iov[0].iov_base = (void *) &data;
+***************
+*** 2292,2414 ****
+ the table. In case we have more than one sequence starting with
+ the same byte we have to use extra indirection. */
+ {
+- auto void add_to_tablewc (uint32_t ch, struct element_t *runp);
+-
+- void add_to_tablewc (uint32_t ch, struct element_t *runp)
+- {
+- if (runp->wcnext == NULL && runp->nwcs == 1)
+- {
+- int32_t weigthidx = output_weightwc (&weightpool, collate, runp);
+- collidx_table_add (&tablewc, ch, weigthidx);
+- }
+- else
+- {
+- /* As for the singlebyte table, we recognize sequences and
+- compress them. */
+- struct element_t *lastp;
+-
+- collidx_table_add (&tablewc, ch,
+- -(obstack_object_size (&extrapool) / sizeof (uint32_t)));
+-
+- do
+- {
+- /* Store the current index in the weight table. We know that
+- the current position in the `extrapool' is aligned on a
+- 32-bit address. */
+- int32_t weightidx;
+- int added;
+-
+- /* Find out wether this is a single entry or we have more than
+- one consecutive entry. */
+- if (runp->wcnext != NULL
+- && runp->nwcs == runp->wcnext->nwcs
+- && wmemcmp ((wchar_t *) runp->wcs,
+- (wchar_t *)runp->wcnext->wcs,
+- runp->nwcs - 1) == 0
+- && (runp->wcs[runp->nwcs - 1]
+- == runp->wcnext->wcs[runp->nwcs - 1] + 1))
+- {
+- int i;
+- struct element_t *series_startp = runp;
+- struct element_t *curp;
+-
+- /* Now add first the initial byte sequence. */
+- added = (1 + 1 + 2 * (runp->nwcs - 1)) * sizeof (int32_t);
+- if (sizeof (int32_t) == sizeof (int))
+- obstack_make_room (&extrapool, added);
+-
+- /* More than one consecutive entry. We mark this by having
+- a negative index into the indirect table. */
+- obstack_int32_grow_fast (&extrapool,
+- -(obstack_object_size (&indirectpool)
+- / sizeof (int32_t)));
+- obstack_int32_grow_fast (&extrapool, runp->nwcs - 1);
+-
+- do
+- runp = runp->wcnext;
+- while (runp->wcnext != NULL
+- && runp->nwcs == runp->wcnext->nwcs
+- && wmemcmp ((wchar_t *) runp->wcs,
+- (wchar_t *)runp->wcnext->wcs,
+- runp->nwcs - 1) == 0
+- && (runp->wcs[runp->nwcs - 1]
+- == runp->wcnext->wcs[runp->nwcs - 1] + 1));
+-
+- /* Now walk backward from here to the beginning. */
+- curp = runp;
+-
+- for (i = 1; i < runp->nwcs; ++i)
+- obstack_int32_grow_fast (&extrapool, curp->wcs[i]);
+-
+- /* Now find the end of the consecutive sequence and
+- add all the indeces in the indirect pool. */
+- do
+- {
+- weightidx = output_weightwc (&weightpool, collate,
+- curp);
+- obstack_int32_grow (&indirectpool, weightidx);
+-
+- curp = curp->wclast;
+- }
+- while (curp != series_startp);
+-
+- /* Add the final weight. */
+- weightidx = output_weightwc (&weightpool, collate, curp);
+- obstack_int32_grow (&indirectpool, weightidx);
+-
+- /* And add the end byte sequence. Without length this
+- time. */
+- for (i = 1; i < curp->nwcs; ++i)
+- obstack_int32_grow (&extrapool, curp->wcs[i]);
+- }
+- else
+- {
+- /* A single entry. Simply add the index and the length and
+- string (except for the first character which is already
+- tested for). */
+- int i;
+-
+- /* Output the weight info. */
+- weightidx = output_weightwc (&weightpool, collate, runp);
+-
+- added = (1 + 1 + runp->nwcs - 1) * sizeof (int32_t);
+- if (sizeof (int) == sizeof (int32_t))
+- obstack_make_room (&extrapool, added);
+-
+- obstack_int32_grow_fast (&extrapool, weightidx);
+- obstack_int32_grow_fast (&extrapool, runp->nwcs - 1);
+- for (i = 1; i < runp->nwcs; ++i)
+- obstack_int32_grow_fast (&extrapool, runp->wcs[i]);
+- }
+-
+- /* Next entry. */
+- lastp = runp;
+- runp = runp->wcnext;
+- }
+- while (runp != NULL);
+- }
+- }
+-
+ tablewc.p = 6;
+ tablewc.q = 10;
+ collidx_table_init (&tablewc);
+--- 2410,2415 ----
diff --git a/recipes/glibc/glibc-2.5/no-z-defs.patch b/recipes/glibc/glibc-2.5/no-z-defs.patch
new file mode 100644
index 0000000000..48c6a41267
--- /dev/null
+++ b/recipes/glibc/glibc-2.5/no-z-defs.patch
@@ -0,0 +1,9 @@
+Create a configparms file which disabled no-z-defs.
+This is required to build a working glibs for sh4,
+without there will be a lot linker errors during the build.
+
+diff -duNr libc.orig/configparms libc/configparms
+--- libc.orig/configparms 1970-01-01 10:00:00.000000000 +1000
++++ libc/configparms 2006-02-23 14:08:18.000000000 +1100
+@@ -0,0 +1 @@
++no-z-defs=yes
diff --git a/recipes/glibc/glibc-2.5/nptl-crosscompile.patch b/recipes/glibc/glibc-2.5/nptl-crosscompile.patch
new file mode 100644
index 0000000000..18a46ad4f1
--- /dev/null
+++ b/recipes/glibc/glibc-2.5/nptl-crosscompile.patch
@@ -0,0 +1,26 @@
+--- glibc-2.4/nptl/sysdeps/pthread/configure.in.ark 2006-03-12 00:41:40.000000000 +0100
++++ glibc-2.4/nptl/sysdeps/pthread/configure.in 2006-03-12 00:44:08.000000000 +0100
+@@ -45,5 +45,6 @@
+ AC_MSG_ERROR([the compiler must support C cleanup handling])
+ fi
+ else
+- AC_MSG_ERROR(forced unwind support is required)
++ AC_MSG_WARN([forced unwind support is required, can't be verified while crosscompiling])
++ AC_DEFINE(HAVE_FORCED_UNWIND)
+ fi
+--- glibc-2.4/nptl/sysdeps/pthread/configure.ark 2006-03-12 00:42:47.000000000 +0100
++++ glibc-2.4/nptl/sysdeps/pthread/configure 2006-03-12 00:44:08.000000000 +0100
+@@ -153,7 +153,10 @@
+ { (exit 1); exit 1; }; }
+ fi
+ else
+- { { echo "$as_me:$LINENO: error: forced unwind support is required" >&5
+-echo "$as_me: error: forced unwind support is required" >&2;}
+- { (exit 1); exit 1; }; }
++ { echo "$as_me:$LINENO: WARNING: forced unwind support is required, can't be verified while crosscompiling" >&5
++echo "$as_me: WARNING: forced unwind support is required, can't be verified while crosscompiling" >&2;}
++ cat >>confdefs.h <<\_ACEOF
++#define HAVE_FORCED_UNWIND 1
++_ACEOF
++
+ fi
diff --git a/recipes/glibc/glibc-2.5/powerpc-sqrt-hack.diff b/recipes/glibc/glibc-2.5/powerpc-sqrt-hack.diff
new file mode 100644
index 0000000000..1046efb2a1
--- /dev/null
+++ b/recipes/glibc/glibc-2.5/powerpc-sqrt-hack.diff
@@ -0,0 +1,25 @@
+diff -Nurd ../glibc-initial-2.5-r4/glibc-2.5/sysdeps/powerpc/fpu/e_sqrt.c glibc-2.5/sysdeps/powerpc/fpu/e_sqrt.c
+--- ../glibc-initial-2.5-r4/glibc-2.5/sysdeps/powerpc/fpu/e_sqrt.c 2006-04-14 07:44:30.000000000 +0200
++++ glibc-2.5/sysdeps/powerpc/fpu/e_sqrt.c 2006-12-08 12:53:32.202227000 +0100
+@@ -25,6 +25,9 @@
+ #include <sysdep.h>
+ #include <ldsodefs.h>
+
++#define __CPU_HAS_FSQRT ((GLRO(dl_hwcap) & PPC_FEATURE_64) != 0)
++
++
+ static const double almost_half = 0.5000000000000001; /* 0.5 + 2^-53 */
+ static const ieee_float_shape_type a_nan = {.word = 0x7fc00000 };
+ static const ieee_float_shape_type a_inf = {.word = 0x7f800000 };
+diff -Nurd ../glibc-initial-2.5-r4/glibc-2.5/sysdeps/powerpc/fpu/e_sqrtf.c glibc-2.5/sysdeps/powerpc/fpu/e_sqrtf.c
+--- ../glibc-initial-2.5-r4/glibc-2.5/sysdeps/powerpc/fpu/e_sqrtf.c 2006-04-14 07:44:30.000000000 +0200
++++ glibc-2.5/sysdeps/powerpc/fpu/e_sqrtf.c 2006-12-08 12:53:36.992227000 +0100
+@@ -25,6 +25,8 @@
+ #include <sysdep.h>
+ #include <ldsodefs.h>
+
++#define __CPU_HAS_FSQRT ((GLRO(dl_hwcap) & PPC_FEATURE_64) != 0)
++
+ static const float almost_half = 0.50000006; /* 0.5 + 2^-24 */
+ static const ieee_float_shape_type a_nan = {.word = 0x7fc00000 };
+ static const ieee_float_shape_type a_inf = {.word = 0x7f800000 };
diff --git a/recipes/glibc/glibc-2.5/ppc-ld-nofpu-20070104.patch b/recipes/glibc/glibc-2.5/ppc-ld-nofpu-20070104.patch
new file mode 100644
index 0000000000..d5b1d31774
--- /dev/null
+++ b/recipes/glibc/glibc-2.5/ppc-ld-nofpu-20070104.patch
@@ -0,0 +1,190 @@
+2007-01-12 Steven Munroe <sjmunroe@us.ibm.com>
+ Joe Kerian <jkerian@us.us.ibm.com>
+
+ [BZ #2749]
+ * sysdeps/ieee754/ldbl-128ibm/s_copysignl.c:
+ Include <math_ldbl_opt.h>.
+ Remove weak_alias. Use long_double_symbol macro.
+ (__copysignl): Use signbit() for comparison.
+ * sysdeps/ieee754/ldbl-128ibm/s_fabsl.c: Correct parms for
+ SET_LDOUBLE_WORDS64.
+
+ [BZ #2423, #2749]
+ * sysdeps/ieee754/ldbl-128ibm/s_ceill.c: Don't include <fenv_libc.h>.
+ (__ceill): Remove calls to fegetround(), fesetround().
+ * sysdeps/ieee754/ldbl-128ibm/s_floorl.c: Likewise.
+ * sysdeps/ieee754/ldbl-128ibm/s_roundl.c: Likewise.
+ * sysdeps/ieee754/ldbl-128ibm/s_truncl.c: Likewise.
+
+diff -urN libc25-cvstip-20070104/sysdeps/ieee754/ldbl-128ibm/s_ceill.c libc24/sysdeps/ieee754/ldbl-128ibm/s_ceill.c
+--- libc25-cvstip-20070104/sysdeps/ieee754/ldbl-128ibm/s_ceill.c 2006-03-16 05:46:37.000000000 -0600
++++ libc24/sysdeps/ieee754/ldbl-128ibm/s_ceill.c 2007-01-11 10:30:12.856890432 -0600
+@@ -19,7 +19,6 @@
+ 02111-1307 USA. */
+
+ #include <math.h>
+-#include <fenv_libc.h>
+ #include <math_ldbl_opt.h>
+ #include <float.h>
+ #include <ieee754.h>
+@@ -44,11 +43,9 @@
+ __builtin_inf ()), 1))
+ {
+ double orig_xh;
+- int save_round = fegetround ();
+
+ /* Long double arithmetic, including the canonicalisation below,
+ only works in round-to-nearest mode. */
+- fesetround (FE_TONEAREST);
+
+ /* Convert the high double to integer. */
+ orig_xh = xh;
+@@ -81,8 +78,6 @@
+ /* Ensure we return -0 rather than +0 when appropriate. */
+ if (orig_xh < 0.0)
+ xh = -__builtin_fabs (xh);
+-
+- fesetround (save_round);
+ }
+
+ return ldbl_pack (xh, xl);
+diff -urN libc25-cvstip-20070104/sysdeps/ieee754/ldbl-128ibm/s_copysignl.c libc24/sysdeps/ieee754/ldbl-128ibm/s_copysignl.c
+--- libc25-cvstip-20070104/sysdeps/ieee754/ldbl-128ibm/s_copysignl.c 2006-01-27 18:07:25.000000000 -0600
++++ libc24/sysdeps/ieee754/ldbl-128ibm/s_copysignl.c 2007-01-11 10:30:12.857890280 -0600
+@@ -25,6 +25,7 @@
+
+ #include "math.h"
+ #include "math_private.h"
++#include <math_ldbl_opt.h>
+
+ #ifdef __STDC__
+ long double __copysignl(long double x, long double y)
+@@ -33,13 +34,13 @@
+ long double x,y;
+ #endif
+ {
+- if (y < 0.0)
+- {
+- if (x >= 0.0)
+- x = -x;
+- }
+- else if (x < 0.0)
++ if( signbit(x) != signbit(y) )
+ x = -x;
+ return x;
+ }
+-weak_alias (__copysignl, copysignl)
++
++#ifdef IS_IN_libm
++long_double_symbol (libm, __copysignl, copysignl);
++#else
++long_double_symbol (libc, __copysignl, copysignl);
++#endif
+diff -urN libc25-cvstip-20070104/sysdeps/ieee754/ldbl-128ibm/s_fabsl.c libc24/sysdeps/ieee754/ldbl-128ibm/s_fabsl.c
+--- libc25-cvstip-20070104/sysdeps/ieee754/ldbl-128ibm/s_fabsl.c 2006-01-27 18:07:25.000000000 -0600
++++ libc24/sysdeps/ieee754/ldbl-128ibm/s_fabsl.c 2007-01-11 10:30:12.857890280 -0600
+@@ -37,7 +37,7 @@
+ GET_LDOUBLE_WORDS64(hx,lx,x);
+ lx = lx ^ ( hx & 0x8000000000000000LL );
+ hx = hx & 0x7fffffffffffffffLL;
+- SET_LDOUBLE_WORDS64(hx,lx,x);
++ SET_LDOUBLE_WORDS64(x,hx,lx);
+ return x;
+ }
+ long_double_symbol (libm, __fabsl, fabsl);
+diff -urN libc25-cvstip-20070104/sysdeps/ieee754/ldbl-128ibm/s_floorl.c libc24/sysdeps/ieee754/ldbl-128ibm/s_floorl.c
+--- libc25-cvstip-20070104/sysdeps/ieee754/ldbl-128ibm/s_floorl.c 2006-03-16 05:46:37.000000000 -0600
++++ libc24/sysdeps/ieee754/ldbl-128ibm/s_floorl.c 2007-01-11 10:30:12.858890128 -0600
+@@ -19,7 +19,6 @@
+ 02111-1307 USA. */
+
+ #include <math.h>
+-#include <fenv_libc.h>
+ #include <math_ldbl_opt.h>
+ #include <float.h>
+ #include <ieee754.h>
+@@ -43,11 +42,8 @@
+ && __builtin_isless (__builtin_fabs (xh),
+ __builtin_inf ()), 1))
+ {
+- int save_round = fegetround ();
+-
+ /* Long double arithmetic, including the canonicalisation below,
+ only works in round-to-nearest mode. */
+- fesetround (FE_TONEAREST);
+
+ /* Convert the high double to integer. */
+ hi = ldbl_nearbyint (xh);
+@@ -75,8 +71,6 @@
+ xh = hi;
+ xl = lo;
+ ldbl_canonicalize (&xh, &xl);
+-
+- fesetround (save_round);
+ }
+
+ return ldbl_pack (xh, xl);
+diff -urN libc25-cvstip-20070104/sysdeps/ieee754/ldbl-128ibm/s_roundl.c libc24/sysdeps/ieee754/ldbl-128ibm/s_roundl.c
+--- libc25-cvstip-20070104/sysdeps/ieee754/ldbl-128ibm/s_roundl.c 2006-03-16 05:46:37.000000000 -0600
++++ libc24/sysdeps/ieee754/ldbl-128ibm/s_roundl.c 2007-01-11 10:30:12.859889976 -0600
+@@ -22,7 +22,6 @@
+ when it's coded in C. */
+
+ #include <math.h>
+-#include <fenv_libc.h>
+ #include <math_ldbl_opt.h>
+ #include <float.h>
+ #include <ieee754.h>
+@@ -47,11 +46,9 @@
+ __builtin_inf ()), 1))
+ {
+ double orig_xh;
+- int save_round = fegetround ();
+
+ /* Long double arithmetic, including the canonicalisation below,
+ only works in round-to-nearest mode. */
+- fesetround (FE_TONEAREST);
+
+ /* Convert the high double to integer. */
+ orig_xh = xh;
+@@ -88,8 +85,6 @@
+ xh = hi;
+ xl = lo;
+ ldbl_canonicalize (&xh, &xl);
+-
+- fesetround (save_round);
+ }
+
+ return ldbl_pack (xh, xl);
+diff -urN libc25-cvstip-20070104/sysdeps/ieee754/ldbl-128ibm/s_truncl.c libc24/sysdeps/ieee754/ldbl-128ibm/s_truncl.c
+--- libc25-cvstip-20070104/sysdeps/ieee754/ldbl-128ibm/s_truncl.c 2006-03-16 05:46:37.000000000 -0600
++++ libc24/sysdeps/ieee754/ldbl-128ibm/s_truncl.c 2007-01-11 10:30:12.860889824 -0600
+@@ -22,7 +22,6 @@
+ when it's coded in C. */
+
+ #include <math.h>
+-#include <fenv_libc.h>
+ #include <math_ldbl_opt.h>
+ #include <float.h>
+ #include <ieee754.h>
+@@ -47,11 +46,9 @@
+ __builtin_inf ()), 1))
+ {
+ double orig_xh;
+- int save_round = fegetround ();
+
+ /* Long double arithmetic, including the canonicalisation below,
+ only works in round-to-nearest mode. */
+- fesetround (FE_TONEAREST);
+
+ /* Convert the high double to integer. */
+ orig_xh = xh;
+@@ -92,8 +89,6 @@
+ /* Ensure we return -0 rather than +0 when appropriate. */
+ if (orig_xh < 0.0)
+ xh = -__builtin_fabs (xh);
+-
+- fesetround (save_round);
+ }
+
+ return ldbl_pack (xh, xl);
diff --git a/recipes/glibc/glibc-2.5/ppc-ports-ld-nofpu-20070114.patch b/recipes/glibc/glibc-2.5/ppc-ports-ld-nofpu-20070114.patch
new file mode 100644
index 0000000000..b4d99592f6
--- /dev/null
+++ b/recipes/glibc/glibc-2.5/ppc-ports-ld-nofpu-20070114.patch
@@ -0,0 +1,38 @@
+2007-01-14 Steven Munroe <sjmunroe@us.ibm.com>
+
+ [BZ #2749]
+ * sysdeps/powerpc/nofpu/fenv_libc.h: New file.
+
+diff -urN dummy-libc/ports-cvstip-20070104/sysdeps/powerpc/nofpu/fenv_libc.h libc25/ports/sysdeps/powerpc/nofpu/fenv_libc.h
+--- dummy-libc/ports-cvstip-20070104/sysdeps/powerpc/nofpu/fenv_libc.h Wed Dec 31 18:00:00 1969
++++ libc25/ports/sysdeps/powerpc/nofpu/fenv_libc.h Thu Jan 11 11:00:53 2007
+@@ -0,0 +1,29 @@
++/* Internal libc stuff for floating point environment routines.
++ Copyright (C) 2007 Free Software Foundation, Inc.
++ This file is part of the GNU C Library.
++
++ The GNU C Library is free software; you can redistribute it and/or
++ modify it under the terms of the GNU Lesser General Public
++ License as published by the Free Software Foundation; either
++ version 2.1 of the License, or (at your option) any later version.
++
++ The GNU C Library is distributed in the hope that it will be useful,
++ but WITHOUT ANY WARRANTY; without even the implied warranty of
++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++ Lesser General Public License for more details.
++
++ You should have received a copy of the GNU Lesser General Public
++ License along with the GNU C Library; if not, write to the Free
++ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
++ 02111-1307 USA. */
++
++#ifndef _FENV_LIBC_H
++#define _FENV_LIBC_H 1
++
++/* fenv_libc.h is used in libm implementations of ldbl-128ibm. So we
++ need this version in the soft-fp to at minimum include fenv.h to
++ get the fegetround definition. */
++
++#include <fenv.h>
++
++#endif /* fenv_libc.h */
diff --git a/recipes/glibc/glibc-2.5/ppc-sfp-machine.patch b/recipes/glibc/glibc-2.5/ppc-sfp-machine.patch
new file mode 100644
index 0000000000..6171a03411
--- /dev/null
+++ b/recipes/glibc/glibc-2.5/ppc-sfp-machine.patch
@@ -0,0 +1,297 @@
+This patch combined with the other patches from Bugzilla #2749 allows
+powerpc32 to build. The Subdirs pulls in the soft-fp directory from
+libc, The Implies pulls in the ports powerpc/soft-fp directory which
+includes sfp-machine.h
+
+The get/set/swapcontext changes overide the common implimentation in
+libc to avoid using hardware FP instructions.
+
+
+
+2006-06-01 Steven Munroe <sjmunroe@us.ibm.com>
+
+ [BZ #2749]
+ * sysdeps/powerpc/soft-fp/Subdirs: New file.
+ * sysdeps/powerpc/soft-fp/sfp-machine.h: New file.
+ * sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/Implies: New file.
+
+ * sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/getcontext.S:
+ New file.
+ * sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/setcontext.S:
+ New file.
+ * sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/swapcontext.S:
+ New file.
+
+diff -urN dummy-libc/ports-cvstip-20060512/sysdeps/powerpc/soft-fp/Subdirs
+libc24/ports/sysdeps/powerpc/soft-fp/Subdirs
+--- dummy-libc/ports-cvstip-20060512/sysdeps/powerpc/soft-fp/Subdirs Wed Dec 31 18:00:00 1969
++++ libc24/ports/sysdeps/powerpc/soft-fp/Subdirs Wed May 31 16:58:44 2006
+@@ -0,0 +1,1 @@
++soft-fp
+diff -urN dummy-libc/ports-cvstip-20060512/sysdeps/powerpc/soft-fp/sfp-machine.h
+libc24/ports/sysdeps/powerpc/soft-fp/sfp-machine.h
+--- dummy-libc/ports-cvstip-20060512/sysdeps/powerpc/soft-fp/sfp-machine.h Wed Dec 31 18:00:00 1969
++++ libc24/ports/sysdeps/powerpc/soft-fp/sfp-machine.h Wed May 31 13:57:07 2006
+@@ -0,0 +1,63 @@
++#define _FP_W_TYPE_SIZE 32
++#define _FP_W_TYPE unsigned long
++#define _FP_WS_TYPE signed long
++#define _FP_I_TYPE long
++
++#define _FP_MUL_MEAT_S(R,X,Y) \
++ _FP_MUL_MEAT_1_wide(_FP_WFRACBITS_S,R,X,Y,umul_ppmm)
++#define _FP_MUL_MEAT_D(R,X,Y) \
++ _FP_MUL_MEAT_2_wide(_FP_WFRACBITS_D,R,X,Y,umul_ppmm)
++#define _FP_MUL_MEAT_Q(R,X,Y) \
++ _FP_MUL_MEAT_4_wide(_FP_WFRACBITS_Q,R,X,Y,umul_ppmm)
++
++#define _FP_DIV_MEAT_S(R,X,Y) _FP_DIV_MEAT_1_loop(S,R,X,Y)
++#define _FP_DIV_MEAT_D(R,X,Y) _FP_DIV_MEAT_2_udiv(D,R,X,Y)
++#define _FP_DIV_MEAT_Q(R,X,Y) _FP_DIV_MEAT_4_udiv(Q,R,X,Y)
++
++#define _FP_NANFRAC_S ((_FP_QNANBIT_S << 1) - 1)
++#define _FP_NANFRAC_D ((_FP_QNANBIT_D << 1) - 1), -1
++#define _FP_NANFRAC_Q ((_FP_QNANBIT_Q << 1) - 1), -1, -1, -1
++#define _FP_NANSIGN_S 0
++#define _FP_NANSIGN_D 0
++#define _FP_NANSIGN_Q 0
++
++#define _FP_KEEPNANFRACP 1
++
++/* Someone please check this. */
++#define _FP_CHOOSENAN(fs, wc, R, X, Y, OP) \
++ do { \
++ if ((_FP_FRAC_HIGH_RAW_##fs(X) & _FP_QNANBIT_##fs) \
++ && !(_FP_FRAC_HIGH_RAW_##fs(Y) & _FP_QNANBIT_##fs)) \
++ { \
++ R##_s = Y##_s; \
++ _FP_FRAC_COPY_##wc(R,Y); \
++ } \
++ else \
++ { \
++ R##_s = X##_s; \
++ _FP_FRAC_COPY_##wc(R,X); \
++ } \
++ R##_c = FP_CLS_NAN; \
++ } while (0)
++
++/* Exception flags. We use the bit positions of the appropriate bits
++ in the FPSCR, which also correspond to the FE_* bits. This makes
++ everything easier ;-). */
++#define FP_EX_INVALID (1 << (31 - 2))
++#define FP_EX_OVERFLOW (1 << (31 - 3))
++#define FP_EX_UNDERFLOW (1 << (31 - 4))
++#define FP_EX_DENORM FP_EX_UNDERFLOW
++#define FP_EX_DIVZERO (1 << (31 - 5))
++#define FP_EX_INEXACT (1 << (31 - 6))
++
++#define FP_HANDLE_EXCEPTIONS __simulate_exceptions (_fex)
++#define FP_ROUNDMODE __sim_round_mode
++
++extern int __sim_exceptions;
++libc_hidden_proto (__sim_exceptions);
++extern int __sim_disabled_exceptions;
++libc_hidden_proto (__sim_disabled_exceptions);
++extern int __sim_round_mode;
++libc_hidden_proto (__sim_round_mode);
++
++extern void __simulate_exceptions (int x) attribute_hidden;
+diff -urN dummy-libc/ports-cvstip-20060512/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/Implies
+libc24/ports/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/Implies
+--- dummy-libc/ports-cvstip-20060512/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/Implies Wed Dec 31 18:00:00 1969
++++ libc24/ports/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/Implies Wed May 31 15:46:44 2006
+@@ -0,0 +1,1 @@
++powerpc/soft-fp
+diff -urN dummy-libc/ports-cvstip-20060512/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/getcontext.S
+libc24/ports/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/getcontext.S
+--- dummy-libc/ports-cvstip-20060512/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/getcontext.S Wed Dec 31 18:00:00 1969
++++ libc24/ports/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/getcontext.S Thu Jun 01 15:31:03 2006
+@@ -0,0 +1,59 @@
++/* Save current context.
++ Copyright (C) 2002, 2004, 2005 Free Software Foundation, Inc.
++ This file is part of the GNU C Library.
++
++ The GNU C Library is free software; you can redistribute it and/or
++ modify it under the terms of the GNU Lesser General Public
++ License as published by the Free Software Foundation; either
++ version 2.1 of the License, or (at your option) any later version.
++
++ The GNU C Library is distributed in the hope that it will be useful,
++ but WITHOUT ANY WARRANTY; without even the implied warranty of
++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++ Lesser General Public License for more details.
++
++ You should have received a copy of the GNU Lesser General Public
++ License along with the GNU C Library; if not, write to the Free
++ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
++ 02111-1307 USA. */
++
++#include <sysdep.h>
++#include <rtld-global-offsets.h>
++#include <shlib-compat.h>
++
++#define __ASSEMBLY__
++#include <asm/ptrace.h>
++#include "ucontext_i.h"
++
++#define __CONTEXT_FUNC_NAME __getcontext
++#undef __CONTEXT_ENABLE_FPRS
++#undef __CONTEXT_ENABLE_VRS
++
++#include "getcontext-common.S"
++
++versioned_symbol (libc, __getcontext, getcontext, GLIBC_2_3_4)
++
++#if SHLIB_COMPAT (libc, GLIBC_2_3_3, GLIBC_2_3_4)
++
++/* For the nofpu case the old/new versions are the same function. */
++strong_alias (__getcontext, __novec_getcontext)
++
++compat_symbol (libc, __novec_getcontext, getcontext, GLIBC_2_3_3)
++
++#endif
++
++#if SHLIB_COMPAT (libc, GLIBC_2_1, GLIBC_2_3_3)
++
++#define _ERRNO_H 1
++#include <bits/errno.h>
++
++ compat_text_section
++ENTRY (__getcontext_stub)
++ li r3,ENOSYS
++ b __syscall_error@local
++END (__getcontext_stub)
++ .previous
++
++compat_symbol (libc, __getcontext_stub, getcontext, GLIBC_2_1)
++
++#endif
+diff -urN dummy-libc/ports-cvstip-20060512/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/setcontext.S
+libc24/ports/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/setcontext.S
+--- dummy-libc/ports-cvstip-20060512/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/setcontext.S Wed Dec 31 18:00:00 1969
++++ libc24/ports/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/setcontext.S Thu Jun 01 15:31:03 2006
+@@ -0,0 +1,59 @@
++/* Jump to a new context.
++ Copyright (C) 2002, 2004, 2005 Free Software Foundation, Inc.
++ This file is part of the GNU C Library.
++
++ The GNU C Library is free software; you can redistribute it and/or
++ modify it under the terms of the GNU Lesser General Public
++ License as published by the Free Software Foundation; either
++ version 2.1 of the License, or (at your option) any later version.
++
++ The GNU C Library is distributed in the hope that it will be useful,
++ but WITHOUT ANY WARRANTY; without even the implied warranty of
++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++ Lesser General Public License for more details.
++
++ You should have received a copy of the GNU Lesser General Public
++ License along with the GNU C Library; if not, write to the Free
++ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
++ 02111-1307 USA. */
++
++#include <sysdep.h>
++#include <rtld-global-offsets.h>
++#include <shlib-compat.h>
++
++#define __ASSEMBLY__
++#include <asm/ptrace.h>
++#include "ucontext_i.h"
++
++#define __CONTEXT_FUNC_NAME __setcontext
++#undef __CONTEXT_ENABLE_FPRS
++#undef __CONTEXT_ENABLE_VRS
++
++#include "setcontext-common.S"
++
++versioned_symbol (libc, __setcontext, setcontext, GLIBC_2_3_4)
++
++#if SHLIB_COMPAT (libc, GLIBC_2_3_3, GLIBC_2_3_4)
++
++/* For the nofpu case the old/new versions are the same function. */
++strong_alias (__setcontext, __novec_setcontext)
++
++compat_symbol (libc, __novec_setcontext, setcontext, GLIBC_2_3_3)
++
++#endif
++
++#if SHLIB_COMPAT (libc, GLIBC_2_0, GLIBC_2_3_3)
++
++#define _ERRNO_H 1
++#include <bits/errno.h>
++
++ compat_text_section
++ENTRY (__setcontext_stub)
++ li r3,ENOSYS
++ b __syscall_error@local
++END (__setcontext_stub)
++ .previous
++
++compat_symbol (libc, __setcontext_stub, setcontext, GLIBC_2_0)
++
++#endif
+diff -urN dummy-libc/ports-cvstip-20060512/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/swapcontext.S
+libc24/ports/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/swapcontext.S
+--- dummy-libc/ports-cvstip-20060512/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/swapcontext.S Wed Dec 31 18:00:00 1969
++++ libc24/ports/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/swapcontext.S Thu Jun 01 15:31:03 2006
+@@ -0,0 +1,59 @@
++/* Save current context and jump to a new context.
++ Copyright (C) 2002, 2004, 2005 Free Software Foundation, Inc.
++ This file is part of the GNU C Library.
++
++ The GNU C Library is free software; you can redistribute it and/or
++ modify it under the terms of the GNU Lesser General Public
++ License as published by the Free Software Foundation; either
++ version 2.1 of the License, or (at your option) any later version.
++
++ The GNU C Library is distributed in the hope that it will be useful,
++ but WITHOUT ANY WARRANTY; without even the implied warranty of
++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++ Lesser General Public License for more details.
++
++ You should have received a copy of the GNU Lesser General Public
++ License along with the GNU C Library; if not, write to the Free
++ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
++ 02111-1307 USA. */
++
++#include <sysdep.h>
++#include <rtld-global-offsets.h>
++#include <shlib-compat.h>
++
++#define __ASSEMBLY__
++#include <asm/ptrace.h>
++#include "ucontext_i.h"
++
++#define __CONTEXT_FUNC_NAME __swapcontext
++#undef __CONTEXT_ENABLE_FPRS
++#undef __CONTEXT_ENABLE_VRS
++
++# include "swapcontext-common.S"
++
++versioned_symbol (libc, __swapcontext, swapcontext, GLIBC_2_3_4)
++
++#if SHLIB_COMPAT (libc, GLIBC_2_3_3, GLIBC_2_3_4)
++
++/* For the nofpu case the old/new versions are the same function. */
++strong_alias (__swapcontext, __novec_swapcontext)
++
++compat_symbol (libc, __novec_swapcontext, swapcontext, GLIBC_2_3_3)
++
++#endif
++
++#if SHLIB_COMPAT (libc, GLIBC_2_1, GLIBC_2_3_3)
++
++#define _ERRNO_H 1
++#include <bits/errno.h>
++
++ compat_text_section
++ENTRY (__swapcontext_stub)
++ li r3,ENOSYS
++ b __syscall_error@local
++END (__swapcontext_stub)
++ .previous
++
++compat_symbol (libc, __swapcontext_stub, swapcontext, GLIBC_2_1)
++
++#endif
+
diff --git a/recipes/glibc/glibc-2.5/ppc-soft-fp-20070115.patch b/recipes/glibc/glibc-2.5/ppc-soft-fp-20070115.patch
new file mode 100644
index 0000000000..a84bc2f7cb
--- /dev/null
+++ b/recipes/glibc/glibc-2.5/ppc-soft-fp-20070115.patch
@@ -0,0 +1,182 @@
+2007-01-14 Steven Munroe <sjmunroe@us.ibm.com>
+ Joe Kerian <jkerian@us.us.ibm.com>
+
+ [BZ #2749]
+ * soft-fp/op-4.h (__FP_FRAC_SUB_3, __FP_FRAC_SUB_4): Correct borrow
+ handling for high words.
+ * soft-fp/op-common.h (_FP_OVERFLOW_SEMIRAW): Always set inexact
+ and overflow for infinity.
+ (_FP_PACK_SEMIRAW): Update comment. Do not round if NaN or Inf.
+
+ * math/basic-test.c (truncdfsf_test): New function.
+ [!NO_LONG_DOUBLE] (trunctfsf_test): New function.
+ [!NO_LONG_DOUBLE] (trunctfdf_test): New function.
+ Change main() to do_test. Define TEST_FUNCTION. Include test-skeleton.c.
+ (do_test): Run new tests.
+
+2007-01-15 Jakub Jelinek <jakub@redhat.com>
+
+ * soft-fp/op-common.h (FP_TRUNC): When truncating a NaN, clear
+ workbits in semi-raw fraction.
+
+
+diff -urN libc25-cvstip-20070104/math/basic-test.c libc24/math/basic-test.c
+--- libc25-cvstip-20070104/math/basic-test.c 2001-07-05 23:55:35.000000000 -0500
++++ libc24/math/basic-test.c 2007-01-15 11:41:17.260963824 -0600
+@@ -1,4 +1,4 @@
+-/* Copyright (C) 1999 Free Software Foundation, Inc.
++/* Copyright (C) 1999, 2007 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Andreas Jaeger <aj@suse.de>, 1999.
+
+@@ -107,17 +107,90 @@
+ TEST_FUNC (double_test, double, nan, DBL_EPSILON, HUGE_VAL)
+ #ifndef NO_LONG_DOUBLE
+ TEST_FUNC (ldouble_test, long double, nanl, LDBL_EPSILON, HUGE_VALL)
++
++void
++trunctfsf_test(void)
++{
++ volatile long double Inf_var, NaN_var, zero_var, one_var;
++ float x1, x2;
++
++ zero_var = 0.0;
++ one_var = 1.0;
++ NaN_var = zero_var/zero_var;
++ Inf_var = one_var / zero_var;
++
++ (void) &zero_var;
++ (void) &one_var;
++ (void) &NaN_var;
++ (void) &Inf_var;
++
++ x1 = (float)NaN_var;
++ check (" float x = (float)((long double)NaN))", isnan (x1) != 0);
++ x2 = (float)Inf_var;
++ check (" float x = (float)((long double)Inf))", isinf (x2) != 0);
++}
++
++void
++trunctfdf_test(void)
++{
++ volatile long double Inf_var, NaN_var, zero_var, one_var;
++ double x1, x2;
++
++ zero_var = 0.0;
++ one_var = 1.0;
++ NaN_var = zero_var/zero_var;
++ Inf_var = one_var / zero_var;
++
++ (void) &zero_var;
++ (void) &one_var;
++ (void) &NaN_var;
++ (void) &Inf_var;
++
++ x1 = (double)NaN_var;
++ check (" double x = (double)((long double)NaN))", isnan (x1) != 0);
++ x2 = (double)Inf_var;
++ check (" double x = (double)((long double)Inf))", isinf (x2) != 0);
++}
++
+ #endif
+
++void
++truncdfsf_test(void)
++{
++ volatile double Inf_var, NaN_var, zero_var, one_var;
++ float x1, x2;
++
++ zero_var = 0.0;
++ one_var = 1.0;
++ NaN_var = zero_var/zero_var;
++ Inf_var = one_var / zero_var;
++
++ (void) &zero_var;
++ (void) &one_var;
++ (void) &NaN_var;
++ (void) &Inf_var;
++
++ x1 = (float)NaN_var;
++ check (" float x = (float)((double)NaN))", isnan (x1) != 0);
++ x2 = (float)Inf_var;
++ check (" float x = (float)((double)Inf))", isinf (x2) != 0);
++}
++
+ int
+-main (void)
++do_test (void)
+ {
+ float_test ();
+ double_test ();
++ truncdfsf_test();
+
+ #ifndef NO_LONG_DOUBLE
+ ldouble_test ();
++ trunctfsf_test();
++ trunctfdf_test();
+ #endif
+
+ return errors != 0;
+ }
++
++#define TEST_FUNCTION do_test ()
++#include "../test-skeleton.c"
+diff -urN libc25-cvstip-20070104/soft-fp/op-4.h libc24/soft-fp/op-4.h
+--- libc25-cvstip-20070104/soft-fp/op-4.h 2006-04-04 03:24:47.000000000 -0500
++++ libc24/soft-fp/op-4.h 2007-01-11 11:00:53.000000000 -0600
+@@ -564,7 +564,7 @@
+ r1 = x1 - y1; \
+ _c2 = r1 > x1; \
+ r1 -= _c1; \
+- _c2 |= r1 > _c1; \
++ _c2 |= _c1 && (y1 == x1); \
+ r2 = x2 - y2 - _c2; \
+ } while (0)
+ #endif
+@@ -578,11 +578,11 @@
+ r1 = x1 - y1; \
+ _c2 = r1 > x1; \
+ r1 -= _c1; \
+- _c2 |= r1 > _c1; \
++ _c2 |= _c1 && (y1 == x1); \
+ r2 = x2 - y2; \
+ _c3 = r2 > x2; \
+ r2 -= _c2; \
+- _c3 |= r2 > _c2; \
++ _c3 |= _c2 && (y2 == x2); \
+ r3 = x3 - y3 - _c3; \
+ } while (0)
+ #endif
+diff -urN libc25-cvstip-20070104/soft-fp/op-common.h libc24/soft-fp/op-common.h
+--- libc25-cvstip-20070104/soft-fp/op-common.h 2006-04-04 03:24:47.000000000 -0500
++++ libc24/soft-fp/op-common.h 2007-01-15 11:46:17.290882288 -0600
+@@ -1,5 +1,5 @@
+ /* Software floating-point emulation. Common operations.
+- Copyright (C) 1997,1998,1999,2006 Free Software Foundation, Inc.
++ Copyright (C) 1997,1998,1999,2006,2007 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Richard Henderson (rth@cygnus.com),
+ Jakub Jelinek (jj@ultra.linux.cz),
+@@ -99,10 +99,10 @@
+ else \
+ { \
+ X##_e = _FP_EXPMAX_##fs - 1; \
+- FP_SET_EXCEPTION(FP_EX_OVERFLOW); \
+- FP_SET_EXCEPTION(FP_EX_INEXACT); \
+ _FP_FRAC_SET_##wc(X, _FP_MAXFRAC_##wc); \
+ } \
++ FP_SET_EXCEPTION(FP_EX_INEXACT); \
++ FP_SET_EXCEPTION(FP_EX_OVERFLOW); \
+ } while (0)
+
+ /* Check for a semi-raw value being a signaling NaN and raise the
+@@ -1252,6 +1252,9 @@
+ _FP_FRAC_SRL_##swc(S, (_FP_WFRACBITS_##sfs \
+ - _FP_WFRACBITS_##dfs)); \
+ _FP_FRAC_COPY_##dwc##_##swc(D, S); \
++ /* Semi-raw NaN must have all workbits cleared. */ \
++ _FP_FRAC_LOW_##dwc(D) \
++ &= ~(_FP_W_TYPE) ((1 << _FP_WORKBITS) - 1); \
+ _FP_FRAC_HIGH_##dfs(D) |= _FP_QNANBIT_SH_##dfs; \
+ } \
+ } \
diff --git a/recipes/glibc/glibc-2.5/sysdeps-nios2.patch b/recipes/glibc/glibc-2.5/sysdeps-nios2.patch
new file mode 100644
index 0000000000..9d54a806e1
--- /dev/null
+++ b/recipes/glibc/glibc-2.5/sysdeps-nios2.patch
@@ -0,0 +1,4028 @@
+Index: glibc-2.5/sysdeps/nios2/Implies
+===================================================================
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ glibc-2.5/sysdeps/nios2/Implies 2010-05-31 08:56:05.000000000 +0200
+@@ -0,0 +1,4 @@
++wordsize-32
++ieee754/dbl-64
++ieee754/flt-32
++nios2/soft-fp
+Index: glibc-2.5/sysdeps/nios2/Makefile
+===================================================================
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ glibc-2.5/sysdeps/nios2/Makefile 2010-05-31 08:56:05.000000000 +0200
+@@ -0,0 +1,33 @@
++# Copyright (C) 1993, 1994, 1996, 1997, 2003, 2008 Free Software Foundation,
++# Inc.
++# This file is part of the GNU C Library.
++
++# The GNU C Library is free software; you can redistribute it and/or
++# modify it under the terms of the GNU Lesser General Public
++# License as published by the Free Software Foundation; either
++# version 2.1 of the License, or (at your option) any later version.
++
++# The GNU C Library is distributed in the hope that it will be useful,
++# but WITHOUT ANY WARRANTY; without even the implied warranty of
++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++# Lesser General Public License for more details.
++
++# You should have received a copy of the GNU Lesser General Public
++# License along with the GNU C Library; if not, write to the Free
++# Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
++# 02111-1307 USA.
++
++pic-ccflag = -fpic
++
++ifeq ($(subdir),elf)
++CFLAGS-rtld.c += -mhw-div
++endif
++
++ifeq ($(subdir),soft-fp)
++sysdep_routines += $(filter-out sqrtsf2,$(gcc-single-routines)) \
++ $(filter-out sqrtdf2,$(gcc-double-routines))
++endif
++
++ifeq ($(subdir),csu)
++gen-as-const-headers += tcb-offsets.sym
++endif
+Index: glibc-2.5/sysdeps/nios2/Subdirs
+===================================================================
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ glibc-2.5/sysdeps/nios2/Subdirs 2010-05-31 08:56:05.000000000 +0200
+@@ -0,0 +1 @@
++soft-fp
+Index: glibc-2.5/sysdeps/nios2/Versions
+===================================================================
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ glibc-2.5/sysdeps/nios2/Versions 2010-05-31 08:56:05.000000000 +0200
+@@ -0,0 +1,12 @@
++libc {
++ GLIBC_2.10 {
++ __adddf3; __addsf3; __divdf3; __divsf3; __eqdf2; __eqsf2; __extendsfdf2;
++ __fixdfdi; __fixdfsi; __fixsfdi; __fixsfsi;
++ __fixunsdfdi; __fixunsdfsi; __fixunssfdi; __fixunssfsi;
++ __floatdidf; __floatdisf; __floatsidf; __floatsisf;
++ __floatundidf; __floatundisf; __floatunsidf; __floatunsisf;
++ __gedf2; __gesf2; __gtdf2; __gtsf2; __ledf2; __lesf2; __ltdf2; __ltsf2;
++ __muldf3; __mulsf3; __nedf2; __nesf2; __negdf2; __negsf2;
++ __subdf3; __subsf3; __truncdfsf2; __unorddf2; __unordsf2;
++ }
++}
+Index: glibc-2.5/sysdeps/nios2/__longjmp.c
+===================================================================
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ glibc-2.5/sysdeps/nios2/__longjmp.c 2010-05-31 08:56:05.000000000 +0200
+@@ -0,0 +1,41 @@
++/* Copyright (C) 1991, 92, 93, 94, 95, 97, 2008 Free Software Foundation, Inc.
++ This file is part of the GNU C Library.
++
++ The GNU C Library is free software; you can redistribute it and/or
++ modify it under the terms of the GNU Lesser General Public
++ License as published by the Free Software Foundation; either
++ version 2.1 of the License, or (at your option) any later version.
++
++ The GNU C Library is distributed in the hope that it will be useful,
++ but WITHOUT ANY WARRANTY; without even the implied warranty of
++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++ Lesser General Public License for more details.
++
++ You should have received a copy of the GNU Lesser General Public
++ License along with the GNU C Library; if not, write to the Free
++ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
++ 02111-1307 USA. */
++
++#include <setjmp.h>
++#include <stdlib.h>
++
++/* Jump to the position specified by ENV, causing the
++ setjmp call there to return VAL, or 1 if VAL is 0. */
++void
++__longjmp (__jmp_buf env, int val)
++{
++ if (val == 0)
++ val = 1;
++ __asm__ volatile ("mov r2, %0" : : "r" (val));
++ __asm__ volatile ("ldw r16, %0" : : "m" (env[0].__regs[0]));
++ __asm__ volatile ("ldw r17, %0" : : "m" (env[0].__regs[1]));
++ __asm__ volatile ("ldw r18, %0" : : "m" (env[0].__regs[2]));
++ __asm__ volatile ("ldw r19, %0" : : "m" (env[0].__regs[3]));
++ __asm__ volatile ("ldw r20, %0" : : "m" (env[0].__regs[4]));
++ __asm__ volatile ("ldw r21, %0" : : "m" (env[0].__regs[5]));
++ __asm__ volatile ("ldw r22, %0" : : "m" (env[0].__regs[6]));
++ __asm__ volatile ("ldw r23, %0" : : "m" (env[0].__regs[7]));
++ __asm__ volatile ("ldw sp, %0" : : "m" (env[0].__regs[8]));
++ __asm__ volatile ("ldw fp, %0" : : "m" (env[0].__regs[9]));
++ __asm__ volatile ("ldw ra, %0" : : "m" (env[0].__regs[10]));
++}
+Index: glibc-2.5/sysdeps/nios2/bits/endian.h
+===================================================================
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ glibc-2.5/sysdeps/nios2/bits/endian.h 2010-05-31 08:56:05.000000000 +0200
+@@ -0,0 +1,12 @@
++/* The Nios II architecture has selectable endianness. */
++
++#ifndef _ENDIAN_H
++# error "Never use <bits/endian.h> directly; include <endian.h> instead."
++#endif
++
++#ifdef __nios2_big_endian__
++# define __BYTE_ORDER __BIG_ENDIAN
++#endif
++#ifdef __nios2_little_endian__
++# define __BYTE_ORDER __LITTLE_ENDIAN
++#endif
+Index: glibc-2.5/sysdeps/nios2/bits/link.h
+===================================================================
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ glibc-2.5/sysdeps/nios2/bits/link.h 2010-05-31 08:56:05.000000000 +0200
+@@ -0,0 +1,54 @@
++/* Copyright (C) 2009 Free Software Foundation, Inc.
++ This file is part of the GNU C Library.
++
++ The GNU C Library is free software; you can redistribute it and/or
++ modify it under the terms of the GNU Lesser General Public
++ License as published by the Free Software Foundation; either
++ version 2.1 of the License, or (at your option) any later version.
++
++ The GNU C Library is distributed in the hope that it will be useful,
++ but WITHOUT ANY WARRANTY; without even the implied warranty of
++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++ Lesser General Public License for more details.
++
++ You should have received a copy of the GNU Lesser General Public
++ License along with the GNU C Library; if not, write to the Free
++ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
++ 02111-1307 USA. */
++
++#ifndef _LINK_H
++# error "Never include <bits/link.h> directly; use <link.h> instead."
++#endif
++
++/* Registers for entry into PLT on Nios II. */
++typedef struct La_nios2_regs
++{
++ uint32_t lr_reg[4]; /* r4 through r7 */
++ uint32_t lr_ra;
++ uint32_t lr_sp;
++} La_nios2_regs;
++
++/* Return values for calls from PLT on Nios II. */
++typedef struct La_nios2_retval
++{
++ uint32_t lrv_r2;
++ uint32_t lrv_r3;
++} La_nios2_retval;
++
++__BEGIN_DECLS
++
++extern Elf32_Addr la_nios2_gnu_pltenter (Elf32_Sym *__sym, unsigned int __ndx,
++ uintptr_t *__refcook,
++ uintptr_t *__defcook,
++ La_nios2_regs *__regs,
++ unsigned int *__flags,
++ const char *__symname,
++ long int *__framesizep);
++extern unsigned int la_nios2_gnu_pltexit (Elf32_Sym *__sym, unsigned int __ndx,
++ uintptr_t *__refcook,
++ uintptr_t *__defcook,
++ const La_nios2_regs *__inregs,
++ La_nios2_retval *__outregs,
++ const char *symname);
++
++__END_DECLS
+Index: glibc-2.5/sysdeps/nios2/bits/setjmp.h
+===================================================================
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ glibc-2.5/sysdeps/nios2/bits/setjmp.h 2010-05-31 08:56:05.000000000 +0200
+@@ -0,0 +1,35 @@
++/* Define the machine-dependent type `jmp_buf'. Nios II version.
++ Copyright (C) 1992,1993,1995,1997,2000,2002,2003,2004,2005,2006,2008
++ Free Software Foundation, Inc.
++ This file is part of the GNU C Library.
++
++ The GNU C Library is free software; you can redistribute it and/or
++ modify it under the terms of the GNU Lesser General Public
++ License as published by the Free Software Foundation; either
++ version 2.1 of the License, or (at your option) any later version.
++
++ The GNU C Library is distributed in the hope that it will be useful,
++ but WITHOUT ANY WARRANTY; without even the implied warranty of
++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++ Lesser General Public License for more details.
++
++ You should have received a copy of the GNU Lesser General Public
++ License along with the GNU C Library; if not, write to the Free
++ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
++ 02111-1307 USA. */
++
++#ifndef _NIOS2_BITS_SETJMP_H
++#define _NIOS2_BITS_SETJMP_H 1
++
++#if !defined(_SETJMP_H) && !defined(_PTHREAD_H)
++# error "Never include <bits/setjmp.h> directly; use <setjmp.h> instead."
++#endif
++
++typedef struct
++ {
++ /* r16,r17,r18,r19,r20,r21,r22,r23,sp,fp,ra */
++ int __regs[11];
++
++ } __jmp_buf[1];
++
++#endif /* _NIOS2_BITS_SETJMP_H */
+Index: glibc-2.5/sysdeps/nios2/bsd-_setjmp.S
+===================================================================
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ glibc-2.5/sysdeps/nios2/bsd-_setjmp.S 2010-05-31 08:56:05.000000000 +0200
+@@ -0,0 +1,40 @@
++/* BSD `_setjmp' entry point to `sigsetjmp (..., 1)'. NIOS2 version.
++ Copyright (C) 1996, 1997, 2000, 2008 Free Software Foundation, Inc.
++ This file is part of the GNU C Library.
++
++ The GNU C Library is free software; you can redistribute it and/or
++ modify it under the terms of the GNU Lesser General Public
++ License as published by the Free Software Foundation; either
++ version 2.1 of the License, or (at your option) any later version.
++
++ The GNU C Library is distributed in the hope that it will be useful,
++ but WITHOUT ANY WARRANTY; without even the implied warranty of
++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++ Lesser General Public License for more details.
++
++ You should have received a copy of the GNU Lesser General Public
++ License along with the GNU C Library; if not, write to the Free
++ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
++ 02111-1307 USA. */
++
++/* This just does a tail-call to `__sigsetjmp (ARG, 1)'.
++ We cannot do it in C because it must be a tail-call, so frame-unwinding
++ in setjmp doesn't clobber the state restored by longjmp. */
++
++#include <sysdep.h>
++
++ENTRY (_setjmp)
++ movi r5, 0 /* Pass a second argument of zero. */
++#if defined (__PIC__) || defined (PIC)
++ nextpc r2
++1: movhi r3, %hiadj(_GLOBAL_OFFSET_TABLE_ - 1b)
++ addi r3, r3, %lo(_GLOBAL_OFFSET_TABLE_ - 1b)
++ add r2, r2, r3
++ ldw r2, %call(C_SYMBOL_NAME(__sigsetjmp))(r2)
++ jmp r2
++#else
++ jmpi C_SYMBOL_NAME (__sigsetjmp)
++#endif
++ .size setjmp, . - setjmp
++
++libc_hidden_def (_setjmp)
+Index: glibc-2.5/sysdeps/nios2/bsd-setjmp.S
+===================================================================
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ glibc-2.5/sysdeps/nios2/bsd-setjmp.S 2010-05-31 08:56:05.000000000 +0200
+@@ -0,0 +1,38 @@
++/* BSD `setjmp' entry point to `sigsetjmp (..., 1)'. NIOS2 version.
++ Copyright (C) 1996, 1997, 2000, 2008 Free Software Foundation, Inc.
++ This file is part of the GNU C Library.
++
++ The GNU C Library is free software; you can redistribute it and/or
++ modify it under the terms of the GNU Lesser General Public
++ License as published by the Free Software Foundation; either
++ version 2.1 of the License, or (at your option) any later version.
++
++ The GNU C Library is distributed in the hope that it will be useful,
++ but WITHOUT ANY WARRANTY; without even the implied warranty of
++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++ Lesser General Public License for more details.
++
++ You should have received a copy of the GNU Lesser General Public
++ License along with the GNU C Library; if not, write to the Free
++ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
++ 02111-1307 USA. */
++
++/* This just does a tail-call to `__sigsetjmp (ARG, 1)'.
++ We cannot do it in C because it must be a tail-call, so frame-unwinding
++ in setjmp doesn't clobber the state restored by longjmp. */
++
++#include <sysdep.h>
++
++ENTRY (setjmp)
++ movi r5, 1 /* Pass a second argument of one. */
++#if defined (__PIC__) || defined (PIC)
++ nextpc r2
++1: movhi r3, %hiadj(_GLOBAL_OFFSET_TABLE_ - 1b)
++ addi r3, r3, %lo(_GLOBAL_OFFSET_TABLE_ - 1b)
++ add r2, r2, r3
++ ldw r2, %call(C_SYMBOL_NAME(__sigsetjmp))(r2)
++ jmp r2
++#else
++ jmpi C_SYMBOL_NAME (__sigsetjmp)
++#endif
++ .size setjmp, . - setjmp
+Index: glibc-2.5/sysdeps/nios2/dl-init.c
+===================================================================
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ glibc-2.5/sysdeps/nios2/dl-init.c 2010-05-31 08:56:05.000000000 +0200
+@@ -0,0 +1,30 @@
++/* Copyright (C) 2008 Free Software Foundation, Inc.
++ This file is part of the GNU C Library.
++
++ The GNU C Library is free software; you can redistribute it and/or
++ modify it under the terms of the GNU Lesser General Public
++ License as published by the Free Software Foundation; either
++ version 2.1 of the License, or (at your option) any later version.
++
++ The GNU C Library is distributed in the hope that it will be useful,
++ but WITHOUT ANY WARRANTY; without even the implied warranty of
++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++ Lesser General Public License for more details.
++
++ You should have received a copy of the GNU Lesser General Public
++ License along with the GNU C Library; if not, write to the Free
++ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
++ 02111-1307 USA. */
++
++#include <elf/dl-init.c>
++
++unsigned int
++internal_function
++_dl_nios2_get_gp_value (struct link_map *main_map)
++{
++ ElfW(Dyn)* dyn = main_map->l_ld;
++ for (dyn = main_map->l_ld; dyn->d_tag != DT_NULL; ++dyn)
++ if (dyn->d_tag == DT_NIOS2_GP)
++ return (unsigned int)(dyn->d_un.d_ptr);
++ return 0;
++}
+Index: glibc-2.5/sysdeps/nios2/dl-machine.h
+===================================================================
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ glibc-2.5/sysdeps/nios2/dl-machine.h 2010-05-31 08:56:05.000000000 +0200
+@@ -0,0 +1,332 @@
++/* Machine-dependent ELF dynamic relocation inline functions. Nios II version.
++ Copyright (C) 1995, 1996, 1997, 1999, 2000, 2001, 2005
++ Free Software Foundation, Inc.
++ This file is part of the GNU C Library.
++
++ The GNU C Library is free software; you can redistribute it and/or
++ modify it under the terms of the GNU Lesser General Public
++ License as published by the Free Software Foundation; either
++ version 2.1 of the License, or (at your option) any later version.
++
++ The GNU C Library is distributed in the hope that it will be useful,
++ but WITHOUT ANY WARRANTY; without even the implied warranty of
++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++ Lesser General Public License for more details.
++
++ You should have received a copy of the GNU Lesser General Public
++ License along with the GNU C Library; if not, write to the Free
++ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
++ 02111-1307 USA. */
++
++#ifndef dl_machine_h
++#define dl_machine_h
++
++#define ELF_MACHINE_NAME "nios2"
++
++#include <string.h>
++#include <link.h>
++#include <dl-tls.h>
++
++/* Return nonzero iff ELF header is compatible with the running host. */
++static inline int
++elf_machine_matches_host (const Elf32_Ehdr *ehdr)
++{
++ return ehdr->e_machine == EM_ALTERA_NIOS2;
++}
++
++
++/* Return the link-time address of _DYNAMIC. Conveniently, this is the
++ first element of the GOT. */
++static inline Elf32_Addr
++elf_machine_dynamic (void)
++{
++ Elf32_Addr *dynamic;
++ int tmp;
++ asm("nextpc\t%0\n\t"
++ "1: movhi\t%1, %%hiadj(_GLOBAL_OFFSET_TABLE_ - 1b)\n\t"
++ "addi\t%1, %1, %%lo( _GLOBAL_OFFSET_TABLE_ - 1b)\n\t"
++ "add\t%0, %0, %1\n"
++ : "=r" (dynamic), "=r" (tmp));
++ return *dynamic;
++}
++
++
++/* Return the run-time load address of the shared object. */
++static inline Elf32_Addr
++elf_machine_load_address (void)
++{
++ Elf32_Addr result;
++ int tmp;
++ asm("nextpc\t%0\n\t"
++ "1: movhi\t%1, %%hiadj(1b)\n\t"
++ "addi\t%1, %1, %%lo(1b)\n\t"
++ "sub\t%0, %0, %1\n"
++ : "=r" (result), "=r" (tmp));
++ return result;
++}
++
++/* Set up the loaded object described by L so its unrelocated PLT
++ entries will jump to the on-demand fixup code in dl-runtime.c. */
++
++static inline int
++elf_machine_runtime_setup (struct link_map *l, int lazy, int profile)
++{
++ extern void _dl_runtime_resolve (Elf32_Word);
++
++ if (lazy)
++ {
++ /* The GOT entries for functions in the PLT have not yet been filled
++ in. Their initial contents will arrange when called to load r15 with
++ an offset into the .got section, load r14 with
++ _GLOBAL_OFFSET_TABLE_[1], and then jump to _GLOBAL_OFFSET_TABLE[2].
++ */
++ Elf32_Addr *got = (Elf32_Addr *) D_PTR (l, l_info[DT_PLTGOT]);
++ got[1] = (Elf32_Addr) l; /* Identify this shared object. */
++
++ /* This function will get called to fix up the GOT entry indicated by
++ the offset on the stack, and then jump to the resolved address. */
++ got[2] = (Elf32_Addr) &_dl_runtime_resolve;
++ }
++
++ return lazy;
++}
++
++/* Initial entry point code for the dynamic linker.
++ The C function `_dl_start' is the real entry point;
++ its return value is the user program's entry point. */
++
++#define RTLD_START asm("\
++.text\n\
++.globl _start\n\
++.type _start, %function\n\
++_start:\n\
++ /* At start time, all the args are on the stack. */\n\
++ mov r4, sp\n\
++\n\
++ /* Start the calculation of the GOT pointer. */\n\
++ nextpc r22\n\
++1: movhi r8, %hiadj(_GLOBAL_OFFSET_TABLE_ - 1b)\n\
++ addi r8, r8, %lo(_GLOBAL_OFFSET_TABLE_ - 1b)\n\
++\n\
++ /* Figure out where _dl_start will need to return to. */\n\
++ movhi ra, %hiadj(2f - 1b)\n\
++ addi ra, ra, %lo(2f - 1b)\n\
++ add ra, ra, r22\n\
++\n\
++ /* Finish the calculation of the GOT pointer. */\n\
++ add r22, r22, r8\n\
++\n\
++ br _dl_start\n\
++\n\
++ /* Save the returned user entry point. */\n\
++2: mov r16, r2\n\
++\n\
++ /* Initialize gp. */\n\
++ ldw r4, %got(_rtld_local)(r22)\n\
++ ldw r4, 0(r4)\n\
++ ldw r8, %call(_dl_nios2_get_gp_value)(r22)\n\
++ callr r8\n\
++ mov gp, r2\n\
++\n\
++ /* Find the number of arguments to skip. */\n\
++ ldw r8, %got(_dl_skip_args)(r22)\n\
++ ldw r8, 0(r8)\n\
++\n\
++ /* Find the main_map from the GOT. */\n\
++ ldw r4, %got(_rtld_local)(r22)\n\
++ ldw r4, 0(r4)\n\
++\n\
++ /* Find argc. */\n\
++ ldw r5, 0(sp)\n\
++ sub r5, r5, r8\n\
++ stw r5, 0(sp)\n\
++\n\
++ /* Find the first unskipped argument. */\n\
++ slli r8, r8, 2\n\
++ addi r6, sp, 4\n\
++ add r9, r6, r8\n\
++ mov r10, r6\n\
++\n\
++ /* Shuffle argv down. */\n\
++3: ldw r11, 0(r9)\n\
++ stw r11, 0(r10)\n\
++ addi r9, r9, 4\n\
++ addi r10, r10, 4\n\
++ bne r11, zero, 3b\n\
++\n\
++ /* Shuffle envp down. */\n\
++ mov r7, r10\n\
++4: ldw r11, 0(r9)\n\
++ stw r11, 0(r10)\n\
++ addi r9, r9, 4\n\
++ addi r10, r10, 4\n\
++ bne r11, zero, 4b\n\
++\n\
++ /* Shuffle auxv down. */\n\
++5: ldw r11, 4(r9)\n\
++ stw r11, 4(r10)\n\
++ ldw r11, 0(r9)\n\
++ stw r11, 0(r10)\n\
++ addi r9, r9, 8\n\
++ addi r10, r10, 8\n\
++ bne r11, zero, 5b\n\
++\n\
++ /* Update _dl_argv. */\n\
++ ldw r2, %got(_dl_argv)(r22)\n\
++ stw r6, 0(r2)\n\
++\n\
++ /* Call _dl_init through the PLT. */\n\
++ ldw r8, %call(_dl_init)(r22)\n\
++ callr r8\n\
++\n\
++ /* Find the finalization function. */\n\
++ ldw r4, %got(_dl_fini)(r22)\n\
++\n\
++ /* Jump to the user's entry point. */\n\
++ jmp r16\n\
++");
++
++/* ELF_RTYPE_CLASS_PLT iff TYPE describes relocation of a PLT entry, so
++ PLT entries should not be allowed to define the value.
++ ELF_RTYPE_CLASS_NOCOPY iff TYPE should not be allowed to resolve to one
++ of the main executable's symbols, as for a COPY reloc. */
++#define elf_machine_type_class(type) \
++ ((((type) == R_NIOS2_JUMP_SLOT) * ELF_RTYPE_CLASS_PLT) \
++ | (((type) == R_NIOS2_COPY) * ELF_RTYPE_CLASS_COPY))
++
++/* A reloc type used for ld.so cmdline arg lookups to reject PLT entries. */
++#define ELF_MACHINE_JMP_SLOT R_NIOS2_JUMP_SLOT
++
++/* The Nios II never uses Elf32_Rel relocations. */
++#define ELF_MACHINE_NO_REL 1
++
++/* Fixup a PLT entry to bounce directly to the function at VALUE. */
++
++static inline Elf32_Addr
++elf_machine_fixup_plt (struct link_map *map, lookup_t t,
++ const Elf32_Rel *reloc,
++ Elf32_Addr *reloc_addr, Elf32_Addr value)
++{
++ return *reloc_addr = value;
++}
++
++/* Return the final value of a plt relocation. */
++static inline Elf32_Addr
++elf_machine_plt_value (struct link_map *map, const Elf32_Rela *reloc,
++ Elf32_Addr value)
++{
++ return value;
++}
++
++/* Names of the architecture-specific auditing callback functions. */
++#define ARCH_LA_PLTENTER nios2_gnu_pltenter
++#define ARCH_LA_PLTEXIT nios2_gnu_pltexit
++
++#endif /* dl_machine_h */
++
++#ifdef RESOLVE_MAP
++
++/* Perform the relocation specified by RELOC and SYM (which is fully resolved).
++ LOADADDR is the load address of the object; INFO is an array indexed
++ by DT_* of the .dynamic section info. */
++
++auto inline void __attribute__ ((always_inline))
++elf_machine_rela (struct link_map *map, const ElfW(Rela) *reloc,
++ const ElfW(Sym) *sym, const struct r_found_version *version,
++ void *const reloc_addr_arg)
++{
++ Elf32_Addr *const reloc_addr = reloc_addr_arg;
++ const unsigned int r_type = ELF32_R_TYPE (reloc->r_info);
++
++ if (__builtin_expect (r_type == R_NIOS2_RELATIVE, 0))
++ *reloc_addr = map->l_addr + reloc->r_addend;
++ else if (__builtin_expect (r_type == R_NIOS2_NONE, 0))
++ return;
++ else
++ {
++ const Elf32_Sym *const refsym = sym;
++ struct link_map *sym_map = RESOLVE_MAP (&sym, version, r_type);
++ Elf32_Addr value = sym == NULL ? 0 : sym_map->l_addr + sym->st_value;
++
++ switch (r_type)
++ {
++ case R_NIOS2_COPY:
++ if (sym == NULL)
++ /* This can happen in trace mode if an object could not be
++ found. */
++ break;
++ if (sym->st_size > refsym->st_size
++ || (sym->st_size < refsym->st_size && GLRO(dl_verbose)))
++ {
++ const char *strtab;
++
++ strtab = (const void *) D_PTR (map, l_info[DT_STRTAB]);
++ _dl_error_printf ("\
++%s: Symbol `%s' has different size in shared object, consider re-linking\n",
++ rtld_progname ?: "<program name unknown>",
++ strtab + refsym->st_name);
++ }
++ memcpy (reloc_addr_arg, (void *) value,
++ MIN (sym->st_size, refsym->st_size));
++ break;
++ case R_NIOS2_GLOB_DAT:
++ case R_NIOS2_JUMP_SLOT:
++# ifdef RTLD_BOOTSTRAP
++ /* Fix weak undefined references. */
++ if (sym != NULL && sym->st_value == 0)
++ *reloc_addr = 0;
++ else
++# endif
++ *reloc_addr = value;
++ break;
++#if defined USE_TLS && !defined RTLD_BOOTSTRAP
++ case R_NIOS2_TLS_DTPMOD:
++ /* Get the information from the link map returned by the
++ resolv function. */
++ if (sym_map != NULL)
++ *reloc_addr = sym_map->l_tls_modid;
++ break;
++
++ case R_NIOS2_TLS_DTPREL:
++ *reloc_addr = reloc->r_addend + TLS_DTPREL_VALUE(sym);
++ break;
++
++ case R_NIOS2_TLS_TPREL:
++ if (sym != NULL)
++ {
++ CHECK_STATIC_TLS (map, sym_map);
++ *reloc_addr = reloc->r_addend + TLS_TPREL_VALUE(sym_map, sym);
++ }
++ break;
++#endif
++ case R_NIOS2_BFD_RELOC_32:
++ *reloc_addr = value + reloc->r_addend;
++ break;
++
++ default:
++ _dl_reloc_bad_type (map, r_type, 0);
++ break;
++ }
++ }
++}
++
++auto inline void __attribute__((always_inline))
++ elf_machine_rela_relative (ElfW(Addr) l_addr, const ElfW(Rela) *reloc,
++ void *const reloc_addr_arg)
++{
++ Elf32_Addr *const reloc_addr = reloc_addr_arg;
++ *reloc_addr = l_addr + reloc->r_addend;
++}
++
++auto inline void __attribute__((always_inline))
++ elf_machine_lazy_rel (struct link_map *map,
++ ElfW(Addr) l_addr, const ElfW(Rela) *reloc)
++{
++ Elf32_Addr *const reloc_addr = (void *) (l_addr + reloc->r_offset);
++ if (ELF32_R_TYPE (reloc->r_info) == R_NIOS2_JUMP_SLOT)
++ *reloc_addr += l_addr;
++ else
++ _dl_reloc_bad_type (map, ELF32_R_TYPE (reloc->r_info), 1);
++}
++
++#endif /* RESOLVE_MAP */
+Index: glibc-2.5/sysdeps/nios2/dl-sysdep.h
+===================================================================
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ glibc-2.5/sysdeps/nios2/dl-sysdep.h 2010-05-31 08:56:05.000000000 +0200
+@@ -0,0 +1,24 @@
++/* System-specific settings for dynamic linker code. Nios II version.
++ Copyright (C) 2009 Free Software Foundation, Inc.
++ This file is part of the GNU C Library.
++
++ The GNU C Library is free software; you can redistribute it and/or
++ modify it under the terms of the GNU Lesser General Public
++ License as published by the Free Software Foundation; either
++ version 2.1 of the License, or (at your option) any later version.
++
++ The GNU C Library is distributed in the hope that it will be useful,
++ but WITHOUT ANY WARRANTY; without even the implied warranty of
++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++ Lesser General Public License for more details.
++
++ You should have received a copy of the GNU Lesser General Public
++ License along with the GNU C Library; if not, write to the Free
++ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
++ 02111-1307 USA. */
++
++#include_next <dl-sysdep.h>
++
++/* _dl_argv cannot be attribute_relro, because _dl_start_user
++ might write into it after _dl_start returns. */
++#define DL_ARGV_NOT_RELRO 1
+Index: glibc-2.5/sysdeps/nios2/dl-tls.h
+===================================================================
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ glibc-2.5/sysdeps/nios2/dl-tls.h 2010-05-31 08:56:05.000000000 +0200
+@@ -0,0 +1,46 @@
++/* Thread-local storage handling in the ELF dynamic linker. Nios II version.
++ Copyright (C) 2005 Free Software Foundation, Inc.
++ This file is part of the GNU C Library.
++
++ The GNU C Library is free software; you can redistribute it and/or
++ modify it under the terms of the GNU Lesser General Public
++ License as published by the Free Software Foundation; either
++ version 2.1 of the License, or (at your option) any later version.
++
++ The GNU C Library is distributed in the hope that it will be useful,
++ but WITHOUT ANY WARRANTY; without even the implied warranty of
++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++ Lesser General Public License for more details.
++
++ You should have received a copy of the GNU Lesser General Public
++ License along with the GNU C Library; if not, write to the Free
++ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
++ 02111-1307 USA. */
++
++
++/* Type used for the representation of TLS information in the GOT. */
++typedef struct
++{
++ unsigned long int ti_module;
++ unsigned long int ti_offset;
++} tls_index;
++
++/* The thread pointer points 0x7000 past the first static TLS block. */
++#define TLS_TP_OFFSET 0x7000
++
++/* Dynamic thread vector pointers point 0x8000 past the start of each
++ TLS block. */
++#define TLS_DTV_OFFSET 0x8000
++
++/* Compute the value for a GOTTPREL reloc. */
++#define TLS_TPREL_VALUE(sym_map, sym) \
++ ((sym_map)->l_tls_offset + (sym)->st_value - TLS_TP_OFFSET)
++
++/* Compute the value for a DTPREL reloc. */
++#define TLS_DTPREL_VALUE(sym) \
++ ((sym)->st_value - TLS_DTV_OFFSET)
++
++extern void *__tls_get_addr (tls_index *ti);
++
++# define GET_ADDR_OFFSET (ti->ti_offset + TLS_DTV_OFFSET)
++# define __TLS_GET_ADDR(__ti) (__tls_get_addr (__ti) - TLS_DTV_OFFSET)
+Index: glibc-2.5/sysdeps/nios2/dl-trampoline.S
+===================================================================
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ glibc-2.5/sysdeps/nios2/dl-trampoline.S 2010-05-31 08:56:05.000000000 +0200
+@@ -0,0 +1,80 @@
++/* PLT trampolines. Nios II version.
++ Copyright (C) 2005 Free Software Foundation, Inc.
++ This file is part of the GNU C Library.
++
++ The GNU C Library is free software; you can redistribute it and/or
++ modify it under the terms of the GNU Lesser General Public
++ License as published by the Free Software Foundation; either
++ version 2.1 of the License, or (at your option) any later version.
++
++ The GNU C Library is distributed in the hope that it will be useful,
++ but WITHOUT ANY WARRANTY; without even the implied warranty of
++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++ Lesser General Public License for more details.
++
++ You should have received a copy of the GNU Lesser General Public
++ License along with the GNU C Library; if not, write to the Free
++ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
++ 02111-1307 USA. */
++
++#include <sysdep.h>
++#include <libc-symbols.h>
++
++ .text
++ .globl _dl_runtime_resolve
++ cfi_startproc
++_dl_runtime_resolve:
++/* The runtime resolver receives the original function arguments in r4
++ through r7, the shared library identifier from GOT[1]? in r14, and the
++ relocation index times four in r15. It updates the corresponding PLT GOT
++ entry so that the PLT entry will transfer control directly to the target
++ in the future, and then transfers control to the target. */
++ /* Save arguments and return address. */
++ subi sp, sp, 28
++ cfi_adjust_cfa_offset (28)
++ stw r22, 24(sp)
++ cfi_rel_offset (r22, 24)
++ stw r8, 20(sp) /* save r8, because this might be a call to mcount */
++ cfi_rel_offset (r8, 20)
++ stw r7, 16(sp)
++ cfi_rel_offset (r7, 16)
++ stw r6, 12(sp)
++ cfi_rel_offset (r6, 12)
++ stw r5, 8(sp)
++ cfi_rel_offset (r5, 8)
++ stw r4, 4(sp)
++ cfi_rel_offset (r4, 4)
++ stw ra, 0(sp)
++ cfi_rel_offset (ra, 0)
++
++ /* Get pointer to linker struct. */
++ mov r4, r14
++
++ /* Get the relocation offset. We're given a multiple of 4 and
++ need a multiple of 12, so multiply by 3. */
++ slli r5, r15, 1
++ add r5, r5, r15
++
++ /* Call the fixup routine. */
++ nextpc r22
++1: movhi r2, %hiadj(_GLOBAL_OFFSET_TABLE_ - 1b)
++ addi r2, r2, %lo(_GLOBAL_OFFSET_TABLE_ - 1b)
++ add r22, r22, r2
++ ldw r2, %call(_dl_fixup)(r22)
++ callr r2
++
++ /* Restore the arguments and return address. */
++ ldw ra, 0(sp)
++ ldw r4, 4(sp)
++ ldw r5, 8(sp)
++ ldw r6, 12(sp)
++ ldw r7, 16(sp)
++ ldw r8, 20(sp)
++ ldw r22, 24(sp)
++ addi sp, sp, 28
++ cfi_adjust_cfa_offset (-28)
++
++ /* Jump to the newly found address. */
++ jmp r2
++
++ cfi_endproc
+Index: glibc-2.5/sysdeps/nios2/elf/start.S
+===================================================================
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ glibc-2.5/sysdeps/nios2/elf/start.S 2010-05-31 08:56:05.000000000 +0200
+@@ -0,0 +1,132 @@
++/* Startup code for Nios II
++ Copyright (C) 1995, 1996, 1997, 1998, 2001, 2002, 2005
++ Free Software Foundation, Inc.
++ This file is part of the GNU C Library.
++
++ The GNU C Library is free software; you can redistribute it and/or
++ modify it under the terms of the GNU Lesser General Public
++ License as published by the Free Software Foundation; either
++ version 2.1 of the License, or (at your option) any later version.
++
++ In addition to the permissions in the GNU Lesser General Public
++ License, the Free Software Foundation gives you unlimited
++ permission to link the compiled version of this file with other
++ programs, and to distribute those programs without any restriction
++ coming from the use of this file. (The GNU Lesser General Public
++ License restrictions do apply in other respects; for example, they
++ cover modification of the file, and distribution when not linked
++ into another program.)
++
++ Note that people who make modified versions of this file are not
++ obligated to grant this special exception for their modified
++ versions; it is their choice whether to do so. The GNU Lesser
++ General Public License gives permission to release a modified
++ version without this exception; this exception also makes it
++ possible to release a modified version which carries forward this
++ exception.
++
++ The GNU C Library is distributed in the hope that it will be useful,
++ but WITHOUT ANY WARRANTY; without even the implied warranty of
++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++ Lesser General Public License for more details.
++
++ You should have received a copy of the GNU Lesser General Public
++ License along with the GNU C Library; if not, write to the Free
++ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
++ 02111-1307 USA. */
++
++/* This is the canonical entry point, usually the first thing in the text
++ segment.
++
++ Note that the code in the .init section has already been run.
++ This includes _init and _libc_init
++
++ The stack pointer, sp, will point to the argument count on the stack.
++ The initial state of the stack when a userspace process is started is:
++
++ Purpose Start Address Length
++ Unspecified High Addresses
++ Referenced strings, etc. Varies
++ Unspecified
++ Null auxilliary vector entry 4bytes
++ Auxilliary vector entries 8bytes each
++ NULL terminator for envp 4bytes
++ Environment pointers sp+8+4*argc 4bytes each
++ NULL terminator for argv sp+4+4*argc 4bytes
++ Argument pointers sp+4 4bytes each
++ Argument count sp 4bytes
++ Unspecified Low Addresses
++
++ If the application should register a destructor function with atexit,
++ the pointer will be placed in r4. Otherwise r4 will be zero.
++
++ The contents of all other registers are unspecified. User code should
++ set fp to zero to mark the end of the frame chain.
++
++ The auxilliary vector is a series of pairs of 32-bit tag and 32-bit
++ value, terminated by an AT_NULL tag.
++*/
++
++ .text
++ .globl _start
++_start:
++ /* Set up the global pointer. */
++ movhi gp, %hiadj(_gp)
++ addi gp, gp, %lo(_gp)
++
++ /* Save the stack pointer. */
++ mov r2, sp
++
++ /* Create room on the stack for the fini, rtld_fini and stack_end args
++ to __libc_start_main. */
++ subi sp, sp, 12
++
++ /* Push stack_end */
++ stw r2, 8(sp)
++
++ /* Push rtld_fini */
++ stw r4, 4(sp)
++
++ /* Set up the GOT pointer. */
++ nextpc r22
++1: movhi r2, %hiadj(_GLOBAL_OFFSET_TABLE_ - 1b)
++ addi r2, r2, %lo(_GLOBAL_OFFSET_TABLE_ - 1b)
++ add r22, r22, r2
++
++ /* Push fini */
++ ldw r8, %call(__libc_csu_fini)(r22)
++ stw r8, 0(sp)
++
++ /* r7 == init */
++ ldw r7, %call(__libc_csu_init)(r22)
++
++ /* r6 == argv */
++ addi r6, sp, 16
++
++ /* r5 == argc */
++ ldw r5, 12(sp)
++
++ /* r4 == main */
++ ldw r4, %call(main)(r22)
++
++ /* fp == 0 */
++ mov fp, zero
++
++ /* __libc_start_main (main, argc, argv, init, fini, rtld_fini,
++ stack_end) */
++
++ /* Let the libc call main and exit with its return code. */
++ ldw r2, %call(__libc_start_main)(r22)
++ callr r2
++
++ /* should never get here....*/
++ ldw r2, %call(abort)(r22)
++ callr r2
++
++/* Define a symbol for the first piece of initialized data. */
++ .data
++ .globl __data_start
++__data_start:
++ .long 0
++ .weak data_start
++ data_start = __data_start
+Index: glibc-2.5/sysdeps/nios2/jmpbuf-offsets.h
+===================================================================
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ glibc-2.5/sysdeps/nios2/jmpbuf-offsets.h 2010-05-31 08:56:05.000000000 +0200
+@@ -0,0 +1,20 @@
++/* Private macros for accessing __jmp_buf contents. Nios II version.
++ Copyright (C) 2006, 2008 Free Software Foundation, Inc.
++ This file is part of the GNU C Library.
++
++ The GNU C Library is free software; you can redistribute it and/or
++ modify it under the terms of the GNU Lesser General Public
++ License as published by the Free Software Foundation; either
++ version 2.1 of the License, or (at your option) any later version.
++
++ The GNU C Library is distributed in the hope that it will be useful,
++ but WITHOUT ANY WARRANTY; without even the implied warranty of
++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++ Lesser General Public License for more details.
++
++ You should have received a copy of the GNU Lesser General Public
++ License along with the GNU C Library; if not, write to the Free
++ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
++ 02111-1307 USA. */
++
++#define __JMP_BUF_SP 8
+Index: glibc-2.5/sysdeps/nios2/jmpbuf-unwind.h
+===================================================================
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ glibc-2.5/sysdeps/nios2/jmpbuf-unwind.h 2010-05-31 08:56:05.000000000 +0200
+@@ -0,0 +1,36 @@
++/* Copyright (C) 2005,2006 Free Software Foundation, Inc.
++ This file is part of the GNU C Library.
++
++ The GNU C Library is free software; you can redistribute it and/or
++ modify it under the terms of the GNU Lesser General Public
++ License as published by the Free Software Foundation; either
++ version 2.1 of the License, or (at your option) any later version.
++
++ The GNU C Library is distributed in the hope that it will be useful,
++ but WITHOUT ANY WARRANTY; without even the implied warranty of
++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++ Lesser General Public License for more details.
++
++ You should have received a copy of the GNU Lesser General Public
++ License along with the GNU C Library; if not, write to the Free
++ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
++ 02111-1307 USA. */
++
++#include <setjmp.h>
++#include <jmpbuf-offsets.h>
++#include <stdint.h>
++#include <unwind.h>
++
++/* Test if longjmp to JMPBUF would unwind the frame
++ containing a local variable at ADDRESS. */
++#define _JMPBUF_UNWINDS(jmpbuf, address, demangle) \
++ ((void *) (address) < (void *) demangle ((jmpbuf)->__regs[__JMP_BUF_SP]))
++
++#define _JMPBUF_CFA_UNWINDS_ADJ(_jmpbuf, _context, _adj) \
++ _JMPBUF_UNWINDS_ADJ (_jmpbuf, (void *) _Unwind_GetCFA (_context), _adj)
++
++#define _JMPBUF_UNWINDS_ADJ(_jmpbuf, _address, _adj) \
++ ((uintptr_t) (_address) - (_adj) < (uintptr_t) (_jmpbuf)->__regs[__JMP_BUF_SP] - (_adj))
++
++/* We use the normal longjmp for unwinding. */
++#define __libc_unwind_longjmp(buf, val) __libc_longjmp (buf, val)
+Index: glibc-2.5/sysdeps/nios2/ldsodefs.h
+===================================================================
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ glibc-2.5/sysdeps/nios2/ldsodefs.h 2010-05-31 08:56:05.000000000 +0200
+@@ -0,0 +1,42 @@
++/* Run-time dynamic linker data structures for loaded ELF shared objects.
++ Copyright (C) 2000, 2002, 2003, 2006, 2007 Free Software Foundation, Inc.
++ This file is part of the GNU C Library.
++
++ The GNU C Library is free software; you can redistribute it and/or
++ modify it under the terms of the GNU Lesser General Public
++ License as published by the Free Software Foundation; either
++ version 2.1 of the License, or (at your option) any later version.
++
++ The GNU C Library is distributed in the hope that it will be useful,
++ but WITHOUT ANY WARRANTY; without even the implied warranty of
++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++ Lesser General Public License for more details.
++
++ You should have received a copy of the GNU Lesser General Public
++ License along with the GNU C Library; if not, write to the Free
++ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
++ 02111-1307 USA. */
++
++#ifndef _NIOS2_LDSODEFS_H
++#define _NIOS2_LDSODEFS_H 1
++
++struct La_nios2_regs;
++struct La_nios2_retval;
++
++#define ARCH_PLTENTER_MEMBERS \
++ Elf32_Addr (*nios2_gnu_pltenter) (Elf32_Sym *, unsigned int, \
++ uintptr_t *, uintptr_t *, \
++ const struct La_nios2_regs *, \
++ unsigned int *, const char *name, \
++ long int *framesizep);
++
++#define ARCH_PLTEXIT_MEMBERS \
++ unsigned int (*nios2_gnu_pltexit) (Elf64_Sym *, unsigned int, \
++ uintptr_t *, uintptr_t *, \
++ const struct La_nios2_regs *, \
++ struct La_nios2_retval *, \
++ const char *);
++
++#include_next <ldsodefs.h>
++
++#endif
+Index: glibc-2.5/sysdeps/nios2/libc-tls.c
+===================================================================
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ glibc-2.5/sysdeps/nios2/libc-tls.c 2010-05-31 08:56:05.000000000 +0200
+@@ -0,0 +1,37 @@
++/* Thread-local storage handling in the ELF dynamic linker. Nios II version.
++ Copyright (C) 2005, 2008 Free Software Foundation, Inc.
++ This file is part of the GNU C Library.
++
++ The GNU C Library is free software; you can redistribute it and/or
++ modify it under the terms of the GNU Lesser General Public
++ License as published by the Free Software Foundation; either
++ version 2.1 of the License, or (at your option) any later version.
++
++ The GNU C Library is distributed in the hope that it will be useful,
++ but WITHOUT ANY WARRANTY; without even the implied warranty of
++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++ Lesser General Public License for more details.
++
++ You should have received a copy of the GNU Lesser General Public
++ License along with the GNU C Library; if not, write to the Free
++ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
++ 02111-1307 USA. */
++
++#include <csu/libc-tls.c>
++#include <dl-tls.h>
++
++#if USE_TLS
++
++/* On Nios II, linker optimizations are not required, so __tls_get_addr
++ can be called even in statically linked binaries. In this case module
++ must be always 1 and PT_TLS segment exist in the binary, otherwise it
++ would not link. */
++
++void *
++__tls_get_addr (tls_index *ti)
++{
++ dtv_t *dtv = THREAD_DTV ();
++ return (char *) dtv[1].pointer.val + GET_ADDR_OFFSET;
++}
++
++#endif
+Index: glibc-2.5/sysdeps/nios2/machine-gmon.h
+===================================================================
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ glibc-2.5/sysdeps/nios2/machine-gmon.h 2010-05-31 08:56:05.000000000 +0200
+@@ -0,0 +1,67 @@
++/* Machine-dependent definitions for profiling support. Nios II version.
++ Copyright (C) 1996, 1997, 1998, 2008 Free Software Foundation, Inc.
++ This file is part of the GNU C Library.
++
++ The GNU C Library is free software; you can redistribute it and/or
++ modify it under the terms of the GNU Lesser General Public
++ License as published by the Free Software Foundation; either
++ version 2.1 of the License, or (at your option) any later version.
++
++ The GNU C Library is distributed in the hope that it will be useful,
++ but WITHOUT ANY WARRANTY; without even the implied warranty of
++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++ Lesser General Public License for more details.
++
++ You should have received a copy of the GNU Lesser General Public
++ License along with the GNU C Library; if not, write to the Free
++ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
++ 02111-1307 USA. */
++
++#include <sysdep.h>
++
++#define _MCOUNT_DECL(frompc, selfpc) \
++static void __attribute_used__ mcount_internal (u_long frompc, u_long selfpc)
++
++/* This macro/func MUST save r4, r5, r6, r7 and r8 because the compiler inserts
++ blind calls to mcount(), ignoring the fact that mcount may clobber
++ registers; therefore, mcount may NOT clobber registers. */
++
++#if defined(__PIC__) || defined(PIC)
++#define NIOS2_MCOUNT_CALL \
++ "nextpc r3\n\t" \
++ "1: movhi r2, %hiadj(_GLOBAL_OFFSET_TABLE_ - 1b)\n\t" \
++ "addi r2, r2, %lo(_GLOBAL_OFFSET_TABLE_ - 1b)\n\t" \
++ "add r2, r2, r3\n\t" \
++ "ldw r2, %call(mcount_internal)(r2)\n\t" \
++ "callr r2\n\t"
++#else
++#define NIOS2_MCOUNT_CALL \
++ "call\tmcount_internal\n\t"
++#endif
++
++#define MCOUNT \
++asm( \
++ ".globl _mcount\n\t" \
++ ".type _mcount,@function\n\t" \
++ "_mcount:\n\t" \
++ "subi sp, sp, 24\n\t" \
++ "stw ra, 20(sp)\n\t" \
++ "stw r8, 16(sp)\n\t" \
++ "stw r7, 12(sp)\n\t" \
++ "stw r6, 8(sp)\n\t" \
++ "stw r5, 4(sp)\n\t" \
++ "stw r4, 0(sp)\n\t" \
++ "mov r4, r8\n\t" \
++ "mov r5, ra\n\t" \
++ NIOS2_MCOUNT_CALL \
++ "ldw ra, 20(sp)\n\t" \
++ "ldw r8, 16(sp)\n\t" \
++ "ldw r7, 12(sp)\n\t" \
++ "ldw r6, 8(sp)\n\t" \
++ "ldw r5, 4(sp)\n\t" \
++ "ldw r4, 0(sp)\n\t" \
++ "addi sp, sp, 24\n\t" \
++ "ret\n\t" \
++ ".size _mcount, . - _mcount\n\t" \
++);
++
+Index: glibc-2.5/sysdeps/nios2/memusage.h
+===================================================================
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ glibc-2.5/sysdeps/nios2/memusage.h 2010-05-31 08:56:05.000000000 +0200
+@@ -0,0 +1,24 @@
++/* Copyright (C) 2000 Free Software Foundation, Inc.
++ This file is part of the GNU C Library.
++
++ The GNU C Library is free software; you can redistribute it and/or
++ modify it under the terms of the GNU Lesser General Public
++ License as published by the Free Software Foundation; either
++ version 2.1 of the License, or (at your option) any later version.
++
++ The GNU C Library is distributed in the hope that it will be useful,
++ but WITHOUT ANY WARRANTY; without even the implied warranty of
++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++ Lesser General Public License for more details.
++
++ You should have received a copy of the GNU Lesser General Public
++ License along with the GNU C Library; if not, write to the Free
++ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
++ 02111-1307 USA. */
++
++
++#define GETSP() ({ register uintptr_t stack_ptr asm ("%sp"); stack_ptr; })
++
++#define uatomic32_t unsigned int
++
++#include <sysdeps/generic/memusage.h>
+Index: glibc-2.5/sysdeps/nios2/nptl/pthread_spin_lock.c
+===================================================================
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ glibc-2.5/sysdeps/nios2/nptl/pthread_spin_lock.c 2010-05-31 08:56:05.000000000 +0200
+@@ -0,0 +1,30 @@
++/* Copyright (C) 2005, 2007 Free Software Foundation, Inc.
++ This file is part of the GNU C Library.
++
++ The GNU C Library is free software; you can redistribute it and/or
++ modify it under the terms of the GNU Lesser General Public
++ License as published by the Free Software Foundation; either
++ version 2.1 of the License, or (at your option) any later version.
++
++ The GNU C Library is distributed in the hope that it will be useful,
++ but WITHOUT ANY WARRANTY; without even the implied warranty of
++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++ Lesser General Public License for more details.
++
++ You should have received a copy of the GNU Lesser General Public
++ License along with the GNU C Library; if not, write to the Free
++ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
++ 02111-1307 USA. */
++
++#include <atomic.h>
++#include "pthreadP.h"
++
++int
++pthread_spin_lock (pthread_spinlock_t *lock)
++{
++ while (atomic_compare_and_exchange_val_acq(lock, 1, 0) != 0)
++ while (*lock != 0)
++ ;
++
++ return 0;
++}
+Index: glibc-2.5/sysdeps/nios2/nptl/pthread_spin_trylock.c
+===================================================================
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ glibc-2.5/sysdeps/nios2/nptl/pthread_spin_trylock.c 2010-05-31 08:56:05.000000000 +0200
+@@ -0,0 +1,27 @@
++/* Copyright (C) 2005, 2007 Free Software Foundation, Inc.
++ This file is part of the GNU C Library.
++
++ The GNU C Library is free software; you can redistribute it and/or
++ modify it under the terms of the GNU Lesser General Public
++ License as published by the Free Software Foundation; either
++ version 2.1 of the License, or (at your option) any later version.
++
++ The GNU C Library is distributed in the hope that it will be useful,
++ but WITHOUT ANY WARRANTY; without even the implied warranty of
++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++ Lesser General Public License for more details.
++
++ You should have received a copy of the GNU Lesser General Public
++ License along with the GNU C Library; if not, write to the Free
++ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
++ 02111-1307 USA. */
++
++#include <errno.h>
++#include <atomic.h>
++#include "pthreadP.h"
++
++int
++pthread_spin_trylock (pthread_spinlock_t *lock)
++{
++ return atomic_compare_and_exchange_val_acq(lock, 1, 0) ? EBUSY : 0;
++}
+Index: glibc-2.5/sysdeps/nios2/nptl/pthreaddef.h
+===================================================================
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ glibc-2.5/sysdeps/nios2/nptl/pthreaddef.h 2010-05-31 08:56:05.000000000 +0200
+@@ -0,0 +1,46 @@
++/* Copyright (C) 2002, 2003, 2005 Free Software Foundation, Inc.
++ This file is part of the GNU C Library.
++
++ The GNU C Library is free software; you can redistribute it and/or
++ modify it under the terms of the GNU Lesser General Public
++ License as published by the Free Software Foundation; either
++ version 2.1 of the License, or (at your option) any later version.
++
++ The GNU C Library is distributed in the hope that it will be useful,
++ but WITHOUT ANY WARRANTY; without even the implied warranty of
++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++ Lesser General Public License for more details.
++
++ You should have received a copy of the GNU Lesser General Public
++ License along with the GNU C Library; if not, write to the Free
++ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
++ 02111-1307 USA. */
++
++/* Default stack size. */
++#define ARCH_STACK_DEFAULT_SIZE (2 * 1024 * 1024)
++
++/* Required stack pointer alignment at beginning. */
++#define STACK_ALIGN 4
++
++/* Minimal stack size after allocating thread descriptor and guard size. */
++#define MINIMAL_REST_STACK 2048
++
++/* Alignment requirement for TCB. */
++#define TCB_ALIGNMENT 4
++
++
++/* Location of current stack frame.
++
++ __builtin_frame_address (0) returns the value of the hard frame
++ pointer, which will point at the location of the saved PC on the
++ stack. Below this in memory is the remainder of the linkage info,
++ occupying 12 bytes. Therefore in order to address from
++ CURRENT_STACK_FRAME using "struct layout", we need to have the macro
++ return the hard FP minus 12. Of course, this makes no sense
++ without the obsolete APCS stack layout... */
++#define CURRENT_STACK_FRAME (__builtin_frame_address (0) - 12)
++
++
++/* XXX Until we have a better place keep the definitions here. */
++#define __exit_thread_inline(val) \
++ INLINE_SYSCALL (exit, 1, (val))
+Index: glibc-2.5/sysdeps/nios2/nptl/tcb-offsets.sym
+===================================================================
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ glibc-2.5/sysdeps/nios2/nptl/tcb-offsets.sym 2010-05-31 08:56:05.000000000 +0200
+@@ -0,0 +1,13 @@
++#include <sysdep.h>
++#include <tls.h>
++
++--
++
++-- Abuse tls.h macros to derive offsets relative to the thread register.
++# undef __thread_self
++# define __thread_self ((void *) 0)
++# define thread_offsetof(mem) ((ptrdiff_t) THREAD_SELF + offsetof (struct pthread, mem))
++
++MULTIPLE_THREADS_OFFSET thread_offsetof (header.multiple_threads)
++PID_OFFSET thread_offsetof (pid)
++TID_OFFSET thread_offsetof (tid)
+Index: glibc-2.5/sysdeps/nios2/nptl/tls.h
+===================================================================
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ glibc-2.5/sysdeps/nios2/nptl/tls.h 2010-05-31 08:56:05.000000000 +0200
+@@ -0,0 +1,138 @@
++/* Definition for thread-local data handling. NPTL/Nios II version.
++ Copyright (C) 2005 Free Software Foundation, Inc.
++ This file is part of the GNU C Library.
++
++ The GNU C Library is free software; you can redistribute it and/or
++ modify it under the terms of the GNU Lesser General Public
++ License as published by the Free Software Foundation; either
++ version 2.1 of the License, or (at your option) any later version.
++
++ The GNU C Library is distributed in the hope that it will be useful,
++ but WITHOUT ANY WARRANTY; without even the implied warranty of
++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++ Lesser General Public License for more details.
++
++ You should have received a copy of the GNU Lesser General Public
++ License along with the GNU C Library; if not, write to the Free
++ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
++ 02111-1307 USA. */
++
++#ifndef _TLS_H
++#define _TLS_H 1
++
++#include <dl-sysdep.h>
++
++#ifndef __ASSEMBLER__
++# include <stdbool.h>
++# include <stddef.h>
++# include <stdint.h>
++
++/* Type for the dtv. */
++typedef union dtv
++{
++ size_t counter;
++ struct
++ {
++ void *val;
++ bool is_static;
++ } pointer;
++} dtv_t;
++
++#else /* __ASSEMBLER__ */
++# include <tcb-offsets.h>
++#endif /* __ASSEMBLER__ */
++
++
++/* Signal that TLS support is available. */
++# define USE_TLS 1
++
++#ifndef __ASSEMBLER__
++
++/* Get system call information. */
++# include <sysdep.h>
++
++/* The TP points to the start of the thread blocks. */
++# define TLS_DTV_AT_TP 1
++
++/* Get the thread descriptor definition. */
++# include <nptl/descr.h>
++
++typedef struct
++{
++ dtv_t *dtv;
++ void *private;
++} tcbhead_t;
++
++register struct pthread *__thread_self __asm__("r23");
++
++/* This is the size of the initial TCB. Because our TCB is before the thread
++ pointer, we don't need this. */
++# define TLS_INIT_TCB_SIZE 0
++
++/* Alignment requirements for the initial TCB. */
++# define TLS_INIT_TCB_ALIGN __alignof__ (struct pthread)
++
++/* This is the size of the TCB. Because our TCB is before the thread
++ pointer, we don't need this. */
++# define TLS_TCB_SIZE 0
++
++/* This is the size we need before TCB - actually, it includes the TCB. */
++# define TLS_PRE_TCB_SIZE \
++ (sizeof (struct pthread) \
++ + ((sizeof (tcbhead_t) + TLS_TCB_ALIGN - 1) & ~(TLS_TCB_ALIGN - 1)))
++
++/* The thread pointer (in hardware register r23) points to the end of
++ the TCB + 0x7000, as for PowerPC and MIPS. */
++# define TLS_TCB_OFFSET 0x7000
++
++/* Alignment requirements for the TCB. */
++# define TLS_TCB_ALIGN __alignof__ (struct pthread)
++
++/* Install the dtv pointer. The pointer passed is to the element with
++ index -1 which contain the length. */
++# define INSTALL_DTV(tcbp, dtvp) \
++ (((tcbhead_t *) (tcbp))[-1].dtv = (dtvp) + 1)
++
++/* Install new dtv for current thread. */
++# define INSTALL_NEW_DTV(dtv) \
++ (THREAD_DTV() = (dtv))
++
++/* Return dtv of given thread descriptor. */
++# define GET_DTV(tcbp) \
++ (((tcbhead_t *) (tcbp))[-1].dtv)
++
++/* Code to initially initialize the thread pointer. */
++# define TLS_INIT_TP(tcbp, secondcall) \
++ (__thread_self = (struct pthread *) ((char *) tcbp + TLS_TCB_OFFSET), NULL)
++
++/* Return the address of the dtv for the current thread. */
++# define THREAD_DTV() \
++ (((tcbhead_t *) ((struct pthread *) ((char *) __thread_self \
++ - TLS_TCB_OFFSET)))[-1].dtv)
++
++/* Return the thread descriptor for the current thread. */
++# define THREAD_SELF \
++ ((struct pthread *) ((char *) __thread_self - TLS_TCB_OFFSET - \
++ TLS_PRE_TCB_SIZE))
++
++/* Magic for libthread_db to know how to do THREAD_SELF. */
++# define DB_THREAD_SELF \
++ REGISTER (32, 32, 23 * 4, -TLS_PRE_TCB_SIZE - TLS_TCB_OFFSET)
++
++/* Access to data in the thread descriptor is easy. */
++#define THREAD_GETMEM(descr, member) \
++ descr->member
++#define THREAD_GETMEM_NC(descr, member, idx) \
++ descr->member[idx]
++#define THREAD_SETMEM(descr, member, value) \
++ descr->member = (value)
++#define THREAD_SETMEM_NC(descr, member, idx, value) \
++ descr->member[idx] = (value)
++
++/* l_tls_offset == 0 is perfectly valid on Nios II, so we have to use some
++ different value to mean unset l_tls_offset. */
++# define NO_TLS_OFFSET -1
++
++#endif /* __ASSEMBLER__ */
++
++#endif /* tls.h */
+Index: glibc-2.5/sysdeps/nios2/setjmp.S
+===================================================================
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ glibc-2.5/sysdeps/nios2/setjmp.S 2010-05-31 08:56:05.000000000 +0200
+@@ -0,0 +1,53 @@
++/* Copyright (C) 1991, 1992, 1994, 1997, 2008 Free Software Foundation, Inc.
++ This file is part of the GNU C Library.
++
++ The GNU C Library is free software; you can redistribute it and/or
++ modify it under the terms of the GNU Lesser General Public
++ License as published by the Free Software Foundation; either
++ version 2.1 of the License, or (at your option) any later version.
++
++ The GNU C Library is distributed in the hope that it will be useful,
++ but WITHOUT ANY WARRANTY; without even the implied warranty of
++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++ Lesser General Public License for more details.
++
++ You should have received a copy of the GNU Lesser General Public
++ License along with the GNU C Library; if not, write to the Free
++ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
++ 02111-1307 USA.
++*/
++
++/* Save the current program position in ENV and return 0. */
++ .text
++ .globl __sigsetjmp
++__sigsetjmp:
++ stw r16, 0(r4)
++ stw r17, 4(r4)
++ stw r18, 8(r4)
++ stw r19, 12(r4)
++ stw r20, 16(r4)
++ stw r21, 20(r4)
++ stw r22, 24(r4)
++ stw r23, 28(r4)
++ stw sp, 32(r4)
++ stw fp, 36(r4)
++ stw ra, 40(r4)
++#if defined NOT_IN_libc && defined IS_IN_rtld
++ /* In ld.so we never save the signal mask. */
++ mov r2, zero
++ ret
++#else
++ /* Save the signal mask if requested. */
++#if defined(__PIC__) || defined(PIC)
++ nextpc r2
++1: movhi r3, %hiadj(_GLOBAL_OFFSET_TABLE_ - 1b)
++ addi r3, r3, %lo(_GLOBAL_OFFSET_TABLE_ - 1b)
++ add r2, r2, r3
++ ldw r2, %call(__sigjmp_save)(r2)
++ jmp r2
++#else
++ jmpi __sigjmp_save
++#endif
++#endif
++
++libc_hidden_def (__sigsetjmp)
+Index: glibc-2.5/sysdeps/nios2/shlib-versions
+===================================================================
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ glibc-2.5/sysdeps/nios2/shlib-versions 2010-05-31 08:56:05.000000000 +0200
+@@ -0,0 +1 @@
++nios2-.*-linux.* DEFAULT GLIBC_2.10
+Index: glibc-2.5/sysdeps/nios2/soft-fp/sfp-machine.h
+===================================================================
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ glibc-2.5/sysdeps/nios2/soft-fp/sfp-machine.h 2010-05-31 08:56:05.000000000 +0200
+@@ -0,0 +1,41 @@
++#define _FP_W_TYPE_SIZE 32
++#define _FP_W_TYPE unsigned long
++#define _FP_WS_TYPE signed long
++#define _FP_I_TYPE long
++
++#define _FP_MUL_MEAT_S(R,X,Y) \
++ _FP_MUL_MEAT_1_wide(_FP_WFRACBITS_S,R,X,Y,umul_ppmm)
++#define _FP_MUL_MEAT_D(R,X,Y) \
++ _FP_MUL_MEAT_2_wide(_FP_WFRACBITS_D,R,X,Y,umul_ppmm)
++#define _FP_MUL_MEAT_Q(R,X,Y) \
++ _FP_MUL_MEAT_4_wide(_FP_WFRACBITS_Q,R,X,Y,umul_ppmm)
++
++#define _FP_DIV_MEAT_S(R,X,Y) _FP_DIV_MEAT_1_loop(S,R,X,Y)
++#define _FP_DIV_MEAT_D(R,X,Y) _FP_DIV_MEAT_2_udiv(D,R,X,Y)
++#define _FP_DIV_MEAT_Q(R,X,Y) _FP_DIV_MEAT_4_udiv(Q,R,X,Y)
++
++#define _FP_NANFRAC_S ((_FP_QNANBIT_S << 1) - 1)
++#define _FP_NANFRAC_D ((_FP_QNANBIT_D << 1) - 1), -1
++#define _FP_NANFRAC_Q ((_FP_QNANBIT_Q << 1) - 1), -1, -1, -1
++#define _FP_NANSIGN_S 0
++#define _FP_NANSIGN_D 0
++#define _FP_NANSIGN_Q 0
++
++#define _FP_KEEPNANFRACP 1
++
++/* This is arbitrarily taken from the PowerPC version. */
++#define _FP_CHOOSENAN(fs, wc, R, X, Y, OP) \
++ do { \
++ if ((_FP_FRAC_HIGH_RAW_##fs(X) & _FP_QNANBIT_##fs) \
++ && !(_FP_FRAC_HIGH_RAW_##fs(Y) & _FP_QNANBIT_##fs)) \
++ { \
++ R##_s = Y##_s; \
++ _FP_FRAC_COPY_##wc(R,Y); \
++ } \
++ else \
++ { \
++ R##_s = X##_s; \
++ _FP_FRAC_COPY_##wc(R,X); \
++ } \
++ R##_c = FP_CLS_NAN; \
++ } while (0)
+Index: glibc-2.5/sysdeps/nios2/stackinfo.h
+===================================================================
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ glibc-2.5/sysdeps/nios2/stackinfo.h 2010-05-31 08:56:05.000000000 +0200
+@@ -0,0 +1,28 @@
++/* Copyright (C) 2001, 2008 Free Software Foundation, Inc.
++ This file is part of the GNU C Library.
++
++ The GNU C Library is free software; you can redistribute it and/or
++ modify it under the terms of the GNU Lesser General Public
++ License as published by the Free Software Foundation; either
++ version 2.1 of the License, or (at your option) any later version.
++
++ The GNU C Library is distributed in the hope that it will be useful,
++ but WITHOUT ANY WARRANTY; without even the implied warranty of
++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++ Lesser General Public License for more details.
++
++ You should have received a copy of the GNU Lesser General Public
++ License along with the GNU C Library; if not, write to the Free
++ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
++ 02111-1307 USA. */
++
++/* This file contains a bit of information about the stack allocation
++ of the processor. */
++
++#ifndef _STACKINFO_H
++#define _STACKINFO_H 1
++
++/* On Nios II the stack grows down. */
++#define _STACK_GROWS_DOWN 1
++
++#endif /* stackinfo.h */
+Index: glibc-2.5/sysdeps/nios2/tls-macros.h
+===================================================================
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ glibc-2.5/sysdeps/nios2/tls-macros.h 2010-05-31 08:56:05.000000000 +0200
+@@ -0,0 +1,46 @@
++#define TLS_LE(x) \
++ ({ int *__result; \
++ asm ("addi %0, r23, %%tls_le(" #x ")" \
++ : "=r" (__result)); \
++ __result; })
++
++#define TLS_IE(x) \
++ ({ int *__result; \
++ int __tmp; \
++ asm ("nextpc %0 ; " \
++ "1: movhi %1, %%hiadj(_GLOBAL_OFFSET_TABLE_ - 1b) ; " \
++ "addi %1, %1, %%lo(_GLOBAL_OFFSET_TABLE_ - 1b) ; " \
++ "add %0, %0, %1 ; " \
++ "ldw %1, %%tls_ie(" #x ")(%0) ; " \
++ "add %1, r23, %1" \
++ : "=&r" (__tmp), "=&r" (__result)); \
++ __result; })
++
++#define TLS_LD(x) \
++ ({ char *__result; \
++ char *__result2; \
++ int *__result3; \
++ int __tmp; \
++ extern void *__tls_get_addr (void *); \
++ asm ("nextpc %0 ; " \
++ "1: movhi %1, %%hiadj(_GLOBAL_OFFSET_TABLE_ - 1b) ; " \
++ "addi %1, %1, %%lo(_GLOBAL_OFFSET_TABLE_ - 1b) ; " \
++ "add %0, %0, %1 ; " \
++ "addi %0, %0, %%tls_ldm(" #x ")" \
++ : "=r" (__result), "=r" (__tmp)); \
++ __result2 = (char *)__tls_get_addr (__result); \
++ asm ("addi %0, %1, %%tls_ldo(" #x ")" \
++ : "=r" (__result3) : "r" (__result2)); \
++ __result3; })
++
++#define TLS_GD(x) \
++ ({ int *__result; \
++ int __tmp; \
++ extern void *__tls_get_addr (void *); \
++ asm ("nextpc %0 ; " \
++ "1: movhi %1, %%hiadj(_GLOBAL_OFFSET_TABLE_ - 1b) ; " \
++ "addi %1, %1, %%lo(_GLOBAL_OFFSET_TABLE_ - 1b) ; " \
++ "add %0, %0, %1 ; " \
++ "addi %0, %0, %%tls_gd(" #x ")" \
++ : "=r" (__result), "=r" (__tmp)); \
++ (int *)__tls_get_addr (__result); })
+Index: glibc-2.5/sysdeps/nios2/tst-audit.h
+===================================================================
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ glibc-2.5/sysdeps/nios2/tst-audit.h 2010-05-31 08:56:05.000000000 +0200
+@@ -0,0 +1,26 @@
++/* Definitions for testing PLT entry/exit auditing. Nios II version.
++
++ Copyright (C) 2009 Free Software Foundation, Inc.
++
++ This file is part of the GNU C Library.
++
++ The GNU C Library is free software; you can redistribute it and/or
++ modify it under the terms of the GNU Lesser General Public
++ License as published by the Free Software Foundation; either
++ version 2.1 of the License, or (at your option) any later version.
++
++ The GNU C Library is distributed in the hope that it will be useful,
++ but WITHOUT ANY WARRANTY; without even the implied warranty of
++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++ Lesser General Public License for more details.
++
++ You should have received a copy of the GNU Lesser General Public
++ License along with the GNU C Library; if not, write to the Free
++ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
++ 02111-1307 USA. */
++
++#define pltenter la_nios2_gnu_pltenter
++#define pltexit la_nios2_gnu_pltexit
++#define La_regs La_nios2_regs
++#define La_retval La_nios2_retval
++#define int_retval lrv_r2
+Index: glibc-2.5/sysdeps/unix/sysv/linux/nios2/bits/atomic.h
+===================================================================
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ glibc-2.5/sysdeps/unix/sysv/linux/nios2/bits/atomic.h 2010-05-31 08:56:05.000000000 +0200
+@@ -0,0 +1,113 @@
++/* Copyright (C) 2003, 2008 Free Software Foundation, Inc.
++ This file is part of the GNU C Library.
++
++ The GNU C Library is free software; you can redistribute it and/or
++ modify it under the terms of the GNU Lesser General Public
++ License as published by the Free Software Foundation; either
++ version 2.1 of the License, or (at your option) any later version.
++
++ The GNU C Library is distributed in the hope that it will be useful,
++ but WITHOUT ANY WARRANTY; without even the implied warranty of
++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++ Lesser General Public License for more details.
++
++ You should have received a copy of the GNU Lesser General Public
++ License along with the GNU C Library; if not, write to the Free
++ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
++ 02111-1307 USA. */
++
++#include <stdint.h>
++
++typedef int8_t atomic8_t;
++typedef uint8_t uatomic8_t;
++typedef int_fast8_t atomic_fast8_t;
++typedef uint_fast8_t uatomic_fast8_t;
++
++typedef int16_t atomic16_t;
++typedef uint16_t uatomic16_t;
++typedef int_fast16_t atomic_fast16_t;
++typedef uint_fast16_t uatomic_fast16_t;
++
++typedef int32_t atomic32_t;
++typedef uint32_t uatomic32_t;
++typedef int_fast32_t atomic_fast32_t;
++typedef uint_fast32_t uatomic_fast32_t;
++
++typedef intptr_t atomicptr_t;
++typedef uintptr_t uatomicptr_t;
++typedef intmax_t atomic_max_t;
++typedef uintmax_t uatomic_max_t;
++
++void __nios2_link_error (void);
++
++#define __arch_compare_and_exchange_bool_8_acq(mem, newval, oldval) \
++ (abort (), 0)
++
++#define __arch_compare_and_exchange_bool_16_acq(mem, newval, oldval) \
++ (abort (), 0)
++
++#define __arch_compare_and_exchange_bool_32_acq(mem, newval, oldval) \
++ (!__sync_bool_compare_and_swap ((mem), (int) (long) (oldval), \
++ (int) (long) (newval)))
++
++#define __arch_compare_and_exchange_bool_64_acq(mem, newval, oldval) \
++ ({ __nios2_link_error (); oldval; })
++
++#define __arch_compare_and_exchange_val_8_acq(mem, newval, oldval) \
++ (abort (), (__typeof (*mem)) 0)
++
++#define __arch_compare_and_exchange_val_16_acq(mem, newval, oldval) \
++ (abort (), (__typeof (*mem)) 0)
++
++#define __arch_compare_and_exchange_val_32_acq(mem, newval, oldval) \
++ __sync_val_compare_and_swap ((mem), (int) (long) (oldval), \
++ (int) (long) (newval))
++
++#define __arch_compare_and_exchange_val_64_acq(mem, newval, oldval) \
++ ({ __nios2_link_error (); oldval; })
++
++/* Atomically store newval and return the old value. */
++#define atomic_exchange_acq(mem, value) \
++ __sync_lock_test_and_set (mem, value)
++
++#define atomic_exchange_rel(mem, value) \
++ (__sync_synchronize (), __sync_lock_test_and_set (mem, value))
++
++#define atomic_exchange_and_add(mem, value) \
++ ({ __typeof (*mem) __result; \
++ __result = __sync_fetch_and_add ((mem), (int) (value)); \
++ __result; })
++
++#define atomic_decrement_if_positive(mem) \
++ ({ __typeof (*mem) __oldval, __val; \
++ __typeof (mem) __memp = (mem); \
++ \
++ __val = (*__memp); \
++ do \
++ { \
++ __oldval = __val; \
++ if (__builtin_expect (__val <= 0, 0)) \
++ break; \
++ __val = atomic_compare_and_exchange_val_acq (__memp, __oldval - 1, \
++ __oldval); \
++ } \
++ while (__builtin_expect (__val != __oldval, 0)); \
++ __oldval; })
++
++#define atomic_bit_test_set(mem, bit) \
++ ({ __typeof (*mem) __oldval, __val; \
++ __typeof (mem) __memp = (mem); \
++ __typeof (*mem) __mask = ((__typeof (*mem)) 1 << (bit)); \
++ \
++ __val = (*__memp); \
++ do \
++ { \
++ __oldval = __val; \
++ __val = atomic_compare_and_exchange_val_acq (__memp, \
++ __oldval | __mask, \
++ __oldval); \
++ } \
++ while (__builtin_expect (__val != __oldval, 0)); \
++ __oldval & __mask; })
++
++#define atomic_full_barrier() __sync_synchronize ()
+Index: glibc-2.5/sysdeps/unix/sysv/linux/nios2/bits/fcntl.h
+===================================================================
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ glibc-2.5/sysdeps/unix/sysv/linux/nios2/bits/fcntl.h 2010-05-31 08:56:05.000000000 +0200
+@@ -0,0 +1,237 @@
++/* O_*, F_*, FD_* bit values for Linux.
++ Copyright (C) 1995-1998, 2000, 2004, 2006, 2008 Free Software Foundation,
++ Inc.
++ This file is part of the GNU C Library.
++
++ The GNU C Library is free software; you can redistribute it and/or
++ modify it under the terms of the GNU Lesser General Public
++ License as published by the Free Software Foundation; either
++ version 2.1 of the License, or (at your option) any later version.
++
++ The GNU C Library is distributed in the hope that it will be useful,
++ but WITHOUT ANY WARRANTY; without even the implied warranty of
++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++ Lesser General Public License for more details.
++
++ You should have received a copy of the GNU Lesser General Public
++ License along with the GNU C Library; if not, write to the Free
++ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
++ 02111-1307 USA. */
++
++#ifndef _FCNTL_H
++# error "Never use <bits/fcntl.h> directly; include <fcntl.h> instead."
++#endif
++
++#include <sys/types.h>
++#ifdef __USE_GNU
++# include <bits/uio.h>
++#endif
++
++
++/* open/fcntl - O_SYNC is only implemented on blocks devices and on files
++ located on an ext2 file system */
++#define O_ACCMODE 0003
++#define O_RDONLY 00
++#define O_WRONLY 01
++#define O_RDWR 02
++#define O_CREAT 0100 /* not fcntl */
++#define O_EXCL 0200 /* not fcntl */
++#define O_NOCTTY 0400 /* not fcntl */
++#define O_TRUNC 01000 /* not fcntl */
++#define O_APPEND 02000
++#define O_NONBLOCK 04000
++#define O_NDELAY O_NONBLOCK
++#define O_SYNC 010000
++#define O_FSYNC O_SYNC
++#define O_ASYNC 020000
++
++#ifdef __USE_GNU
++# define O_DIRECTORY 040000 /* Must be a directory. */
++# define O_NOFOLLOW 0100000 /* Do not follow links. */
++# define O_DIRECT 0200000 /* Direct disk access. */
++# define O_NOATIME 01000000 /* Do not set atime. */
++#endif
++
++/* For now Linux has synchronisity options for data and read operations.
++ We define the symbols here but let them do the same as O_SYNC since
++ this is a superset. */
++#if defined __USE_POSIX199309 || defined __USE_UNIX98
++# define O_DSYNC O_SYNC /* Synchronize data. */
++# define O_RSYNC O_SYNC /* Synchronize read operations. */
++#endif
++
++#ifdef __USE_LARGEFILE64
++# define O_LARGEFILE 0400000
++#endif
++
++/* Values for the second argument to `fcntl'. */
++#define F_DUPFD 0 /* Duplicate file descriptor. */
++#define F_GETFD 1 /* Get file descriptor flags. */
++#define F_SETFD 2 /* Set file descriptor flags. */
++#define F_GETFL 3 /* Get file status flags. */
++#define F_SETFL 4 /* Set file status flags. */
++#ifndef __USE_FILE_OFFSET64
++# define F_GETLK 5 /* Get record locking info. */
++# define F_SETLK 6 /* Set record locking info (non-blocking). */
++# define F_SETLKW 7 /* Set record locking info (blocking). */
++#else
++# define F_GETLK F_GETLK64 /* Get record locking info. */
++# define F_SETLK F_SETLK64 /* Set record locking info (non-blocking).*/
++# define F_SETLKW F_SETLKW64 /* Set record locking info (blocking). */
++#endif
++#define F_GETLK64 12 /* Get record locking info. */
++#define F_SETLK64 13 /* Set record locking info (non-blocking). */
++#define F_SETLKW64 14 /* Set record locking info (blocking). */
++
++#if defined __USE_BSD || defined __USE_UNIX98
++# define F_SETOWN 8 /* Get owner of socket (receiver of SIGIO). */
++# define F_GETOWN 9 /* Set owner of socket (receiver of SIGIO). */
++#endif
++
++#ifdef __USE_GNU
++# define F_SETSIG 10 /* Set number of signal to be sent. */
++# define F_GETSIG 11 /* Get number of signal to be sent. */
++#endif
++
++#ifdef __USE_GNU
++# define F_SETLEASE 1024 /* Set a lease. */
++# define F_GETLEASE 1025 /* Enquire what lease is active. */
++# define F_NOTIFY 1026 /* Request notfications on a directory. */
++#endif
++
++/* For F_[GET|SET]FL. */
++#define FD_CLOEXEC 1 /* actually anything with low bit set goes */
++
++/* For posix fcntl() and `l_type' field of a `struct flock' for lockf(). */
++#define F_RDLCK 0 /* Read lock. */
++#define F_WRLCK 1 /* Write lock. */
++#define F_UNLCK 2 /* Remove lock. */
++
++/* For old implementation of bsd flock(). */
++#define F_EXLCK 4 /* or 3 */
++#define F_SHLCK 8 /* or 4 */
++
++#ifdef __USE_BSD
++/* Operations for bsd flock(), also used by the kernel implementation. */
++# define LOCK_SH 1 /* shared lock */
++# define LOCK_EX 2 /* exclusive lock */
++# define LOCK_NB 4 /* or'd with one of the above to prevent
++ blocking */
++# define LOCK_UN 8 /* remove lock */
++#endif
++
++#ifdef __USE_GNU
++# define LOCK_MAND 32 /* This is a mandatory flock: */
++# define LOCK_READ 64 /* ... which allows concurrent read operations. */
++# define LOCK_WRITE 128 /* ... which allows concurrent write operations. */
++# define LOCK_RW 192 /* ... Which allows concurrent read & write operations. */
++#endif
++
++#ifdef __USE_GNU
++/* Types of directory notifications that may be requested with F_NOTIFY. */
++# define DN_ACCESS 0x00000001 /* File accessed. */
++# define DN_MODIFY 0x00000002 /* File modified. */
++# define DN_CREATE 0x00000004 /* File created. */
++# define DN_DELETE 0x00000008 /* File removed. */
++# define DN_RENAME 0x00000010 /* File renamed. */
++# define DN_ATTRIB 0x00000020 /* File changed attibutes. */
++# define DN_MULTISHOT 0x80000000 /* Don't remove notifier. */
++#endif
++
++struct flock
++ {
++ short int l_type; /* Type of lock: F_RDLCK, F_WRLCK, or F_UNLCK. */
++ short int l_whence; /* Where `l_start' is relative to (like `lseek'). */
++#ifndef __USE_FILE_OFFSET64
++ __off_t l_start; /* Offset where the lock begins. */
++ __off_t l_len; /* Size of the locked area; zero means until EOF. */
++#else
++ __off64_t l_start; /* Offset where the lock begins. */
++ __off64_t l_len; /* Size of the locked area; zero means until EOF. */
++#endif
++ __pid_t l_pid; /* Process holding the lock. */
++ };
++
++#ifdef __USE_LARGEFILE64
++struct flock64
++ {
++ short int l_type; /* Type of lock: F_RDLCK, F_WRLCK, or F_UNLCK. */
++ short int l_whence; /* Where `l_start' is relative to (like `lseek'). */
++ __off64_t l_start; /* Offset where the lock begins. */
++ __off64_t l_len; /* Size of the locked area; zero means until EOF. */
++ __pid_t l_pid; /* Process holding the lock. */
++ };
++#endif
++
++/* Define some more compatibility macros to be backward compatible with
++ BSD systems which did not managed to hide these kernel macros. */
++#ifdef __USE_BSD
++# define FAPPEND O_APPEND
++# define FFSYNC O_FSYNC
++# define FASYNC O_ASYNC
++# define FNONBLOCK O_NONBLOCK
++# define FNDELAY O_NDELAY
++#endif /* Use BSD. */
++
++/* Advise to `posix_fadvise'. */
++#ifdef __USE_XOPEN2K
++# define POSIX_FADV_NORMAL 0 /* No further special treatment. */
++# define POSIX_FADV_RANDOM 1 /* Expect random page references. */
++# define POSIX_FADV_SEQUENTIAL 2 /* Expect sequential page references. */
++# define POSIX_FADV_WILLNEED 3 /* Will need these pages. */
++# define POSIX_FADV_DONTNEED 4 /* Don't need these pages. */
++# define POSIX_FADV_NOREUSE 5 /* Data will be accessed once. */
++#endif
++
++
++#ifdef __USE_GNU
++/* Flags for SYNC_FILE_RANGE. */
++# define SYNC_FILE_RANGE_WAIT_BEFORE 1 /* Wait upon writeout of all pages
++ in the range before performing the
++ write. */
++# define SYNC_FILE_RANGE_WRITE 2 /* Initiate writeout of all those
++ dirty pages in the range which are
++ not presently under writeback. */
++# define SYNC_FILE_RANGE_WAIT_AFTER 4 /* Wait upon writeout of all pages in
++ the range after performing the
++ write. */
++
++/* Flags for SPLICE and VMSPLICE. */
++# define SPLICE_F_MOVE 1 /* Move pages instead of copying. */
++# define SPLICE_F_NONBLOCK 2 /* Don't block on the pipe splicing
++ (but we may still block on the fd
++ we splice from/to). */
++# define SPLICE_F_MORE 4 /* Expect more data. */
++# define SPLICE_F_GIFT 8 /* Pages passed in are a gift. */
++#endif
++
++__BEGIN_DECLS
++
++#ifdef __USE_GNU
++
++/* Provide kernel hint to read ahead. */
++extern ssize_t readahead (int __fd, __off64_t __offset, size_t __count)
++ __THROW;
++
++
++/* Selective file content synch'ing. */
++extern int sync_file_range (int __fd, __off64_t __from, __off64_t __to,
++ unsigned int __flags);
++
++
++/* Splice address range into a pipe. */
++extern int vmsplice (int __fdout, const struct iovec *__iov, size_t __count,
++ unsigned int __flags);
++
++/* Splice two files together. */
++extern int splice (int __fdin, __off64_t *__offin, int __fdout,
++ __off64_t *__offout, size_t __len, unsigned int __flags)
++ __THROW;
++
++/* In-kernel implementation of tee for pipe buffers. */
++extern int tee (int __fdin, int __fdout, size_t __len, unsigned int __flags)
++ __THROW;
++
++#endif
++
++__END_DECLS
+Index: glibc-2.5/sysdeps/unix/sysv/linux/nios2/bits/mman.h
+===================================================================
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ glibc-2.5/sysdeps/unix/sysv/linux/nios2/bits/mman.h 2010-05-31 08:56:05.000000000 +0200
+@@ -0,0 +1,106 @@
++/* Definitions for POSIX memory map interface. Linux/Nios II version.
++ Copyright (C) 1997, 2000, 2003, 2004, 2005, 2006, 2008
++ Free Software Foundation, Inc.
++ This file is part of the GNU C Library.
++
++ The GNU C Library is free software; you can redistribute it and/or
++ modify it under the terms of the GNU Lesser General Public
++ License as published by the Free Software Foundation; either
++ version 2.1 of the License, or (at your option) any later version.
++
++ The GNU C Library is distributed in the hope that it will be useful,
++ but WITHOUT ANY WARRANTY; without even the implied warranty of
++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++ Lesser General Public License for more details.
++
++ You should have received a copy of the GNU Lesser General Public
++ License along with the GNU C Library; if not, write to the Free
++ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
++ 02111-1307 USA. */
++
++#ifndef _SYS_MMAN_H
++# error "Never use <bits/mman.h> directly; include <sys/mman.h> instead."
++#endif
++
++/* The following definitions basically come from the kernel headers.
++ But the kernel header is not namespace clean. */
++
++
++/* Protections are chosen from these bits, OR'd together. The
++ implementation does not necessarily support PROT_EXEC or PROT_WRITE
++ without PROT_READ. The only guarantees are that no writing will be
++ allowed without PROT_WRITE and no access will be allowed for PROT_NONE. */
++
++#define PROT_READ 0x1 /* Page can be read. */
++#define PROT_WRITE 0x2 /* Page can be written. */
++#define PROT_EXEC 0x4 /* Page can be executed. */
++#define PROT_NONE 0x0 /* Page can not be accessed. */
++#define PROT_GROWSDOWN 0x01000000 /* Extend change to start of
++ growsdown vma (mprotect only). */
++#define PROT_GROWSUP 0x02000000 /* Extend change to start of
++ growsup vma (mprotect only). */
++
++/* Sharing types (must choose one and only one of these). */
++#define MAP_SHARED 0x01 /* Share changes. */
++#define MAP_PRIVATE 0x02 /* Changes are private. */
++#ifdef __USE_MISC
++# define MAP_TYPE 0x0f /* Mask for type of mapping. */
++#endif
++
++/* Other flags. */
++#define MAP_FIXED 0x10 /* Interpret addr exactly. */
++#ifdef __USE_MISC
++# define MAP_FILE 0
++# define MAP_ANONYMOUS 0x0020 /* Don't use a file. */
++# define MAP_ANON MAP_ANONYMOUS
++# define MAP_RENAME MAP_ANONYMOUS
++#endif
++
++/* These are Linux-specific. */
++#ifdef __USE_MISC
++# define MAP_NORESERVE 0x4000 /* don't check for reservations */
++# define MAP_ANONYMOUS 0x0020 /* don't use a file */
++# define MAP_GROWSDOWN 0x0100 /* stack-like segment */
++# define MAP_DENYWRITE 0x0800 /* ETXTBSY */
++# define MAP_EXECUTABLE 0x1000 /* mark it as an executable */
++# define MAP_LOCKED 0x2000 /* pages are locked */
++# define MAP_POPULATE 0x8000 /* populate (prefault) pagetables */
++# define MAP_NONBLOCK 0x10000 /* do not block on IO */
++#endif
++
++/* Flags to `msync'. */
++#define MS_ASYNC 1 /* Sync memory asynchronously. */
++#define MS_SYNC 4 /* Synchronous memory sync. */
++#define MS_INVALIDATE 2 /* Invalidate the caches. */
++
++/* Flags for `mlockall'. */
++#define MCL_CURRENT 1 /* Lock all currently mapped pages. */
++#define MCL_FUTURE 2 /* Lock all additions to address
++ space. */
++
++/* Flags for `mremap'. */
++#ifdef __USE_GNU
++# define MREMAP_MAYMOVE 1
++# define MREMAP_FIXED 2
++#endif
++
++/* Advice to `madvise'. */
++#ifdef __USE_BSD
++# define MADV_NORMAL 0 /* No further special treatment. */
++# define MADV_RANDOM 1 /* Expect random page references. */
++# define MADV_SEQUENTIAL 2 /* Expect sequential page references. */
++# define MADV_WILLNEED 3 /* Will need these pages. */
++# define MADV_DONTNEED 4 /* Don't need these pages. */
++# define MADV_REMOVE 9 /* Remove these pages and resources. */
++# define MADV_DONTFORK 10 /* Do not inherit across fork. */
++# define MADV_DOFORK 11 /* Do inherit across fork. */
++#endif
++
++/* The POSIX people had to invent similar names for the same things. */
++#ifdef __USE_XOPEN2K
++# define POSIX_MADV_NORMAL 0 /* No further special treatment. */
++# define POSIX_MADV_RANDOM 1 /* Expect random page references. */
++# define POSIX_MADV_SEQUENTIAL 2 /* Expect sequential page references. */
++# define POSIX_MADV_WILLNEED 3 /* Will need these pages. */
++# define POSIX_MADV_DONTNEED 4 /* Don't need these pages. */
++#endif
+Index: glibc-2.5/sysdeps/unix/sysv/linux/nios2/bits/poll.h
+===================================================================
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ glibc-2.5/sysdeps/unix/sysv/linux/nios2/bits/poll.h 2010-05-31 08:56:05.000000000 +0200
+@@ -0,0 +1,50 @@
++/* Copyright (C) 1997, 2001, 2006 Free Software Foundation, Inc.
++ This file is part of the GNU C Library.
++
++ The GNU C Library is free software; you can redistribute it and/or
++ modify it under the terms of the GNU Lesser General Public
++ License as published by the Free Software Foundation; either
++ version 2.1 of the License, or (at your option) any later version.
++
++ The GNU C Library is distributed in the hope that it will be useful,
++ but WITHOUT ANY WARRANTY; without even the implied warranty of
++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++ Lesser General Public License for more details.
++
++ You should have received a copy of the GNU Lesser General Public
++ License along with the GNU C Library; if not, write to the Free
++ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
++ 02111-1307 USA. */
++
++#ifndef _SYS_POLL_H
++# error "Never use <bits/poll.h> directly; include <sys/poll.h> instead."
++#endif
++
++/* Event types that can be polled for. These bits may be set in `events'
++ to indicate the interesting event types; they will appear in `revents'
++ to indicate the status of the file descriptor. */
++#define POLLIN 0x001 /* There is data to read. */
++#define POLLPRI 0x002 /* There is urgent data to read. */
++#define POLLOUT 0x004 /* Writing now will not block. */
++
++#ifdef __USE_XOPEN
++/* These values are defined in XPG4.2. */
++# define POLLRDNORM 0x040 /* Normal data may be read. */
++# define POLLRDBAND 0x080 /* Priority data may be read. */
++# define POLLWRNORM POLLOUT /* Writing now will not block. */
++# define POLLWRBAND 0x100 /* Priority data may be written. */
++#endif
++
++#ifdef __USE_GNU
++/* These are extensions for Linux. */
++# define POLLMSG 0x400
++# define POLLREMOVE 0x1000
++# define POLLRDHUP 0x2000
++#endif
++
++/* Event types always implicitly polled for. These bits need not be set in
++ `events', but they will appear in `revents' to indicate the status of
++ the file descriptor. */
++#define POLLERR 0x008 /* Error condition. */
++#define POLLHUP 0x010 /* Hung up. */
++#define POLLNVAL 0x020 /* Invalid polling request. */
+Index: glibc-2.5/sysdeps/unix/sysv/linux/nios2/brk.c
+===================================================================
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ glibc-2.5/sysdeps/unix/sysv/linux/nios2/brk.c 2010-05-31 08:56:05.000000000 +0200
+@@ -0,0 +1,58 @@
++/* brk system call for Linux/Nios II.
++ Copyright (C) 1995, 1996, 2005 Free Software Foundation, Inc.
++ This file is part of the GNU C Library.
++
++ The GNU C Library is free software; you can redistribute it and/or
++ modify it under the terms of the GNU Lesser General Public
++ License as published by the Free Software Foundation; either
++ version 2.1 of the License, or (at your option) any later version.
++
++ The GNU C Library is distributed in the hope that it will be useful,
++ but WITHOUT ANY WARRANTY; without even the implied warranty of
++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++ Lesser General Public License for more details.
++
++ You should have received a copy of the GNU Lesser General Public
++ License along with the GNU C Library; if not, write to the Free
++ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
++ 02111-1307 USA. */
++
++#include <errno.h>
++#include <unistd.h>
++#include <sysdep.h>
++
++/* This must be initialized data because commons can't have aliases. */
++void *__curbrk = 0;
++
++int
++__brk (void *addr)
++{
++ void *newbrk;
++
++ /* We can't use the INLINE_SYSCALL macro here because on non-optimized
++ builds it loads the address of errno even if no error occurred. __brk
++ is called during process initialization, before errno is set up. */
++ {
++ register int _r2 asm ("r2") = (int)(SYS_ify (brk));
++ register int _err asm ("r7");
++ register int _r4 asm ("r4") = (int)(addr);
++ asm volatile ("trap"
++ : "=r" (_r2), "=r" (_err)
++ : "r" (_r2), "r" (_r4)
++ : __SYSCALL_CLOBBERS);
++ newbrk = (void *) _r2;
++ if (_err)
++ newbrk = 0;
++ }
++
++ __curbrk = newbrk;
++
++ if (newbrk < addr)
++ {
++ __set_errno (ENOMEM);
++ return -1;
++ }
++
++ return 0;
++}
++weak_alias (__brk, brk)
+Index: glibc-2.5/sysdeps/unix/sysv/linux/nios2/clone.S
+===================================================================
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ glibc-2.5/sysdeps/unix/sysv/linux/nios2/clone.S 2010-05-31 08:56:05.000000000 +0200
+@@ -0,0 +1,102 @@
++/* Copyright (C) 2008 Free Software Foundation, Inc.
++ This file is part of the GNU C Library.
++ Contributed by Andrew Jenner <andrew@codesourcery.com>, 2008.
++
++ The GNU C Library is free software; you can redistribute it and/or
++ modify it under the terms of the GNU Lesser General Public
++ License as published by the Free Software Foundation; either
++ version 2.1 of the License, or (at your option) any later version.
++
++ The GNU C Library is distributed in the hope that it will be useful,
++ but WITHOUT ANY WARRANTY; without even the implied warranty of
++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++ Lesser General Public License for more details.
++
++ You should have received a copy of the GNU Lesser General Public
++ License along with the GNU C Library; if not, write to the Free
++ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
++ 02111-1307 USA. */
++
++/* clone() is even more special than fork() as it mucks with stacks
++ and invokes a function in the right context after its all over. */
++
++#include <sysdep.h>
++#define _ERRNO_H 1
++#include <bits/errno.h>
++#include <tcb-offsets.h>
++
++#define CLONE_VM 0x00000100
++#define CLONE_THREAD 0x00010000
++
++/* int clone(int (*fn)(void *arg), void *child_stack, int flags, void *arg,
++ void *parent_tidptr, void *tls, void *child_tidptr) */
++
++ .text
++ENTRY(__clone)
++ /* Sanity check arguments. */
++ movi r2,EINVAL
++ /* No NULL function pointers. */
++ beq r4,zero,SYSCALL_ERROR_LABEL
++ /* No NULL stack pointers. */
++ beq r5,zero,SYSCALL_ERROR_LABEL
++
++ subi r5,r5,12 /* Reserve argument save space. */
++ stw r6,8(r5) /* Save flags. */
++ stw r4,4(r5) /* Save function pointer. */
++ stw r7,0(r5) /* Save argument pointer. */
++
++ /* Load arguments. */
++ mov r4,r6
++ ldw r6,0(sp)
++ ldw r7,4(sp)
++ ldw r8,8(sp)
++
++ /* Do the system call. */
++ movi r2,__NR_clone
++ trap
++
++ /* Check for errors. */
++ bne r7,zero,SYSCALL_ERROR_LABEL
++
++ /* See if we're on the newly created thread. */
++ beq r2,zero,thread_start
++
++ /* Successful return from the parent */
++ ret
++
++thread_start:
++ ldw r4,8(sp)
++
++ andi r2,r4,CLONE_THREAD
++ bne r2,zero,2f
++ andi r3,r4,CLONE_VM
++ movi r2,-1
++ bne r3,zero,3f
++ DO_CALL (getpid, 0)
++3:
++ stw r2,PID_OFFSET(r23)
++ stw r2,TID_OFFSET(r23)
++2:
++ ldw r5,4(sp) /* Function pointer. */
++ ldw r4,0(sp) /* Argument pointer. */
++ addi sp,sp,12
++
++ /* Call the user's function. */
++ callr r5
++
++ /* _exit with the result. */
++ mov r4,r2
++
++#ifdef PIC
++ nextpc r22
++1: movhi r8, %hiadj(_GLOBAL_OFFSET_TABLE_ - 1b)
++ addi r8, r8, %lo(_GLOBAL_OFFSET_TABLE_ - 1b)
++ add r22, r22, r8
++ ldw r8, %call(_exit)(r22)
++ jmp r8
++#else
++ jmpi _exit
++#endif
++PSEUDO_END (__clone)
++
++weak_alias (__clone, clone)
+Index: glibc-2.5/sysdeps/unix/sysv/linux/nios2/configure
+===================================================================
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ glibc-2.5/sysdeps/unix/sysv/linux/nios2/configure 2010-05-31 08:56:05.000000000 +0200
+@@ -0,0 +1,4 @@
++# This file is generated from configure.in by Autoconf. DO NOT EDIT!
++ # Local configure fragment for sysdeps/unix/sysv/linux/nios2.
++
++arch_minimum_kernel=2.6.21
+Index: glibc-2.5/sysdeps/unix/sysv/linux/nios2/configure.in
+===================================================================
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ glibc-2.5/sysdeps/unix/sysv/linux/nios2/configure.in 2010-05-31 08:56:05.000000000 +0200
+@@ -0,0 +1,4 @@
++GLIBC_PROVIDES dnl See aclocal.m4 in the top level source directory.
++# Local configure fragment for sysdeps/unix/sysv/linux/nios2.
++
++arch_minimum_kernel=2.6.21
+Index: glibc-2.5/sysdeps/unix/sysv/linux/nios2/fxstatat.c
+===================================================================
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ glibc-2.5/sysdeps/unix/sysv/linux/nios2/fxstatat.c 2010-05-31 08:56:05.000000000 +0200
+@@ -0,0 +1 @@
++#include <sysdeps/unix/sysv/linux/i386/fxstatat.c>
+Index: glibc-2.5/sysdeps/unix/sysv/linux/nios2/getrlimit.c
+===================================================================
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ glibc-2.5/sysdeps/unix/sysv/linux/nios2/getrlimit.c 2010-05-31 08:56:05.000000000 +0200
+@@ -0,0 +1 @@
++#include <sysdeps/unix/sysv/linux/i386/getrlimit.c>
+Index: glibc-2.5/sysdeps/unix/sysv/linux/nios2/kernel-features.h
+===================================================================
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ glibc-2.5/sysdeps/unix/sysv/linux/nios2/kernel-features.h 2010-05-31 08:56:05.000000000 +0200
+@@ -0,0 +1,26 @@
++/* Set flags signalling availability of kernel features based on given
++ kernel version number.
++ Copyright (C) 2006, 2008 Free Software Foundation, Inc.
++ This file is part of the GNU C Library.
++
++ The GNU C Library is free software; you can redistribute it and/or
++ modify it under the terms of the GNU Lesser General Public
++ License as published by the Free Software Foundation; either
++ version 2.1 of the License, or (at your option) any later version.
++
++ The GNU C Library is distributed in the hope that it will be useful,
++ but WITHOUT ANY WARRANTY; without even the implied warranty of
++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++ Lesser General Public License for more details.
++
++ You should have received a copy of the GNU Lesser General Public
++ License along with the GNU C Library; if not, write to the Free
++ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
++ 02111-1307 USA. */
++
++#define __ASSUME_NEW_GETRLIMIT_SYSCALL 1
++
++#include_next <kernel-features.h>
++
++#undef __ASSUME_PSELECT
++#undef __ASSUME_PPOLL
+Index: glibc-2.5/sysdeps/unix/sysv/linux/nios2/nptl/bits/pthreadtypes.h
+===================================================================
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ glibc-2.5/sysdeps/unix/sysv/linux/nios2/nptl/bits/pthreadtypes.h 2010-05-31 08:56:05.000000000 +0200
+@@ -0,0 +1,167 @@
++/* Copyright (C) 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
++ This file is part of the GNU C Library.
++
++ The GNU C Library is free software; you can redistribute it and/or
++ modify it under the terms of the GNU Lesser General Public
++ License as published by the Free Software Foundation; either
++ version 2.1 of the License, or (at your option) any later version.
++
++ The GNU C Library is distributed in the hope that it will be useful,
++ but WITHOUT ANY WARRANTY; without even the implied warranty of
++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++ Lesser General Public License for more details.
++
++ You should have received a copy of the GNU Lesser General Public
++ License along with the GNU C Library; if not, write to the Free
++ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
++ 02111-1307 USA. */
++
++#ifndef _BITS_PTHREADTYPES_H
++#define _BITS_PTHREADTYPES_H 1
++
++#define __SIZEOF_PTHREAD_ATTR_T 36
++#define __SIZEOF_PTHREAD_MUTEX_T 24
++#define __SIZEOF_PTHREAD_MUTEXATTR_T 4
++#define __SIZEOF_PTHREAD_COND_T 48
++#define __SIZEOF_PTHREAD_COND_COMPAT_T 12
++#define __SIZEOF_PTHREAD_CONDATTR_T 4
++#define __SIZEOF_PTHREAD_RWLOCK_T 32
++#define __SIZEOF_PTHREAD_RWLOCKATTR_T 8
++#define __SIZEOF_PTHREAD_BARRIER_T 20
++#define __SIZEOF_PTHREAD_BARRIERATTR_T 4
++
++
++/* Thread identifiers. The structure of the attribute type is not
++ exposed on purpose. */
++typedef unsigned long int pthread_t;
++
++
++typedef union
++{
++ char __size[__SIZEOF_PTHREAD_ATTR_T];
++ long int __align;
++} pthread_attr_t;
++
++
++typedef struct __pthread_internal_slist
++{
++ struct __pthread_internal_slist *__next;
++} __pthread_slist_t;
++
++
++/* Data structures for mutex handling. The structure of the attribute
++ type is not exposed on purpose. */
++typedef union
++{
++ struct __pthread_mutex_s
++ {
++ int __lock;
++ unsigned int __count;
++ int __owner;
++ /* KIND must stay at this position in the structure to maintain
++ binary compatibility. */
++ int __kind;
++ unsigned int __nusers;
++ __extension__ union
++ {
++ int __spins;
++ __pthread_slist_t __list;
++ };
++ } __data;
++ char __size[__SIZEOF_PTHREAD_MUTEX_T];
++ long int __align;
++} pthread_mutex_t;
++
++typedef union
++{
++ char __size[__SIZEOF_PTHREAD_MUTEXATTR_T];
++ long int __align;
++} pthread_mutexattr_t;
++
++
++/* Data structure for conditional variable handling. The structure of
++ the attribute type is not exposed on purpose. */
++typedef union
++{
++ struct
++ {
++ int __lock;
++ unsigned int __futex;
++ __extension__ unsigned long long int __total_seq;
++ __extension__ unsigned long long int __wakeup_seq;
++ __extension__ unsigned long long int __woken_seq;
++ void *__mutex;
++ unsigned int __nwaiters;
++ unsigned int __broadcast_seq;
++ } __data;
++ char __size[__SIZEOF_PTHREAD_COND_T];
++ __extension__ long long int __align;
++} pthread_cond_t;
++
++typedef union
++{
++ char __size[__SIZEOF_PTHREAD_CONDATTR_T];
++ long int __align;
++} pthread_condattr_t;
++
++
++/* Keys for thread-specific data */
++typedef unsigned int pthread_key_t;
++
++
++/* Once-only execution */
++typedef int pthread_once_t;
++
++
++#if defined __USE_UNIX98 || defined __USE_XOPEN2K
++/* Data structure for read-write lock variable handling. The
++ structure of the attribute type is not exposed on purpose. */
++typedef union
++{
++ struct
++ {
++ int __lock;
++ unsigned int __nr_readers;
++ unsigned int __readers_wakeup;
++ unsigned int __writer_wakeup;
++ unsigned int __nr_readers_queued;
++ unsigned int __nr_writers_queued;
++ /* FLAGS must stay at this position in the structure to maintain
++ binary compatibility. */
++ unsigned int __flags;
++ int __writer;
++ } __data;
++ char __size[__SIZEOF_PTHREAD_RWLOCK_T];
++ long int __align;
++} pthread_rwlock_t;
++
++typedef union
++{
++ char __size[__SIZEOF_PTHREAD_RWLOCKATTR_T];
++ long int __align;
++} pthread_rwlockattr_t;
++#endif
++
++
++#ifdef __USE_XOPEN2K
++/* POSIX spinlock data type. */
++typedef volatile int pthread_spinlock_t;
++
++
++/* POSIX barriers data type. The structure of the type is
++ deliberately not exposed. */
++typedef union
++{
++ char __size[__SIZEOF_PTHREAD_BARRIER_T];
++ long int __align;
++} pthread_barrier_t;
++
++typedef union
++{
++ char __size[__SIZEOF_PTHREAD_BARRIERATTR_T];
++ int __align;
++} pthread_barrierattr_t;
++#endif
++
++
++#endif /* bits/pthreadtypes.h */
+Index: glibc-2.5/sysdeps/unix/sysv/linux/nios2/nptl/bits/semaphore.h
+===================================================================
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ glibc-2.5/sysdeps/unix/sysv/linux/nios2/nptl/bits/semaphore.h 2010-05-31 08:56:05.000000000 +0200
+@@ -0,0 +1,38 @@
++/* Copyright (C) 2002, 2005 Free Software Foundation, Inc.
++ This file is part of the GNU C Library.
++
++ The GNU C Library is free software; you can redistribute it and/or
++ modify it under the terms of the GNU Lesser General Public
++ License as published by the Free Software Foundation; either
++ version 2.1 of the License, or (at your option) any later version.
++
++ The GNU C Library is distributed in the hope that it will be useful,
++ but WITHOUT ANY WARRANTY; without even the implied warranty of
++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++ Lesser General Public License for more details.
++
++ You should have received a copy of the GNU Lesser General Public
++ License along with the GNU C Library; if not, write to the Free
++ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
++ 02111-1307 USA. */
++
++#ifndef _SEMAPHORE_H
++# error "Never use <bits/semaphore.h> directly; include <semaphore.h> instead."
++#endif
++
++
++#define __SIZEOF_SEM_T 16
++
++
++/* Value returned if `sem_open' failed. */
++#define SEM_FAILED ((sem_t *) 0)
++
++/* Maximum value the semaphore can have. */
++#define SEM_VALUE_MAX ((int) ((~0u) >> 1))
++
++
++typedef union
++{
++ char __size[__SIZEOF_SEM_T];
++ long int __align;
++} sem_t;
+Index: glibc-2.5/sysdeps/unix/sysv/linux/nios2/nptl/createthread.c
+===================================================================
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ glibc-2.5/sysdeps/unix/sysv/linux/nios2/nptl/createthread.c 2010-05-31 08:56:05.000000000 +0200
+@@ -0,0 +1,24 @@
++/* Copyright (C) 2005 Free Software Foundation, Inc.
++ This file is part of the GNU C Library.
++
++ The GNU C Library is free software; you can redistribute it and/or
++ modify it under the terms of the GNU Lesser General Public
++ License as published by the Free Software Foundation; either
++ version 2.1 of the License, or (at your option) any later version.
++
++ The GNU C Library is distributed in the hope that it will be useful,
++ but WITHOUT ANY WARRANTY; without even the implied warranty of
++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++ Lesser General Public License for more details.
++
++ You should have received a copy of the GNU Lesser General Public
++ License along with the GNU C Library; if not, write to the Free
++ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
++ 02111-1307 USA. */
++
++/* Value passed to 'clone' for initialization of the thread register. */
++#define TLS_VALUE ((void *) (pd) \
++ + TLS_TCB_OFFSET + TLS_PRE_TCB_SIZE)
++
++/* Get the real implementation. */
++#include <nptl/sysdeps/pthread/createthread.c>
+Index: glibc-2.5/sysdeps/unix/sysv/linux/nios2/nptl/fork.c
+===================================================================
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ glibc-2.5/sysdeps/unix/sysv/linux/nios2/nptl/fork.c 2010-05-31 08:56:05.000000000 +0200
+@@ -0,0 +1,34 @@
++/* Copyright (C) 2005 Free Software Foundation, Inc.
++ This file is part of the GNU C Library.
++
++ The GNU C Library is free software; you can redistribute it and/or
++ modify it under the terms of the GNU Lesser General Public
++ License as published by the Free Software Foundation; either
++ version 2.1 of the License, or (at your option) any later version.
++
++ The GNU C Library is distributed in the hope that it will be useful,
++ but WITHOUT ANY WARRANTY; without even the implied warranty of
++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++ Lesser General Public License for more details.
++
++ You should have received a copy of the GNU Lesser General Public
++ License along with the GNU C Library; if not, write to the Free
++ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
++ 02111-1307 USA. */
++
++#include <sched.h>
++#include <signal.h>
++#include <sysdep.h>
++#include <tls.h>
++
++/* Argument 1 - Clone flags.
++ 2 - Child stack pointer.
++ 3 - Parent tid pointer.
++ 4 - New TLS area pointer.
++ 5 - Child tid pointer. */
++#define ARCH_FORK() \
++ INLINE_SYSCALL (clone, 5, \
++ CLONE_CHILD_SETTID | CLONE_CHILD_CLEARTID | SIGCHLD, \
++ NULL, NULL, NULL, &THREAD_SELF->tid)
++
++#include <nptl/sysdeps/unix/sysv/linux/fork.c>
+Index: glibc-2.5/sysdeps/unix/sysv/linux/nios2/nptl/lowlevellock.h
+===================================================================
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ glibc-2.5/sysdeps/unix/sysv/linux/nios2/nptl/lowlevellock.h 2010-05-31 08:56:05.000000000 +0200
+@@ -0,0 +1,294 @@
++/* Copyright (C) 2005, 2006 Free Software Foundation, Inc.
++ This file is part of the GNU C Library.
++
++ The GNU C Library is free software; you can redistribute it and/or
++ modify it under the terms of the GNU Lesser General Public
++ License as published by the Free Software Foundation; either
++ version 2.1 of the License, or (at your option) any later version.
++
++ The GNU C Library is distributed in the hope that it will be useful,
++ but WITHOUT ANY WARRANTY; without even the implied warranty of
++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++ Lesser General Public License for more details.
++
++ You should have received a copy of the GNU Lesser General Public
++ License along with the GNU C Library; if not, write to the Free
++ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
++ 02111-1307 USA. */
++
++#ifndef _LOWLEVELLOCK_H
++#define _LOWLEVELLOCK_H 1
++
++#include <time.h>
++#include <sys/param.h>
++#include <bits/pthreadtypes.h>
++#include <atomic.h>
++#include <sysdep.h>
++
++#define FUTEX_WAIT 0
++#define FUTEX_WAKE 1
++#define FUTEX_REQUEUE 3
++#define FUTEX_CMP_REQUEUE 4
++#define FUTEX_WAKE_OP 5
++#define FUTEX_OP_CLEAR_WAKE_IF_GT_ONE ((4 << 24) | 1)
++#define FUTEX_LOCK_PI 6
++#define FUTEX_UNLOCK_PI 7
++#define FUTEX_TRYLOCK_PI 8
++
++/* Initializer for compatibility lock. */
++#define LLL_MUTEX_LOCK_INITIALIZER (0)
++
++#define lll_futex_wait(futexp, val) \
++ ({ \
++ INTERNAL_SYSCALL_DECL (__err); \
++ long int __ret; \
++ __ret = INTERNAL_SYSCALL (futex, __err, 4, \
++ (futexp), FUTEX_WAIT, (val), 0); \
++ INTERNAL_SYSCALL_ERROR_P (__ret, __err) ? -__ret : __ret; \
++ })
++
++#define lll_futex_timed_wait(futexp, val, timespec) \
++ ({ \
++ INTERNAL_SYSCALL_DECL (__err); \
++ long int __ret; \
++ __ret = INTERNAL_SYSCALL (futex, __err, 4, \
++ (futexp), FUTEX_WAIT, (val), (timespec)); \
++ INTERNAL_SYSCALL_ERROR_P (__ret, __err) ? -__ret : __ret; \
++ })
++
++#define lll_futex_wake(futexp, nr) \
++ ({ \
++ INTERNAL_SYSCALL_DECL (__err); \
++ long int __ret; \
++ __ret = INTERNAL_SYSCALL (futex, __err, 4, \
++ (futexp), FUTEX_WAKE, (nr), 0); \
++ INTERNAL_SYSCALL_ERROR_P (__ret, __err) ? -__ret : __ret; \
++ })
++
++#define lll_robust_mutex_dead(futexv) \
++ do \
++ { \
++ int *__futexp = &(futexv); \
++ atomic_or (__futexp, FUTEX_OWNER_DIED); \
++ lll_futex_wake (__futexp, 1); \
++ } \
++ while (0)
++
++/* Returns non-zero if error happened, zero if success. */
++#define lll_futex_requeue(futexp, nr_wake, nr_move, mutex, val) \
++ ({ \
++ INTERNAL_SYSCALL_DECL (__err); \
++ long int __ret; \
++ __ret = INTERNAL_SYSCALL (futex, __err, 6, \
++ (futexp), FUTEX_CMP_REQUEUE, (nr_wake), \
++ (nr_move), (mutex), (val)); \
++ INTERNAL_SYSCALL_ERROR_P (__ret, __err) ? -__ret : __ret; \
++ })
++
++
++/* Returns non-zero if error happened, zero if success. */
++#define lll_futex_wake_unlock(futexp, nr_wake, nr_wake2, futexp2) \
++ ({ \
++ INTERNAL_SYSCALL_DECL (__err); \
++ long int __ret; \
++ __ret = INTERNAL_SYSCALL (futex, __err, 6, \
++ (futexp), FUTEX_WAKE_OP, (nr_wake), \
++ (nr_wake2), (futexp2), \
++ FUTEX_OP_CLEAR_WAKE_IF_GT_ONE); \
++ INTERNAL_SYSCALL_ERROR_P (__ret, __err) ? -__ret : __ret; \
++ })
++
++
++#define lll_mutex_trylock(lock) \
++ atomic_compare_and_exchange_val_acq(&(lock), 1, 0)
++
++#define lll_mutex_cond_trylock(lock) \
++ atomic_compare_and_exchange_val_acq(&(lock), 2, 0)
++
++static inline int __attribute__((always_inline))
++__lll_robust_mutex_trylock(int *futex, int id)
++{
++ return atomic_compare_and_exchange_val_acq (futex, id, 0) != 0;
++}
++#define lll_robust_mutex_trylock(lock, id) \
++ __lll_robust_mutex_trylock (&(lock), id)
++
++extern int __lll_robust_lock_wait (int *futex) attribute_hidden;
++
++static inline void __attribute__((always_inline))
++__lll_mutex_lock (int *futex)
++{
++ int val = atomic_exchange_acq (futex, 1);
++
++ if (__builtin_expect (val != 0, 0))
++ {
++ while (atomic_exchange_acq (futex, 2) != 0)
++ lll_futex_wait (futex, 2);
++ }
++}
++#define lll_mutex_lock(futex) __lll_mutex_lock (&(futex))
++
++
++static inline int __attribute__ ((always_inline))
++__lll_robust_mutex_lock (int *futex, int id)
++{
++ int result = 0;
++ if (atomic_compare_and_exchange_bool_acq (futex, id, 0) != 0)
++ result = __lll_robust_lock_wait (futex);
++ return result;
++}
++#define lll_robust_mutex_lock(futex, id) \
++ __lll_robust_mutex_lock (&(futex), id)
++
++
++static inline void __attribute__ ((always_inline))
++__lll_mutex_cond_lock (int *futex)
++{
++ int val = atomic_exchange_acq (futex, 2);
++
++ if (__builtin_expect (val != 0, 0))
++ {
++ while (atomic_exchange_acq (futex, 2) != 0)
++ lll_futex_wait (futex, 2);
++ }
++}
++#define lll_mutex_cond_lock(futex) __lll_mutex_cond_lock (&(futex))
++
++
++#define lll_robust_mutex_cond_lock(futex, id) \
++ __lll_robust_mutex_lock (&(futex), (id) | FUTEX_WAITERS)
++
++
++extern int __lll_timedlock_wait (int *futex, const struct timespec *)
++ attribute_hidden;
++extern int __lll_robust_timedlock_wait (int *futex, const struct timespec *)
++ attribute_hidden;
++
++static inline int __attribute__ ((always_inline))
++__lll_mutex_timedlock (int *futex, const struct timespec *abstime)
++{
++ int result = 0;
++ int val = atomic_exchange_acq (futex, 1);
++
++ if (__builtin_expect (val != 0, 0))
++ result = __lll_timedlock_wait (futex, abstime);
++ return result;
++}
++#define lll_mutex_timedlock(futex, abstime) \
++ __lll_mutex_timedlock (&(futex), abstime)
++
++
++static inline int __attribute__ ((always_inline))
++__lll_robust_mutex_timedlock (int *futex, const struct timespec *abstime,
++ int id)
++{
++ int result = 0;
++ if (atomic_compare_and_exchange_bool_acq (futex, id, 0) != 0)
++ result = __lll_robust_timedlock_wait (futex, abstime);
++ return result;
++}
++#define lll_robust_mutex_timedlock(futex, abstime, id) \
++ __lll_robust_mutex_timedlock (&(futex), abstime, id)
++
++
++static inline void __attribute__ ((always_inline))
++__lll_mutex_unlock (int *futex)
++{
++ int val = atomic_exchange_rel (futex, 0);
++ if (__builtin_expect (val > 1, 0))
++ lll_futex_wake (futex, 1);
++}
++#define lll_mutex_unlock(futex) __lll_mutex_unlock(&(futex))
++
++
++static inline void __attribute__ ((always_inline))
++__lll_robust_mutex_unlock (int *futex, int mask)
++{
++ int val = atomic_exchange_rel (futex, 0);
++ if (__builtin_expect (val & mask, 0))
++ lll_futex_wake (futex, 1);
++}
++#define lll_robust_mutex_unlock(futex) \
++ __lll_robust_mutex_unlock(&(futex), FUTEX_WAITERS)
++
++
++static inline void __attribute__ ((always_inline))
++__lll_mutex_unlock_force (int *futex)
++{
++ (void) atomic_exchange_rel (futex, 0);
++ lll_futex_wake (futex, 1);
++}
++#define lll_mutex_unlock_force(futex) __lll_mutex_unlock_force(&(futex))
++
++
++#define lll_mutex_islocked(futex) \
++ (futex != 0)
++
++
++/* Our internal lock implementation is identical to the binary-compatible
++ mutex implementation. */
++
++/* Type for lock object. */
++typedef int lll_lock_t;
++
++/* Initializers for lock. */
++#define LLL_LOCK_INITIALIZER (0)
++#define LLL_LOCK_INITIALIZER_LOCKED (1)
++
++extern int lll_unlock_wake_cb (int *__futex) attribute_hidden;
++
++/* The states of a lock are:
++ 0 - untaken
++ 1 - taken by one user
++ >1 - taken by more users */
++
++#define lll_trylock(lock) lll_mutex_trylock (lock)
++#define lll_lock(lock) lll_mutex_lock (lock)
++#define lll_unlock(lock) lll_mutex_unlock (lock)
++#define lll_islocked(lock) lll_mutex_islocked (lock)
++
++/* The kernel notifies a process which uses CLONE_CLEARTID via futex
++ wakeup when the clone terminates. The memory location contains the
++ thread ID while the clone is running and is reset to zero
++ afterwards. */
++#define lll_wait_tid(tid) \
++ do { \
++ __typeof (tid) __tid; \
++ while ((__tid = (tid)) != 0) \
++ lll_futex_wait (&(tid), __tid); \
++ } while (0)
++
++extern int __lll_timedwait_tid (int *, const struct timespec *)
++ attribute_hidden;
++
++#define lll_timedwait_tid(tid, abstime) \
++ ({ \
++ int __res = 0; \
++ if ((tid) != 0) \
++ __res = __lll_timedwait_tid (&(tid), (abstime)); \
++ __res; \
++ })
++
++
++/* Conditional variable handling. */
++
++extern void __lll_cond_wait (pthread_cond_t *cond)
++ attribute_hidden;
++extern int __lll_cond_timedwait (pthread_cond_t *cond,
++ const struct timespec *abstime)
++ attribute_hidden;
++extern void __lll_cond_wake (pthread_cond_t *cond)
++ attribute_hidden;
++extern void __lll_cond_broadcast (pthread_cond_t *cond)
++ attribute_hidden;
++
++#define lll_cond_wait(cond) \
++ __lll_cond_wait (cond)
++#define lll_cond_timedwait(cond, abstime) \
++ __lll_cond_timedwait (cond, abstime)
++#define lll_cond_wake(cond) \
++ __lll_cond_wake (cond)
++#define lll_cond_broadcast(cond) \
++ __lll_cond_broadcast (cond)
++
++#endif /* lowlevellock.h */
+Index: glibc-2.5/sysdeps/unix/sysv/linux/nios2/nptl/pt-vfork.S
+===================================================================
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ glibc-2.5/sysdeps/unix/sysv/linux/nios2/nptl/pt-vfork.S 2010-05-31 08:56:05.000000000 +0200
+@@ -0,0 +1,42 @@
++/* Copyright (C) 2005, 2008 Free Software Foundation, Inc.
++ This file is part of the GNU C Library.
++
++ The GNU C Library is free software; you can redistribute it and/or
++ modify it under the terms of the GNU Lesser General Public
++ License as published by the Free Software Foundation; either
++ version 2.1 of the License, or (at your option) any later version.
++
++ The GNU C Library is distributed in the hope that it will be useful,
++ but WITHOUT ANY WARRANTY; without even the implied warranty of
++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++ Lesser General Public License for more details.
++
++ You should have received a copy of the GNU Lesser General Public
++ License along with the GNU C Library; if not, write to the Free
++ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
++ 02111-1307 USA. */
++
++#include <sysdep.h>
++#include <tcb-offsets.h>
++
++ENTRY (__vfork)
++
++ ldw r4, PID_OFFSET(r23)
++ sub r4, zero, r4
++ stw r4, PID_OFFSET(r23)
++
++ DO_CALL (vfork, 0)
++
++ beq r2, zero, 1f
++ ldw r4, PID_OFFSET(r23)
++ sub r4, zero, r4
++ stw r4, PID_OFFSET(r23)
++1:
++
++ bne r7, zero, SYSCALL_ERROR_LABEL
++ ret
++
++PSEUDO_END (__vfork)
++libc_hidden_def (__vfork)
++
++weak_alias (__vfork, vfork)
+Index: glibc-2.5/sysdeps/unix/sysv/linux/nios2/nptl/pthread_once.c
+===================================================================
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ glibc-2.5/sysdeps/unix/sysv/linux/nios2/nptl/pthread_once.c 2010-05-31 08:56:05.000000000 +0200
+@@ -0,0 +1,94 @@
++/* Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc.
++ This file is part of the GNU C Library.
++ Contributed by Jakub Jelinek <jakub@redhat.com>, 2003.
++
++ The GNU C Library is free software; you can redistribute it and/or
++ modify it under the terms of the GNU Lesser General Public
++ License as published by the Free Software Foundation; either
++ version 2.1 of the License, or (at your option) any later version.
++
++ The GNU C Library is distributed in the hope that it will be useful,
++ but WITHOUT ANY WARRANTY; without even the implied warranty of
++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++ Lesser General Public License for more details.
++
++ You should have received a copy of the GNU Lesser General Public
++ License along with the GNU C Library; if not, write to the Free
++ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
++ 02111-1307 USA. */
++
++#include "pthreadP.h"
++#include <lowlevellock.h>
++
++
++unsigned long int __fork_generation attribute_hidden;
++
++
++static void
++clear_once_control (void *arg)
++{
++ pthread_once_t *once_control = (pthread_once_t *) arg;
++
++ *once_control = 0;
++ lll_futex_wake (once_control, INT_MAX);
++}
++
++
++int
++__pthread_once (once_control, init_routine)
++ pthread_once_t *once_control;
++ void (*init_routine) (void);
++{
++ while (1)
++ {
++ int oldval, val, newval;
++
++ val = *once_control;
++ do
++ {
++ /* Check if the initialized has already been done. */
++ if ((val & 2) != 0)
++ return 0;
++
++ oldval = val;
++ newval = (oldval & 3) | __fork_generation | 1;
++ val = atomic_compare_and_exchange_val_acq (once_control, newval,
++ oldval);
++ }
++ while (__builtin_expect (val != oldval, 0));
++
++ /* Check if another thread already runs the initializer. */
++ if ((oldval & 1) != 0)
++ {
++ /* Check whether the initializer execution was interrupted
++ by a fork. */
++ if (((oldval ^ newval) & -4) == 0)
++ {
++ /* Same generation, some other thread was faster. Wait. */
++ lll_futex_wait (once_control, newval);
++ continue;
++ }
++ }
++
++ /* This thread is the first here. Do the initialization.
++ Register a cleanup handler so that in case the thread gets
++ interrupted the initialization can be restarted. */
++ pthread_cleanup_push (clear_once_control, once_control);
++
++ init_routine ();
++
++ pthread_cleanup_pop (0);
++
++
++ /* Add one to *once_control. */
++ atomic_increment (once_control);
++
++ /* Wake up all other threads. */
++ lll_futex_wake (once_control, INT_MAX);
++ break;
++ }
++
++ return 0;
++}
++weak_alias (__pthread_once, pthread_once)
++strong_alias (__pthread_once, __pthread_once_internal)
+Index: glibc-2.5/sysdeps/unix/sysv/linux/nios2/nptl/sysdep-cancel.h
+===================================================================
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ glibc-2.5/sysdeps/unix/sysv/linux/nios2/nptl/sysdep-cancel.h 2010-05-31 08:56:05.000000000 +0200
+@@ -0,0 +1,133 @@
++/* Copyright (C) 2003, 2004, 2005, 2008 Free Software Foundation, Inc.
++ This file is part of the GNU C Library.
++
++ The GNU C Library is free software; you can redistribute it and/or
++ modify it under the terms of the GNU Lesser General Public
++ License as published by the Free Software Foundation; either
++ version 2.1 of the License, or (at your option) any later version.
++
++ The GNU C Library is distributed in the hope that it will be useful,
++ but WITHOUT ANY WARRANTY; without even the implied warranty of
++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++ Lesser General Public License for more details.
++
++ You should have received a copy of the GNU Lesser General Public
++ License along with the GNU C Library; if not, write to the Free
++ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
++ 02111-1307 USA. */
++
++#include <sysdep.h>
++#include <sysdeps/generic/sysdep.h>
++#include <tls.h>
++#ifndef __ASSEMBLER__
++# include <nptl/pthreadP.h>
++#endif
++
++#if !defined NOT_IN_libc || defined IS_IN_libpthread || defined IS_IN_librt
++
++# undef PSEUDO
++# define PSEUDO(name, syscall_name, args) \
++ .type __##syscall_name##_nocancel, @function; \
++ .globl __##syscall_name##_nocancel; \
++ __##syscall_name##_nocancel: \
++ DO_CALL (syscall_name, args); \
++ bne r7, zero, SYSCALL_ERROR_LABEL; \
++ ret; \
++ .size __##syscall_name##_nocancel,.-__##syscall_name##_nocancel; \
++ ENTRY (name) \
++ cfi_startproc; \
++ SINGLE_THREAD_P(r2); \
++ bne r2, zero, pseudo_cancel; \
++ DO_CALL (syscall_name, args); \
++ bne r7, zero, SYSCALL_ERROR_LABEL; \
++ ret; \
++ pseudo_cancel: \
++ SAVESTK_##args; /* save syscall args and adjust stack */ \
++ SAVEREG(ra, 0); /* save return address */ \
++ SAVEREG(r22, 4); /* save GOT pointer */ \
++ nextpc r22; \
++1: movhi r2, %hiadj(_GLOBAL_OFFSET_TABLE_ - 1b); \
++ addi r2, r2, %lo(_GLOBAL_OFFSET_TABLE_ - 1b); \
++ add r22, r22, r2; \
++ CENABLE; \
++ callr r3; \
++ stw r2, 8(sp); /* save mask */ \
++ LOADARGS_##args; \
++ movi r2, SYS_ify(syscall_name); \
++ trap; \
++ stw r2, 12(sp); /* save syscall result */ \
++ stw r7, 16(sp); /* save syscall error flag */ \
++ ldw r4, 8(sp); /* pass mask as argument 1 */ \
++ CDISABLE; \
++ callr r3; \
++ ldw r7, 16(sp); /* restore syscall error flag */ \
++ ldw r2, 12(sp); /* restore syscall result */ \
++ ldw ra, 0(sp); /* restore return address */ \
++ ldw r22, 4(sp); /* restore GOT pointer */ \
++ RESTORESTK_##args; \
++ bne r7, zero, SYSCALL_ERROR_LABEL; \
++ cfi_endproc;
++
++# undef PSEUDO_END
++# define PSEUDO_END(sym) \
++ SYSCALL_ERROR_HANDLER \
++ END (sym)
++
++#define SAVEREG(REG, LOC) stw REG, LOC(sp); cfi_rel_offset (REG, LOC)
++#define SAVESTK(X) subi sp, sp, X; cfi_adjust_cfa_offset(X)
++#define SAVESTK_0 SAVESTK(20)
++#define SAVEARG_1 SAVEREG(r4, 20)
++#define SAVESTK_1 SAVESTK(24); SAVEARG_1
++#define SAVEARG_2 SAVEREG(r5, 24); SAVEARG_1
++#define SAVESTK_2 SAVESTK(28); SAVEARG_2
++#define SAVEARG_3 SAVEREG(r6, 28); SAVEARG_2
++#define SAVESTK_3 SAVESTK(32); SAVEARG_3
++#define SAVEARG_4 SAVEREG(r7, 32); SAVEARG_3
++#define SAVESTK_4 SAVESTK(36); SAVEARG_4
++#define SAVESTK_5 SAVESTK_4
++#define SAVESTK_6 SAVESTK_5
++
++#define LOADARGS_0
++#define LOADARGS_1 ldw r4, 20(sp)
++#define LOADARGS_2 LOADARGS_1; ldw r5, 24(sp)
++#define LOADARGS_3 LOADARGS_2; ldw r6, 28(sp)
++#define LOADARGS_4 LOADARGS_3; ldw r7, 32(sp)
++#define LOADARGS_5 LOADARGS_4; ldw r8, 36(sp)
++#define LOADARGS_6 LOADARGS_5; ldw r9, 40(sp)
++
++#define RESTORESTK(X) addi sp, sp, X; cfi_adjust_cfa_offset(-X)
++#define RESTORESTK_0 RESTORESTK(20)
++#define RESTORESTK_1 RESTORESTK(24)
++#define RESTORESTK_2 RESTORESTK(28)
++#define RESTORESTK_3 RESTORESTK(32)
++#define RESTORESTK_4 RESTORESTK(36)
++#define RESTORESTK_5 RESTORESTK(36)
++#define RESTORESTK_6 RESTORESTK(36)
++
++# ifdef IS_IN_libpthread
++# define CENABLE ldw r3, %call(__pthread_enable_asynccancel)(r22)
++# define CDISABLE ldw r3, %call(__pthread_disable_asynccancel)(r22)
++# elif defined IS_IN_librt
++# define CENABLE ldw r3, %call(__librt_enable_asynccancel)(r22)
++# define CDISABLE ldw r3, %call(__librt_disable_asynccancel)(r22)
++# else
++# define CENABLE ldw r3, %call(__libc_enable_asynccancel)(r22)
++# define CDISABLE ldw r3, %call(__libc_disable_asynccancel)(r22)
++# endif
++
++# ifndef __ASSEMBLER__
++# define SINGLE_THREAD_P \
++ __builtin_expect (THREAD_GETMEM (THREAD_SELF, \
++ header.multiple_threads) \
++ == 0, 1)
++# else
++# define SINGLE_THREAD_P(reg) \
++ ldw reg, MULTIPLE_THREADS_OFFSET(r23)
++#endif
++
++#elif !defined __ASSEMBLER__
++
++# define SINGLE_THREAD_P 1
++# define NO_CANCELLATION 1
++
++#endif
+Index: glibc-2.5/sysdeps/unix/sysv/linux/nios2/nptl/vfork.S
+===================================================================
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ glibc-2.5/sysdeps/unix/sysv/linux/nios2/nptl/vfork.S 2010-05-31 08:56:05.000000000 +0200
+@@ -0,0 +1,42 @@
++/* Copyright (C) 2005, 2008 Free Software Foundation, Inc.
++ This file is part of the GNU C Library.
++
++ The GNU C Library is free software; you can redistribute it and/or
++ modify it under the terms of the GNU Lesser General Public
++ License as published by the Free Software Foundation; either
++ version 2.1 of the License, or (at your option) any later version.
++
++ The GNU C Library is distributed in the hope that it will be useful,
++ but WITHOUT ANY WARRANTY; without even the implied warranty of
++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++ Lesser General Public License for more details.
++
++ You should have received a copy of the GNU Lesser General Public
++ License along with the GNU C Library; if not, write to the Free
++ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
++ 02111-1307 USA. */
++
++#include <sysdep.h>
++#include <tcb-offsets.h>
++
++ENTRY (__vfork)
++
++ ldw r4, PID_OFFSET(r23)
++ sub r4, zero, r4
++ stw r4, PID_OFFSET(r23)
++
++ DO_CALL (vfork, 0)
++
++ beq r2, zero, 1f
++ ldw r4, PID_OFFSET(r23)
++ sub r4, zero, r4
++ stw r4, PID_OFFSET(r23)
++1:
++
++ bne r7, zero, SYSCALL_ERROR_LABEL
++ ret
++
++PSEUDO_END (__vfork)
++libc_hidden_def (__vfork)
++
++weak_alias (__vfork, vfork)
+Index: glibc-2.5/sysdeps/unix/sysv/linux/nios2/profil-counter.h
+===================================================================
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ glibc-2.5/sysdeps/unix/sysv/linux/nios2/profil-counter.h 2010-05-31 08:56:05.000000000 +0200
+@@ -0,0 +1,2 @@
++/* We can use the ix86 version. */
++#include <sysdeps/unix/sysv/linux/i386/profil-counter.h>
+Index: glibc-2.5/sysdeps/unix/sysv/linux/nios2/socket.S
+===================================================================
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ glibc-2.5/sysdeps/unix/sysv/linux/nios2/socket.S 2010-05-31 08:56:05.000000000 +0200
+@@ -0,0 +1,136 @@
++/* Copyright (C) 1995, 1996, 1997, 1998, 2003, 2004, 2005
++ Free Software Foundation, Inc.
++
++ This file is part of the GNU C Library.
++
++ The GNU C Library is free software; you can redistribute it and/or
++ modify it under the terms of the GNU Lesser General Public
++ License as published by the Free Software Foundation; either
++ version 2.1 of the License, or (at your option) any later version.
++
++ The GNU C Library is distributed in the hope that it will be useful,
++ but WITHOUT ANY WARRANTY; without even the implied warranty of
++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++ Lesser General Public License for more details.
++
++ You should have received a copy of the GNU Lesser General Public
++ License along with the GNU C Library; if not, write to the Free
++ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
++ 02111-1307 USA. */
++
++#include <sysdep-cancel.h>
++#include <socketcall.h>
++
++#define P(a, b) P2(a, b)
++#define P2(a, b) a##b
++
++ .text
++/* The socket-oriented system calls are handled unusally in Linux.
++ They are all gated through the single `socketcall' system call number.
++ `socketcall' takes two arguments: the first is the subcode, specifying
++ which socket function is being called; and the second is a pointer to
++ the arguments to the specific function.
++
++ The .S files for the other calls just #define socket and #include this. */
++
++#ifndef __socket
++# ifndef NO_WEAK_ALIAS
++# define __socket P(__,socket)
++# else
++# define __socket socket
++# endif
++#endif
++
++#define PUSHARGS_1 subi sp, sp, 4 ; \
++ stw r4, 0(sp)
++#define PUSHARGS_2 subi sp, sp, 8 ; \
++ stw r5, 4(sp) ; \
++ stw r4, 0(sp)
++#define PUSHARGS_3 subi sp, sp, 12 ; \
++ stw r6, 8(sp) ; \
++ stw r5, 4(sp) ; \
++ stw r4, 0(sp)
++#define PUSHARGS_4 subi sp, sp, 16 ; \
++ stw r7, 12(sp) ; \
++ stw r6, 8(sp) ; \
++ stw r5, 4(sp) ; \
++ stw r4, 0(sp)
++#define PUSHARGS_5 PUSHARGS_4 /* Caller has already pushed arg 5 */
++#define PUSHARGS_6 PUSHARGS_4
++
++#define POPARGS_1 addi sp, sp, 4
++#define POPARGS_2 addi sp, sp, 8
++#define POPARGS_3 addi sp, sp, 12
++#define POPARGS_4 addi sp, sp, 16
++#define POPARGS_5 addi sp, sp, 16
++#define POPARGS_6 addi sp, sp, 16
++
++#ifndef NARGS
++#define NARGS 3 /* If we were called with no wrapper, this is really socket() */
++#endif
++
++.globl __socket
++ENTRY (__socket)
++ /* Push args onto the stack. */
++ P(PUSHARGS_,NARGS)
++
++#if defined NEED_CANCELLATION && defined CENABLE
++ SINGLE_THREAD_P(r2)
++ bne r2,zero,2f
++#endif
++
++ /* Do the system call trap. */
++ movi r4, P(SOCKOP_,socket)
++ mov r5, sp
++ movi r2, SYS_ify(socketcall)
++ trap
++
++ /* Pop args off the stack. */
++ P(POPARGS_,NARGS)
++
++ /* Check for errors. */
++ bne r7,zero,SYSCALL_ERROR_LABEL
++
++ ret
++#if defined NEED_CANCELLATION && defined CENABLE
++
++2: subi sp, sp, 20
++ stw ra, 0(sp)
++ stw r22, 4(sp)
++
++ nextpc r22
++1: movhi r2, %hiadj(_GLOBAL_OFFSET_TABLE_ - 1b)
++ addi r2, r2, %lo(_GLOBAL_OFFSET_TABLE_ - 1b)
++ add r22, r22, r2
++
++ CENABLE
++ callr r3
++ stw r16, 8(sp)
++
++ movi r4, P(SOCKOP_,socket)
++ addi r5, sp, 20
++ movi r2, SYS_ify(socketcall)
++ trap
++
++ stw r2, 12(sp)
++ stw r7, 16(sp)
++ ldw r4, 8(sp)
++ CDISABLE
++ callr r3
++ ldw r7, 16(sp)
++ ldw r2, 12(sp)
++ ldw r22, 4(sp)
++ ldw ra, 0(sp)
++ addi sp, sp, 20
++
++ P(POPARGS_,NARGS)
++
++ bne r7, zero, SYSCALL_ERROR_LABEL
++ ret
++#endif
++
++PSEUDO_END (__socket)
++
++#ifndef NO_WEAK_ALIAS
++weak_alias (__socket, socket)
++#endif
+Index: glibc-2.5/sysdeps/unix/sysv/linux/nios2/sys/procfs.h
+===================================================================
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ glibc-2.5/sysdeps/unix/sysv/linux/nios2/sys/procfs.h 2010-05-31 08:56:05.000000000 +0200
+@@ -0,0 +1,123 @@
++/* Copyright (C) 1996, 1997, 1999, 2001 Free Software Foundation, Inc.
++ This file is part of the GNU C Library.
++
++ The GNU C Library is free software; you can redistribute it and/or
++ modify it under the terms of the GNU Lesser General Public
++ License as published by the Free Software Foundation; either
++ version 2.1 of the License, or (at your option) any later version.
++
++ The GNU C Library is distributed in the hope that it will be useful,
++ but WITHOUT ANY WARRANTY; without even the implied warranty of
++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++ Lesser General Public License for more details.
++
++ You should have received a copy of the GNU Lesser General Public
++ License along with the GNU C Library; if not, write to the Free
++ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
++ 02111-1307 USA. */
++
++#ifndef _SYS_PROCFS_H
++#define _SYS_PROCFS_H 1
++
++/* This is somewhat modelled after the file of the same name on SVR4
++ systems. It provides a definition of the core file format for ELF
++ used on Linux. It doesn't have anything to do with the /proc file
++ system, even though Linux has one.
++
++ Anyway, the whole purpose of this file is for GDB and GDB only.
++ Don't read too much into it. Don't use it for anything other than
++ GDB unless you know what you are doing. */
++
++#include <features.h>
++#include <sys/time.h>
++#include <sys/types.h>
++#include <sys/user.h>
++
++__BEGIN_DECLS
++
++/* Type for a general-purpose register. */
++typedef unsigned long elf_greg_t;
++
++/* And the whole bunch of them. We could have used `struct
++ user_regs' directly in the typedef, but tradition says that
++ the register set is an array, which does have some peculiar
++ semantics, so leave it that way. */
++#define ELF_NGREG (sizeof (struct user_regs) / sizeof(elf_greg_t))
++typedef elf_greg_t elf_gregset_t[ELF_NGREG];
++
++/* Register set for the floating-point registers. */
++typedef struct user_fpregs elf_fpregset_t;
++
++/* Signal info. */
++struct elf_siginfo
++ {
++ int si_signo; /* Signal number. */
++ int si_code; /* Extra code. */
++ int si_errno; /* Errno. */
++ };
++
++/* Definitions to generate Intel SVR4-like core files. These mostly
++ have the same names as the SVR4 types with "elf_" tacked on the
++ front to prevent clashes with Linux definitions, and the typedef
++ forms have been avoided. This is mostly like the SVR4 structure,
++ but more Linuxy, with things that Linux does not support and which
++ GDB doesn't really use excluded. */
++
++struct elf_prstatus
++ {
++ struct elf_siginfo pr_info; /* Info associated with signal. */
++ short int pr_cursig; /* Current signal. */
++ unsigned long int pr_sigpend; /* Set of pending signals. */
++ unsigned long int pr_sighold; /* Set of held signals. */
++ __pid_t pr_pid;
++ __pid_t pr_ppid;
++ __pid_t pr_pgrp;
++ __pid_t pr_sid;
++ struct timeval pr_utime; /* User time. */
++ struct timeval pr_stime; /* System time. */
++ struct timeval pr_cutime; /* Cumulative user time. */
++ struct timeval pr_cstime; /* Cumulative system time. */
++ elf_gregset_t pr_reg; /* GP registers. */
++ int pr_fpvalid; /* True if math copro being used. */
++ };
++
++
++#define ELF_PRARGSZ (80) /* Number of chars for args. */
++
++struct elf_prpsinfo
++ {
++ char pr_state; /* Numeric process state. */
++ char pr_sname; /* Char for pr_state. */
++ char pr_zomb; /* Zombie. */
++ char pr_nice; /* Nice val. */
++ unsigned long int pr_flag; /* Flags. */
++ unsigned short int pr_uid;
++ unsigned short int pr_gid;
++ int pr_pid, pr_ppid, pr_pgrp, pr_sid;
++ /* Lots missing */
++ char pr_fname[16]; /* Filename of executable. */
++ char pr_psargs[ELF_PRARGSZ]; /* Initial part of arg list. */
++ };
++
++/* The rest of this file provides the types for emulation of the
++ Solaris <proc_service.h> interfaces that should be implemented by
++ users of libthread_db. */
++
++/* Addresses. */
++typedef void *psaddr_t;
++
++/* Register sets. Linux has different names. */
++typedef elf_gregset_t prgregset_t;
++typedef elf_fpregset_t prfpregset_t;
++
++/* We don't have any differences between processes and threads,
++ therefore have only one PID type. */
++typedef __pid_t lwpid_t;
++
++/* Process status and info. In the end we do provide typedefs for them. */
++typedef struct elf_prstatus prstatus_t;
++typedef struct elf_prpsinfo prpsinfo_t;
++
++__END_DECLS
++
++#endif /* sys/procfs.h */
+Index: glibc-2.5/sysdeps/unix/sysv/linux/nios2/sys/user.h
+===================================================================
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ glibc-2.5/sysdeps/unix/sysv/linux/nios2/sys/user.h 2010-05-31 08:56:05.000000000 +0200
+@@ -0,0 +1,58 @@
++/* Copyright (C) 1998, 1999, 2000, 2001 Free Software Foundation, Inc.
++ This file is part of the GNU C Library.
++
++ The GNU C Library is free software; you can redistribute it and/or
++ modify it under the terms of the GNU Lesser General Public
++ License as published by the Free Software Foundation; either
++ version 2.1 of the License, or (at your option) any later version.
++
++ The GNU C Library is distributed in the hope that it will be useful,
++ but WITHOUT ANY WARRANTY; without even the implied warranty of
++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++ Lesser General Public License for more details.
++
++ You should have received a copy of the GNU Lesser General Public
++ License along with the GNU C Library; if not, write to the Free
++ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
++ 02111-1307 USA. */
++
++#ifndef _SYS_USER_H
++#define _SYS_USER_H 1
++
++/* The whole purpose of this file is for GDB and GDB only. Don't read
++ too much into it. Don't use it for anything other than GDB unless
++ you know what you are doing. */
++
++struct user_fpregs
++{
++};
++
++struct user_regs
++{
++ unsigned long int uregs[32];
++};
++
++struct user
++{
++ struct user_regs regs; /* General registers */
++ int u_fpvalid; /* True if math co-processor being used. */
++
++ unsigned long int u_tsize; /* Text segment size (pages). */
++ unsigned long int u_dsize; /* Data segment size (pages). */
++ unsigned long int u_ssize; /* Stack segment size (pages). */
++
++ unsigned long start_code; /* Starting virtual address of text. */
++ unsigned long start_stack; /* Starting virtual address of stack. */
++
++ long int signal; /* Signal that caused the core dump. */
++ int reserved; /* No longer used */
++ struct user_regs *u_ar0; /* help gdb to find the general registers. */
++
++ unsigned long magic; /* uniquely identify a core file */
++ char u_comm[32]; /* User command that was responsible */
++ int u_debugreg[8];
++ struct user_fpregs u_fp; /* Floating point registers */
++ struct user_fpregs *u_fp0; /* help gdb to find the FP registers. */
++};
++
++#endif /* sys/user.h */
+Index: glibc-2.5/sysdeps/unix/sysv/linux/nios2/syscall.S
+===================================================================
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ glibc-2.5/sysdeps/unix/sysv/linux/nios2/syscall.S 2010-05-31 08:56:05.000000000 +0200
+@@ -0,0 +1,36 @@
++/* Copyright (C) 2005, 2008 Free Software Foundation, Inc.
++ This file is part of the GNU C Library.
++
++ The GNU C Library is free software; you can redistribute it and/or
++ modify it under the terms of the GNU Lesser General Public
++ License as published by the Free Software Foundation; either
++ version 2.1 of the License, or (at your option) any later version.
++
++ The GNU C Library is distributed in the hope that it will be useful,
++ but WITHOUT ANY WARRANTY; without even the implied warranty of
++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++ Lesser General Public License for more details.
++
++ You should have received a copy of the GNU Lesser General Public
++ License along with the GNU C Library; if not, write to the Free
++ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
++ 02111-1307 USA. */
++
++#include <sysdep.h>
++
++/* We don't need a special syscall to implement syscall(). It won't work
++ reliably with 64-bit arguments (but that is true on many modern platforms).
++*/
++
++ENTRY (syscall)
++ mov r2, r4
++ mov r4, r5
++ mov r5, r6
++ mov r6, r7
++ ldw r7, 0(sp)
++ ldw r8, 4(sp)
++ ldw r9, 8(sp)
++ trap
++ bne r7, zero, SYSCALL_ERROR_LABEL
++ ret
++PSEUDO_END (syscall)
+Index: glibc-2.5/sysdeps/unix/sysv/linux/nios2/sysdep.h
+===================================================================
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ glibc-2.5/sysdeps/unix/sysv/linux/nios2/sysdep.h 2010-05-31 08:56:05.000000000 +0200
+@@ -0,0 +1,219 @@
++/* Copyright (C) 2000, 2002, 2003, 2004, 2005, 2008 Free Software Foundation,
++ Inc.
++ This file is part of the GNU C Library.
++
++ The GNU C Library is free software; you can redistribute it and/or
++ modify it under the terms of the GNU Lesser General Public
++ License as published by the Free Software Foundation; either
++ version 2.1 of the License, or (at your option) any later version.
++
++ The GNU C Library is distributed in the hope that it will be useful,
++ but WITHOUT ANY WARRANTY; without even the implied warranty of
++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++ Lesser General Public License for more details.
++
++ You should have received a copy of the GNU Lesser General Public
++ License along with the GNU C Library; if not, write to the Free
++ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
++ 02111-1307 USA. */
++
++#ifndef _LINUX_NIOS2_SYSDEP_H
++#define _LINUX_NIOS2_SYSDEP_H 1
++
++#include <sysdeps/unix/sysdep.h>
++
++/* For Linux we can use the system call table in the header file
++ /usr/include/asm/unistd.h
++ of the kernel. But these symbols do not follow the SYS_* syntax
++ so we have to redefine the `SYS_ify' macro here. */
++#undef SYS_ify
++#define SYS_ify(syscall_name) __NR_##syscall_name
++
++#ifdef __ASSEMBLER__
++
++#define ASM_TYPE_DIRECTIVE(name,typearg) .type name,%##typearg;
++#define ASM_SIZE_DIRECTIVE(name) .size name,.-name
++
++#define ENTRY(name) \
++ ASM_GLOBAL_DIRECTIVE C_SYMBOL_NAME(name); \
++ ASM_TYPE_DIRECTIVE (C_SYMBOL_NAME(name),function) \
++ C_LABEL(name)
++
++#undef END
++#define END(name) \
++ ASM_SIZE_DIRECTIVE(name)
++
++#define SYSCALL_ERROR_LABEL __syscall_error
++
++#undef PSEUDO
++#define PSEUDO(name, syscall_name, args) \
++ ENTRY (name) \
++ DO_CALL (syscall_name, args) \
++ bne r7, zero, SYSCALL_ERROR_LABEL; \
++
++#undef PSEUDO_END
++#define PSEUDO_END(name) \
++ SYSCALL_ERROR_HANDLER \
++ END (name)
++
++#undef PSEUDO_NOERRNO
++#define PSEUDO_NOERRNO(name, syscall_name, args) \
++ ENTRY (name) \
++ DO_CALL (syscall_name, args)
++
++#undef PSEUDO_END_NOERRNO
++#define PSEUDO_END_NOERRNO(name) \
++ END (name)
++
++#undef ret_NOERRNO
++#define ret_NOERRNO ret
++
++#undef DO_CALL
++#define DO_CALL(syscall_name, args) \
++ DOARGS_##args \
++ movi r2, SYS_ify(syscall_name); \
++ trap;
++
++#if defined(__PIC__) || defined(PIC)
++
++#define SYSCALL_ERROR_HANDLER \
++SYSCALL_ERROR_LABEL: \
++ subi sp, sp, 12; \
++ stw r22, 8(sp); \
++ stw r2, 4(sp); \
++ stw ra, 0(sp); \
++ nextpc r22; \
++1: movhi r8, %hiadj(_GLOBAL_OFFSET_TABLE_ - 1b); \
++ addi r8, r8, %lo(_GLOBAL_OFFSET_TABLE_ - 1b); \
++ add r22, r22, r8; \
++ ldw r3, %call(__errno_location)(r22); \
++ callr r3; \
++ ldw ra, 0(sp); \
++ ldw r10, 4(sp); \
++ ldw r22, 8(sp); \
++ addi sp, sp, 12; \
++ stw r10, 0(r2); \
++ movi r2, -1; \
++ ret;
++
++#else
++
++#define SYSCALL_ERROR_HANDLER \
++SYSCALL_ERROR_LABEL: \
++ subi sp, sp, 8; \
++ stw r2, 4(sp); \
++ stw ra, 0(sp); \
++ call __errno_location; \
++ ldw ra, 0(sp); \
++ ldw r10, 4(sp); \
++ addi sp, sp, 8; \
++ stw r10, 0(r2); \
++ movi r2, -1; \
++ ret;
++
++#endif
++
++#define DOARGS_0 /* nothing */
++#define DOARGS_1 /* nothing */
++#define DOARGS_2 /* nothing */
++#define DOARGS_3 /* nothing */
++#define DOARGS_4 /* nothing */
++#define DOARGS_5 ldw r8, 0(sp);
++#define DOARGS_6 ldw r9, 4(sp); ldw r8, 0(sp);
++
++/* The function has to return the error code. */
++#undef PSEUDO_ERRVAL
++#define PSEUDO_ERRVAL(name, syscall_name, args) \
++ ENTRY (name) \
++ DO_CALL (syscall_name, args)
++
++#undef PSEUDO_END_ERRVAL
++#define PSEUDO_END_ERRVAL(name) \
++ END (name)
++
++#define ret_ERRVAL ret
++
++#else /* __ASSEMBLER__ */
++
++#include <asm/unistd.h>
++
++/* Define a macro which expands into the inline wrapper code for a system
++ call. */
++#undef INLINE_SYSCALL
++#define INLINE_SYSCALL(name, nr, args...) \
++ ({ INTERNAL_SYSCALL_DECL(err); \
++ unsigned int result_var = INTERNAL_SYSCALL (name, err, nr, args); \
++ if ( INTERNAL_SYSCALL_ERROR_P (result_var, err) ) \
++ { \
++ __set_errno (INTERNAL_SYSCALL_ERRNO (result_var, err)); \
++ result_var = -1L; \
++ } \
++ (int) result_var; })
++
++#undef INTERNAL_SYSCALL_DECL
++#define INTERNAL_SYSCALL_DECL(err) unsigned int err
++
++#undef INTERNAL_SYSCALL_ERROR_P
++#define INTERNAL_SYSCALL_ERROR_P(val, err) ((unsigned int) (err))
++
++#undef INTERNAL_SYSCALL_ERRNO
++#define INTERNAL_SYSCALL_ERRNO(val, err) (val)
++
++#undef INTERNAL_SYSCALL_RAW
++#define INTERNAL_SYSCALL_RAW(name, err, nr, args...) \
++ ({ unsigned int _sys_result; \
++ { \
++ register int _r2 asm ("r2") = (int)(name); \
++ register int _err asm ("r7"); \
++ LOAD_ARGS_##nr (args) \
++ asm volatile ("trap" \
++ : "=r" (_r2), "=r" (_err) \
++ : ASM_ARGS_##nr \
++ : __SYSCALL_CLOBBERS); \
++ _sys_result = _r2; \
++ err = _err; \
++ } \
++ (int) _sys_result; })
++
++#undef INTERNAL_SYSCALL
++#define INTERNAL_SYSCALL(name, err, nr, args...) \
++ INTERNAL_SYSCALL_RAW(SYS_ify(name), err, nr, args)
++
++#undef INTERNAL_SYSCALL_NCS
++#define INTERNAL_SYSCALL_NCS(number, err, nr, args...) \
++ INTERNAL_SYSCALL_RAW(number, err, nr, args)
++
++#define LOAD_ARGS_0()
++#define ASM_ARGS_0 "r" (_r2)
++#define LOAD_ARGS_1(a1) \
++ register int _r4 asm ("r4") = (int) (a1); \
++ LOAD_ARGS_0 ()
++#define ASM_ARGS_1 ASM_ARGS_0, "r" (_r4)
++#define LOAD_ARGS_2(a1, a2) \
++ register int _r5 asm ("r5") = (int) (a2); \
++ LOAD_ARGS_1 (a1)
++#define ASM_ARGS_2 ASM_ARGS_1, "r" (_r5)
++#define LOAD_ARGS_3(a1, a2, a3) \
++ register int _r6 asm ("r6") = (int) (a3); \
++ LOAD_ARGS_2 (a1, a2)
++#define ASM_ARGS_3 ASM_ARGS_2, "r" (_r6)
++#define LOAD_ARGS_4(a1, a2, a3, a4) \
++ register int _r7 asm ("r7") = (int) (a4); \
++ LOAD_ARGS_3 (a1, a2, a3)
++#define ASM_ARGS_4 ASM_ARGS_3, "r" (_r7)
++#define LOAD_ARGS_5(a1, a2, a3, a4, a5) \
++ register int _r8 asm ("r8") = (int) (a5); \
++ LOAD_ARGS_4 (a1, a2, a3, a4)
++#define ASM_ARGS_5 ASM_ARGS_4, "r" (_r8)
++#define LOAD_ARGS_6(a1, a2, a3, a4, a5, a6) \
++ register int _r9 asm ("r9") = (int) (a6); \
++ LOAD_ARGS_5 (a1, a2, a3, a4, a5)
++#define ASM_ARGS_6 ASM_ARGS_5, "r" (_r9)
++
++
++#define __SYSCALL_CLOBBERS "r1", "r3", "r10", "r11", "r12", "r13", "r14", \
++ "r15", "r29", "memory"
++
++#endif /* __ASSEMBLER__ */
++
++#endif /* linux/nios2/sysdep.h */
diff --git a/recipes/glibc/glibc-2.4/zecke-sane-readelf.patch b/recipes/glibc/glibc-2.5/zecke-sane-readelf.patch
index 2bc87974a1..2bc87974a1 100644
--- a/recipes/glibc/glibc-2.4/zecke-sane-readelf.patch
+++ b/recipes/glibc/glibc-2.5/zecke-sane-readelf.patch
diff --git a/recipes/glibc/glibc-2.6.1/arm-longlong.patch b/recipes/glibc/glibc-2.6.1/arm-longlong.patch
new file mode 100644
index 0000000000..28aca83dff
--- /dev/null
+++ b/recipes/glibc/glibc-2.6.1/arm-longlong.patch
@@ -0,0 +1,58 @@
+--- glibc-2.4/stdlib/longlong.h.ark 2006-03-11 22:49:27.000000000 +0100
++++ glibc-2.4/stdlib/longlong.h 2006-03-11 22:55:12.000000000 +0100
+@@ -206,6 +206,14 @@
+ "rI" ((USItype) (bh)), \
+ "r" ((USItype) (al)), \
+ "rI" ((USItype) (bl)) __CLOBBER_CC)
++/* v3m and all higher arches have long multiply support. */
++#if !defined(__ARM_ARCH_2__) && !defined(__ARM_ARCH_3__)
++#define umul_ppmm(xh, xl, a, b) \
++ __asm__ ("umull %0,%1,%2,%3" : "=&r" (xl), "=&r" (xh) : "r" (a), "r" (b))
++#define UMUL_TIME 5
++#define smul_ppmm(xh, xl, a, b) \
++ __asm__ ("smull %0,%1,%2,%3" : "=&r" (xl), "=&r" (xh) : "r" (a), "r" (b))
++#else
+ #define umul_ppmm(xh, xl, a, b) \
+ {register USItype __t0, __t1, __t2; \
+ __asm__ ("%@ Inlined umul_ppmm\n" \
+@@ -227,7 +235,13 @@
+ : "r" ((USItype) (a)), \
+ "r" ((USItype) (b)) __CLOBBER_CC );}
+ #define UMUL_TIME 20
++#endif
+ #define UDIV_TIME 100
++#if defined(__ARM_ARCH_5__) || defined(__ARM_ARCH_5T__) || defined(__ARM_ARCH_5TE__)
++#define count_leading_zeros(COUNT,X) ((COUNT) = __builtin_clz (X))
++#define COUNT_LEADING_ZEROS_0 32
++#endif
++
+ #endif /* __arm__ */
+
+ #if defined (__hppa) && W_TYPE_SIZE == 32
+--- glibc-2.4/ports/sysdeps/arm/mp_clz_tab.c.ark 2006-03-11 22:56:43.000000000 +0100
++++ glibc-2.4/ports/sysdeps/arm/mp_clz_tab.c 2006-03-11 22:58:19.000000000 +0100
+@@ -0,0 +1,24 @@
++/* __clz_tab -- support for longlong.h
++ Copyright (C) 2004 Free Software Foundation, Inc.
++ This file is part of the GNU C Library.
++
++ The GNU C Library is free software; you can redistribute it and/or
++ modify it under the terms of the GNU Lesser General Public
++ License as published by the Free Software Foundation; either
++ version 2.1 of the License, or (at your option) any later version.
++
++ The GNU C Library is distributed in the hope that it will be useful,
++ but WITHOUT ANY WARRANTY; without even the implied warranty of
++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++ Lesser General Public License for more details.
++
++ You should have received a copy of the GNU Lesser General Public
++ License along with the GNU C Library; if not, write to the Free
++ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
++ 02111-1307 USA. */
++
++#if defined(__ARM_ARCH_5__) || defined(__ARM_ARCH_5T__) || defined(__ARM_ARCH_5TE__)
++/* Nothing required. */
++#else
++#include <stdlib/mp_clz_tab.c>
++#endif
diff --git a/recipes/glibc/glibc-2.6.1/arm-memcpy.patch b/recipes/glibc/glibc-2.6.1/arm-memcpy.patch
new file mode 100644
index 0000000000..bc2b3dab84
--- /dev/null
+++ b/recipes/glibc/glibc-2.6.1/arm-memcpy.patch
@@ -0,0 +1,758 @@
+--- /dev/null 2004-02-02 20:32:13.000000000 +0000
++++ sysdeps/arm/memmove.S 2004-03-20 18:37:23.000000000 +0000
+@@ -0,0 +1,251 @@
++/*
++ * Optimized memmove implementation for ARM processors
++ *
++ * Author: Nicolas Pitre
++ * Created: Dec 23, 2003
++ * Copyright: (C) MontaVista Software, Inc.
++ *
++ * This file is free software; you can redistribute it and/or
++ * modify it under the terms of the GNU Lesser General Public
++ * License as published by the Free Software Foundation; either
++ * version 2.1 of the License, or (at your option) any later version.
++ *
++ * This file is distributed in the hope that it will be useful,
++ * but WITHOUT ANY WARRANTY; without even the implied warranty of
++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++ * Lesser General Public License for more details.
++ */
++
++#include <sysdep.h>
++
++
++/*
++ * Endian independent macros for shifting bytes within registers.
++ */
++#ifndef __ARMEB__
++#define pull lsr
++#define push lsl
++#else
++#define pull lsl
++#define push lsr
++#endif
++
++/*
++ * Enable data preload for architectures that support it (ARMv5 and above)
++ */
++#if defined(__ARM_ARCH_5__) || \
++ defined(__ARM_ARCH_5T__) || \
++ defined(__ARM_ARCH_5TE__)
++#define PLD(code...) code
++#else
++#define PLD(code...)
++#endif
++
++
++/* char * memmove (char *dst, const char *src) */
++ENTRY(memmove)
++ subs ip, r0, r1
++ cmphi r2, ip
++ bls memcpy(PLT)
++
++ stmfd sp!, {r0, r4, lr}
++ add r1, r1, r2
++ add r0, r0, r2
++ subs r2, r2, #4
++ blt 25f
++ ands ip, r0, #3
++ PLD( pld [r1, #-4] )
++ bne 26f
++ ands ip, r1, #3
++ bne 27f
++
++19: subs r2, r2, #4
++ blt 24f
++ subs r2, r2, #8
++ blt 23f
++ subs r2, r2, #16
++ blt 22f
++
++ PLD( pld [r1, #-32] )
++ PLD( subs r2, r2, #96 )
++ stmfd sp!, {r5 - r8}
++ PLD( blt 21f )
++
++ PLD( @ cache alignment )
++ PLD( ands ip, r1, #31 )
++ PLD( pld [r1, #-64] )
++ PLD( beq 20f )
++ PLD( cmp r2, ip )
++ PLD( pld [r1, #-96] )
++ PLD( blt 20f )
++ PLD( cmp ip, #16 )
++ PLD( sub r2, r2, ip )
++ PLD( ldmgedb r1!, {r3 - r6} )
++ PLD( stmgedb r0!, {r3 - r6} )
++ PLD( beq 20f )
++ PLD( and ip, ip, #15 )
++ PLD( cmp ip, #8 )
++ PLD( ldr r3, [r1, #-4]! )
++ PLD( ldrge r4, [r1, #-4]! )
++ PLD( ldrgt r5, [r1, #-4]! )
++ PLD( str r3, [r0, #-4]! )
++ PLD( strge r4, [r0, #-4]! )
++ PLD( strgt r5, [r0, #-4]! )
++
++20: PLD( pld [r1, #-96] )
++ PLD( pld [r1, #-128] )
++21: ldmdb r1!, {r3, r4, ip, lr}
++ subs r2, r2, #32
++ stmdb r0!, {r3, r4, ip, lr}
++ ldmdb r1!, {r3, r4, ip, lr}
++ stmgedb r0!, {r3, r4, ip, lr}
++ ldmgedb r1!, {r3, r4, ip, lr}
++ stmgedb r0!, {r3, r4, ip, lr}
++ ldmgedb r1!, {r3, r4, ip, lr}
++ subges r2, r2, #32
++ stmdb r0!, {r3, r4, ip, lr}
++ bge 20b
++ PLD( cmn r2, #96 )
++ PLD( bge 21b )
++ PLD( add r2, r2, #96 )
++ tst r2, #31
++ ldmfd sp!, {r5 - r8}
++ ldmeqfd sp!, {r0, r4, pc}
++
++ tst r2, #16
++22: ldmnedb r1!, {r3, r4, ip, lr}
++ stmnedb r0!, {r3, r4, ip, lr}
++
++ tst r2, #8
++23: ldmnedb r1!, {r3, r4}
++ stmnedb r0!, {r3, r4}
++
++ tst r2, #4
++24: ldrne r3, [r1, #-4]!
++ strne r3, [r0, #-4]!
++
++25: ands r2, r2, #3
++ ldmeqfd sp!, {r0, r4, pc}
++
++ cmp r2, #2
++ ldrb r3, [r1, #-1]
++ ldrgeb r4, [r1, #-2]
++ ldrgtb ip, [r1, #-3]
++ strb r3, [r0, #-1]
++ strgeb r4, [r0, #-2]
++ strgtb ip, [r0, #-3]
++ ldmfd sp!, {r0, r4, pc}
++
++26: cmp ip, #2
++ ldrb r3, [r1, #-1]!
++ ldrgeb r4, [r1, #-1]!
++ ldrgtb lr, [r1, #-1]!
++ strb r3, [r0, #-1]!
++ strgeb r4, [r0, #-1]!
++ strgtb lr, [r0, #-1]!
++ subs r2, r2, ip
++ blt 25b
++ ands ip, r1, #3
++ beq 19b
++
++27: bic r1, r1, #3
++ cmp ip, #2
++ ldr r3, [r1]
++ beq 35f
++ blt 36f
++
++
++ .macro backward_copy_shift push pull
++
++ cmp r2, #12
++ PLD( pld [r1, #-4] )
++ blt 33f
++ subs r2, r2, #28
++ stmfd sp!, {r5 - r9}
++ blt 31f
++
++ PLD( subs r2, r2, #96 )
++ PLD( pld [r1, #-32] )
++ PLD( blt 30f )
++ PLD( pld [r1, #-64] )
++
++ PLD( @ cache alignment )
++ PLD( ands ip, r1, #31 )
++ PLD( pld [r1, #-96] )
++ PLD( beq 29f )
++ PLD( cmp r2, ip )
++ PLD( pld [r1, #-128] )
++ PLD( blt 29f )
++ PLD( sub r2, r2, ip )
++28: PLD( mov r4, r3, push #\push )
++ PLD( ldr r3, [r1, #-4]! )
++ PLD( subs ip, ip, #4 )
++ PLD( orr r4, r4, r3, pull #\pull )
++ PLD( str r4, [r0, #-4]! )
++ PLD( bgt 28b )
++
++29: PLD( pld [r1, #-128] )
++30: mov lr, r3, push #\push
++ ldmdb r1!, {r3 - r9, ip}
++ subs r2, r2, #32
++ orr lr, lr, ip, pull #\pull
++ mov ip, ip, push #\push
++ orr ip, ip, r9, pull #\pull
++ mov r9, r9, push #\push
++ orr r9, r9, r8, pull #\pull
++ mov r8, r8, push #\push
++ orr r8, r8, r7, pull #\pull
++ mov r7, r7, push #\push
++ orr r7, r7, r6, pull #\pull
++ mov r6, r6, push #\push
++ orr r6, r6, r5, pull #\pull
++ mov r5, r5, push #\push
++ orr r5, r5, r4, pull #\pull
++ mov r4, r4, push #\push
++ orr r4, r4, r3, pull #\pull
++ stmdb r0!, {r4 - r9, ip, lr}
++ bge 29b
++ PLD( cmn r2, #96 )
++ PLD( bge 30b )
++ PLD( add r2, r2, #96 )
++ cmn r2, #16
++ blt 32f
++31: mov r7, r3, push #\push
++ ldmdb r1!, {r3 - r6}
++ sub r2, r2, #16
++ orr r7, r7, r6, pull #\pull
++ mov r6, r6, push #\push
++ orr r6, r6, r5, pull #\pull
++ mov r5, r5, push #\push
++ orr r5, r5, r4, pull #\pull
++ mov r4, r4, push #\push
++ orr r4, r4, r3, pull #\pull
++ stmdb r0!, {r4 - r7}
++32: adds r2, r2, #28
++ ldmfd sp!, {r5 - r9}
++ blt 34f
++33: mov r4, r3, push #\push
++ ldr r3, [r1, #-4]!
++ subs r2, r2, #4
++ orr r4, r4, r3, pull #\pull
++ str r4, [r0, #-4]!
++ bge 33b
++34:
++ .endm
++
++
++ backward_copy_shift push=8 pull=24
++ add r1, r1, #3
++ b 25b
++
++35: backward_copy_shift push=16 pull=16
++ add r1, r1, #2
++ b 25b
++
++36: backward_copy_shift push=24 pull=8
++ add r1, r1, #1
++ b 25b
++
++ .size memmove, . - memmove
++END(memmove)
++libc_hidden_builtin_def (memmove)
+--- /dev/null 2004-02-02 20:32:13.000000000 +0000
++++ sysdeps/arm/bcopy.S 2004-03-20 18:37:48.000000000 +0000
+@@ -0,0 +1,255 @@
++/*
++ * Optimized memmove implementation for ARM processors
++ *
++ * Author: Nicolas Pitre
++ * Created: Dec 23, 2003
++ * Copyright: (C) MontaVista Software, Inc.
++ *
++ * This file is free software; you can redistribute it and/or
++ * modify it under the terms of the GNU Lesser General Public
++ * License as published by the Free Software Foundation; either
++ * version 2.1 of the License, or (at your option) any later version.
++ *
++ * This file is distributed in the hope that it will be useful,
++ * but WITHOUT ANY WARRANTY; without even the implied warranty of
++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++ * Lesser General Public License for more details.
++ */
++
++#include <sysdep.h>
++
++
++/*
++ * Endian independent macros for shifting bytes within registers.
++ */
++#ifndef __ARMEB__
++#define pull lsr
++#define push lsl
++#else
++#define pull lsl
++#define push lsr
++#endif
++
++/*
++ * Enable data preload for architectures that support it (ARMv5 and above)
++ */
++#if defined(__ARM_ARCH_5__) || \
++ defined(__ARM_ARCH_5T__) || \
++ defined(__ARM_ARCH_5TE__)
++#define PLD(code...) code
++#else
++#define PLD(code...)
++#endif
++
++dst .req r1
++src .req r0
++
++/* void *bcopy (const char *src, char *dst, size_t size) */
++ENTRY(bcopy)
++ subs ip, dst, src
++ cmphi r2, ip
++ movls r3, r0
++ movls r0, r1
++ movls r1, r3
++ bls memcpy(PLT)
++
++ stmfd sp!, {r4, lr}
++ add src, src, r2
++ add dst, dst, r2
++ subs r2, r2, #4
++ blt 25f
++ ands ip, dst, #3
++ PLD( pld [src, #-4] )
++ bne 26f
++ ands ip, src, #3
++ bne 27f
++
++19: subs r2, r2, #4
++ blt 24f
++ subs r2, r2, #8
++ blt 23f
++ subs r2, r2, #16
++ blt 22f
++
++ PLD( pld [src, #-32] )
++ PLD( subs r2, r2, #96 )
++ stmfd sp!, {r5 - r8}
++ PLD( blt 21f )
++
++ PLD( @ cache alignment )
++ PLD( ands ip, src, #31 )
++ PLD( pld [src, #-64] )
++ PLD( beq 20f )
++ PLD( cmp r2, ip )
++ PLD( pld [src, #-96] )
++ PLD( blt 20f )
++ PLD( cmp ip, #16 )
++ PLD( sub r2, r2, ip )
++ PLD( ldmgedb src!, {r3 - r6} )
++ PLD( stmgedb dst!, {r3 - r6} )
++ PLD( beq 20f )
++ PLD( and ip, ip, #15 )
++ PLD( cmp ip, #8 )
++ PLD( ldr r3, [src, #-4]! )
++ PLD( ldrge r4, [src, #-4]! )
++ PLD( ldrgt r5, [src, #-4]! )
++ PLD( str r3, [dst, #-4]! )
++ PLD( strge r4, [dst, #-4]! )
++ PLD( strgt r5, [dst, #-4]! )
++
++20: PLD( pld [src, #-96] )
++ PLD( pld [src, #-128] )
++21: ldmdb src!, {r3, r4, ip, lr}
++ subs r2, r2, #32
++ stmdb dst!, {r3, r4, ip, lr}
++ ldmdb src!, {r3, r4, ip, lr}
++ stmgedb dst!, {r3, r4, ip, lr}
++ ldmgedb src!, {r3, r4, ip, lr}
++ stmgedb dst!, {r3, r4, ip, lr}
++ ldmgedb src!, {r3, r4, ip, lr}
++ subges r2, r2, #32
++ stmdb dst!, {r3, r4, ip, lr}
++ bge 20b
++ PLD( cmn r2, #96 )
++ PLD( bge 21b )
++ PLD( add r2, r2, #96 )
++ tst r2, #31
++ ldmfd sp!, {r5 - r8}
++ ldmeqfd sp!, {r4, pc}
++
++ tst r2, #16
++22: ldmnedb src!, {r3, r4, ip, lr}
++ stmnedb dst!, {r3, r4, ip, lr}
++
++ tst r2, #8
++23: ldmnedb src!, {r3, r4}
++ stmnedb dst!, {r3, r4}
++
++ tst r2, #4
++24: ldrne r3, [src, #-4]!
++ strne r3, [dst, #-4]!
++
++25: ands r2, r2, #3
++ ldmeqfd sp!, {dst, r4, pc}
++
++ cmp r2, #2
++ ldrb r3, [src, #-1]
++ ldrgeb r4, [src, #-2]
++ ldrgtb ip, [src, #-3]
++ strb r3, [dst, #-1]
++ strgeb r4, [dst, #-2]
++ strgtb ip, [dst, #-3]
++ ldmfd sp!, {dst, r4, pc}
++
++26: cmp ip, #2
++ ldrb r3, [src, #-1]!
++ ldrgeb r4, [src, #-1]!
++ ldrgtb lr, [src, #-1]!
++ strb r3, [dst, #-1]!
++ strgeb r4, [dst, #-1]!
++ strgtb lr, [dst, #-1]!
++ subs r2, r2, ip
++ blt 25b
++ ands ip, src, #3
++ beq 19b
++
++27: bic src, src, #3
++ cmp ip, #2
++ ldr r3, [src]
++ beq 35f
++ blt 36f
++
++
++ .macro backward_copy_shift push pull
++
++ cmp r2, #12
++ PLD( pld [src, #-4] )
++ blt 33f
++ subs r2, r2, #28
++ stmfd sp!, {r5 - r9}
++ blt 31f
++
++ PLD( subs r2, r2, #96 )
++ PLD( pld [src, #-32] )
++ PLD( blt 30f )
++ PLD( pld [src, #-64] )
++
++ PLD( @ cache alignment )
++ PLD( ands ip, src, #31 )
++ PLD( pld [src, #-96] )
++ PLD( beq 29f )
++ PLD( cmp r2, ip )
++ PLD( pld [src, #-128] )
++ PLD( blt 29f )
++ PLD( sub r2, r2, ip )
++28: PLD( mov r4, r3, push #\push )
++ PLD( ldr r3, [src, #-4]! )
++ PLD( subs ip, ip, #4 )
++ PLD( orr r4, r4, r3, pull #\pull )
++ PLD( str r4, [dst, #-4]! )
++ PLD( bgt 28b )
++
++29: PLD( pld [src, #-128] )
++30: mov lr, r3, push #\push
++ ldmdb src!, {r3 - r9, ip}
++ subs r2, r2, #32
++ orr lr, lr, ip, pull #\pull
++ mov ip, ip, push #\push
++ orr ip, ip, r9, pull #\pull
++ mov r9, r9, push #\push
++ orr r9, r9, r8, pull #\pull
++ mov r8, r8, push #\push
++ orr r8, r8, r7, pull #\pull
++ mov r7, r7, push #\push
++ orr r7, r7, r6, pull #\pull
++ mov r6, r6, push #\push
++ orr r6, r6, r5, pull #\pull
++ mov r5, r5, push #\push
++ orr r5, r5, r4, pull #\pull
++ mov r4, r4, push #\push
++ orr r4, r4, r3, pull #\pull
++ stmdb dst!, {r4 - r9, ip, lr}
++ bge 29b
++ PLD( cmn r2, #96 )
++ PLD( bge 30b )
++ PLD( add r2, r2, #96 )
++ cmn r2, #16
++ blt 32f
++31: mov r7, r3, push #\push
++ ldmdb src!, {r3 - r6}
++ sub r2, r2, #16
++ orr r7, r7, r6, pull #\pull
++ mov r6, r6, push #\push
++ orr r6, r6, r5, pull #\pull
++ mov r5, r5, push #\push
++ orr r5, r5, r4, pull #\pull
++ mov r4, r4, push #\push
++ orr r4, r4, r3, pull #\pull
++ stmdb dst!, {r4 - r7}
++32: adds r2, r2, #28
++ ldmfd sp!, {r5 - r9}
++ blt 34f
++33: mov r4, r3, push #\push
++ ldr r3, [src, #-4]!
++ subs r2, r2, #4
++ orr r4, r4, r3, pull #\pull
++ str r4, [dst, #-4]!
++ bge 33b
++34:
++ .endm
++
++
++ backward_copy_shift push=8 pull=24
++ add src, src, #3
++ b 25b
++
++35: backward_copy_shift push=16 pull=16
++ add src, src, #2
++ b 25b
++
++36: backward_copy_shift push=24 pull=8
++ add src, src, #1
++ b 25b
++
++ .size bcopy, . - bcopy
++END(bcopy)
+
+--- /dev/null 2004-02-02 20:32:13.000000000 +0000
++++ sysdeps/arm/memcpy.S 2004-05-02 14:33:22.000000000 +0100
+@@ -0,0 +1,242 @@
++/*
++ * Optimized memcpy implementation for ARM processors
++ *
++ * Author: Nicolas Pitre
++ * Created: Dec 23, 2003
++ * Copyright: (C) MontaVista Software, Inc.
++ *
++ * This file is free software; you can redistribute it and/or
++ * modify it under the terms of the GNU Lesser General Public
++ * License as published by the Free Software Foundation; either
++ * version 2.1 of the License, or (at your option) any later version.
++ *
++ * This file is distributed in the hope that it will be useful,
++ * but WITHOUT ANY WARRANTY; without even the implied warranty of
++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++ * Lesser General Public License for more details.
++ */
++
++#include <sysdep.h>
++
++
++/*
++ * Endian independent macros for shifting bytes within registers.
++ */
++#ifndef __ARMEB__
++#define pull lsr
++#define push lsl
++#else
++#define pull lsl
++#define push lsr
++#endif
++
++/*
++ * Enable data preload for architectures that support it (ARMv5 and above)
++ */
++#if defined(__ARM_ARCH_5__) || \
++ defined(__ARM_ARCH_5T__) || \
++ defined(__ARM_ARCH_5TE__)
++#define PLD(code...) code
++#else
++#define PLD(code...)
++#endif
++
++
++/* char * memcpy (char *dst, const char *src) */
++
++ENTRY(memcpy)
++ subs r2, r2, #4
++ stmfd sp!, {r0, r4, lr}
++ blt 7f
++ ands ip, r0, #3
++ PLD( pld [r1, #0] )
++ bne 8f
++ ands ip, r1, #3
++ bne 9f
++
++1: subs r2, r2, #4
++ blt 6f
++ subs r2, r2, #8
++ blt 5f
++ subs r2, r2, #16
++ blt 4f
++
++ PLD( subs r2, r2, #65 )
++ stmfd sp!, {r5 - r8}
++ PLD( blt 3f )
++ PLD( pld [r1, #32] )
++
++ PLD( @ cache alignment )
++ PLD( ands ip, r1, #31 )
++ PLD( pld [r1, #64] )
++ PLD( beq 2f )
++ PLD( rsb ip, ip, #32 )
++ PLD( cmp r2, ip )
++ PLD( pld [r1, #96] )
++ PLD( blt 2f )
++ PLD( cmp ip, #16 )
++ PLD( sub r2, r2, ip )
++ PLD( ldmgeia r1!, {r3 - r6} )
++ PLD( stmgeia r0!, {r3 - r6} )
++ PLD( beq 2f )
++ PLD( and ip, ip, #15 )
++ PLD( cmp ip, #8 )
++ PLD( ldr r3, [r1], #4 )
++ PLD( ldrge r4, [r1], #4 )
++ PLD( ldrgt r5, [r1], #4 )
++ PLD( str r3, [r0], #4 )
++ PLD( strge r4, [r0], #4 )
++ PLD( strgt r5, [r0], #4 )
++
++2: PLD( pld [r1, #96] )
++3: ldmia r1!, {r3 - r8, ip, lr}
++ subs r2, r2, #32
++ stmia r0!, {r3 - r8, ip, lr}
++ bge 2b
++ PLD( cmn r2, #65 )
++ PLD( bge 3b )
++ PLD( add r2, r2, #65 )
++ tst r2, #31
++ ldmfd sp!, {r5 - r8}
++ ldmeqfd sp!, {r0, r4, pc}
++
++ tst r2, #16
++4: ldmneia r1!, {r3, r4, ip, lr}
++ stmneia r0!, {r3, r4, ip, lr}
++
++ tst r2, #8
++5: ldmneia r1!, {r3, r4}
++ stmneia r0!, {r3, r4}
++
++ tst r2, #4
++6: ldrne r3, [r1], #4
++ strne r3, [r0], #4
++
++7: ands r2, r2, #3
++ ldmeqfd sp!, {r0, r4, pc}
++
++ cmp r2, #2
++ ldrb r3, [r1], #1
++ ldrgeb r4, [r1], #1
++ ldrgtb ip, [r1]
++ strb r3, [r0], #1
++ strgeb r4, [r0], #1
++ strgtb ip, [r0]
++ ldmfd sp!, {r0, r4, pc}
++
++8: rsb ip, ip, #4
++ cmp ip, #2
++ ldrb r3, [r1], #1
++ ldrgeb r4, [r1], #1
++ ldrgtb lr, [r1], #1
++ strb r3, [r0], #1
++ strgeb r4, [r0], #1
++ strgtb lr, [r0], #1
++ subs r2, r2, ip
++ blt 7b
++ ands ip, r1, #3
++ beq 1b
++
++9: bic r1, r1, #3
++ cmp ip, #2
++ ldr lr, [r1], #4
++ beq 17f
++ bgt 18f
++
++
++ .macro forward_copy_shift pull push
++
++ cmp r2, #12
++ PLD( pld [r1, #0] )
++ blt 15f
++ subs r2, r2, #28
++ stmfd sp!, {r5 - r9}
++ blt 13f
++
++ PLD( subs r2, r2, #97 )
++ PLD( blt 12f )
++ PLD( pld [r1, #32] )
++
++ PLD( @ cache alignment )
++ PLD( rsb ip, r1, #36 )
++ PLD( pld [r1, #64] )
++ PLD( ands ip, ip, #31 )
++ PLD( pld [r1, #96] )
++ PLD( beq 11f )
++ PLD( cmp r2, ip )
++ PLD( pld [r1, #128] )
++ PLD( blt 11f )
++ PLD( sub r2, r2, ip )
++10: PLD( mov r3, lr, pull #\pull )
++ PLD( ldr lr, [r1], #4 )
++ PLD( subs ip, ip, #4 )
++ PLD( orr r3, r3, lr, push #\push )
++ PLD( str r3, [r0], #4 )
++ PLD( bgt 10b )
++
++11: PLD( pld [r1, #128] )
++12: mov r3, lr, pull #\pull
++ ldmia r1!, {r4 - r9, ip, lr}
++ subs r2, r2, #32
++ orr r3, r3, r4, push #\push
++ mov r4, r4, pull #\pull
++ orr r4, r4, r5, push #\push
++ mov r5, r5, pull #\pull
++ orr r5, r5, r6, push #\push
++ mov r6, r6, pull #\pull
++ orr r6, r6, r7, push #\push
++ mov r7, r7, pull #\pull
++ orr r7, r7, r8, push #\push
++ mov r8, r8, pull #\pull
++ orr r8, r8, r9, push #\push
++ mov r9, r9, pull #\pull
++ orr r9, r9, ip, push #\push
++ mov ip, ip, pull #\pull
++ orr ip, ip, lr, push #\push
++ stmia r0!, {r3 - r9, ip}
++ bge 11b
++ PLD( cmn r2, #97 )
++ PLD( bge 12b )
++ PLD( add r2, r2, #97 )
++ cmn r2, #16
++ blt 14f
++13: mov r3, lr, pull #\pull
++ ldmia r1!, {r4 - r6, lr}
++ sub r2, r2, #16
++ orr r3, r3, r4, push #\push
++ mov r4, r4, pull #\pull
++ orr r4, r4, r5, push #\push
++ mov r5, r5, pull #\pull
++ orr r5, r5, r6, push #\push
++ mov r6, r6, pull #\pull
++ orr r6, r6, lr, push #\push
++ stmia r0!, {r3 - r6}
++14: adds r2, r2, #28
++ ldmfd sp!, {r5 - r9}
++ blt 16f
++15: mov r3, lr, pull #\pull
++ ldr lr, [r1], #4
++ subs r2, r2, #4
++ orr r3, r3, lr, push #\push
++ str r3, [r0], #4
++ bge 15b
++16:
++ .endm
++
++
++ forward_copy_shift pull=8 push=24
++ sub r1, r1, #3
++ b 7b
++
++17: forward_copy_shift pull=16 push=16
++ sub r1, r1, #2
++ b 7b
++
++18: forward_copy_shift pull=24 push=8
++ sub r1, r1, #1
++ b 7b
++
++ .size memcpy, . - memcpy
++END(memcpy)
++libc_hidden_builtin_def (memcpy)
++
diff --git a/recipes/glibc/glibc-2.6.1/dl-cache-libcmp.patch b/recipes/glibc/glibc-2.6.1/dl-cache-libcmp.patch
new file mode 100644
index 0000000000..2fedfa6db0
--- /dev/null
+++ b/recipes/glibc/glibc-2.6.1/dl-cache-libcmp.patch
@@ -0,0 +1,10 @@
+--- glibc-2.4/elf/Versions.ark 2006-03-11 23:30:09.000000000 +0100
++++ glibc-2.4/elf/Versions 2006-03-11 23:31:44.000000000 +0100
+@@ -63,5 +63,7 @@
+ _dl_debug_state;
+ # Pointer protection.
+ __pointer_chk_guard;
++ # for ldconfig
++ _dl_cache_libcmp;
+ }
+ }
diff --git a/recipes/glibc/glibc-2.6.1/etc/ld.so.conf b/recipes/glibc/glibc-2.6.1/etc/ld.so.conf
new file mode 100644
index 0000000000..46e06d3f0a
--- /dev/null
+++ b/recipes/glibc/glibc-2.6.1/etc/ld.so.conf
@@ -0,0 +1,2 @@
+/usr/local/lib
+
diff --git a/recipes/glibc/glibc-2.6.1/fhs-linux-paths.patch b/recipes/glibc/glibc-2.6.1/fhs-linux-paths.patch
new file mode 100644
index 0000000000..1f32f6d7f2
--- /dev/null
+++ b/recipes/glibc/glibc-2.6.1/fhs-linux-paths.patch
@@ -0,0 +1,11 @@
+--- glibc-2.1.1/sysdeps/unix/sysv/linux/paths.h~ Thu May 27 13:16:33 1999
++++ glibc-2.1.1/sysdeps/unix/sysv/linux/paths.h Thu May 27 13:17:55 1999
+@@ -71,7 +71,7 @@
+ /* Provide trailing slash, since mostly used for building pathnames. */
+ #define _PATH_DEV "/dev/"
+ #define _PATH_TMP "/tmp/"
+-#define _PATH_VARDB "/var/db/"
++#define _PATH_VARDB "/var/lib/misc/"
+ #define _PATH_VARRUN "/var/run/"
+ #define _PATH_VARTMP "/var/tmp/"
+
diff --git a/recipes/glibc/glibc-2.6.1/generate-supported.mk b/recipes/glibc/glibc-2.6.1/generate-supported.mk
new file mode 100644
index 0000000000..d2a28c2dc6
--- /dev/null
+++ b/recipes/glibc/glibc-2.6.1/generate-supported.mk
@@ -0,0 +1,11 @@
+#!/usr/bin/make
+
+include $(IN)
+
+all:
+ rm -f $(OUT)
+ touch $(OUT)
+ for locale in $(SUPPORTED-LOCALES); do \
+ [ $$locale = true ] && continue; \
+ echo $$locale | sed 's,/, ,' >> $(OUT); \
+ done
diff --git a/recipes/glibc/glibc-2.6.1/generic-bits_select.h b/recipes/glibc/glibc-2.6.1/generic-bits_select.h
new file mode 100644
index 0000000000..47e7dedc30
--- /dev/null
+++ b/recipes/glibc/glibc-2.6.1/generic-bits_select.h
@@ -0,0 +1,35 @@
+/* Copyright (C) 1997, 1998, 2001 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _SYS_SELECT_H
+# error "Never use <bits/select.h> directly; include <sys/select.h> instead."
+#endif
+
+
+/* We don't use `memset' because this would require a prototype and
+ the array isn't too big. */
+#define __FD_ZERO(s) \
+ do { \
+ unsigned int __i; \
+ fd_set *__arr = (s); \
+ for (__i = 0; __i < sizeof (fd_set) / sizeof (__fd_mask); ++__i) \
+ __FDS_BITS (__arr)[__i] = 0; \
+ } while (0)
+#define __FD_SET(d, s) (__FDS_BITS (s)[__FDELT(d)] |= __FDMASK(d))
+#define __FD_CLR(d, s) (__FDS_BITS (s)[__FDELT(d)] &= ~__FDMASK(d))
+#define __FD_ISSET(d, s) ((__FDS_BITS (s)[__FDELT(d)] & __FDMASK(d)) != 0)
diff --git a/recipes/glibc/glibc-2.6.1/generic-bits_time.h b/recipes/glibc/glibc-2.6.1/generic-bits_time.h
new file mode 100644
index 0000000000..b3184d1de9
--- /dev/null
+++ b/recipes/glibc/glibc-2.6.1/generic-bits_time.h
@@ -0,0 +1,75 @@
+/* System-dependent timing definitions. Generic version.
+ Copyright (C) 1996,1997,1999-2002,2003 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+/*
+ * Never include this file directly; use <time.h> instead.
+ */
+
+#ifndef __need_timeval
+# ifndef _BITS_TIME_H
+# define _BITS_TIME_H 1
+
+/* ISO/IEC 9899:1990 7.12.1: <time.h>
+ The macro `CLOCKS_PER_SEC' is the number per second of the value
+ returned by the `clock' function. */
+/* CAE XSH, Issue 4, Version 2: <time.h>
+ The value of CLOCKS_PER_SEC is required to be 1 million on all
+ XSI-conformant systems. */
+# define CLOCKS_PER_SEC 1000000l
+
+# if !defined __STRICT_ANSI__ && !defined __USE_XOPEN2K
+/* Even though CLOCKS_PER_SEC has such a strange value CLK_TCK
+ presents the real value for clock ticks per second for the system. */
+# include <bits/types.h>
+extern long int __sysconf (int);
+# define CLK_TCK ((__clock_t) __sysconf (2)) /* 2 is _SC_CLK_TCK */
+# endif
+
+# ifdef __USE_POSIX199309
+/* Identifier for system-wide realtime clock. */
+# define CLOCK_REALTIME 0
+/* Monotonic system-wide clock. */
+# define CLOCK_MONOTONIC 1
+/* High-resolution timer from the CPU. */
+# define CLOCK_PROCESS_CPUTIME_ID 2
+/* Thread-specific CPU-time clock. */
+# define CLOCK_THREAD_CPUTIME_ID 3
+
+/* Flag to indicate time is absolute. */
+# define TIMER_ABSTIME 1
+# endif
+
+# endif /* bits/time.h */
+#endif
+
+#ifdef __need_timeval
+# undef __need_timeval
+# ifndef _STRUCT_TIMEVAL
+# define _STRUCT_TIMEVAL 1
+# include <bits/types.h>
+
+/* A time value that is accurate to the nearest
+ microsecond but also has a range of years. */
+struct timeval
+ {
+ __time_t tv_sec; /* Seconds. */
+ __suseconds_t tv_usec; /* Microseconds. */
+ };
+# endif /* struct timeval */
+#endif /* need timeval */
diff --git a/recipes/glibc/glibc-2.6.1/generic-bits_types.h b/recipes/glibc/glibc-2.6.1/generic-bits_types.h
new file mode 100644
index 0000000000..65c8a9fe90
--- /dev/null
+++ b/recipes/glibc/glibc-2.6.1/generic-bits_types.h
@@ -0,0 +1,200 @@
+/* bits/types.h -- definitions of __*_t types underlying *_t types.
+ Copyright (C) 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+/*
+ * Never include this file directly; use <sys/types.h> instead.
+ */
+
+#ifndef _BITS_TYPES_H
+#define _BITS_TYPES_H 1
+
+#include <features.h>
+#include <bits/wordsize.h>
+
+#define __need_size_t
+#include <stddef.h>
+
+/* Convenience types. */
+typedef unsigned char __u_char;
+typedef unsigned short int __u_short;
+typedef unsigned int __u_int;
+typedef unsigned long int __u_long;
+
+/* Fixed-size types, underlying types depend on word size and compiler. */
+typedef signed char __int8_t;
+typedef unsigned char __uint8_t;
+typedef signed short int __int16_t;
+typedef unsigned short int __uint16_t;
+typedef signed int __int32_t;
+typedef unsigned int __uint32_t;
+#if __WORDSIZE == 64
+typedef signed long int __int64_t;
+typedef unsigned long int __uint64_t;
+#elif defined __GLIBC_HAVE_LONG_LONG
+__extension__ typedef signed long long int __int64_t;
+__extension__ typedef unsigned long long int __uint64_t;
+#endif
+
+/* quad_t is also 64 bits. */
+#if __WORDSIZE == 64
+typedef long int __quad_t;
+typedef unsigned long int __u_quad_t;
+#elif defined __GLIBC_HAVE_LONG_LONG
+__extension__ typedef long long int __quad_t;
+__extension__ typedef unsigned long long int __u_quad_t;
+#else
+typedef struct
+{
+ long __val[2];
+} __quad_t;
+typedef struct
+{
+ __u_long __val[2];
+} __u_quad_t;
+#endif
+
+
+/* The machine-dependent file <bits/typesizes.h> defines __*_T_TYPE
+ macros for each of the OS types we define below. The definitions
+ of those macros must use the following macros for underlying types.
+ We define __S<SIZE>_TYPE and __U<SIZE>_TYPE for the signed and unsigned
+ variants of each of the following integer types on this machine.
+
+ 16 -- "natural" 16-bit type (always short)
+ 32 -- "natural" 32-bit type (always int)
+ 64 -- "natural" 64-bit type (long or long long)
+ LONG32 -- 32-bit type, traditionally long
+ QUAD -- 64-bit type, always long long
+ WORD -- natural type of __WORDSIZE bits (int or long)
+ LONGWORD -- type of __WORDSIZE bits, traditionally long
+
+ We distinguish WORD/LONGWORD, 32/LONG32, and 64/QUAD so that the
+ conventional uses of `long' or `long long' type modifiers match the
+ types we define, even when a less-adorned type would be the same size.
+ This matters for (somewhat) portably writing printf/scanf formats for
+ these types, where using the appropriate l or ll format modifiers can
+ make the typedefs and the formats match up across all GNU platforms. If
+ we used `long' when it's 64 bits where `long long' is expected, then the
+ compiler would warn about the formats not matching the argument types,
+ and the programmer changing them to shut up the compiler would break the
+ program's portability.
+
+ Here we assume what is presently the case in all the GCC configurations
+ we support: long long is always 64 bits, long is always word/address size,
+ and int is always 32 bits. */
+
+#define __S16_TYPE short int
+#define __U16_TYPE unsigned short int
+#define __S32_TYPE int
+#define __U32_TYPE unsigned int
+#define __SLONGWORD_TYPE long int
+#define __ULONGWORD_TYPE unsigned long int
+#if __WORDSIZE == 32
+# define __SQUAD_TYPE __quad_t
+# define __UQUAD_TYPE __u_quad_t
+# define __SWORD_TYPE int
+# define __UWORD_TYPE unsigned int
+# define __SLONG32_TYPE long int
+# define __ULONG32_TYPE unsigned long int
+# define __S64_TYPE __quad_t
+# define __U64_TYPE __u_quad_t
+/* We want __extension__ before typedef's that use nonstandard base types
+ such as `long long' in C89 mode. */
+# define __STD_TYPE __extension__ typedef
+#elif __WORDSIZE == 64
+# define __SQUAD_TYPE long int
+# define __UQUAD_TYPE unsigned long int
+# define __SWORD_TYPE long int
+# define __UWORD_TYPE unsigned long int
+# define __SLONG32_TYPE int
+# define __ULONG32_TYPE unsigned int
+# define __S64_TYPE long int
+# define __U64_TYPE unsigned long int
+/* No need to mark the typedef with __extension__. */
+# define __STD_TYPE typedef
+#else
+# error
+#endif
+#include <bits/typesizes.h> /* Defines __*_T_TYPE macros. */
+
+
+__STD_TYPE __DEV_T_TYPE __dev_t; /* Type of device numbers. */
+__STD_TYPE __UID_T_TYPE __uid_t; /* Type of user identifications. */
+__STD_TYPE __GID_T_TYPE __gid_t; /* Type of group identifications. */
+__STD_TYPE __INO_T_TYPE __ino_t; /* Type of file serial numbers. */
+__STD_TYPE __INO64_T_TYPE __ino64_t; /* Type of file serial numbers (LFS).*/
+__STD_TYPE __MODE_T_TYPE __mode_t; /* Type of file attribute bitmasks. */
+__STD_TYPE __NLINK_T_TYPE __nlink_t; /* Type of file link counts. */
+__STD_TYPE __OFF_T_TYPE __off_t; /* Type of file sizes and offsets. */
+__STD_TYPE __OFF64_T_TYPE __off64_t; /* Type of file sizes and offsets (LFS). */
+__STD_TYPE __PID_T_TYPE __pid_t; /* Type of process identifications. */
+__STD_TYPE __FSID_T_TYPE __fsid_t; /* Type of file system IDs. */
+__STD_TYPE __CLOCK_T_TYPE __clock_t; /* Type of CPU usage counts. */
+__STD_TYPE __RLIM_T_TYPE __rlim_t; /* Type for resource measurement. */
+__STD_TYPE __RLIM64_T_TYPE __rlim64_t; /* Type for resource measurement (LFS). */
+__STD_TYPE __ID_T_TYPE __id_t; /* General type for IDs. */
+__STD_TYPE __TIME_T_TYPE __time_t; /* Seconds since the Epoch. */
+__STD_TYPE __USECONDS_T_TYPE __useconds_t; /* Count of microseconds. */
+__STD_TYPE __SUSECONDS_T_TYPE __suseconds_t; /* Signed count of microseconds. */
+
+__STD_TYPE __DADDR_T_TYPE __daddr_t; /* The type of a disk address. */
+__STD_TYPE __SWBLK_T_TYPE __swblk_t; /* Type of a swap block maybe? */
+__STD_TYPE __KEY_T_TYPE __key_t; /* Type of an IPC key. */
+
+/* Clock ID used in clock and timer functions. */
+__STD_TYPE __CLOCKID_T_TYPE __clockid_t;
+
+/* Timer ID returned by `timer_create'. */
+__STD_TYPE __TIMER_T_TYPE __timer_t;
+
+/* Type to represent block size. */
+__STD_TYPE __BLKSIZE_T_TYPE __blksize_t;
+
+/* Types from the Large File Support interface. */
+
+/* Type to count number of disk blocks. */
+__STD_TYPE __BLKCNT_T_TYPE __blkcnt_t;
+__STD_TYPE __BLKCNT64_T_TYPE __blkcnt64_t;
+
+/* Type to count file system blocks. */
+__STD_TYPE __FSBLKCNT_T_TYPE __fsblkcnt_t;
+__STD_TYPE __FSBLKCNT64_T_TYPE __fsblkcnt64_t;
+
+/* Type to count file system nodes. */
+__STD_TYPE __FSFILCNT_T_TYPE __fsfilcnt_t;
+__STD_TYPE __FSFILCNT64_T_TYPE __fsfilcnt64_t;
+
+__STD_TYPE __SSIZE_T_TYPE __ssize_t; /* Type of a byte count, or error. */
+
+/* These few don't really vary by system, they always correspond
+ to one of the other defined types. */
+typedef __off64_t __loff_t; /* Type of file sizes and offsets (LFS). */
+typedef __quad_t *__qaddr_t;
+typedef char *__caddr_t;
+
+/* Duplicates info from stdint.h but this is used in unistd.h. */
+__STD_TYPE __SWORD_TYPE __intptr_t;
+
+/* Duplicate info from sys/socket.h. */
+__STD_TYPE __U32_TYPE __socklen_t;
+
+
+#undef __STD_TYPE
+
+#endif /* bits/types.h */
diff --git a/recipes/glibc/glibc-2.6.1/generic-bits_typesizes.h b/recipes/glibc/glibc-2.6.1/generic-bits_typesizes.h
new file mode 100644
index 0000000000..e9226c4174
--- /dev/null
+++ b/recipes/glibc/glibc-2.6.1/generic-bits_typesizes.h
@@ -0,0 +1,66 @@
+/* bits/typesizes.h -- underlying types for *_t. Generic version.
+ Copyright (C) 2002, 2003 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _BITS_TYPES_H
+# error "Never include <bits/typesizes.h> directly; use <sys/types.h> instead."
+#endif
+
+#ifndef _BITS_TYPESIZES_H
+#define _BITS_TYPESIZES_H 1
+
+/* See <bits/types.h> for the meaning of these macros. This file exists so
+ that <bits/types.h> need not vary across different GNU platforms. */
+
+#define __DEV_T_TYPE __UQUAD_TYPE
+#define __UID_T_TYPE __U32_TYPE
+#define __GID_T_TYPE __U32_TYPE
+#define __INO_T_TYPE __ULONGWORD_TYPE
+#define __INO64_T_TYPE __UQUAD_TYPE
+#define __MODE_T_TYPE __U32_TYPE
+#define __NLINK_T_TYPE __UWORD_TYPE
+#define __OFF_T_TYPE __SLONGWORD_TYPE
+#define __OFF64_T_TYPE __SQUAD_TYPE
+#define __PID_T_TYPE __S32_TYPE
+#define __RLIM_T_TYPE __ULONGWORD_TYPE
+#define __RLIM64_T_TYPE __UQUAD_TYPE
+#define __BLKCNT_T_TYPE __SLONGWORD_TYPE
+#define __BLKCNT64_T_TYPE __SQUAD_TYPE
+#define __FSBLKCNT_T_TYPE __ULONGWORD_TYPE
+#define __FSBLKCNT64_T_TYPE __UQUAD_TYPE
+#define __FSFILCNT_T_TYPE __ULONGWORD_TYPE
+#define __FSFILCNT64_T_TYPE __UQUAD_TYPE
+#define __ID_T_TYPE __U32_TYPE
+#define __CLOCK_T_TYPE __SLONGWORD_TYPE
+#define __TIME_T_TYPE __SLONGWORD_TYPE
+#define __USECONDS_T_TYPE __U32_TYPE
+#define __SUSECONDS_T_TYPE __SLONGWORD_TYPE
+#define __DADDR_T_TYPE __S32_TYPE
+#define __SWBLK_T_TYPE __SLONGWORD_TYPE
+#define __KEY_T_TYPE __S32_TYPE
+#define __CLOCKID_T_TYPE __S32_TYPE
+#define __TIMER_T_TYPE void *
+#define __BLKSIZE_T_TYPE __SLONGWORD_TYPE
+#define __FSID_T_TYPE struct { int __val[2]; }
+#define __SSIZE_T_TYPE __SWORD_TYPE
+
+/* Number of descriptors that can fit in an `fd_set'. */
+#define __FD_SETSIZE 1024
+
+
+#endif /* bits/typesizes.h */
diff --git a/recipes/glibc/glibc-2.6.1/glibc-2.5-local-dynamic-resolvconf.patch b/recipes/glibc/glibc-2.6.1/glibc-2.5-local-dynamic-resolvconf.patch
new file mode 100644
index 0000000000..e137287dd1
--- /dev/null
+++ b/recipes/glibc/glibc-2.6.1/glibc-2.5-local-dynamic-resolvconf.patch
@@ -0,0 +1,41 @@
+# All lines beginning with `# DP:' are a description of the patch.
+# DP: Description: allow dynamic long-running processes to
+# DP: re-read a dynamically updated resolv.conf on the fly
+# DP: Dpatch author: Adam Conrad <adconrad@ubuntu.com>
+# DP: Patch author: Thorsten Kukuk <kukuk@suse.de>
+# DP: Upstream status: Ubuntu-Specific
+# DP: Date: 2006-01-13 08:14:21 UTC
+
+Index: resolv/res_libc.c
+===================================================================
+--- resolv/res_libc.c.orig
++++ resolv/res_libc.c
+@@ -22,7 +22,7 @@
+ #include <arpa/nameser.h>
+ #include <resolv.h>
+ #include <bits/libc-lock.h>
+-
++#include <sys/stat.h>
+
+ /* The following bit is copied from res_data.c (where it is #ifdef'ed
+ out) since res_init() should go into libc.so but the rest of that
+@@ -94,8 +94,17 @@
+ int
+ __res_maybe_init (res_state resp, int preinit)
+ {
+- if (resp->options & RES_INIT) {
+- if (__res_initstamp != resp->_u._ext.initstamp) {
++ static time_t last_mtime;
++ struct stat statbuf;
++ int ret;
++
++
++ if (resp->options & RES_INIT) {
++ ret = stat (_PATH_RESCONF, &statbuf);
++ if (__res_initstamp != resp->_u._ext.initstamp
++ || (ret == 0) && (last_mtime != statbuf.st_mtime))
++ {
++ last_mtime = statbuf.st_mtime;
+ if (resp->nscount > 0) {
+ __res_iclose (resp, true);
+ return __res_vinit (resp, 1);
diff --git a/recipes/glibc/glibc-2.6.1/glibc-2.6.1-use-short-for-fnstsw.patch b/recipes/glibc/glibc-2.6.1/glibc-2.6.1-use-short-for-fnstsw.patch
new file mode 100644
index 0000000000..6979229279
--- /dev/null
+++ b/recipes/glibc/glibc-2.6.1/glibc-2.6.1-use-short-for-fnstsw.patch
@@ -0,0 +1,30 @@
+Source: http://sourceware.org/ml/libc-alpha/2008-01/msg00017.html
+
+I am checking this x86 assembler patch:
+
+http://sourceware.org/ml/binutils/2008-01/msg00148.html
+
+to check operand size. fnstsw stores 16bit into %ax. The upper
+16bit of %eax is unchanged. The new assembler will disallow
+"fnstsw %eax". Here is a patch for glibc.
+
+
+H.J.
+
+---
+ sysdeps/i386/fpu/ftestexcept.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+Index: glibc-2.6.1/sysdeps/i386/fpu/ftestexcept.c
+===================================================================
+--- glibc-2.6.1.orig/sysdeps/i386/fpu/ftestexcept.c 2008-07-19 11:00:45.000000000 -0700
++++ glibc-2.6.1/sysdeps/i386/fpu/ftestexcept.c 2008-07-19 11:01:25.000000000 -0700
+@@ -26,7 +26,7 @@
+ int
+ fetestexcept (int excepts)
+ {
+- int temp;
++ short temp;
+ int xtemp = 0;
+
+ /* Get current exceptions. */
diff --git a/recipes/glibc/glibc-2.6.1/glibc-arm-no-asm-page.patch b/recipes/glibc/glibc-2.6.1/glibc-arm-no-asm-page.patch
new file mode 100644
index 0000000000..7eb17179ba
--- /dev/null
+++ b/recipes/glibc/glibc-2.6.1/glibc-arm-no-asm-page.patch
@@ -0,0 +1,15 @@
+http://sourceware.org/ml/libc-ports/2008-04/msg00005.html
+
+
+Index: glibc-2.6.1/ports/sysdeps/unix/sysv/linux/arm/ioperm.c
+===================================================================
+--- glibc-2.6.1.orig/ports/sysdeps/unix/sysv/linux/arm/ioperm.c 2008-09-12 18:08:18.000000000 -0700
++++ glibc-2.6.1/ports/sysdeps/unix/sysv/linux/arm/ioperm.c 2008-09-12 18:08:28.000000000 -0700
+@@ -45,7 +45,6 @@
+ #include <sys/mman.h>
+
+ #include <linux/version.h>
+-#include <asm/page.h>
+ #include <sys/sysctl.h>
+
+ #define PATH_ARM_SYSTYPE "/etc/arm_systype"
diff --git a/recipes/glibc/glibc-2.6.1/glibc-check_pf.patch b/recipes/glibc/glibc-2.6.1/glibc-check_pf.patch
new file mode 100644
index 0000000000..3cff6bbcfa
--- /dev/null
+++ b/recipes/glibc/glibc-2.6.1/glibc-check_pf.patch
@@ -0,0 +1,343 @@
+From libc-ports-return-550-listarch-libc-ports=sources dot redhat dot com at sourceware dot org Tue Oct 31 17:37:21 2006
+Return-Path: <libc-ports-return-550-listarch-libc-ports=sources dot redhat dot com at sourceware dot org>
+Delivered-To: listarch-libc-ports at sources dot redhat dot com
+Received: (qmail 17273 invoked by alias); 31 Oct 2006 17:37:20 -0000
+Received: (qmail 17262 invoked by uid 22791); 31 Oct 2006 17:37:19 -0000
+X-Spam-Status: No, hits=-2.5 required=5.0 tests=AWL,BAYES_00,TW_CP
+X-Spam-Check-By: sourceware.org
+Received: from nevyn.them.org (HELO nevyn.them.org) (66.93.172.17) by sourceware.org (qpsmtpd/0.31.1) with ESMTP; Tue, 31 Oct 2006 17:37:11 +0000
+Received: from drow by nevyn.them.org with local (Exim 4.54) id 1GexXw-0007Dj-30; Tue, 31 Oct 2006 12:37:08 -0500
+Date: Tue, 31 Oct 2006 12:37:08 -0500
+From: Daniel Jacobowitz <drow at false dot org>
+To: Mike Frysinger <vapier at gentoo dot org>
+Cc: libc-ports at sourceware dot org, Philip Balister <philip dot balister at gmail dot com>
+Subject: Re: Problem with glibc-2.5 on ARM
+Message-ID: <20061031173708.GJ20468@nevyn.them.org>
+References: <499146270610241149ibe030e0nd9d6b177a95b346e@mail.gmail.com> <499146270610241254u7cadf63ej2edf05cedbc5266f@mail.gmail.com> <20061024195837.GA20181@nevyn.them.org> <200610291954.27022.vapier@gentoo.org>
+MIME-Version: 1.0
+Content-Type: text/plain; charset=us-ascii
+Content-Disposition: inline
+In-Reply-To: <200610291954 dot 27022 dot vapier at gentoo dot org>
+User-Agent: Mutt/1.5.13 (2006-08-11)
+X-IsSubscribed: yes
+Mailing-List: contact libc-ports-help at sourceware dot org; run by ezmlm
+Precedence: bulk
+List-Subscribe: <mailto:libc-ports-subscribe at sourceware dot org>
+List-Post: <mailto:libc-ports at sourceware dot org>
+List-Help: <mailto:libc-ports-help at sourceware dot org>, <http://sourceware dot org/lists dot html#faqs>
+Sender: libc-ports-owner at sourceware dot org
+Delivered-To: mailing list libc-ports at sourceware dot org
+
+On Sun, Oct 29, 2006 at 07:54:25PM -0500, Mike Frysinger wrote:
+> On Tuesday 24 October 2006 15:58, Daniel Jacobowitz wrote:
+> > ARM is going to need a slightly different version of that file, I
+> > guess.
+>
+> would declaring req with attribute packed not help ?
+> -mike
+
+Nope. "struct rtgenmsg" would still have size 4.
+
+Philip, are you still at all interested in this for the old ABI?
+I don't have time to test this patch right now, but I think it
+will work.
+
+--
+Daniel Jacobowitz
+CodeSourcery
+
+2006-10-31 Daniel Jacobowitz <dan@codesourcery.com>
+
+ * sysdeps/unix/sysv/linux/arm/check_pf.c: New file.
+ * sysdeps/unix/sysv/linux/arm/eabi/check_pf.c: New file.
+
+Index: sysdeps/unix/sysv/linux/arm/check_pf.c
+===================================================================
+RCS file: sysdeps/unix/sysv/linux/arm/check_pf.c
+diff -N sysdeps/unix/sysv/linux/arm/check_pf.c
+--- /dev/null 1 Jan 1970 00:00:00 -0000
++++ sysdeps/unix/sysv/linux/arm/check_pf.c 31 Oct 2006 17:29:58 -0000
+@@ -0,0 +1,274 @@
++/* Determine protocol families for which interfaces exist. ARM Linux version.
++ Copyright (C) 2003, 2006 Free Software Foundation, Inc.
++ This file is part of the GNU C Library.
++
++ The GNU C Library is free software; you can redistribute it and/or
++ modify it under the terms of the GNU Lesser General Public
++ License as published by the Free Software Foundation; either
++ version 2.1 of the License, or (at your option) any later version.
++
++ The GNU C Library is distributed in the hope that it will be useful,
++ but WITHOUT ANY WARRANTY; without even the implied warranty of
++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++ Lesser General Public License for more details.
++
++ You should have received a copy of the GNU Lesser General Public
++ License along with the GNU C Library; if not, write to the Free
++ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
++ 02111-1307 USA. */
++
++#include <assert.h>
++#include <errno.h>
++#include <ifaddrs.h>
++#include <netdb.h>
++#include <stddef.h>
++#include <string.h>
++#include <time.h>
++#include <unistd.h>
++#include <sys/socket.h>
++
++#include <asm/types.h>
++#include <linux/netlink.h>
++#include <linux/rtnetlink.h>
++
++#include <not-cancel.h>
++#include <kernel-features.h>
++
++
++#ifndef IFA_F_TEMPORARY
++# define IFA_F_TEMPORARY IFA_F_SECONDARY
++#endif
++#ifndef IFA_F_HOMEADDRESS
++# define IFA_F_HOMEADDRESS 0
++#endif
++
++
++static int
++make_request (int fd, pid_t pid, bool *seen_ipv4, bool *seen_ipv6,
++ struct in6addrinfo **in6ai, size_t *in6ailen)
++{
++ struct req
++ {
++ struct nlmsghdr nlh;
++ struct rtgenmsg g;
++ } req;
++ struct sockaddr_nl nladdr;
++
++ /* struct rtgenmsg consists of a single byte but the ARM ABI rounds
++ it up to a word. Clear the padding explicitly here. */
++ assert (sizeof (req.g) == 4);
++ memset (&req.g, '\0', sizeof (req.g));
++
++ req.nlh.nlmsg_len = sizeof (req);
++ req.nlh.nlmsg_type = RTM_GETADDR;
++ req.nlh.nlmsg_flags = NLM_F_ROOT | NLM_F_MATCH | NLM_F_REQUEST;
++ req.nlh.nlmsg_pid = 0;
++ req.nlh.nlmsg_seq = time (NULL);
++ req.g.rtgen_family = AF_UNSPEC;
++
++ memset (&nladdr, '\0', sizeof (nladdr));
++ nladdr.nl_family = AF_NETLINK;
++
++ if (TEMP_FAILURE_RETRY (__sendto (fd, (void *) &req, sizeof (req), 0,
++ (struct sockaddr *) &nladdr,
++ sizeof (nladdr))) < 0)
++ return -1;
++
++ *seen_ipv4 = false;
++ *seen_ipv6 = false;
++
++ bool done = false;
++ char buf[4096];
++ struct iovec iov = { buf, sizeof (buf) };
++ struct in6ailist
++ {
++ struct in6addrinfo info;
++ struct in6ailist *next;
++ } *in6ailist = NULL;
++ size_t in6ailistlen = 0;
++
++ do
++ {
++ struct msghdr msg =
++ {
++ (void *) &nladdr, sizeof (nladdr),
++ &iov, 1,
++ NULL, 0,
++ 0
++ };
++
++ ssize_t read_len = TEMP_FAILURE_RETRY (__recvmsg (fd, &msg, 0));
++ if (read_len < 0)
++ return -1;
++
++ if (msg.msg_flags & MSG_TRUNC)
++ return -1;
++
++ struct nlmsghdr *nlmh;
++ for (nlmh = (struct nlmsghdr *) buf;
++ NLMSG_OK (nlmh, (size_t) read_len);
++ nlmh = (struct nlmsghdr *) NLMSG_NEXT (nlmh, read_len))
++ {
++ if (nladdr.nl_pid != 0 || (pid_t) nlmh->nlmsg_pid != pid
++ || nlmh->nlmsg_seq != req.nlh.nlmsg_seq)
++ continue;
++
++ if (nlmh->nlmsg_type == RTM_NEWADDR)
++ {
++ struct ifaddrmsg *ifam = (struct ifaddrmsg *) NLMSG_DATA (nlmh);
++
++ switch (ifam->ifa_family)
++ {
++ case AF_INET:
++ *seen_ipv4 = true;
++ break;
++ case AF_INET6:
++ *seen_ipv6 = true;
++
++ if (ifam->ifa_flags & (IFA_F_DEPRECATED
++ | IFA_F_TEMPORARY
++ | IFA_F_HOMEADDRESS))
++ {
++ struct rtattr *rta = IFA_RTA (ifam);
++ size_t len = (nlmh->nlmsg_len
++ - NLMSG_LENGTH (sizeof (*ifam)));
++ void *local = NULL;
++ void *address = NULL;
++ while (RTA_OK (rta, len))
++ {
++ switch (rta->rta_type)
++ {
++ case IFA_LOCAL:
++ local = RTA_DATA (rta);
++ break;
++
++ case IFA_ADDRESS:
++ address = RTA_DATA (rta);
++ break;
++ }
++
++ rta = RTA_NEXT (rta, len);
++ }
++
++ struct in6ailist *newp = alloca (sizeof (*newp));
++ newp->info.flags = (((ifam->ifa_flags & IFA_F_DEPRECATED)
++ ? in6ai_deprecated : 0)
++ | ((ifam->ifa_flags
++ & IFA_F_TEMPORARY)
++ ? in6ai_temporary : 0)
++ | ((ifam->ifa_flags
++ & IFA_F_HOMEADDRESS)
++ ? in6ai_homeaddress : 0));
++ memcpy (newp->info.addr, address ?: local,
++ sizeof (newp->info.addr));
++ newp->next = in6ailist;
++ in6ailist = newp;
++ ++in6ailistlen;
++ }
++ break;
++ default:
++ /* Ignore. */
++ break;
++ }
++ }
++ else if (nlmh->nlmsg_type == NLMSG_DONE)
++ /* We found the end, leave the loop. */
++ done = true;
++ }
++ }
++ while (! done);
++
++ close_not_cancel_no_status (fd);
++
++ if (in6ailist != NULL)
++ {
++ *in6ai = malloc (in6ailistlen * sizeof (**in6ai));
++ if (*in6ai == NULL)
++ return -1;
++
++ *in6ailen = in6ailistlen;
++
++ do
++ {
++ (*in6ai)[--in6ailistlen] = in6ailist->info;
++ in6ailist = in6ailist->next;
++ }
++ while (in6ailist != NULL);
++ }
++
++ return 0;
++}
++
++
++/* We don't know if we have NETLINK support compiled in in our
++ Kernel. */
++#if __ASSUME_NETLINK_SUPPORT == 0
++/* Define in ifaddrs.h. */
++extern int __no_netlink_support attribute_hidden;
++#else
++# define __no_netlink_support 0
++#endif
++
++
++void
++attribute_hidden
++__check_pf (bool *seen_ipv4, bool *seen_ipv6,
++ struct in6addrinfo **in6ai, size_t *in6ailen)
++{
++ *in6ai = NULL;
++ *in6ailen = 0;
++
++ if (! __no_netlink_support)
++ {
++ int fd = __socket (PF_NETLINK, SOCK_RAW, NETLINK_ROUTE);
++
++ struct sockaddr_nl nladdr;
++ memset (&nladdr, '\0', sizeof (nladdr));
++ nladdr.nl_family = AF_NETLINK;
++
++ socklen_t addr_len = sizeof (nladdr);
++
++ if (fd >= 0
++ && __bind (fd, (struct sockaddr *) &nladdr, sizeof (nladdr)) == 0
++ && __getsockname (fd, (struct sockaddr *) &nladdr, &addr_len) == 0
++ && make_request (fd, nladdr.nl_pid, seen_ipv4, seen_ipv6,
++ in6ai, in6ailen) == 0)
++ /* It worked. */
++ return;
++
++ if (fd >= 0)
++ __close (fd);
++
++#if __ASSUME_NETLINK_SUPPORT == 0
++ /* Remember that there is no netlink support. */
++ __no_netlink_support = 1;
++#else
++ /* We cannot determine what interfaces are available. Be
++ pessimistic. */
++ *seen_ipv4 = true;
++ *seen_ipv6 = true;
++#endif
++ }
++
++#if __ASSUME_NETLINK_SUPPORT == 0
++ /* No netlink. Get the interface list via getifaddrs. */
++ struct ifaddrs *ifa = NULL;
++ if (getifaddrs (&ifa) != 0)
++ {
++ /* We cannot determine what interfaces are available. Be
++ pessimistic. */
++ *seen_ipv4 = true;
++ *seen_ipv6 = true;
++ return;
++ }
++
++ struct ifaddrs *runp;
++ for (runp = ifa; runp != NULL; runp = runp->ifa_next)
++ if (runp->ifa_addr->sa_family == PF_INET)
++ *seen_ipv4 = true;
++ else if (runp->ifa_addr->sa_family == PF_INET6)
++ *seen_ipv6 = true;
++
++ (void) freeifaddrs (ifa);
++#endif
++}
+Index: sysdeps/unix/sysv/linux/arm/eabi/check_pf.c
+===================================================================
+RCS file: sysdeps/unix/sysv/linux/arm/eabi/check_pf.c
+diff -N sysdeps/unix/sysv/linux/arm/eabi/check_pf.c
+--- /dev/null 1 Jan 1970 00:00:00 -0000
++++ sysdeps/unix/sysv/linux/arm/eabi/check_pf.c 31 Oct 2006 17:29:58 -0000
+@@ -0,0 +1 @@
++#include <sysdeps/unix/sysv/linux/check_pf.c>
+
diff --git a/recipes/glibc/glibc-2.4/glibc-crunch-eabi-force.patch b/recipes/glibc/glibc-2.6.1/glibc-crunch-eabi-force.patch
index b509b133c7..b509b133c7 100644
--- a/recipes/glibc/glibc-2.4/glibc-crunch-eabi-force.patch
+++ b/recipes/glibc/glibc-2.6.1/glibc-crunch-eabi-force.patch
diff --git a/recipes/glibc/glibc-2.4/glibc-crunch-eabi-fraiseexcpt.patch b/recipes/glibc/glibc-2.6.1/glibc-crunch-eabi-fraiseexcpt.patch
index dcee3fad0a..dcee3fad0a 100644
--- a/recipes/glibc/glibc-2.4/glibc-crunch-eabi-fraiseexcpt.patch
+++ b/recipes/glibc/glibc-2.6.1/glibc-crunch-eabi-fraiseexcpt.patch
diff --git a/recipes/glibc/glibc-2.4/glibc-crunch-eabi-setjmp_longjmp.patch b/recipes/glibc/glibc-2.6.1/glibc-crunch-eabi-setjmp_longjmp.patch
index cf4ed6060b..cf4ed6060b 100644
--- a/recipes/glibc/glibc-2.4/glibc-crunch-eabi-setjmp_longjmp.patch
+++ b/recipes/glibc/glibc-2.6.1/glibc-crunch-eabi-setjmp_longjmp.patch
diff --git a/recipes/glibc/glibc-2.4/glibc-crunch-eabi-unwind.patch b/recipes/glibc/glibc-2.6.1/glibc-crunch-eabi-unwind.patch
index d91d4fd356..d91d4fd356 100644
--- a/recipes/glibc/glibc-2.4/glibc-crunch-eabi-unwind.patch
+++ b/recipes/glibc/glibc-2.6.1/glibc-crunch-eabi-unwind.patch
diff --git a/recipes/glibc/glibc-2.4/glibc-crunch-eabi.patch b/recipes/glibc/glibc-2.6.1/glibc-crunch-eabi.patch
index 8af4baf9d7..8af4baf9d7 100644
--- a/recipes/glibc/glibc-2.4/glibc-crunch-eabi.patch
+++ b/recipes/glibc/glibc-2.6.1/glibc-crunch-eabi.patch
diff --git a/recipes/glibc/glibc-2.4/glibc-crunch-endian-littleword-littlebyte.patch b/recipes/glibc/glibc-2.6.1/glibc-crunch-endian-littleword-littlebyte.patch
index e8559d4f67..e8559d4f67 100644
--- a/recipes/glibc/glibc-2.4/glibc-crunch-endian-littleword-littlebyte.patch
+++ b/recipes/glibc/glibc-2.6.1/glibc-crunch-endian-littleword-littlebyte.patch
diff --git a/recipes/glibc/glibc-2.4/glibc-use-isystem-include-fixed.patch b/recipes/glibc/glibc-2.6.1/glibc-use-isystem-include-fixed.patch
index d9ed12a0fe..d9ed12a0fe 100644
--- a/recipes/glibc/glibc-2.4/glibc-use-isystem-include-fixed.patch
+++ b/recipes/glibc/glibc-2.6.1/glibc-use-isystem-include-fixed.patch
diff --git a/recipes/glibc/glibc-2.6.1/ldd-unbash.patch b/recipes/glibc/glibc-2.6.1/ldd-unbash.patch
new file mode 100644
index 0000000000..2fb8854b49
--- /dev/null
+++ b/recipes/glibc/glibc-2.6.1/ldd-unbash.patch
@@ -0,0 +1,11 @@
+--- glibc-2.5/elf/ldd.bash.in.org 2006-04-30 16:06:20.000000000 +0000
++++ glibc-2.5/elf/ldd.bash.in 2007-03-30 19:18:57.000000000 +0000
+@@ -110,7 +110,7 @@
+ # environments where the executed program might not have permissions
+ # to write to the console/tty. But only bash 3.x supports the pipefail
+ # option, and we don't bother to handle the case for older bash versions.
+-if set -o pipefail 2> /dev/null; then
++if false; then
+ try_trace() {
+ eval $add_env '"$@"' | cat
+ }
diff --git a/recipes/glibc/glibc-2.6.1/no-z-defs.patch b/recipes/glibc/glibc-2.6.1/no-z-defs.patch
new file mode 100644
index 0000000000..48c6a41267
--- /dev/null
+++ b/recipes/glibc/glibc-2.6.1/no-z-defs.patch
@@ -0,0 +1,9 @@
+Create a configparms file which disabled no-z-defs.
+This is required to build a working glibs for sh4,
+without there will be a lot linker errors during the build.
+
+diff -duNr libc.orig/configparms libc/configparms
+--- libc.orig/configparms 1970-01-01 10:00:00.000000000 +1000
++++ libc/configparms 2006-02-23 14:08:18.000000000 +1100
+@@ -0,0 +1 @@
++no-z-defs=yes
diff --git a/recipes/glibc/glibc-2.6.1/nptl-crosscompile.patch b/recipes/glibc/glibc-2.6.1/nptl-crosscompile.patch
new file mode 100644
index 0000000000..18a46ad4f1
--- /dev/null
+++ b/recipes/glibc/glibc-2.6.1/nptl-crosscompile.patch
@@ -0,0 +1,26 @@
+--- glibc-2.4/nptl/sysdeps/pthread/configure.in.ark 2006-03-12 00:41:40.000000000 +0100
++++ glibc-2.4/nptl/sysdeps/pthread/configure.in 2006-03-12 00:44:08.000000000 +0100
+@@ -45,5 +45,6 @@
+ AC_MSG_ERROR([the compiler must support C cleanup handling])
+ fi
+ else
+- AC_MSG_ERROR(forced unwind support is required)
++ AC_MSG_WARN([forced unwind support is required, can't be verified while crosscompiling])
++ AC_DEFINE(HAVE_FORCED_UNWIND)
+ fi
+--- glibc-2.4/nptl/sysdeps/pthread/configure.ark 2006-03-12 00:42:47.000000000 +0100
++++ glibc-2.4/nptl/sysdeps/pthread/configure 2006-03-12 00:44:08.000000000 +0100
+@@ -153,7 +153,10 @@
+ { (exit 1); exit 1; }; }
+ fi
+ else
+- { { echo "$as_me:$LINENO: error: forced unwind support is required" >&5
+-echo "$as_me: error: forced unwind support is required" >&2;}
+- { (exit 1); exit 1; }; }
++ { echo "$as_me:$LINENO: WARNING: forced unwind support is required, can't be verified while crosscompiling" >&5
++echo "$as_me: WARNING: forced unwind support is required, can't be verified while crosscompiling" >&2;}
++ cat >>confdefs.h <<\_ACEOF
++#define HAVE_FORCED_UNWIND 1
++_ACEOF
++
+ fi
diff --git a/recipes/glibc/glibc-2.6.1/powerpc-sqrt-hack.diff b/recipes/glibc/glibc-2.6.1/powerpc-sqrt-hack.diff
new file mode 100644
index 0000000000..1046efb2a1
--- /dev/null
+++ b/recipes/glibc/glibc-2.6.1/powerpc-sqrt-hack.diff
@@ -0,0 +1,25 @@
+diff -Nurd ../glibc-initial-2.5-r4/glibc-2.5/sysdeps/powerpc/fpu/e_sqrt.c glibc-2.5/sysdeps/powerpc/fpu/e_sqrt.c
+--- ../glibc-initial-2.5-r4/glibc-2.5/sysdeps/powerpc/fpu/e_sqrt.c 2006-04-14 07:44:30.000000000 +0200
++++ glibc-2.5/sysdeps/powerpc/fpu/e_sqrt.c 2006-12-08 12:53:32.202227000 +0100
+@@ -25,6 +25,9 @@
+ #include <sysdep.h>
+ #include <ldsodefs.h>
+
++#define __CPU_HAS_FSQRT ((GLRO(dl_hwcap) & PPC_FEATURE_64) != 0)
++
++
+ static const double almost_half = 0.5000000000000001; /* 0.5 + 2^-53 */
+ static const ieee_float_shape_type a_nan = {.word = 0x7fc00000 };
+ static const ieee_float_shape_type a_inf = {.word = 0x7f800000 };
+diff -Nurd ../glibc-initial-2.5-r4/glibc-2.5/sysdeps/powerpc/fpu/e_sqrtf.c glibc-2.5/sysdeps/powerpc/fpu/e_sqrtf.c
+--- ../glibc-initial-2.5-r4/glibc-2.5/sysdeps/powerpc/fpu/e_sqrtf.c 2006-04-14 07:44:30.000000000 +0200
++++ glibc-2.5/sysdeps/powerpc/fpu/e_sqrtf.c 2006-12-08 12:53:36.992227000 +0100
+@@ -25,6 +25,8 @@
+ #include <sysdep.h>
+ #include <ldsodefs.h>
+
++#define __CPU_HAS_FSQRT ((GLRO(dl_hwcap) & PPC_FEATURE_64) != 0)
++
+ static const float almost_half = 0.50000006; /* 0.5 + 2^-24 */
+ static const ieee_float_shape_type a_nan = {.word = 0x7fc00000 };
+ static const ieee_float_shape_type a_inf = {.word = 0x7f800000 };
diff --git a/recipes/glibc/glibc-2.6.1/zecke-sane-readelf.patch b/recipes/glibc/glibc-2.6.1/zecke-sane-readelf.patch
new file mode 100644
index 0000000000..2bc87974a1
--- /dev/null
+++ b/recipes/glibc/glibc-2.6.1/zecke-sane-readelf.patch
@@ -0,0 +1,243 @@
+upstream: http://sources.redhat.com/bugzilla/show_bug.cgi?id=3004
+status: WONTFIX
+comment: Use OEs version of the readelf version. There might be no
+host system version (e.g. on OSX) or it is not multiarch.
+
+Index: glibc-2.6.1/configure
+===================================================================
+--- glibc-2.6.1.orig/configure 2007-07-31 06:46:12.000000000 -0700
++++ glibc-2.6.1/configure 2008-09-12 16:38:06.000000000 -0700
+@@ -5478,6 +5478,96 @@
+ fi
+ fi
+
++### AC_CHECK_TARGET_TOOL([READELF],[readelf],[readelf],[$PATH])
++### XXXX copy and pasted
++# Check for readelf
++# Extract the first word of "$target_alias-readelf", so it can be a program name with args.
++set dummy $target_alias-readelf; ac_word=$2
++{ echo "$as_me:$LINENO: checking for $ac_word" >&5
++echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
++if test "${ac_cv_prog_READELF+set}" = set; then
++ echo $ECHO_N "(cached) $ECHO_C" >&6
++else
++ if test -n "$READELF"; then
++ ac_cv_prog_READELF="$READELF" # Let the user override the test.
++else
++as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
++for as_dir in $PATH
++do
++ IFS=$as_save_IFS
++ test -z "$as_dir" && as_dir=.
++ for ac_exec_ext in '' $ac_executable_extensions; do
++ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then
++ ac_cv_prog_READELF="$target_alias-readelf"
++ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
++ break 2
++ fi
++done
++done
++IFS=$as_save_IFS
++
++fi
++fi
++READELF=$ac_cv_prog_READELF
++if test -n "$READELF"; then
++ { echo "$as_me:$LINENO: result: $READELF" >&5
++echo "${ECHO_T}$READELF" >&6; }
++else
++ { echo "$as_me:$LINENO: result: no" >&5
++echo "${ECHO_T}no" >&6; }
++fi
++
++
++if test -z "$ac_cv_prog_READELF"; then
++ if test "$build" = "$target"; then
++ ac_ct_READELF=$READELF
++ # Extract the first word of "readelf", so it can be a program name with args.
++set dummy readelf; ac_word=$2
++{ echo "$as_me:$LINENO: checking for $ac_word" >&5
++echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
++if test "${ac_cv_prog_ac_ct_READELF+set}" = set; then
++ echo $ECHO_N "(cached) $ECHO_C" >&6
++else
++ if test -n "$ac_ct_READELF"; then
++ ac_cv_prog_ac_ct_READELF="$ac_ct_READELF" # Let the user override the test.
++else
++as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
++for as_dir in $PATH
++do
++ IFS=$as_save_IFS
++ test -z "$as_dir" && as_dir=.
++ for ac_exec_ext in '' $ac_executable_extensions; do
++ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then
++ ac_cv_prog_ac_ct_READELF="readelf"
++ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
++ break 2
++ fi
++done
++done
++IFS=$as_save_IFS
++
++ test -z "$ac_cv_prog_ac_ct_READELF" && ac_cv_prog_ac_ct_READELF="readelf"
++fi
++fi
++ac_ct_READELF=$ac_cv_prog_ac_ct_READELF
++if test -n "$ac_ct_READELF"; then
++ { echo "$as_me:$LINENO: result: $ac_ct_READELF" >&5
++echo "${ECHO_T}$ac_ct_READELF" >&6; }
++else
++ { echo "$as_me:$LINENO: result: no" >&5
++echo "${ECHO_T}no" >&6; }
++fi
++
++ READELF=ac_ct_READELF
++ else
++ READELF="readelf"
++ fi
++else
++ READELF="$ac_cv_prog_READELF"
++fi
++
++### XXXX copy and pasted
++
+ echo "$as_me:$LINENO: checking for .preinit_array/.init_array/.fini_array support" >&5
+ echo $ECHO_N "checking for .preinit_array/.init_array/.fini_array support... $ECHO_C" >&6
+ if test "${libc_cv_initfini_array+set}" = set; then
+@@ -5497,7 +5587,7 @@
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }
+ then
+- if readelf -S conftest | fgrep INIT_ARRAY > /dev/null; then
++ if $READELF -S conftest | fgrep INIT_ARRAY > /dev/null; then
+ libc_cv_initfini_array=yes
+ else
+ libc_cv_initfini_array=no
+@@ -5797,7 +5887,7 @@
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }
+ then
+- if readelf -S conftest.so | grep '\.rel\(a\|\)\.dyn' > /dev/null; then
++ if $READELF -S conftest.so | grep '\.rel\(a\|\)\.dyn' > /dev/null; then
+ libc_cv_z_combreloc=yes
+ else
+ libc_cv_z_combreloc=no
+Index: glibc-2.6.1/configure.in
+===================================================================
+--- glibc-2.6.1.orig/configure.in 2007-03-20 05:11:23.000000000 -0700
++++ glibc-2.6.1/configure.in 2008-09-12 16:38:26.000000000 -0700
+@@ -1347,6 +1347,96 @@
+ fi
+ fi
+
++### AC_CHECK_TARGET_TOOL([READELF],[readelf],[readelf],[$PATH])
++### XXXX copy and pasted
++# Check for readelf
++# Extract the first word of "$target_alias-readelf", so it can be a program name with args.
++set dummy $target_alias-readelf; ac_word=$2
++{ echo "$as_me:$LINENO: checking for $ac_word" >&5
++echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
++if test "${ac_cv_prog_READELF+set}" = set; then
++ echo $ECHO_N "(cached) $ECHO_C" >&6
++else
++ if test -n "$READELF"; then
++ ac_cv_prog_READELF="$READELF" # Let the user override the test.
++else
++as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
++for as_dir in $PATH
++do
++ IFS=$as_save_IFS
++ test -z "$as_dir" && as_dir=.
++ for ac_exec_ext in '' $ac_executable_extensions; do
++ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then
++ ac_cv_prog_READELF="$target_alias-readelf"
++ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
++ break 2
++ fi
++done
++done
++IFS=$as_save_IFS
++
++fi
++fi
++READELF=$ac_cv_prog_READELF
++if test -n "$READELF"; then
++ { echo "$as_me:$LINENO: result: $READELF" >&5
++echo "${ECHO_T}$READELF" >&6; }
++else
++ { echo "$as_me:$LINENO: result: no" >&5
++echo "${ECHO_T}no" >&6; }
++fi
++
++
++if test -z "$ac_cv_prog_READELF"; then
++ if test "$build" = "$target"; then
++ ac_ct_READELF=$READELF
++ # Extract the first word of "readelf", so it can be a program name with args.
++set dummy readelf; ac_word=$2
++{ echo "$as_me:$LINENO: checking for $ac_word" >&5
++echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
++if test "${ac_cv_prog_ac_ct_READELF+set}" = set; then
++ echo $ECHO_N "(cached) $ECHO_C" >&6
++else
++ if test -n "$ac_ct_READELF"; then
++ ac_cv_prog_ac_ct_READELF="$ac_ct_READELF" # Let the user override the test.
++else
++as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
++for as_dir in $PATH
++do
++ IFS=$as_save_IFS
++ test -z "$as_dir" && as_dir=.
++ for ac_exec_ext in '' $ac_executable_extensions; do
++ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then
++ ac_cv_prog_ac_ct_READELF="readelf"
++ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
++ break 2
++ fi
++done
++done
++IFS=$as_save_IFS
++
++ test -z "$ac_cv_prog_ac_ct_READELF" && ac_cv_prog_ac_ct_READELF="readelf"
++fi
++fi
++ac_ct_READELF=$ac_cv_prog_ac_ct_READELF
++if test -n "$ac_ct_READELF"; then
++ { echo "$as_me:$LINENO: result: $ac_ct_READELF" >&5
++echo "${ECHO_T}$ac_ct_READELF" >&6; }
++else
++ { echo "$as_me:$LINENO: result: no" >&5
++echo "${ECHO_T}no" >&6; }
++fi
++
++ READELF=ac_ct_READELF
++ else
++ READELF="readelf"
++ fi
++else
++ READELF="$ac_cv_prog_READELF"
++fi
++
++### XXXX copy and pasted
++
+ AC_CACHE_CHECK(for .preinit_array/.init_array/.fini_array support,
+ libc_cv_initfini_array, [dnl
+ cat > conftest.c <<EOF
+@@ -1358,7 +1448,7 @@
+ if AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS -o conftest conftest.c
+ -static -nostartfiles -nostdlib 1>&AS_MESSAGE_LOG_FD])
+ then
+- if readelf -S conftest | fgrep INIT_ARRAY > /dev/null; then
++ if $READELF -S conftest | fgrep INIT_ARRAY > /dev/null; then
+ libc_cv_initfini_array=yes
+ else
+ libc_cv_initfini_array=no
+@@ -1543,7 +1633,7 @@
+ dnl introducing new options this is not easily doable. Instead use a tool
+ dnl which always is cross-platform: readelf. To detect whether -z combreloc
+ dnl look for a section named .rel.dyn.
+- if readelf -S conftest.so | grep '\.rel\(a\|\)\.dyn' > /dev/null; then
++ if $READELF -S conftest.so | grep '\.rel\(a\|\)\.dyn' > /dev/null; then
+ libc_cv_z_combreloc=yes
+ else
+ libc_cv_z_combreloc=no
diff --git a/recipes/glibc/glibc-2.7/all_glibc-i586-chk.patch b/recipes/glibc/glibc-2.7/all_glibc-i586-chk.patch
deleted file mode 100644
index 9362bcaf17..0000000000
--- a/recipes/glibc/glibc-2.7/all_glibc-i586-chk.patch
+++ /dev/null
@@ -1,33 +0,0 @@
-http://bugs.gentoo.org/199479
-
-2007-09-13 H.J. Lu <hongjiu.lu@intel.com>
-
- * sysdeps/i386/i586/memcpy_chk.S: New file.
- * sysdeps/i386/i586/mempcpy_chk.S: Likewise.
- * sysdeps/i386/i586/memset_chk.S: Likewise.
-
-Index: glibc/sysdeps/i386/i586/memcpy_chk.S
-===================================================================
-RCS file: sysdeps/i386/i586/memcpy_chk.S
-diff -N sysdeps/i386/i586/memcpy_chk.S
---- /dev/null 1 Jan 1970 00:00:00 -0000
-+++ glibc/sysdeps/i386/i586/memcpy_chk.S 13 Nov 2007 01:56:18 -0000 1.1
-@@ -0,0 +1 @@
-+#include <sysdeps/i386/i686/memcpy_chk.S>
-Index: glibc/sysdeps/i386/i586/mempcpy_chk.S
-===================================================================
-RCS file: sysdeps/i386/i586/mempcpy_chk.S
-diff -N sysdeps/i386/i586/mempcpy_chk.S
---- /dev/null 1 Jan 1970 00:00:00 -0000
-+++ glibc/sysdeps/i386/i586/mempcpy_chk.S 13 Nov 2007 01:56:18 -0000 1.1
-@@ -0,0 +1 @@
-+#include <sysdeps/i386/i686/mempcpy_chk.S>
-Index: glibc/sysdeps/i386/i586/memset_chk.S
-===================================================================
-RCS file: sysdeps/i386/i586/memset_chk.S
-diff -N sysdeps/i386/i586/memset_chk.S
---- /dev/null 1 Jan 1970 00:00:00 -0000
-+++ glibc/sysdeps/i386/i586/memset_chk.S 13 Nov 2007 01:56:18 -0000 1.1
-@@ -0,0 +1 @@
-+#include <sysdeps/i386/i686/memset_chk.S>
-
diff --git a/recipes/glibc/glibc-2.9/arm-longlong.patch b/recipes/glibc/glibc-2.9/arm-longlong.patch
new file mode 100644
index 0000000000..28aca83dff
--- /dev/null
+++ b/recipes/glibc/glibc-2.9/arm-longlong.patch
@@ -0,0 +1,58 @@
+--- glibc-2.4/stdlib/longlong.h.ark 2006-03-11 22:49:27.000000000 +0100
++++ glibc-2.4/stdlib/longlong.h 2006-03-11 22:55:12.000000000 +0100
+@@ -206,6 +206,14 @@
+ "rI" ((USItype) (bh)), \
+ "r" ((USItype) (al)), \
+ "rI" ((USItype) (bl)) __CLOBBER_CC)
++/* v3m and all higher arches have long multiply support. */
++#if !defined(__ARM_ARCH_2__) && !defined(__ARM_ARCH_3__)
++#define umul_ppmm(xh, xl, a, b) \
++ __asm__ ("umull %0,%1,%2,%3" : "=&r" (xl), "=&r" (xh) : "r" (a), "r" (b))
++#define UMUL_TIME 5
++#define smul_ppmm(xh, xl, a, b) \
++ __asm__ ("smull %0,%1,%2,%3" : "=&r" (xl), "=&r" (xh) : "r" (a), "r" (b))
++#else
+ #define umul_ppmm(xh, xl, a, b) \
+ {register USItype __t0, __t1, __t2; \
+ __asm__ ("%@ Inlined umul_ppmm\n" \
+@@ -227,7 +235,13 @@
+ : "r" ((USItype) (a)), \
+ "r" ((USItype) (b)) __CLOBBER_CC );}
+ #define UMUL_TIME 20
++#endif
+ #define UDIV_TIME 100
++#if defined(__ARM_ARCH_5__) || defined(__ARM_ARCH_5T__) || defined(__ARM_ARCH_5TE__)
++#define count_leading_zeros(COUNT,X) ((COUNT) = __builtin_clz (X))
++#define COUNT_LEADING_ZEROS_0 32
++#endif
++
+ #endif /* __arm__ */
+
+ #if defined (__hppa) && W_TYPE_SIZE == 32
+--- glibc-2.4/ports/sysdeps/arm/mp_clz_tab.c.ark 2006-03-11 22:56:43.000000000 +0100
++++ glibc-2.4/ports/sysdeps/arm/mp_clz_tab.c 2006-03-11 22:58:19.000000000 +0100
+@@ -0,0 +1,24 @@
++/* __clz_tab -- support for longlong.h
++ Copyright (C) 2004 Free Software Foundation, Inc.
++ This file is part of the GNU C Library.
++
++ The GNU C Library is free software; you can redistribute it and/or
++ modify it under the terms of the GNU Lesser General Public
++ License as published by the Free Software Foundation; either
++ version 2.1 of the License, or (at your option) any later version.
++
++ The GNU C Library is distributed in the hope that it will be useful,
++ but WITHOUT ANY WARRANTY; without even the implied warranty of
++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++ Lesser General Public License for more details.
++
++ You should have received a copy of the GNU Lesser General Public
++ License along with the GNU C Library; if not, write to the Free
++ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
++ 02111-1307 USA. */
++
++#if defined(__ARM_ARCH_5__) || defined(__ARM_ARCH_5T__) || defined(__ARM_ARCH_5TE__)
++/* Nothing required. */
++#else
++#include <stdlib/mp_clz_tab.c>
++#endif
diff --git a/recipes/glibc/glibc-2.9/arm-lowlevellock-include-tls.patch b/recipes/glibc/glibc-2.9/arm-lowlevellock-include-tls.patch
new file mode 100644
index 0000000000..5c8062ecee
--- /dev/null
+++ b/recipes/glibc/glibc-2.9/arm-lowlevellock-include-tls.patch
@@ -0,0 +1,12 @@
+Index: glibc-2.9/ports/sysdeps/unix/sysv/linux/arm/nptl/lowlevellock.h
+===================================================================
+--- glibc-2.9.orig/ports/sysdeps/unix/sysv/linux/arm/nptl/lowlevellock.h 2009-06-19 20:54:35.446686910 +0400
++++ glibc-2.9/ports/sysdeps/unix/sysv/linux/arm/nptl/lowlevellock.h 2009-06-19 20:54:43.774683370 +0400
+@@ -25,6 +25,7 @@
+ #include <atomic.h>
+ #include <sysdep.h>
+ #include <kernel-features.h>
++#include <tls.h>
+
+ #define FUTEX_WAIT 0
+ #define FUTEX_WAKE 1
diff --git a/recipes/glibc/glibc-2.9/arm-memcpy.patch b/recipes/glibc/glibc-2.9/arm-memcpy.patch
new file mode 100644
index 0000000000..bc2b3dab84
--- /dev/null
+++ b/recipes/glibc/glibc-2.9/arm-memcpy.patch
@@ -0,0 +1,758 @@
+--- /dev/null 2004-02-02 20:32:13.000000000 +0000
++++ sysdeps/arm/memmove.S 2004-03-20 18:37:23.000000000 +0000
+@@ -0,0 +1,251 @@
++/*
++ * Optimized memmove implementation for ARM processors
++ *
++ * Author: Nicolas Pitre
++ * Created: Dec 23, 2003
++ * Copyright: (C) MontaVista Software, Inc.
++ *
++ * This file is free software; you can redistribute it and/or
++ * modify it under the terms of the GNU Lesser General Public
++ * License as published by the Free Software Foundation; either
++ * version 2.1 of the License, or (at your option) any later version.
++ *
++ * This file is distributed in the hope that it will be useful,
++ * but WITHOUT ANY WARRANTY; without even the implied warranty of
++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++ * Lesser General Public License for more details.
++ */
++
++#include <sysdep.h>
++
++
++/*
++ * Endian independent macros for shifting bytes within registers.
++ */
++#ifndef __ARMEB__
++#define pull lsr
++#define push lsl
++#else
++#define pull lsl
++#define push lsr
++#endif
++
++/*
++ * Enable data preload for architectures that support it (ARMv5 and above)
++ */
++#if defined(__ARM_ARCH_5__) || \
++ defined(__ARM_ARCH_5T__) || \
++ defined(__ARM_ARCH_5TE__)
++#define PLD(code...) code
++#else
++#define PLD(code...)
++#endif
++
++
++/* char * memmove (char *dst, const char *src) */
++ENTRY(memmove)
++ subs ip, r0, r1
++ cmphi r2, ip
++ bls memcpy(PLT)
++
++ stmfd sp!, {r0, r4, lr}
++ add r1, r1, r2
++ add r0, r0, r2
++ subs r2, r2, #4
++ blt 25f
++ ands ip, r0, #3
++ PLD( pld [r1, #-4] )
++ bne 26f
++ ands ip, r1, #3
++ bne 27f
++
++19: subs r2, r2, #4
++ blt 24f
++ subs r2, r2, #8
++ blt 23f
++ subs r2, r2, #16
++ blt 22f
++
++ PLD( pld [r1, #-32] )
++ PLD( subs r2, r2, #96 )
++ stmfd sp!, {r5 - r8}
++ PLD( blt 21f )
++
++ PLD( @ cache alignment )
++ PLD( ands ip, r1, #31 )
++ PLD( pld [r1, #-64] )
++ PLD( beq 20f )
++ PLD( cmp r2, ip )
++ PLD( pld [r1, #-96] )
++ PLD( blt 20f )
++ PLD( cmp ip, #16 )
++ PLD( sub r2, r2, ip )
++ PLD( ldmgedb r1!, {r3 - r6} )
++ PLD( stmgedb r0!, {r3 - r6} )
++ PLD( beq 20f )
++ PLD( and ip, ip, #15 )
++ PLD( cmp ip, #8 )
++ PLD( ldr r3, [r1, #-4]! )
++ PLD( ldrge r4, [r1, #-4]! )
++ PLD( ldrgt r5, [r1, #-4]! )
++ PLD( str r3, [r0, #-4]! )
++ PLD( strge r4, [r0, #-4]! )
++ PLD( strgt r5, [r0, #-4]! )
++
++20: PLD( pld [r1, #-96] )
++ PLD( pld [r1, #-128] )
++21: ldmdb r1!, {r3, r4, ip, lr}
++ subs r2, r2, #32
++ stmdb r0!, {r3, r4, ip, lr}
++ ldmdb r1!, {r3, r4, ip, lr}
++ stmgedb r0!, {r3, r4, ip, lr}
++ ldmgedb r1!, {r3, r4, ip, lr}
++ stmgedb r0!, {r3, r4, ip, lr}
++ ldmgedb r1!, {r3, r4, ip, lr}
++ subges r2, r2, #32
++ stmdb r0!, {r3, r4, ip, lr}
++ bge 20b
++ PLD( cmn r2, #96 )
++ PLD( bge 21b )
++ PLD( add r2, r2, #96 )
++ tst r2, #31
++ ldmfd sp!, {r5 - r8}
++ ldmeqfd sp!, {r0, r4, pc}
++
++ tst r2, #16
++22: ldmnedb r1!, {r3, r4, ip, lr}
++ stmnedb r0!, {r3, r4, ip, lr}
++
++ tst r2, #8
++23: ldmnedb r1!, {r3, r4}
++ stmnedb r0!, {r3, r4}
++
++ tst r2, #4
++24: ldrne r3, [r1, #-4]!
++ strne r3, [r0, #-4]!
++
++25: ands r2, r2, #3
++ ldmeqfd sp!, {r0, r4, pc}
++
++ cmp r2, #2
++ ldrb r3, [r1, #-1]
++ ldrgeb r4, [r1, #-2]
++ ldrgtb ip, [r1, #-3]
++ strb r3, [r0, #-1]
++ strgeb r4, [r0, #-2]
++ strgtb ip, [r0, #-3]
++ ldmfd sp!, {r0, r4, pc}
++
++26: cmp ip, #2
++ ldrb r3, [r1, #-1]!
++ ldrgeb r4, [r1, #-1]!
++ ldrgtb lr, [r1, #-1]!
++ strb r3, [r0, #-1]!
++ strgeb r4, [r0, #-1]!
++ strgtb lr, [r0, #-1]!
++ subs r2, r2, ip
++ blt 25b
++ ands ip, r1, #3
++ beq 19b
++
++27: bic r1, r1, #3
++ cmp ip, #2
++ ldr r3, [r1]
++ beq 35f
++ blt 36f
++
++
++ .macro backward_copy_shift push pull
++
++ cmp r2, #12
++ PLD( pld [r1, #-4] )
++ blt 33f
++ subs r2, r2, #28
++ stmfd sp!, {r5 - r9}
++ blt 31f
++
++ PLD( subs r2, r2, #96 )
++ PLD( pld [r1, #-32] )
++ PLD( blt 30f )
++ PLD( pld [r1, #-64] )
++
++ PLD( @ cache alignment )
++ PLD( ands ip, r1, #31 )
++ PLD( pld [r1, #-96] )
++ PLD( beq 29f )
++ PLD( cmp r2, ip )
++ PLD( pld [r1, #-128] )
++ PLD( blt 29f )
++ PLD( sub r2, r2, ip )
++28: PLD( mov r4, r3, push #\push )
++ PLD( ldr r3, [r1, #-4]! )
++ PLD( subs ip, ip, #4 )
++ PLD( orr r4, r4, r3, pull #\pull )
++ PLD( str r4, [r0, #-4]! )
++ PLD( bgt 28b )
++
++29: PLD( pld [r1, #-128] )
++30: mov lr, r3, push #\push
++ ldmdb r1!, {r3 - r9, ip}
++ subs r2, r2, #32
++ orr lr, lr, ip, pull #\pull
++ mov ip, ip, push #\push
++ orr ip, ip, r9, pull #\pull
++ mov r9, r9, push #\push
++ orr r9, r9, r8, pull #\pull
++ mov r8, r8, push #\push
++ orr r8, r8, r7, pull #\pull
++ mov r7, r7, push #\push
++ orr r7, r7, r6, pull #\pull
++ mov r6, r6, push #\push
++ orr r6, r6, r5, pull #\pull
++ mov r5, r5, push #\push
++ orr r5, r5, r4, pull #\pull
++ mov r4, r4, push #\push
++ orr r4, r4, r3, pull #\pull
++ stmdb r0!, {r4 - r9, ip, lr}
++ bge 29b
++ PLD( cmn r2, #96 )
++ PLD( bge 30b )
++ PLD( add r2, r2, #96 )
++ cmn r2, #16
++ blt 32f
++31: mov r7, r3, push #\push
++ ldmdb r1!, {r3 - r6}
++ sub r2, r2, #16
++ orr r7, r7, r6, pull #\pull
++ mov r6, r6, push #\push
++ orr r6, r6, r5, pull #\pull
++ mov r5, r5, push #\push
++ orr r5, r5, r4, pull #\pull
++ mov r4, r4, push #\push
++ orr r4, r4, r3, pull #\pull
++ stmdb r0!, {r4 - r7}
++32: adds r2, r2, #28
++ ldmfd sp!, {r5 - r9}
++ blt 34f
++33: mov r4, r3, push #\push
++ ldr r3, [r1, #-4]!
++ subs r2, r2, #4
++ orr r4, r4, r3, pull #\pull
++ str r4, [r0, #-4]!
++ bge 33b
++34:
++ .endm
++
++
++ backward_copy_shift push=8 pull=24
++ add r1, r1, #3
++ b 25b
++
++35: backward_copy_shift push=16 pull=16
++ add r1, r1, #2
++ b 25b
++
++36: backward_copy_shift push=24 pull=8
++ add r1, r1, #1
++ b 25b
++
++ .size memmove, . - memmove
++END(memmove)
++libc_hidden_builtin_def (memmove)
+--- /dev/null 2004-02-02 20:32:13.000000000 +0000
++++ sysdeps/arm/bcopy.S 2004-03-20 18:37:48.000000000 +0000
+@@ -0,0 +1,255 @@
++/*
++ * Optimized memmove implementation for ARM processors
++ *
++ * Author: Nicolas Pitre
++ * Created: Dec 23, 2003
++ * Copyright: (C) MontaVista Software, Inc.
++ *
++ * This file is free software; you can redistribute it and/or
++ * modify it under the terms of the GNU Lesser General Public
++ * License as published by the Free Software Foundation; either
++ * version 2.1 of the License, or (at your option) any later version.
++ *
++ * This file is distributed in the hope that it will be useful,
++ * but WITHOUT ANY WARRANTY; without even the implied warranty of
++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++ * Lesser General Public License for more details.
++ */
++
++#include <sysdep.h>
++
++
++/*
++ * Endian independent macros for shifting bytes within registers.
++ */
++#ifndef __ARMEB__
++#define pull lsr
++#define push lsl
++#else
++#define pull lsl
++#define push lsr
++#endif
++
++/*
++ * Enable data preload for architectures that support it (ARMv5 and above)
++ */
++#if defined(__ARM_ARCH_5__) || \
++ defined(__ARM_ARCH_5T__) || \
++ defined(__ARM_ARCH_5TE__)
++#define PLD(code...) code
++#else
++#define PLD(code...)
++#endif
++
++dst .req r1
++src .req r0
++
++/* void *bcopy (const char *src, char *dst, size_t size) */
++ENTRY(bcopy)
++ subs ip, dst, src
++ cmphi r2, ip
++ movls r3, r0
++ movls r0, r1
++ movls r1, r3
++ bls memcpy(PLT)
++
++ stmfd sp!, {r4, lr}
++ add src, src, r2
++ add dst, dst, r2
++ subs r2, r2, #4
++ blt 25f
++ ands ip, dst, #3
++ PLD( pld [src, #-4] )
++ bne 26f
++ ands ip, src, #3
++ bne 27f
++
++19: subs r2, r2, #4
++ blt 24f
++ subs r2, r2, #8
++ blt 23f
++ subs r2, r2, #16
++ blt 22f
++
++ PLD( pld [src, #-32] )
++ PLD( subs r2, r2, #96 )
++ stmfd sp!, {r5 - r8}
++ PLD( blt 21f )
++
++ PLD( @ cache alignment )
++ PLD( ands ip, src, #31 )
++ PLD( pld [src, #-64] )
++ PLD( beq 20f )
++ PLD( cmp r2, ip )
++ PLD( pld [src, #-96] )
++ PLD( blt 20f )
++ PLD( cmp ip, #16 )
++ PLD( sub r2, r2, ip )
++ PLD( ldmgedb src!, {r3 - r6} )
++ PLD( stmgedb dst!, {r3 - r6} )
++ PLD( beq 20f )
++ PLD( and ip, ip, #15 )
++ PLD( cmp ip, #8 )
++ PLD( ldr r3, [src, #-4]! )
++ PLD( ldrge r4, [src, #-4]! )
++ PLD( ldrgt r5, [src, #-4]! )
++ PLD( str r3, [dst, #-4]! )
++ PLD( strge r4, [dst, #-4]! )
++ PLD( strgt r5, [dst, #-4]! )
++
++20: PLD( pld [src, #-96] )
++ PLD( pld [src, #-128] )
++21: ldmdb src!, {r3, r4, ip, lr}
++ subs r2, r2, #32
++ stmdb dst!, {r3, r4, ip, lr}
++ ldmdb src!, {r3, r4, ip, lr}
++ stmgedb dst!, {r3, r4, ip, lr}
++ ldmgedb src!, {r3, r4, ip, lr}
++ stmgedb dst!, {r3, r4, ip, lr}
++ ldmgedb src!, {r3, r4, ip, lr}
++ subges r2, r2, #32
++ stmdb dst!, {r3, r4, ip, lr}
++ bge 20b
++ PLD( cmn r2, #96 )
++ PLD( bge 21b )
++ PLD( add r2, r2, #96 )
++ tst r2, #31
++ ldmfd sp!, {r5 - r8}
++ ldmeqfd sp!, {r4, pc}
++
++ tst r2, #16
++22: ldmnedb src!, {r3, r4, ip, lr}
++ stmnedb dst!, {r3, r4, ip, lr}
++
++ tst r2, #8
++23: ldmnedb src!, {r3, r4}
++ stmnedb dst!, {r3, r4}
++
++ tst r2, #4
++24: ldrne r3, [src, #-4]!
++ strne r3, [dst, #-4]!
++
++25: ands r2, r2, #3
++ ldmeqfd sp!, {dst, r4, pc}
++
++ cmp r2, #2
++ ldrb r3, [src, #-1]
++ ldrgeb r4, [src, #-2]
++ ldrgtb ip, [src, #-3]
++ strb r3, [dst, #-1]
++ strgeb r4, [dst, #-2]
++ strgtb ip, [dst, #-3]
++ ldmfd sp!, {dst, r4, pc}
++
++26: cmp ip, #2
++ ldrb r3, [src, #-1]!
++ ldrgeb r4, [src, #-1]!
++ ldrgtb lr, [src, #-1]!
++ strb r3, [dst, #-1]!
++ strgeb r4, [dst, #-1]!
++ strgtb lr, [dst, #-1]!
++ subs r2, r2, ip
++ blt 25b
++ ands ip, src, #3
++ beq 19b
++
++27: bic src, src, #3
++ cmp ip, #2
++ ldr r3, [src]
++ beq 35f
++ blt 36f
++
++
++ .macro backward_copy_shift push pull
++
++ cmp r2, #12
++ PLD( pld [src, #-4] )
++ blt 33f
++ subs r2, r2, #28
++ stmfd sp!, {r5 - r9}
++ blt 31f
++
++ PLD( subs r2, r2, #96 )
++ PLD( pld [src, #-32] )
++ PLD( blt 30f )
++ PLD( pld [src, #-64] )
++
++ PLD( @ cache alignment )
++ PLD( ands ip, src, #31 )
++ PLD( pld [src, #-96] )
++ PLD( beq 29f )
++ PLD( cmp r2, ip )
++ PLD( pld [src, #-128] )
++ PLD( blt 29f )
++ PLD( sub r2, r2, ip )
++28: PLD( mov r4, r3, push #\push )
++ PLD( ldr r3, [src, #-4]! )
++ PLD( subs ip, ip, #4 )
++ PLD( orr r4, r4, r3, pull #\pull )
++ PLD( str r4, [dst, #-4]! )
++ PLD( bgt 28b )
++
++29: PLD( pld [src, #-128] )
++30: mov lr, r3, push #\push
++ ldmdb src!, {r3 - r9, ip}
++ subs r2, r2, #32
++ orr lr, lr, ip, pull #\pull
++ mov ip, ip, push #\push
++ orr ip, ip, r9, pull #\pull
++ mov r9, r9, push #\push
++ orr r9, r9, r8, pull #\pull
++ mov r8, r8, push #\push
++ orr r8, r8, r7, pull #\pull
++ mov r7, r7, push #\push
++ orr r7, r7, r6, pull #\pull
++ mov r6, r6, push #\push
++ orr r6, r6, r5, pull #\pull
++ mov r5, r5, push #\push
++ orr r5, r5, r4, pull #\pull
++ mov r4, r4, push #\push
++ orr r4, r4, r3, pull #\pull
++ stmdb dst!, {r4 - r9, ip, lr}
++ bge 29b
++ PLD( cmn r2, #96 )
++ PLD( bge 30b )
++ PLD( add r2, r2, #96 )
++ cmn r2, #16
++ blt 32f
++31: mov r7, r3, push #\push
++ ldmdb src!, {r3 - r6}
++ sub r2, r2, #16
++ orr r7, r7, r6, pull #\pull
++ mov r6, r6, push #\push
++ orr r6, r6, r5, pull #\pull
++ mov r5, r5, push #\push
++ orr r5, r5, r4, pull #\pull
++ mov r4, r4, push #\push
++ orr r4, r4, r3, pull #\pull
++ stmdb dst!, {r4 - r7}
++32: adds r2, r2, #28
++ ldmfd sp!, {r5 - r9}
++ blt 34f
++33: mov r4, r3, push #\push
++ ldr r3, [src, #-4]!
++ subs r2, r2, #4
++ orr r4, r4, r3, pull #\pull
++ str r4, [dst, #-4]!
++ bge 33b
++34:
++ .endm
++
++
++ backward_copy_shift push=8 pull=24
++ add src, src, #3
++ b 25b
++
++35: backward_copy_shift push=16 pull=16
++ add src, src, #2
++ b 25b
++
++36: backward_copy_shift push=24 pull=8
++ add src, src, #1
++ b 25b
++
++ .size bcopy, . - bcopy
++END(bcopy)
+
+--- /dev/null 2004-02-02 20:32:13.000000000 +0000
++++ sysdeps/arm/memcpy.S 2004-05-02 14:33:22.000000000 +0100
+@@ -0,0 +1,242 @@
++/*
++ * Optimized memcpy implementation for ARM processors
++ *
++ * Author: Nicolas Pitre
++ * Created: Dec 23, 2003
++ * Copyright: (C) MontaVista Software, Inc.
++ *
++ * This file is free software; you can redistribute it and/or
++ * modify it under the terms of the GNU Lesser General Public
++ * License as published by the Free Software Foundation; either
++ * version 2.1 of the License, or (at your option) any later version.
++ *
++ * This file is distributed in the hope that it will be useful,
++ * but WITHOUT ANY WARRANTY; without even the implied warranty of
++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++ * Lesser General Public License for more details.
++ */
++
++#include <sysdep.h>
++
++
++/*
++ * Endian independent macros for shifting bytes within registers.
++ */
++#ifndef __ARMEB__
++#define pull lsr
++#define push lsl
++#else
++#define pull lsl
++#define push lsr
++#endif
++
++/*
++ * Enable data preload for architectures that support it (ARMv5 and above)
++ */
++#if defined(__ARM_ARCH_5__) || \
++ defined(__ARM_ARCH_5T__) || \
++ defined(__ARM_ARCH_5TE__)
++#define PLD(code...) code
++#else
++#define PLD(code...)
++#endif
++
++
++/* char * memcpy (char *dst, const char *src) */
++
++ENTRY(memcpy)
++ subs r2, r2, #4
++ stmfd sp!, {r0, r4, lr}
++ blt 7f
++ ands ip, r0, #3
++ PLD( pld [r1, #0] )
++ bne 8f
++ ands ip, r1, #3
++ bne 9f
++
++1: subs r2, r2, #4
++ blt 6f
++ subs r2, r2, #8
++ blt 5f
++ subs r2, r2, #16
++ blt 4f
++
++ PLD( subs r2, r2, #65 )
++ stmfd sp!, {r5 - r8}
++ PLD( blt 3f )
++ PLD( pld [r1, #32] )
++
++ PLD( @ cache alignment )
++ PLD( ands ip, r1, #31 )
++ PLD( pld [r1, #64] )
++ PLD( beq 2f )
++ PLD( rsb ip, ip, #32 )
++ PLD( cmp r2, ip )
++ PLD( pld [r1, #96] )
++ PLD( blt 2f )
++ PLD( cmp ip, #16 )
++ PLD( sub r2, r2, ip )
++ PLD( ldmgeia r1!, {r3 - r6} )
++ PLD( stmgeia r0!, {r3 - r6} )
++ PLD( beq 2f )
++ PLD( and ip, ip, #15 )
++ PLD( cmp ip, #8 )
++ PLD( ldr r3, [r1], #4 )
++ PLD( ldrge r4, [r1], #4 )
++ PLD( ldrgt r5, [r1], #4 )
++ PLD( str r3, [r0], #4 )
++ PLD( strge r4, [r0], #4 )
++ PLD( strgt r5, [r0], #4 )
++
++2: PLD( pld [r1, #96] )
++3: ldmia r1!, {r3 - r8, ip, lr}
++ subs r2, r2, #32
++ stmia r0!, {r3 - r8, ip, lr}
++ bge 2b
++ PLD( cmn r2, #65 )
++ PLD( bge 3b )
++ PLD( add r2, r2, #65 )
++ tst r2, #31
++ ldmfd sp!, {r5 - r8}
++ ldmeqfd sp!, {r0, r4, pc}
++
++ tst r2, #16
++4: ldmneia r1!, {r3, r4, ip, lr}
++ stmneia r0!, {r3, r4, ip, lr}
++
++ tst r2, #8
++5: ldmneia r1!, {r3, r4}
++ stmneia r0!, {r3, r4}
++
++ tst r2, #4
++6: ldrne r3, [r1], #4
++ strne r3, [r0], #4
++
++7: ands r2, r2, #3
++ ldmeqfd sp!, {r0, r4, pc}
++
++ cmp r2, #2
++ ldrb r3, [r1], #1
++ ldrgeb r4, [r1], #1
++ ldrgtb ip, [r1]
++ strb r3, [r0], #1
++ strgeb r4, [r0], #1
++ strgtb ip, [r0]
++ ldmfd sp!, {r0, r4, pc}
++
++8: rsb ip, ip, #4
++ cmp ip, #2
++ ldrb r3, [r1], #1
++ ldrgeb r4, [r1], #1
++ ldrgtb lr, [r1], #1
++ strb r3, [r0], #1
++ strgeb r4, [r0], #1
++ strgtb lr, [r0], #1
++ subs r2, r2, ip
++ blt 7b
++ ands ip, r1, #3
++ beq 1b
++
++9: bic r1, r1, #3
++ cmp ip, #2
++ ldr lr, [r1], #4
++ beq 17f
++ bgt 18f
++
++
++ .macro forward_copy_shift pull push
++
++ cmp r2, #12
++ PLD( pld [r1, #0] )
++ blt 15f
++ subs r2, r2, #28
++ stmfd sp!, {r5 - r9}
++ blt 13f
++
++ PLD( subs r2, r2, #97 )
++ PLD( blt 12f )
++ PLD( pld [r1, #32] )
++
++ PLD( @ cache alignment )
++ PLD( rsb ip, r1, #36 )
++ PLD( pld [r1, #64] )
++ PLD( ands ip, ip, #31 )
++ PLD( pld [r1, #96] )
++ PLD( beq 11f )
++ PLD( cmp r2, ip )
++ PLD( pld [r1, #128] )
++ PLD( blt 11f )
++ PLD( sub r2, r2, ip )
++10: PLD( mov r3, lr, pull #\pull )
++ PLD( ldr lr, [r1], #4 )
++ PLD( subs ip, ip, #4 )
++ PLD( orr r3, r3, lr, push #\push )
++ PLD( str r3, [r0], #4 )
++ PLD( bgt 10b )
++
++11: PLD( pld [r1, #128] )
++12: mov r3, lr, pull #\pull
++ ldmia r1!, {r4 - r9, ip, lr}
++ subs r2, r2, #32
++ orr r3, r3, r4, push #\push
++ mov r4, r4, pull #\pull
++ orr r4, r4, r5, push #\push
++ mov r5, r5, pull #\pull
++ orr r5, r5, r6, push #\push
++ mov r6, r6, pull #\pull
++ orr r6, r6, r7, push #\push
++ mov r7, r7, pull #\pull
++ orr r7, r7, r8, push #\push
++ mov r8, r8, pull #\pull
++ orr r8, r8, r9, push #\push
++ mov r9, r9, pull #\pull
++ orr r9, r9, ip, push #\push
++ mov ip, ip, pull #\pull
++ orr ip, ip, lr, push #\push
++ stmia r0!, {r3 - r9, ip}
++ bge 11b
++ PLD( cmn r2, #97 )
++ PLD( bge 12b )
++ PLD( add r2, r2, #97 )
++ cmn r2, #16
++ blt 14f
++13: mov r3, lr, pull #\pull
++ ldmia r1!, {r4 - r6, lr}
++ sub r2, r2, #16
++ orr r3, r3, r4, push #\push
++ mov r4, r4, pull #\pull
++ orr r4, r4, r5, push #\push
++ mov r5, r5, pull #\pull
++ orr r5, r5, r6, push #\push
++ mov r6, r6, pull #\pull
++ orr r6, r6, lr, push #\push
++ stmia r0!, {r3 - r6}
++14: adds r2, r2, #28
++ ldmfd sp!, {r5 - r9}
++ blt 16f
++15: mov r3, lr, pull #\pull
++ ldr lr, [r1], #4
++ subs r2, r2, #4
++ orr r3, r3, lr, push #\push
++ str r3, [r0], #4
++ bge 15b
++16:
++ .endm
++
++
++ forward_copy_shift pull=8 push=24
++ sub r1, r1, #3
++ b 7b
++
++17: forward_copy_shift pull=16 push=16
++ sub r1, r1, #2
++ b 7b
++
++18: forward_copy_shift pull=24 push=8
++ sub r1, r1, #1
++ b 7b
++
++ .size memcpy, . - memcpy
++END(memcpy)
++libc_hidden_builtin_def (memcpy)
++
diff --git a/recipes/glibc/glibc-2.9/dl-cache-libcmp.patch b/recipes/glibc/glibc-2.9/dl-cache-libcmp.patch
new file mode 100644
index 0000000000..2fedfa6db0
--- /dev/null
+++ b/recipes/glibc/glibc-2.9/dl-cache-libcmp.patch
@@ -0,0 +1,10 @@
+--- glibc-2.4/elf/Versions.ark 2006-03-11 23:30:09.000000000 +0100
++++ glibc-2.4/elf/Versions 2006-03-11 23:31:44.000000000 +0100
+@@ -63,5 +63,7 @@
+ _dl_debug_state;
+ # Pointer protection.
+ __pointer_chk_guard;
++ # for ldconfig
++ _dl_cache_libcmp;
+ }
+ }
diff --git a/recipes/glibc/glibc-2.9/etc/ld.so.conf b/recipes/glibc/glibc-2.9/etc/ld.so.conf
new file mode 100644
index 0000000000..46e06d3f0a
--- /dev/null
+++ b/recipes/glibc/glibc-2.9/etc/ld.so.conf
@@ -0,0 +1,2 @@
+/usr/local/lib
+
diff --git a/recipes/glibc/glibc-2.9/fhs-linux-paths.patch b/recipes/glibc/glibc-2.9/fhs-linux-paths.patch
new file mode 100644
index 0000000000..1f32f6d7f2
--- /dev/null
+++ b/recipes/glibc/glibc-2.9/fhs-linux-paths.patch
@@ -0,0 +1,11 @@
+--- glibc-2.1.1/sysdeps/unix/sysv/linux/paths.h~ Thu May 27 13:16:33 1999
++++ glibc-2.1.1/sysdeps/unix/sysv/linux/paths.h Thu May 27 13:17:55 1999
+@@ -71,7 +71,7 @@
+ /* Provide trailing slash, since mostly used for building pathnames. */
+ #define _PATH_DEV "/dev/"
+ #define _PATH_TMP "/tmp/"
+-#define _PATH_VARDB "/var/db/"
++#define _PATH_VARDB "/var/lib/misc/"
+ #define _PATH_VARRUN "/var/run/"
+ #define _PATH_VARTMP "/var/tmp/"
+
diff --git a/recipes/glibc/glibc-2.9/generate-supported.mk b/recipes/glibc/glibc-2.9/generate-supported.mk
new file mode 100644
index 0000000000..d2a28c2dc6
--- /dev/null
+++ b/recipes/glibc/glibc-2.9/generate-supported.mk
@@ -0,0 +1,11 @@
+#!/usr/bin/make
+
+include $(IN)
+
+all:
+ rm -f $(OUT)
+ touch $(OUT)
+ for locale in $(SUPPORTED-LOCALES); do \
+ [ $$locale = true ] && continue; \
+ echo $$locale | sed 's,/, ,' >> $(OUT); \
+ done
diff --git a/recipes/glibc/glibc-2.9/generic-bits_select.h b/recipes/glibc/glibc-2.9/generic-bits_select.h
new file mode 100644
index 0000000000..47e7dedc30
--- /dev/null
+++ b/recipes/glibc/glibc-2.9/generic-bits_select.h
@@ -0,0 +1,35 @@
+/* Copyright (C) 1997, 1998, 2001 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _SYS_SELECT_H
+# error "Never use <bits/select.h> directly; include <sys/select.h> instead."
+#endif
+
+
+/* We don't use `memset' because this would require a prototype and
+ the array isn't too big. */
+#define __FD_ZERO(s) \
+ do { \
+ unsigned int __i; \
+ fd_set *__arr = (s); \
+ for (__i = 0; __i < sizeof (fd_set) / sizeof (__fd_mask); ++__i) \
+ __FDS_BITS (__arr)[__i] = 0; \
+ } while (0)
+#define __FD_SET(d, s) (__FDS_BITS (s)[__FDELT(d)] |= __FDMASK(d))
+#define __FD_CLR(d, s) (__FDS_BITS (s)[__FDELT(d)] &= ~__FDMASK(d))
+#define __FD_ISSET(d, s) ((__FDS_BITS (s)[__FDELT(d)] & __FDMASK(d)) != 0)
diff --git a/recipes/glibc/glibc-2.9/generic-bits_time.h b/recipes/glibc/glibc-2.9/generic-bits_time.h
new file mode 100644
index 0000000000..b3184d1de9
--- /dev/null
+++ b/recipes/glibc/glibc-2.9/generic-bits_time.h
@@ -0,0 +1,75 @@
+/* System-dependent timing definitions. Generic version.
+ Copyright (C) 1996,1997,1999-2002,2003 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+/*
+ * Never include this file directly; use <time.h> instead.
+ */
+
+#ifndef __need_timeval
+# ifndef _BITS_TIME_H
+# define _BITS_TIME_H 1
+
+/* ISO/IEC 9899:1990 7.12.1: <time.h>
+ The macro `CLOCKS_PER_SEC' is the number per second of the value
+ returned by the `clock' function. */
+/* CAE XSH, Issue 4, Version 2: <time.h>
+ The value of CLOCKS_PER_SEC is required to be 1 million on all
+ XSI-conformant systems. */
+# define CLOCKS_PER_SEC 1000000l
+
+# if !defined __STRICT_ANSI__ && !defined __USE_XOPEN2K
+/* Even though CLOCKS_PER_SEC has such a strange value CLK_TCK
+ presents the real value for clock ticks per second for the system. */
+# include <bits/types.h>
+extern long int __sysconf (int);
+# define CLK_TCK ((__clock_t) __sysconf (2)) /* 2 is _SC_CLK_TCK */
+# endif
+
+# ifdef __USE_POSIX199309
+/* Identifier for system-wide realtime clock. */
+# define CLOCK_REALTIME 0
+/* Monotonic system-wide clock. */
+# define CLOCK_MONOTONIC 1
+/* High-resolution timer from the CPU. */
+# define CLOCK_PROCESS_CPUTIME_ID 2
+/* Thread-specific CPU-time clock. */
+# define CLOCK_THREAD_CPUTIME_ID 3
+
+/* Flag to indicate time is absolute. */
+# define TIMER_ABSTIME 1
+# endif
+
+# endif /* bits/time.h */
+#endif
+
+#ifdef __need_timeval
+# undef __need_timeval
+# ifndef _STRUCT_TIMEVAL
+# define _STRUCT_TIMEVAL 1
+# include <bits/types.h>
+
+/* A time value that is accurate to the nearest
+ microsecond but also has a range of years. */
+struct timeval
+ {
+ __time_t tv_sec; /* Seconds. */
+ __suseconds_t tv_usec; /* Microseconds. */
+ };
+# endif /* struct timeval */
+#endif /* need timeval */
diff --git a/recipes/glibc/glibc-2.9/generic-bits_types.h b/recipes/glibc/glibc-2.9/generic-bits_types.h
new file mode 100644
index 0000000000..65c8a9fe90
--- /dev/null
+++ b/recipes/glibc/glibc-2.9/generic-bits_types.h
@@ -0,0 +1,200 @@
+/* bits/types.h -- definitions of __*_t types underlying *_t types.
+ Copyright (C) 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+/*
+ * Never include this file directly; use <sys/types.h> instead.
+ */
+
+#ifndef _BITS_TYPES_H
+#define _BITS_TYPES_H 1
+
+#include <features.h>
+#include <bits/wordsize.h>
+
+#define __need_size_t
+#include <stddef.h>
+
+/* Convenience types. */
+typedef unsigned char __u_char;
+typedef unsigned short int __u_short;
+typedef unsigned int __u_int;
+typedef unsigned long int __u_long;
+
+/* Fixed-size types, underlying types depend on word size and compiler. */
+typedef signed char __int8_t;
+typedef unsigned char __uint8_t;
+typedef signed short int __int16_t;
+typedef unsigned short int __uint16_t;
+typedef signed int __int32_t;
+typedef unsigned int __uint32_t;
+#if __WORDSIZE == 64
+typedef signed long int __int64_t;
+typedef unsigned long int __uint64_t;
+#elif defined __GLIBC_HAVE_LONG_LONG
+__extension__ typedef signed long long int __int64_t;
+__extension__ typedef unsigned long long int __uint64_t;
+#endif
+
+/* quad_t is also 64 bits. */
+#if __WORDSIZE == 64
+typedef long int __quad_t;
+typedef unsigned long int __u_quad_t;
+#elif defined __GLIBC_HAVE_LONG_LONG
+__extension__ typedef long long int __quad_t;
+__extension__ typedef unsigned long long int __u_quad_t;
+#else
+typedef struct
+{
+ long __val[2];
+} __quad_t;
+typedef struct
+{
+ __u_long __val[2];
+} __u_quad_t;
+#endif
+
+
+/* The machine-dependent file <bits/typesizes.h> defines __*_T_TYPE
+ macros for each of the OS types we define below. The definitions
+ of those macros must use the following macros for underlying types.
+ We define __S<SIZE>_TYPE and __U<SIZE>_TYPE for the signed and unsigned
+ variants of each of the following integer types on this machine.
+
+ 16 -- "natural" 16-bit type (always short)
+ 32 -- "natural" 32-bit type (always int)
+ 64 -- "natural" 64-bit type (long or long long)
+ LONG32 -- 32-bit type, traditionally long
+ QUAD -- 64-bit type, always long long
+ WORD -- natural type of __WORDSIZE bits (int or long)
+ LONGWORD -- type of __WORDSIZE bits, traditionally long
+
+ We distinguish WORD/LONGWORD, 32/LONG32, and 64/QUAD so that the
+ conventional uses of `long' or `long long' type modifiers match the
+ types we define, even when a less-adorned type would be the same size.
+ This matters for (somewhat) portably writing printf/scanf formats for
+ these types, where using the appropriate l or ll format modifiers can
+ make the typedefs and the formats match up across all GNU platforms. If
+ we used `long' when it's 64 bits where `long long' is expected, then the
+ compiler would warn about the formats not matching the argument types,
+ and the programmer changing them to shut up the compiler would break the
+ program's portability.
+
+ Here we assume what is presently the case in all the GCC configurations
+ we support: long long is always 64 bits, long is always word/address size,
+ and int is always 32 bits. */
+
+#define __S16_TYPE short int
+#define __U16_TYPE unsigned short int
+#define __S32_TYPE int
+#define __U32_TYPE unsigned int
+#define __SLONGWORD_TYPE long int
+#define __ULONGWORD_TYPE unsigned long int
+#if __WORDSIZE == 32
+# define __SQUAD_TYPE __quad_t
+# define __UQUAD_TYPE __u_quad_t
+# define __SWORD_TYPE int
+# define __UWORD_TYPE unsigned int
+# define __SLONG32_TYPE long int
+# define __ULONG32_TYPE unsigned long int
+# define __S64_TYPE __quad_t
+# define __U64_TYPE __u_quad_t
+/* We want __extension__ before typedef's that use nonstandard base types
+ such as `long long' in C89 mode. */
+# define __STD_TYPE __extension__ typedef
+#elif __WORDSIZE == 64
+# define __SQUAD_TYPE long int
+# define __UQUAD_TYPE unsigned long int
+# define __SWORD_TYPE long int
+# define __UWORD_TYPE unsigned long int
+# define __SLONG32_TYPE int
+# define __ULONG32_TYPE unsigned int
+# define __S64_TYPE long int
+# define __U64_TYPE unsigned long int
+/* No need to mark the typedef with __extension__. */
+# define __STD_TYPE typedef
+#else
+# error
+#endif
+#include <bits/typesizes.h> /* Defines __*_T_TYPE macros. */
+
+
+__STD_TYPE __DEV_T_TYPE __dev_t; /* Type of device numbers. */
+__STD_TYPE __UID_T_TYPE __uid_t; /* Type of user identifications. */
+__STD_TYPE __GID_T_TYPE __gid_t; /* Type of group identifications. */
+__STD_TYPE __INO_T_TYPE __ino_t; /* Type of file serial numbers. */
+__STD_TYPE __INO64_T_TYPE __ino64_t; /* Type of file serial numbers (LFS).*/
+__STD_TYPE __MODE_T_TYPE __mode_t; /* Type of file attribute bitmasks. */
+__STD_TYPE __NLINK_T_TYPE __nlink_t; /* Type of file link counts. */
+__STD_TYPE __OFF_T_TYPE __off_t; /* Type of file sizes and offsets. */
+__STD_TYPE __OFF64_T_TYPE __off64_t; /* Type of file sizes and offsets (LFS). */
+__STD_TYPE __PID_T_TYPE __pid_t; /* Type of process identifications. */
+__STD_TYPE __FSID_T_TYPE __fsid_t; /* Type of file system IDs. */
+__STD_TYPE __CLOCK_T_TYPE __clock_t; /* Type of CPU usage counts. */
+__STD_TYPE __RLIM_T_TYPE __rlim_t; /* Type for resource measurement. */
+__STD_TYPE __RLIM64_T_TYPE __rlim64_t; /* Type for resource measurement (LFS). */
+__STD_TYPE __ID_T_TYPE __id_t; /* General type for IDs. */
+__STD_TYPE __TIME_T_TYPE __time_t; /* Seconds since the Epoch. */
+__STD_TYPE __USECONDS_T_TYPE __useconds_t; /* Count of microseconds. */
+__STD_TYPE __SUSECONDS_T_TYPE __suseconds_t; /* Signed count of microseconds. */
+
+__STD_TYPE __DADDR_T_TYPE __daddr_t; /* The type of a disk address. */
+__STD_TYPE __SWBLK_T_TYPE __swblk_t; /* Type of a swap block maybe? */
+__STD_TYPE __KEY_T_TYPE __key_t; /* Type of an IPC key. */
+
+/* Clock ID used in clock and timer functions. */
+__STD_TYPE __CLOCKID_T_TYPE __clockid_t;
+
+/* Timer ID returned by `timer_create'. */
+__STD_TYPE __TIMER_T_TYPE __timer_t;
+
+/* Type to represent block size. */
+__STD_TYPE __BLKSIZE_T_TYPE __blksize_t;
+
+/* Types from the Large File Support interface. */
+
+/* Type to count number of disk blocks. */
+__STD_TYPE __BLKCNT_T_TYPE __blkcnt_t;
+__STD_TYPE __BLKCNT64_T_TYPE __blkcnt64_t;
+
+/* Type to count file system blocks. */
+__STD_TYPE __FSBLKCNT_T_TYPE __fsblkcnt_t;
+__STD_TYPE __FSBLKCNT64_T_TYPE __fsblkcnt64_t;
+
+/* Type to count file system nodes. */
+__STD_TYPE __FSFILCNT_T_TYPE __fsfilcnt_t;
+__STD_TYPE __FSFILCNT64_T_TYPE __fsfilcnt64_t;
+
+__STD_TYPE __SSIZE_T_TYPE __ssize_t; /* Type of a byte count, or error. */
+
+/* These few don't really vary by system, they always correspond
+ to one of the other defined types. */
+typedef __off64_t __loff_t; /* Type of file sizes and offsets (LFS). */
+typedef __quad_t *__qaddr_t;
+typedef char *__caddr_t;
+
+/* Duplicates info from stdint.h but this is used in unistd.h. */
+__STD_TYPE __SWORD_TYPE __intptr_t;
+
+/* Duplicate info from sys/socket.h. */
+__STD_TYPE __U32_TYPE __socklen_t;
+
+
+#undef __STD_TYPE
+
+#endif /* bits/types.h */
diff --git a/recipes/glibc/glibc-2.9/generic-bits_typesizes.h b/recipes/glibc/glibc-2.9/generic-bits_typesizes.h
new file mode 100644
index 0000000000..e9226c4174
--- /dev/null
+++ b/recipes/glibc/glibc-2.9/generic-bits_typesizes.h
@@ -0,0 +1,66 @@
+/* bits/typesizes.h -- underlying types for *_t. Generic version.
+ Copyright (C) 2002, 2003 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _BITS_TYPES_H
+# error "Never include <bits/typesizes.h> directly; use <sys/types.h> instead."
+#endif
+
+#ifndef _BITS_TYPESIZES_H
+#define _BITS_TYPESIZES_H 1
+
+/* See <bits/types.h> for the meaning of these macros. This file exists so
+ that <bits/types.h> need not vary across different GNU platforms. */
+
+#define __DEV_T_TYPE __UQUAD_TYPE
+#define __UID_T_TYPE __U32_TYPE
+#define __GID_T_TYPE __U32_TYPE
+#define __INO_T_TYPE __ULONGWORD_TYPE
+#define __INO64_T_TYPE __UQUAD_TYPE
+#define __MODE_T_TYPE __U32_TYPE
+#define __NLINK_T_TYPE __UWORD_TYPE
+#define __OFF_T_TYPE __SLONGWORD_TYPE
+#define __OFF64_T_TYPE __SQUAD_TYPE
+#define __PID_T_TYPE __S32_TYPE
+#define __RLIM_T_TYPE __ULONGWORD_TYPE
+#define __RLIM64_T_TYPE __UQUAD_TYPE
+#define __BLKCNT_T_TYPE __SLONGWORD_TYPE
+#define __BLKCNT64_T_TYPE __SQUAD_TYPE
+#define __FSBLKCNT_T_TYPE __ULONGWORD_TYPE
+#define __FSBLKCNT64_T_TYPE __UQUAD_TYPE
+#define __FSFILCNT_T_TYPE __ULONGWORD_TYPE
+#define __FSFILCNT64_T_TYPE __UQUAD_TYPE
+#define __ID_T_TYPE __U32_TYPE
+#define __CLOCK_T_TYPE __SLONGWORD_TYPE
+#define __TIME_T_TYPE __SLONGWORD_TYPE
+#define __USECONDS_T_TYPE __U32_TYPE
+#define __SUSECONDS_T_TYPE __SLONGWORD_TYPE
+#define __DADDR_T_TYPE __S32_TYPE
+#define __SWBLK_T_TYPE __SLONGWORD_TYPE
+#define __KEY_T_TYPE __S32_TYPE
+#define __CLOCKID_T_TYPE __S32_TYPE
+#define __TIMER_T_TYPE void *
+#define __BLKSIZE_T_TYPE __SLONGWORD_TYPE
+#define __FSID_T_TYPE struct { int __val[2]; }
+#define __SSIZE_T_TYPE __SWORD_TYPE
+
+/* Number of descriptors that can fit in an `fd_set'. */
+#define __FD_SETSIZE 1024
+
+
+#endif /* bits/typesizes.h */
diff --git a/recipes/glibc/glibc-2.9/glibc-arm-IO-acquire-lock-fix.diff b/recipes/glibc/glibc-2.9/glibc-arm-IO-acquire-lock-fix.diff
new file mode 100644
index 0000000000..a552cf0d1f
--- /dev/null
+++ b/recipes/glibc/glibc-2.9/glibc-arm-IO-acquire-lock-fix.diff
@@ -0,0 +1,13 @@
+Arm needs a similar fix as http://sourceware.org/ml/libc-ports/2007-12/msg00000.html
+
+--- /tmp/stdio-lock.h 2008-03-04 18:51:15.555038993 +0100
++++ glibc-2.7/ports/sysdeps/unix/sysv/linux/arm/bits/stdio-lock.h 2008-03-04 18:51:28.445035052 +0100
+@@ -50,6 +50,8 @@
+ _IO_cleanup_region_start ((void (*) (void *)) _IO_funlockfile, (_fp)); \
+ _IO_flockfile (_fp)
+
++# define _IO_acquire_lock_clear_flags2(_fp) _IO_acquire_lock (_fp)
++
+ # define _IO_release_lock(_fp) \
+ _IO_funlockfile (_fp); \
+ _IO_cleanup_region_end (0)
diff --git a/recipes/glibc/glibc-2.9/glibc-check_pf.patch b/recipes/glibc/glibc-2.9/glibc-check_pf.patch
new file mode 100644
index 0000000000..3cff6bbcfa
--- /dev/null
+++ b/recipes/glibc/glibc-2.9/glibc-check_pf.patch
@@ -0,0 +1,343 @@
+From libc-ports-return-550-listarch-libc-ports=sources dot redhat dot com at sourceware dot org Tue Oct 31 17:37:21 2006
+Return-Path: <libc-ports-return-550-listarch-libc-ports=sources dot redhat dot com at sourceware dot org>
+Delivered-To: listarch-libc-ports at sources dot redhat dot com
+Received: (qmail 17273 invoked by alias); 31 Oct 2006 17:37:20 -0000
+Received: (qmail 17262 invoked by uid 22791); 31 Oct 2006 17:37:19 -0000
+X-Spam-Status: No, hits=-2.5 required=5.0 tests=AWL,BAYES_00,TW_CP
+X-Spam-Check-By: sourceware.org
+Received: from nevyn.them.org (HELO nevyn.them.org) (66.93.172.17) by sourceware.org (qpsmtpd/0.31.1) with ESMTP; Tue, 31 Oct 2006 17:37:11 +0000
+Received: from drow by nevyn.them.org with local (Exim 4.54) id 1GexXw-0007Dj-30; Tue, 31 Oct 2006 12:37:08 -0500
+Date: Tue, 31 Oct 2006 12:37:08 -0500
+From: Daniel Jacobowitz <drow at false dot org>
+To: Mike Frysinger <vapier at gentoo dot org>
+Cc: libc-ports at sourceware dot org, Philip Balister <philip dot balister at gmail dot com>
+Subject: Re: Problem with glibc-2.5 on ARM
+Message-ID: <20061031173708.GJ20468@nevyn.them.org>
+References: <499146270610241149ibe030e0nd9d6b177a95b346e@mail.gmail.com> <499146270610241254u7cadf63ej2edf05cedbc5266f@mail.gmail.com> <20061024195837.GA20181@nevyn.them.org> <200610291954.27022.vapier@gentoo.org>
+MIME-Version: 1.0
+Content-Type: text/plain; charset=us-ascii
+Content-Disposition: inline
+In-Reply-To: <200610291954 dot 27022 dot vapier at gentoo dot org>
+User-Agent: Mutt/1.5.13 (2006-08-11)
+X-IsSubscribed: yes
+Mailing-List: contact libc-ports-help at sourceware dot org; run by ezmlm
+Precedence: bulk
+List-Subscribe: <mailto:libc-ports-subscribe at sourceware dot org>
+List-Post: <mailto:libc-ports at sourceware dot org>
+List-Help: <mailto:libc-ports-help at sourceware dot org>, <http://sourceware dot org/lists dot html#faqs>
+Sender: libc-ports-owner at sourceware dot org
+Delivered-To: mailing list libc-ports at sourceware dot org
+
+On Sun, Oct 29, 2006 at 07:54:25PM -0500, Mike Frysinger wrote:
+> On Tuesday 24 October 2006 15:58, Daniel Jacobowitz wrote:
+> > ARM is going to need a slightly different version of that file, I
+> > guess.
+>
+> would declaring req with attribute packed not help ?
+> -mike
+
+Nope. "struct rtgenmsg" would still have size 4.
+
+Philip, are you still at all interested in this for the old ABI?
+I don't have time to test this patch right now, but I think it
+will work.
+
+--
+Daniel Jacobowitz
+CodeSourcery
+
+2006-10-31 Daniel Jacobowitz <dan@codesourcery.com>
+
+ * sysdeps/unix/sysv/linux/arm/check_pf.c: New file.
+ * sysdeps/unix/sysv/linux/arm/eabi/check_pf.c: New file.
+
+Index: sysdeps/unix/sysv/linux/arm/check_pf.c
+===================================================================
+RCS file: sysdeps/unix/sysv/linux/arm/check_pf.c
+diff -N sysdeps/unix/sysv/linux/arm/check_pf.c
+--- /dev/null 1 Jan 1970 00:00:00 -0000
++++ sysdeps/unix/sysv/linux/arm/check_pf.c 31 Oct 2006 17:29:58 -0000
+@@ -0,0 +1,274 @@
++/* Determine protocol families for which interfaces exist. ARM Linux version.
++ Copyright (C) 2003, 2006 Free Software Foundation, Inc.
++ This file is part of the GNU C Library.
++
++ The GNU C Library is free software; you can redistribute it and/or
++ modify it under the terms of the GNU Lesser General Public
++ License as published by the Free Software Foundation; either
++ version 2.1 of the License, or (at your option) any later version.
++
++ The GNU C Library is distributed in the hope that it will be useful,
++ but WITHOUT ANY WARRANTY; without even the implied warranty of
++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++ Lesser General Public License for more details.
++
++ You should have received a copy of the GNU Lesser General Public
++ License along with the GNU C Library; if not, write to the Free
++ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
++ 02111-1307 USA. */
++
++#include <assert.h>
++#include <errno.h>
++#include <ifaddrs.h>
++#include <netdb.h>
++#include <stddef.h>
++#include <string.h>
++#include <time.h>
++#include <unistd.h>
++#include <sys/socket.h>
++
++#include <asm/types.h>
++#include <linux/netlink.h>
++#include <linux/rtnetlink.h>
++
++#include <not-cancel.h>
++#include <kernel-features.h>
++
++
++#ifndef IFA_F_TEMPORARY
++# define IFA_F_TEMPORARY IFA_F_SECONDARY
++#endif
++#ifndef IFA_F_HOMEADDRESS
++# define IFA_F_HOMEADDRESS 0
++#endif
++
++
++static int
++make_request (int fd, pid_t pid, bool *seen_ipv4, bool *seen_ipv6,
++ struct in6addrinfo **in6ai, size_t *in6ailen)
++{
++ struct req
++ {
++ struct nlmsghdr nlh;
++ struct rtgenmsg g;
++ } req;
++ struct sockaddr_nl nladdr;
++
++ /* struct rtgenmsg consists of a single byte but the ARM ABI rounds
++ it up to a word. Clear the padding explicitly here. */
++ assert (sizeof (req.g) == 4);
++ memset (&req.g, '\0', sizeof (req.g));
++
++ req.nlh.nlmsg_len = sizeof (req);
++ req.nlh.nlmsg_type = RTM_GETADDR;
++ req.nlh.nlmsg_flags = NLM_F_ROOT | NLM_F_MATCH | NLM_F_REQUEST;
++ req.nlh.nlmsg_pid = 0;
++ req.nlh.nlmsg_seq = time (NULL);
++ req.g.rtgen_family = AF_UNSPEC;
++
++ memset (&nladdr, '\0', sizeof (nladdr));
++ nladdr.nl_family = AF_NETLINK;
++
++ if (TEMP_FAILURE_RETRY (__sendto (fd, (void *) &req, sizeof (req), 0,
++ (struct sockaddr *) &nladdr,
++ sizeof (nladdr))) < 0)
++ return -1;
++
++ *seen_ipv4 = false;
++ *seen_ipv6 = false;
++
++ bool done = false;
++ char buf[4096];
++ struct iovec iov = { buf, sizeof (buf) };
++ struct in6ailist
++ {
++ struct in6addrinfo info;
++ struct in6ailist *next;
++ } *in6ailist = NULL;
++ size_t in6ailistlen = 0;
++
++ do
++ {
++ struct msghdr msg =
++ {
++ (void *) &nladdr, sizeof (nladdr),
++ &iov, 1,
++ NULL, 0,
++ 0
++ };
++
++ ssize_t read_len = TEMP_FAILURE_RETRY (__recvmsg (fd, &msg, 0));
++ if (read_len < 0)
++ return -1;
++
++ if (msg.msg_flags & MSG_TRUNC)
++ return -1;
++
++ struct nlmsghdr *nlmh;
++ for (nlmh = (struct nlmsghdr *) buf;
++ NLMSG_OK (nlmh, (size_t) read_len);
++ nlmh = (struct nlmsghdr *) NLMSG_NEXT (nlmh, read_len))
++ {
++ if (nladdr.nl_pid != 0 || (pid_t) nlmh->nlmsg_pid != pid
++ || nlmh->nlmsg_seq != req.nlh.nlmsg_seq)
++ continue;
++
++ if (nlmh->nlmsg_type == RTM_NEWADDR)
++ {
++ struct ifaddrmsg *ifam = (struct ifaddrmsg *) NLMSG_DATA (nlmh);
++
++ switch (ifam->ifa_family)
++ {
++ case AF_INET:
++ *seen_ipv4 = true;
++ break;
++ case AF_INET6:
++ *seen_ipv6 = true;
++
++ if (ifam->ifa_flags & (IFA_F_DEPRECATED
++ | IFA_F_TEMPORARY
++ | IFA_F_HOMEADDRESS))
++ {
++ struct rtattr *rta = IFA_RTA (ifam);
++ size_t len = (nlmh->nlmsg_len
++ - NLMSG_LENGTH (sizeof (*ifam)));
++ void *local = NULL;
++ void *address = NULL;
++ while (RTA_OK (rta, len))
++ {
++ switch (rta->rta_type)
++ {
++ case IFA_LOCAL:
++ local = RTA_DATA (rta);
++ break;
++
++ case IFA_ADDRESS:
++ address = RTA_DATA (rta);
++ break;
++ }
++
++ rta = RTA_NEXT (rta, len);
++ }
++
++ struct in6ailist *newp = alloca (sizeof (*newp));
++ newp->info.flags = (((ifam->ifa_flags & IFA_F_DEPRECATED)
++ ? in6ai_deprecated : 0)
++ | ((ifam->ifa_flags
++ & IFA_F_TEMPORARY)
++ ? in6ai_temporary : 0)
++ | ((ifam->ifa_flags
++ & IFA_F_HOMEADDRESS)
++ ? in6ai_homeaddress : 0));
++ memcpy (newp->info.addr, address ?: local,
++ sizeof (newp->info.addr));
++ newp->next = in6ailist;
++ in6ailist = newp;
++ ++in6ailistlen;
++ }
++ break;
++ default:
++ /* Ignore. */
++ break;
++ }
++ }
++ else if (nlmh->nlmsg_type == NLMSG_DONE)
++ /* We found the end, leave the loop. */
++ done = true;
++ }
++ }
++ while (! done);
++
++ close_not_cancel_no_status (fd);
++
++ if (in6ailist != NULL)
++ {
++ *in6ai = malloc (in6ailistlen * sizeof (**in6ai));
++ if (*in6ai == NULL)
++ return -1;
++
++ *in6ailen = in6ailistlen;
++
++ do
++ {
++ (*in6ai)[--in6ailistlen] = in6ailist->info;
++ in6ailist = in6ailist->next;
++ }
++ while (in6ailist != NULL);
++ }
++
++ return 0;
++}
++
++
++/* We don't know if we have NETLINK support compiled in in our
++ Kernel. */
++#if __ASSUME_NETLINK_SUPPORT == 0
++/* Define in ifaddrs.h. */
++extern int __no_netlink_support attribute_hidden;
++#else
++# define __no_netlink_support 0
++#endif
++
++
++void
++attribute_hidden
++__check_pf (bool *seen_ipv4, bool *seen_ipv6,
++ struct in6addrinfo **in6ai, size_t *in6ailen)
++{
++ *in6ai = NULL;
++ *in6ailen = 0;
++
++ if (! __no_netlink_support)
++ {
++ int fd = __socket (PF_NETLINK, SOCK_RAW, NETLINK_ROUTE);
++
++ struct sockaddr_nl nladdr;
++ memset (&nladdr, '\0', sizeof (nladdr));
++ nladdr.nl_family = AF_NETLINK;
++
++ socklen_t addr_len = sizeof (nladdr);
++
++ if (fd >= 0
++ && __bind (fd, (struct sockaddr *) &nladdr, sizeof (nladdr)) == 0
++ && __getsockname (fd, (struct sockaddr *) &nladdr, &addr_len) == 0
++ && make_request (fd, nladdr.nl_pid, seen_ipv4, seen_ipv6,
++ in6ai, in6ailen) == 0)
++ /* It worked. */
++ return;
++
++ if (fd >= 0)
++ __close (fd);
++
++#if __ASSUME_NETLINK_SUPPORT == 0
++ /* Remember that there is no netlink support. */
++ __no_netlink_support = 1;
++#else
++ /* We cannot determine what interfaces are available. Be
++ pessimistic. */
++ *seen_ipv4 = true;
++ *seen_ipv6 = true;
++#endif
++ }
++
++#if __ASSUME_NETLINK_SUPPORT == 0
++ /* No netlink. Get the interface list via getifaddrs. */
++ struct ifaddrs *ifa = NULL;
++ if (getifaddrs (&ifa) != 0)
++ {
++ /* We cannot determine what interfaces are available. Be
++ pessimistic. */
++ *seen_ipv4 = true;
++ *seen_ipv6 = true;
++ return;
++ }
++
++ struct ifaddrs *runp;
++ for (runp = ifa; runp != NULL; runp = runp->ifa_next)
++ if (runp->ifa_addr->sa_family == PF_INET)
++ *seen_ipv4 = true;
++ else if (runp->ifa_addr->sa_family == PF_INET6)
++ *seen_ipv6 = true;
++
++ (void) freeifaddrs (ifa);
++#endif
++}
+Index: sysdeps/unix/sysv/linux/arm/eabi/check_pf.c
+===================================================================
+RCS file: sysdeps/unix/sysv/linux/arm/eabi/check_pf.c
+diff -N sysdeps/unix/sysv/linux/arm/eabi/check_pf.c
+--- /dev/null 1 Jan 1970 00:00:00 -0000
++++ sysdeps/unix/sysv/linux/arm/eabi/check_pf.c 31 Oct 2006 17:29:58 -0000
+@@ -0,0 +1 @@
++#include <sysdeps/unix/sysv/linux/check_pf.c>
+
diff --git a/recipes/glibc/glibc-2.9/ldd-unbash.patch b/recipes/glibc/glibc-2.9/ldd-unbash.patch
new file mode 100644
index 0000000000..2fb8854b49
--- /dev/null
+++ b/recipes/glibc/glibc-2.9/ldd-unbash.patch
@@ -0,0 +1,11 @@
+--- glibc-2.5/elf/ldd.bash.in.org 2006-04-30 16:06:20.000000000 +0000
++++ glibc-2.5/elf/ldd.bash.in 2007-03-30 19:18:57.000000000 +0000
+@@ -110,7 +110,7 @@
+ # environments where the executed program might not have permissions
+ # to write to the console/tty. But only bash 3.x supports the pipefail
+ # option, and we don't bother to handle the case for older bash versions.
+-if set -o pipefail 2> /dev/null; then
++if false; then
+ try_trace() {
+ eval $add_env '"$@"' | cat
+ }
diff --git a/recipes/glibc/glibc-2.9/ldsocache-varrun.patch b/recipes/glibc/glibc-2.9/ldsocache-varrun.patch
new file mode 100644
index 0000000000..9994d4f879
--- /dev/null
+++ b/recipes/glibc/glibc-2.9/ldsocache-varrun.patch
@@ -0,0 +1,18 @@
+This patch moves ld.so.cache from /etc to /var/run. This is for devices
+where /etc is JFFS2 or CRAMFS but /var is a ramdisk.
+
+#
+# Patch managed by http://www.mn-logistik.de/unsupported/pxa250/patcher
+#
+
+--- libc/sysdeps/generic/dl-cache.h~ldsocache-varrun
++++ libc/sysdeps/generic/dl-cache.h
+@@ -29,7 +29,7 @@
+ #endif
+
+ #ifndef LD_SO_CACHE
+-# define LD_SO_CACHE SYSCONFDIR "/ld.so.cache"
++# define LD_SO_CACHE "/var/run/ld.so.cache"
+ #endif
+
+ #ifndef add_system_dir
diff --git a/recipes/glibc/glibc-2.9/march-i686.patch b/recipes/glibc/glibc-2.9/march-i686.patch
new file mode 100644
index 0000000000..04616032ad
--- /dev/null
+++ b/recipes/glibc/glibc-2.9/march-i686.patch
@@ -0,0 +1,38 @@
+2007-02-15 Khem Raj <kraj@xxxxxxxxxx>
+
+ * sysdeps/unix/sysv/linux/i386/sysdep.h: Re-define __i686.
+ * nptl/sysdeps/pthread/pt-initfini.c: Ditto.
+
+
+
+Index: sysdeps/unix/sysv/linux/i386/sysdep.h
+===================================================================
+--- sysdeps/unix/sysv/linux/i386/sysdep.h (revision 1469)
++++ sysdeps/unix/sysv/linux/i386/sysdep.h (working copy)
+@@ -29,6 +29,10 @@
+ #include <dl-sysdep.h>
+ #include <tls.h>
+
++#if defined __i686 && defined __ASSEMBLER__
++#undef __i686
++#define __i686 __i686
++#endif
+
+ /* For Linux we can use the system call table in the header file
+ /usr/include/asm/unistd.h
+Index: nptl/sysdeps/pthread/pt-initfini.c
+===================================================================
+--- nptl/sysdeps/pthread/pt-initfini.c (revision 1469)
++++ nptl/sysdeps/pthread/pt-initfini.c (working copy)
+@@ -45,6 +45,11 @@
+ /* Embed an #include to pull in the alignment and .end directives. */
+ asm ("\n#include \"defs.h\"");
+
++asm ("\n#if defined __i686 && defined __ASSEMBLER__");
++asm ("\n#undef __i686");
++asm ("\n#define __i686 __i686");
++asm ("\n#endif");
++
+ /* The initial common code ends here. */
+ asm ("\n/*@HEADER_ENDS*/");
+
diff --git a/recipes/glibc/glibc-2.9/no-z-defs.patch b/recipes/glibc/glibc-2.9/no-z-defs.patch
new file mode 100644
index 0000000000..48c6a41267
--- /dev/null
+++ b/recipes/glibc/glibc-2.9/no-z-defs.patch
@@ -0,0 +1,9 @@
+Create a configparms file which disabled no-z-defs.
+This is required to build a working glibs for sh4,
+without there will be a lot linker errors during the build.
+
+diff -duNr libc.orig/configparms libc/configparms
+--- libc.orig/configparms 1970-01-01 10:00:00.000000000 +1000
++++ libc/configparms 2006-02-23 14:08:18.000000000 +1100
+@@ -0,0 +1 @@
++no-z-defs=yes
diff --git a/recipes/glibc/glibc-2.9/nptl-crosscompile.patch b/recipes/glibc/glibc-2.9/nptl-crosscompile.patch
new file mode 100644
index 0000000000..18a46ad4f1
--- /dev/null
+++ b/recipes/glibc/glibc-2.9/nptl-crosscompile.patch
@@ -0,0 +1,26 @@
+--- glibc-2.4/nptl/sysdeps/pthread/configure.in.ark 2006-03-12 00:41:40.000000000 +0100
++++ glibc-2.4/nptl/sysdeps/pthread/configure.in 2006-03-12 00:44:08.000000000 +0100
+@@ -45,5 +45,6 @@
+ AC_MSG_ERROR([the compiler must support C cleanup handling])
+ fi
+ else
+- AC_MSG_ERROR(forced unwind support is required)
++ AC_MSG_WARN([forced unwind support is required, can't be verified while crosscompiling])
++ AC_DEFINE(HAVE_FORCED_UNWIND)
+ fi
+--- glibc-2.4/nptl/sysdeps/pthread/configure.ark 2006-03-12 00:42:47.000000000 +0100
++++ glibc-2.4/nptl/sysdeps/pthread/configure 2006-03-12 00:44:08.000000000 +0100
+@@ -153,7 +153,10 @@
+ { (exit 1); exit 1; }; }
+ fi
+ else
+- { { echo "$as_me:$LINENO: error: forced unwind support is required" >&5
+-echo "$as_me: error: forced unwind support is required" >&2;}
+- { (exit 1); exit 1; }; }
++ { echo "$as_me:$LINENO: WARNING: forced unwind support is required, can't be verified while crosscompiling" >&5
++echo "$as_me: WARNING: forced unwind support is required, can't be verified while crosscompiling" >&2;}
++ cat >>confdefs.h <<\_ACEOF
++#define HAVE_FORCED_UNWIND 1
++_ACEOF
++
+ fi
diff --git a/recipes/glibc/glibc-2.9/nscd-init.patch b/recipes/glibc/glibc-2.9/nscd-init.patch
new file mode 100644
index 0000000000..884609a5a3
--- /dev/null
+++ b/recipes/glibc/glibc-2.9/nscd-init.patch
@@ -0,0 +1,39 @@
+--- nscd/nscd.init
++++ nscd/nscd.init
+@@ -48,9 +48,8 @@
+
+ start () {
+ [ -d /var/run/nscd ] || mkdir /var/run/nscd
+- [ -d /var/db/nscd ] || mkdir /var/db/nscd
+ echo -n $"Starting $prog: "
+- daemon /usr/sbin/nscd
++ /usr/sbin/nscd
+ RETVAL=$?
+ echo
+ [ $RETVAL -eq 0 ] && touch /var/lock/subsys/nscd
+@@ -67,12 +66,10 @@
+ # a non-privileged user
+ rm -f /var/run/nscd/nscd.pid
+ rm -f /var/run/nscd/socket
+- success $"$prog shutdown"
+- else
+- failure $"$prog shutdown"
+ fi
+- echo
+- return $RETVAL
++ echo "Done."
++ # If nscd did not run, return 0 according to LSB.
++ return 0
+ }
+
+ restart() {
+@@ -104,7 +101,8 @@
+ ;;
+ force-reload | reload)
+ echo -n $"Reloading $prog: "
+- killproc /usr/sbin/nscd -HUP
++ # Use killall, initscripts-1.0-r115 don't support -HUP yet.
++ killall -HUP /usr/sbin/nscd
+ RETVAL=$?
+ echo
+ ;;
diff --git a/recipes/glibc/glibc-2.9/powerpc-sqrt-hack.diff b/recipes/glibc/glibc-2.9/powerpc-sqrt-hack.diff
new file mode 100644
index 0000000000..1046efb2a1
--- /dev/null
+++ b/recipes/glibc/glibc-2.9/powerpc-sqrt-hack.diff
@@ -0,0 +1,25 @@
+diff -Nurd ../glibc-initial-2.5-r4/glibc-2.5/sysdeps/powerpc/fpu/e_sqrt.c glibc-2.5/sysdeps/powerpc/fpu/e_sqrt.c
+--- ../glibc-initial-2.5-r4/glibc-2.5/sysdeps/powerpc/fpu/e_sqrt.c 2006-04-14 07:44:30.000000000 +0200
++++ glibc-2.5/sysdeps/powerpc/fpu/e_sqrt.c 2006-12-08 12:53:32.202227000 +0100
+@@ -25,6 +25,9 @@
+ #include <sysdep.h>
+ #include <ldsodefs.h>
+
++#define __CPU_HAS_FSQRT ((GLRO(dl_hwcap) & PPC_FEATURE_64) != 0)
++
++
+ static const double almost_half = 0.5000000000000001; /* 0.5 + 2^-53 */
+ static const ieee_float_shape_type a_nan = {.word = 0x7fc00000 };
+ static const ieee_float_shape_type a_inf = {.word = 0x7f800000 };
+diff -Nurd ../glibc-initial-2.5-r4/glibc-2.5/sysdeps/powerpc/fpu/e_sqrtf.c glibc-2.5/sysdeps/powerpc/fpu/e_sqrtf.c
+--- ../glibc-initial-2.5-r4/glibc-2.5/sysdeps/powerpc/fpu/e_sqrtf.c 2006-04-14 07:44:30.000000000 +0200
++++ glibc-2.5/sysdeps/powerpc/fpu/e_sqrtf.c 2006-12-08 12:53:36.992227000 +0100
+@@ -25,6 +25,8 @@
+ #include <sysdep.h>
+ #include <ldsodefs.h>
+
++#define __CPU_HAS_FSQRT ((GLRO(dl_hwcap) & PPC_FEATURE_64) != 0)
++
+ static const float almost_half = 0.50000006; /* 0.5 + 2^-24 */
+ static const ieee_float_shape_type a_nan = {.word = 0x7fc00000 };
+ static const ieee_float_shape_type a_inf = {.word = 0x7f800000 };
diff --git a/recipes/glibc/glibc-2.9/tls_i486.patch b/recipes/glibc/glibc-2.9/tls_i486.patch
new file mode 100644
index 0000000000..69a1fdf91d
--- /dev/null
+++ b/recipes/glibc/glibc-2.9/tls_i486.patch
@@ -0,0 +1,14 @@
+Index: glibc-2.9/sysdeps/i386/dl-tlsdesc.S
+===================================================================
+--- glibc-2.9.orig/sysdeps/i386/dl-tlsdesc.S 2009-07-07 23:21:11.647664128 +0200
++++ glibc-2.9/sysdeps/i386/dl-tlsdesc.S 2009-07-07 23:21:32.802555992 +0200
+@@ -128,8 +128,7 @@
+ .Lslow:
+ cfi_adjust_cfa_offset (28)
+ movl %ebx, 16(%esp)
+- call __i686.get_pc_thunk.bx
+- addl $_GLOBAL_OFFSET_TABLE_, %ebx
++ LOAD_PIC_REG (bx)
+ call ___tls_get_addr@PLT
+ movl 16(%esp), %ebx
+ jmp .Lret
diff --git a/recipes/glibc/glibc-initial_2.3.2+cvs20040726.bb b/recipes/glibc/glibc-initial_2.3.2+cvs20040726.bb
deleted file mode 100644
index c7dde2310e..0000000000
--- a/recipes/glibc/glibc-initial_2.3.2+cvs20040726.bb
+++ /dev/null
@@ -1,4 +0,0 @@
-require glibc_${PV}.bb
-require glibc-initial.inc
-
-DEFAULT_PREFERENCE_sh3 = "-99"
diff --git a/recipes/glibc/glibc-initial_2.3.6.bb b/recipes/glibc/glibc-initial_2.3.6.bb
deleted file mode 100644
index fa7836ad88..0000000000
--- a/recipes/glibc/glibc-initial_2.3.6.bb
+++ /dev/null
@@ -1,2 +0,0 @@
-require glibc_${PV}.bb
-require glibc-initial.inc
diff --git a/recipes/glibc/glibc-initial_2.4.bb b/recipes/glibc/glibc-initial_2.4.bb
deleted file mode 100644
index fa7836ad88..0000000000
--- a/recipes/glibc/glibc-initial_2.4.bb
+++ /dev/null
@@ -1,2 +0,0 @@
-require glibc_${PV}.bb
-require glibc-initial.inc
diff --git a/recipes/glibc/glibc-initial_2.7.bb b/recipes/glibc/glibc-initial_2.7.bb
deleted file mode 100644
index d66297090f..0000000000
--- a/recipes/glibc/glibc-initial_2.7.bb
+++ /dev/null
@@ -1,6 +0,0 @@
-require glibc_${PV}.bb
-require glibc-initial.inc
-
-do_configure_prepend () {
- unset CFLAGS
-}
diff --git a/recipes/glibc/glibc.inc b/recipes/glibc/glibc.inc
index 19b5524293..643ebd30b8 100644
--- a/recipes/glibc/glibc.inc
+++ b/recipes/glibc/glibc.inc
@@ -10,6 +10,8 @@ DEPENDS = "virtual/${TARGET_PREFIX}gcc-intermediate linux-libc-headers"
PROVIDES = "virtual/libc virtual/${TARGET_PREFIX}libc-for-gcc"
PROVIDES += "virtual/libintl virtual/libiconv"
+COMPATIBLE_TARGET_SYS ?= "(?!nios2)"
+
# INC_PR for glibc.inc, glibc-initial.inc and glibc-stage.inc
INC_PR = "r36"
diff --git a/recipes/glibc/glibc_2.10.1.bb b/recipes/glibc/glibc_2.10.1.bb
index 3db617b17e..b29e36a820 100644
--- a/recipes/glibc/glibc_2.10.1.bb
+++ b/recipes/glibc/glibc_2.10.1.bb
@@ -1,5 +1,7 @@
require glibc.inc
+PR = "${INC_PR}.1"
+
ARM_INSTRUCTION_SET = "arm"
PACKAGES_DYNAMIC = "libc6*"
@@ -9,9 +11,6 @@ RPROVIDES_${PN}-dev = "libc6-dev virtual-libc-dev"
BUILD_CPPFLAGS = "-I${STAGING_INCDIR_NATIVE}"
TARGET_CPPFLAGS = "-I${STAGING_DIR_TARGET}${layout_includedir}"
-
-FILESPATHPKG =. "glibc-2.4:"
-
GLIBC_ADDONS ?= "ports,nptl,libidn"
GLIBC_BROKEN_LOCALES = " _ER _ET so_ET yn_ER sid_ET tr_TR mn_MN gez_ET gez_ER bn_BD te_IN"
@@ -37,34 +36,40 @@ RDEPENDS_${PN}-dev = "linux-libc-headers-dev"
SRC_URI = "ftp://ftp.gnu.org/pub/gnu/glibc/glibc-${PV}.tar.bz2;name=archive \
ftp://ftp.gnu.org/pub/gnu/glibc/glibc-ports-${PV}.tar.bz2;name=ports \
ftp://ftp.gnu.org/pub/gnu/glibc/glibc-libidn-${PV}.tar.bz2;name=libidn \
- file://nscd-init.patch;patch=1;pnum=0 \
- file://arm-memcpy.patch;patch=1 \
- file://arm-longlong.patch;patch=1 \
- file://fhs-linux-paths.patch;patch=1 \
- file://dl-cache-libcmp.patch;patch=1 \
- file://ldsocache-varrun.patch;patch=1 \
- file://nptl-crosscompile.patch;patch=1 \
- file://glibc-check_pf.patch;patch=1;pnum=0 \
- file://ldd-unbash.patch;patch=1 \
- file://glibc-arm-IO-acquire-lock-fix.diff;patch=1 \
+ file://nscd-init.patch;striplevel=0 \
+ file://arm-memcpy.patch \
+ file://arm-longlong.patch \
+ file://fhs-linux-paths.patch \
+ file://dl-cache-libcmp.patch \
+ file://ldsocache-varrun.patch \
+ file://nptl-crosscompile.patch \
+ file://glibc-check_pf.patch;striplevel=0 \
+ file://ldd-unbash.patch \
+ file://glibc-arm-IO-acquire-lock-fix.diff \
file://generic-bits_select.h \
file://generic-bits_types.h \
file://generic-bits_typesizes.h \
file://generic-bits_time.h \
file://etc/ld.so.conf \
file://generate-supported.mk \
- file://march-i686.patch;patch=1;pnum=0 \
- file://arm-lowlevellock-include-tls.patch;patch=1 \
- file://glibc-2.9-enable-binutils-2.2.patch;patch=1 \
- file://armv4t-interworking.patch;patch=1 \
+ file://march-i686.patch;striplevel=0 \
+ file://arm-lowlevellock-include-tls.patch \
+ file://glibc-2.9-enable-binutils-2.2.patch \
+ file://armv4t-interworking.patch \
+ file://PTR_MANGLE.patch \
"
# Build fails on sh3 and sh4 without additional patches
-SRC_URI_append_sh3 = " file://no-z-defs.patch;patch=1"
-SRC_URI_append_sh4 = " file://no-z-defs.patch;patch=1"
+SRC_URI_append_sh3 = " file://no-z-defs.patch"
+SRC_URI_append_sh4 = " file://no-z-defs.patch"
#powerpc patches to add support for soft-float
-SRC_URI_append_powerpc= " file://powerpc-sqrt-hack.diff;patch=1"
+SRC_URI_append_powerpc= " file://powerpc-sqrt-hack.diff"
+
+SRC_URI_append_nios2 = " \
+ file://sysdeps-nios2.patch \
+ file://nios2-elf.patch \
+"
S = "${WORKDIR}/glibc-${PV}"
B = "${WORKDIR}/build-${TARGET_SYS}"
diff --git a/recipes/glibc/glibc_2.2.5.bb b/recipes/glibc/glibc_2.2.5.bb
index a1c00e7d4b..8622950d76 100644
--- a/recipes/glibc/glibc_2.2.5.bb
+++ b/recipes/glibc/glibc_2.2.5.bb
@@ -42,68 +42,68 @@ FILES_localedef = "${bindir}/localedef"
RDEPENDS_${PN}-dev = "linux-libc-headers-dev"
RPROVIDES_${PN}-dev += "libc-dev virtual-libc-dev"
-# file://noinfo.patch;patch=1 \
-# file://ldconfig.patch;patch=1;pnum=0 \
+# file://noinfo.patch \
+# file://ldconfig.patch;striplevel=0 \
SRC_URI = "${GNU_MIRROR}/glibc/glibc-${PV}.tar.gz;name=archive \
${GNU_MIRROR}/glibc/glibc-linuxthreads-${PV}.tar.gz;name=linuxthreads \
- file://alpha-build-failure.patch;patch=1 \
- file://arm-asm-clobber.patch;patch=1 \
- file://arm-ctl_bus_isa.patch;patch=1 \
- file://cris-libc-symbols.patch;patch=1 \
- file://cris-stack-direction.patch;patch=1 \
- file://dl-machine-alpha.patch;patch=1 \
- file://dl-machine-arm.patch;patch=1 \
- file://dl-machine-m68k.patch;patch=1 \
- file://dl-machine-mips.patch;patch=1 \
- file://dl-machine-sh.patch;patch=1 \
- file://dl-machine-sparc.patch;patch=1 \
- file://errlist-1.9.patch;patch=1 \
- file://errlist-arm.patch;patch=1 \
- file://glibc-2.2.5-allow-gcc-3.4-fixup.patch;patch=1 \
- file://glibc-2.2.5-allow-gcc-3.4-grp.patch;patch=1 \
- file://glibc-2.2.5-allow-gcc-4.x-configure.patch;patch=1 \
- file://glibc-2.2.5-alpha-pwrite64.patch;patch=1 \
- file://glibc-2.2.5-arm-pwrite64.patch;patch=1 \
- file://glibc-2.2.5-crosstest.patch;patch=1 \
- file://glibc-2.2.5-crossyes.patch;patch=1 \
- file://glibc-2.2.5-cygwin.patch;patch=1 \
- file://glibc-2.2.5-hhl-powerpc-fpu.patch;patch=1 \
- file://glibc-2.2.5-mips-build-gmon.patch;patch=1 \
- file://glibc-2.2.5-mips-clone-local-label.patch;patch=1 \
- file://glibc-2.2.5-ppc405erratum77.patch;patch=1 \
- file://glibc-drow-sh.patch;patch=1 \
- file://glibc-test-lowram.patch;patch=1 \
- file://initfini-alpha.patch;patch=1 \
- file://initfini-sh.patch;patch=1 \
- file://longjmp-sparc.patch;patch=1 \
- file://sh-setjmp-fix.patch;patch=1 \
- file://sprintf-prototype.patch;patch=1 \
- file://sscanf.patch;patch=1 \
- file://unwind-arm.patch;patch=1 \
- file://ldd.patch;patch=1;pnum=0 \
- file://fhs-linux-paths.patch;patch=1;pnum=1 \
- file://arm-no-hwcap.patch;patch=1;pnum=0 \
- file://arm-memcpy.patch;patch=1;pnum=0 \
- file://arm-longlong.patch;patch=1;pnum=0 \
- file://arm-machine-gmon.patch;patch=1;pnum=0 \
- file://glibc-2.2.5-allow-gcc-3.4-td.patch;patch=1 \
- file://glibc-2.2.5-alpha-self-clobber.patch;patch=1 \
- file://pt-initfini-alpha.patch;patch=1 \
- file://pt-initfini-sh.patch;patch=1 \
- file://linuxthreads-2.2.5-ppc405erratum77.patch;patch=1 \
- file://threadparam.patch;patch=1 \
- file://initfini-flags.patch;patch=1 \
- file://pt-initfini-flags.patch;patch=1 \
- file://glibc-2.3.2-allow-solaris.patch;patch=1 \
+ file://alpha-build-failure.patch \
+ file://arm-asm-clobber.patch \
+ file://arm-ctl_bus_isa.patch \
+ file://cris-libc-symbols.patch \
+ file://cris-stack-direction.patch \
+ file://dl-machine-alpha.patch \
+ file://dl-machine-arm.patch \
+ file://dl-machine-m68k.patch \
+ file://dl-machine-mips.patch \
+ file://dl-machine-sh.patch \
+ file://dl-machine-sparc.patch \
+ file://errlist-1.9.patch \
+ file://errlist-arm.patch \
+ file://glibc-2.2.5-allow-gcc-3.4-fixup.patch \
+ file://glibc-2.2.5-allow-gcc-3.4-grp.patch \
+ file://glibc-2.2.5-allow-gcc-4.x-configure.patch \
+ file://glibc-2.2.5-alpha-pwrite64.patch \
+ file://glibc-2.2.5-arm-pwrite64.patch \
+ file://glibc-2.2.5-crosstest.patch \
+ file://glibc-2.2.5-crossyes.patch \
+ file://glibc-2.2.5-cygwin.patch \
+ file://glibc-2.2.5-hhl-powerpc-fpu.patch \
+ file://glibc-2.2.5-mips-build-gmon.patch \
+ file://glibc-2.2.5-mips-clone-local-label.patch \
+ file://glibc-2.2.5-ppc405erratum77.patch \
+ file://glibc-drow-sh.patch \
+ file://glibc-test-lowram.patch \
+ file://initfini-alpha.patch \
+ file://initfini-sh.patch \
+ file://longjmp-sparc.patch \
+ file://sh-setjmp-fix.patch \
+ file://sprintf-prototype.patch \
+ file://sscanf.patch \
+ file://unwind-arm.patch \
+ file://ldd.patch;striplevel=0 \
+ file://fhs-linux-paths.patch \
+ file://arm-no-hwcap.patch;striplevel=0 \
+ file://arm-memcpy.patch;striplevel=0 \
+ file://arm-longlong.patch;striplevel=0 \
+ file://arm-machine-gmon.patch;striplevel=0 \
+ file://glibc-2.2.5-allow-gcc-3.4-td.patch \
+ file://glibc-2.2.5-alpha-self-clobber.patch \
+ file://pt-initfini-alpha.patch \
+ file://pt-initfini-sh.patch \
+ file://linuxthreads-2.2.5-ppc405erratum77.patch \
+ file://threadparam.patch \
+ file://initfini-flags.patch \
+ file://pt-initfini-flags.patch \
+ file://glibc-2.3.2-allow-solaris.patch \
\
file://etc/ld.so.conf \
file://generate-supported.mk"
-# file://makeconfig.patch;patch=1;pnum=0
+# file://makeconfig.patch;striplevel=0
# seems to break on TLS platforms
-# SRC_URI_append_arm = " file://dyn-ldconfig.patch;patch=1;pnum=0"
+# SRC_URI_append_arm = " file://dyn-ldconfig.patch;striplevel=0"
S = "${WORKDIR}/glibc-${PV}"
B = "${WORKDIR}/build-${TARGET_SYS}"
diff --git a/recipes/glibc/glibc_2.3.2+cvs20040726.bb b/recipes/glibc/glibc_2.3.2+cvs20040726.bb
deleted file mode 100644
index 7773e9cd52..0000000000
--- a/recipes/glibc/glibc_2.3.2+cvs20040726.bb
+++ /dev/null
@@ -1,78 +0,0 @@
-require glibc.inc
-
-DEFAULT_PREFERENCE_sh3 = "-99"
-
-FILESDIR = "${@os.path.dirname(bb.data.getVar('FILE',d,1))}/glibc-cvs"
-PR = "${INC_PR}.0"
-
-GLIBC_ADDONS ?= "linuxthreads"
-
-# file://noinfo.patch;patch=1
-# file://ldconfig.patch;patch=1;pnum=0
-SRC_URI = "cvs://anoncvs@sources.redhat.com/cvs/glibc;module=libc;date=${@bb.data.getVar('PV', d, 1)[9:]} \
- file://arm-ioperm.patch;patch=1;pnum=0 \
- file://makeconfig.patch;patch=1;pnum=0 \
- file://ldd.patch;patch=1;pnum=0 \
- file://fhs-linux-paths.patch;patch=1 \
- file://arm-no-hwcap.patch;patch=1;pnum=0 \
- file://arm-memcpy.patch;patch=1;pnum=0 \
- file://arm-longlong.patch;patch=1;pnum=0 \
- file://arm-machine-gmon.patch;patch=1;pnum=0 \
- file://glibc-fp-byteorder.patch;patch=1 \
- \
- file://etc/ld.so.conf \
- file://generate-supported.mk"
-
-# seems to fail on tls platforms
-SRC_URI_append_arm = " file://dyn-ldconfig.patch;patch=1;pnum=0"
-
-SRC_URI_append_openmn = " file://ldsocache-varrun.patch;patch=1"
-
-S = "${WORKDIR}/libc"
-B = "${WORKDIR}/build-${TARGET_SYS}"
-
-RDEPENDS_${PN}-dev = "linux-libc-headers-dev"
-RPROVIDES_${PN}-dev += "libc-dev virtual-libc-dev"
-
-EXTRA_OECONF = "--enable-kernel=${OLDEST_KERNEL} \
- --without-cvs --disable-profile --disable-debug --without-gd \
- --enable-clocale=gnu \
- --enable-add-ons=${GLIBC_ADDONS} \
- --with-headers=${STAGING_INCDIR} \
- ${GLIBC_EXTRA_OECONF}"
-
-do_configure () {
-# override this function to avoid the autoconf/automake/aclocal/autoheader
-# calls for now
-# don't pass CPPFLAGS into configure, since it upsets the kernel-headers
-# version check and doesn't really help with anything
- if [ -z "`which rpcgen`" ]; then
- echo "rpcgen not found. Install glibc-devel."
- exit 1
- fi
- (cd ${S} && gnu-configize) || die "failure in running gnu-configize"
- CPPFLAGS="" oe_runconf
-}
-
-rpcsvc = "bootparam_prot.x nlm_prot.x rstat.x \
- yppasswd.x klm_prot.x rex.x sm_inter.x mount.x \
- rusers.x spray.x nfs_prot.x rquota.x key_prot.x"
-
-do_compile () {
- # this really is arm specific
- touch ${S}/sysdeps/arm/framestate.c
- # -Wl,-rpath-link <staging>/lib in LDFLAGS can cause breakage if another glibc is in staging
- unset LDFLAGS
- base_do_compile
- (
- cd ${S}/sunrpc/rpcsvc
- for r in ${rpcsvc}; do
- h=`echo $r|sed -e's,\.x$,.h,'`
- rpcgen -h $r -o $h || oewarn "unable to generate header for $r"
- done
- )
-}
-
-require glibc-stage.inc
-
-require glibc-package.inc
diff --git a/recipes/glibc/glibc_2.3.2.bb b/recipes/glibc/glibc_2.3.2.bb
index 6c8c6a5f1f..632df5b5d6 100644
--- a/recipes/glibc/glibc_2.3.2.bb
+++ b/recipes/glibc/glibc_2.3.2.bb
@@ -43,71 +43,71 @@ RPROVIDES_${PN}-dev += "libc-dev virtual-libc-dev"
SRC_URI = "ftp://ftp.gnu.org/gnu/glibc/glibc-${PV}.tar.gz;name=archive \
ftp://ftp.gnu.org/pub/gnu/glibc/glibc-linuxthreads-2.3.2.tar.gz;name=linuxthreads \
- file://noinfo.patch;patch=1 \
- file://10_cvs.patch;patch=1 \
- file://arm-ioperm.patch;patch=1;pnum=0 \
- file://glibc-i686-timing.patch;patch=1;pnum=1 \
- file://makeconfig.patch;patch=1;pnum=0 \
- file://locale-es_AR.patch;patch=1;pnum=0 \
- file://ldconfig.patch;patch=1;pnum=0 \
- file://ldd.patch;patch=1;pnum=0 \
- file://fhs-linux-paths.patch;patch=1;pnum=1 \
- file://glibc22-nss-upgrade.patch;patch=1;pnum=1 \
- file://glibc22-eo_EO.patch;patch=1;pnum=1 \
- file://glibc22-m68k-compat.patch;patch=1;pnum=1 \
- file://glibc22-m68k-fpic.patch;patch=1;pnum=1 \
- file://glibc22-locales.patch;patch=1;pnum=0 \
- file://sparc64-fixups.patch;patch=1;pnum=1 \
- file://glibc22-ttyname-devfs.patch;patch=1;pnum=0 \
- file://powerpc-sysconf.patch;patch=1;pnum=1 \
- file://arm-no-hwcap.patch;patch=1;pnum=0 \
- file://locales-stuff.patch;patch=1;pnum=1 \
- file://librt-mips.patch;patch=1;pnum=0 \
- file://glibc23-ctype-compat.patch;patch=1;pnum=1 \
- file://glibc23-hppa-Rminkernel.patch;patch=1;pnum=0 \
- file://glibc23-function-compat.patch;patch=1;pnum=1 \
- file://glibc23-errno.patch;patch=1;pnum=1 \
- file://glibc23-asserth-decls.patch;patch=1;pnum=0 \
- file://alpha-pic.patch;patch=1;pnum=0 \
- file://glibc23-cmov.patch;patch=1;pnum=1 \
- file://libgcc-compat-all.patch;patch=1;pnum=0 \
- file://locales-supported.patch;patch=1;pnum=0 \
- file://libgcc-compat-other.patch;patch=1;pnum=1 \
- file://s390-tls.patch;patch=1;pnum=0 \
- file://hurd-enable-ldconfig.patch;patch=1;pnum=1 \
- file://30_glibc232-base.patch;patch=1;pnum=0 \
- file://sparcv8-target.patch;patch=1;pnum=0 \
- file://50_glibc232-arm-dwarf2-buildfix.patch;patch=1;pnum=0 \
- file://50_glibc232-m68k-dwarf2-buildfix.patch;patch=1;pnum=1 \
- file://arm-output-format.patch;patch=1;pnum=0 \
- file://pthread-cleanup.patch;patch=1;pnum=0 \
- file://glibc-${PV}-ldconfig-tls.patch;patch=1;pnum=1 \
- file://glibc23-mips-msq.patch;patch=1;pnum=0 \
- file://glibc23-libio-compat.patch;patch=1;pnum=1 \
- file://80_glibc232-locales-nb_NO-fix.patch;patch=1;pnum=0 \
- file://ldso-disable-hwcap.patch;patch=1;pnum=1 \
- file://11_shlib-lds.patch;patch=1;pnum=1 \
- file://glibc23-version-sanity.patch;patch=1;pnum=1 \
- file://glibc23-sse-oldkernel.patch;patch=1;pnum=1 \
- file://glibc23-sparc-pread64.patch;patch=1;pnum=1 \
- file://glibc23-powerpc-sigcontext.patch;patch=1;pnum=1 \
- file://hppa-syscall.patch;patch=1;pnum=0 \
- file://glibc23-errno-hack.patch;patch=1;pnum=1 \
- file://90_glibc232-statvfs.patch;patch=1;pnum=0 \
- file://90_glibc232-timezones.patch;patch=1;pnum=0 \
- file://arm-memcpy.patch;patch=1;pnum=0 \
- file://arm-longlong.patch;patch=1;pnum=0 \
- file://arm-machine-gmon.patch;patch=1;pnum=0 \
- file://dyn-ldconfig.diff;patch=1;pnum=0 \
- file://glibc232-gcc34-i386-fixup-attribute.patch;patch=1;pnum=1 \
- file://glibc232-gcc34-no-unit-at-a-time.patch;patch=1;pnum=1 \
+ file://noinfo.patch \
+ file://10_cvs.patch \
+ file://arm-ioperm.patch;striplevel=0 \
+ file://glibc-i686-timing.patch \
+ file://makeconfig.patch;striplevel=0 \
+ file://locale-es_AR.patch;striplevel=0 \
+ file://ldconfig.patch;striplevel=0 \
+ file://ldd.patch;striplevel=0 \
+ file://fhs-linux-paths.patch \
+ file://glibc22-nss-upgrade.patch \
+ file://glibc22-eo_EO.patch \
+ file://glibc22-m68k-compat.patch \
+ file://glibc22-m68k-fpic.patch \
+ file://glibc22-locales.patch;striplevel=0 \
+ file://sparc64-fixups.patch \
+ file://glibc22-ttyname-devfs.patch;striplevel=0 \
+ file://powerpc-sysconf.patch \
+ file://arm-no-hwcap.patch;striplevel=0 \
+ file://locales-stuff.patch \
+ file://librt-mips.patch;striplevel=0 \
+ file://glibc23-ctype-compat.patch \
+ file://glibc23-hppa-Rminkernel.patch;striplevel=0 \
+ file://glibc23-function-compat.patch \
+ file://glibc23-errno.patch \
+ file://glibc23-asserth-decls.patch;striplevel=0 \
+ file://alpha-pic.patch;striplevel=0 \
+ file://glibc23-cmov.patch \
+ file://libgcc-compat-all.patch;striplevel=0 \
+ file://locales-supported.patch;striplevel=0 \
+ file://libgcc-compat-other.patch \
+ file://s390-tls.patch;striplevel=0 \
+ file://hurd-enable-ldconfig.patch \
+ file://30_glibc232-base.patch;striplevel=0 \
+ file://sparcv8-target.patch;striplevel=0 \
+ file://50_glibc232-arm-dwarf2-buildfix.patch;striplevel=0 \
+ file://50_glibc232-m68k-dwarf2-buildfix.patch \
+ file://arm-output-format.patch;striplevel=0 \
+ file://pthread-cleanup.patch;striplevel=0 \
+ file://glibc-${PV}-ldconfig-tls.patch \
+ file://glibc23-mips-msq.patch;striplevel=0 \
+ file://glibc23-libio-compat.patch \
+ file://80_glibc232-locales-nb_NO-fix.patch;striplevel=0 \
+ file://ldso-disable-hwcap.patch \
+ file://11_shlib-lds.patch \
+ file://glibc23-version-sanity.patch \
+ file://glibc23-sse-oldkernel.patch \
+ file://glibc23-sparc-pread64.patch \
+ file://glibc23-powerpc-sigcontext.patch \
+ file://hppa-syscall.patch;striplevel=0 \
+ file://glibc23-errno-hack.patch \
+ file://90_glibc232-statvfs.patch;striplevel=0 \
+ file://90_glibc232-timezones.patch;striplevel=0 \
+ file://arm-memcpy.patch;striplevel=0 \
+ file://arm-longlong.patch;striplevel=0 \
+ file://arm-machine-gmon.patch;striplevel=0 \
+ file://dyn-ldconfig.diff;striplevel=0 \
+ file://glibc232-gcc34-i386-fixup-attribute.patch \
+ file://glibc232-gcc34-no-unit-at-a-time.patch \
file://etc/ld.so.conf \
file://generate-supported.mk"
-SRC_URI_append_mtx-1 = " file://mips-abio32.patch;patch=1 \
- file://allow-gcc.patch;patch=1 "
-SRC_URI_append_mtx-2 = " file://mips-abio32.patch;patch=1 \
- file://allow-gcc.patch;patch=1 "
+SRC_URI_append_mtx-1 = " file://mips-abio32.patch \
+ file://allow-gcc.patch "
+SRC_URI_append_mtx-2 = " file://mips-abio32.patch \
+ file://allow-gcc.patch "
S = "${WORKDIR}/glibc-${PV}"
B = "${WORKDIR}/build-${TARGET_SYS}"
diff --git a/recipes/glibc/glibc_2.3.3+cvs20041128.bb b/recipes/glibc/glibc_2.3.3+cvs20041128.bb
deleted file mode 100644
index f52bb07643..0000000000
--- a/recipes/glibc/glibc_2.3.3+cvs20041128.bb
+++ /dev/null
@@ -1,100 +0,0 @@
-require glibc.inc
-
-DEFAULT_PREFERENCE_sh3 = "-99"
-
-FILESDIR = "${@os.path.dirname(bb.data.getVar('FILE',d,1))}/glibc-cvs"
-PR = "${INC_PR}.0"
-
-GLIBC_ADDONS ?= "linuxthreads"
-
-DEFAULT_PREFERENCE = "-1"
-DEFAULT_PREFERENCE_i686 = "0"
-DEFAULT_PREFERENCE_sh3 = "0"
-DEFAULT_PREFERENCE_sh4 = "0"
-
-#
-# For now, we will skip building of a gcc package if it is a uclibc one
-# and our build is not a uclibc one, and we skip a glibc one if our build
-# is a uclibc build.
-#
-# See the note in gcc/gcc_3.4.0.oe
-#
-
-python __anonymous () {
- import bb, re
- uc_os = (re.match('.*uclibc$', bb.data.getVar('TARGET_OS', d, 1)) != None)
- if uc_os:
- raise bb.parse.SkipPackage("incompatible with target %s" %
- bb.data.getVar('TARGET_OS', d, 1))
-}
-
-# file://noinfo.patch;patch=1
-# file://ldconfig.patch;patch=1;pnum=0
-SRC_URI = "cvs://anoncvs@sources.redhat.com/cvs/glibc;module=libc;date=${@bb.data.getVar('PV', d, 1)[9:]} \
- file://arm-ioperm.patch;patch=1;pnum=0 \
- file://ldd.patch;patch=1;pnum=0 \
- file://fhs-linux-paths.patch;patch=1 \
- file://arm-no-hwcap.patch;patch=1;pnum=0 \
- file://arm-memcpy.patch;patch=1;pnum=0 \
- file://arm-longlong.patch;patch=1;pnum=0 \
- file://arm-machine-gmon.patch;patch=1;pnum=0 \
- \
- file://etc/ld.so.conf \
- file://generate-supported.mk"
-
-# seems to fail on tls platforms
-SRC_URI_append_arm = " file://dyn-ldconfig-20041128.patch;patch=1"
-
-SRC_URI_append_openmn = " file://ldsocache-varrun.patch;patch=1"
-
-S = "${WORKDIR}/libc"
-B = "${WORKDIR}/build-${TARGET_SYS}"
-
-RDEPENDS_${PN}-dev = "linux-libc-headers-dev"
-RPROVIDES_${PN}-dev += "libc-dev virtual-libc-dev"
-
-EXTRA_OECONF = "--enable-kernel=${OLDEST_KERNEL} \
- --without-cvs --disable-profile --disable-debug --without-gd \
- --enable-clocale=gnu \
- --enable-add-ons=${GLIBC_ADDONS} \
- --with-headers=${STAGING_INCDIR} \
- --without-selinux \
- ${GLIBC_EXTRA_OECONF}"
-
-EXTRA_OECONF += "${@get_glibc_fpu_setting(bb, d)}"
-
-do_configure () {
-# override this function to avoid the autoconf/automake/aclocal/autoheader
-# calls for now
-# don't pass CPPFLAGS into configure, since it upsets the kernel-headers
-# version check and doesn't really help with anything
- if [ -z "`which rpcgen`" ]; then
- echo "rpcgen not found. Install glibc-devel."
- exit 1
- fi
- (cd ${S} && gnu-configize) || die "failure in running gnu-configize"
- CPPFLAGS="" oe_runconf
-}
-
-rpcsvc = "bootparam_prot.x nlm_prot.x rstat.x \
- yppasswd.x klm_prot.x rex.x sm_inter.x mount.x \
- rusers.x spray.x nfs_prot.x rquota.x key_prot.x"
-
-do_compile () {
- # this really is arm specific
- touch ${S}/sysdeps/arm/framestate.c
- # -Wl,-rpath-link <staging>/lib in LDFLAGS can cause breakage if another glibc is in staging
- unset LDFLAGS
- base_do_compile
- (
- cd ${S}/sunrpc/rpcsvc
- for r in ${rpcsvc}; do
- h=`echo $r|sed -e's,\.x$,.h,'`
- rpcgen -h $r -o $h || oewarn "unable to generate header for $r"
- done
- )
-}
-
-require glibc-stage.inc
-
-require glibc-package.inc
diff --git a/recipes/glibc/glibc_2.3.3+cvs20050221.bb b/recipes/glibc/glibc_2.3.3+cvs20050221.bb
deleted file mode 100644
index 34efe71ed5..0000000000
--- a/recipes/glibc/glibc_2.3.3+cvs20050221.bb
+++ /dev/null
@@ -1,83 +0,0 @@
-require glibc.inc
-
-DEFAULT_PREFERENCE_sh3 = "-99"
-
-FILESDIR = "${@os.path.dirname(bb.data.getVar('FILE',d,1))}/glibc-cvs"
-PR = "${INC_PR}.0"
-
-GLIBC_ADDONS ?= "linuxthreads"
-
-DEFAULT_PREFERENCE = "-1"
-DEFAULT_PREFERENCE_i686 = "0"
-DEFAULT_PREFERENCE_sh3 = "0"
-DEFAULT_PREFERENCE_sh4 = "0"
-
-# file://noinfo.patch;patch=1
-# file://ldconfig.patch;patch=1;pnum=0
-SRC_URI = "cvs://anoncvs@sources.redhat.com/cvs/glibc;module=libc;date=${@bb.data.getVar('PV', d, 1)[9:]} \
- file://arm-ioperm.patch;patch=1;pnum=0 \
- file://fhs-linux-paths.patch;patch=1 \
- file://arm-no-hwcap.patch;patch=1;pnum=0 \
- file://arm-memcpy.patch;patch=1;pnum=0 \
- file://arm-longlong.patch;patch=1;pnum=0 \
- file://arm-machine-gmon.patch;patch=1;pnum=0 \
- file://trampoline.patch;patch=1;pnum=0 \
- file://dl-cache-libcmp.patch;patch=1 \
- \
- file://etc/ld.so.conf \
- file://generate-supported.mk"
-
-# seems to fail on tls platforms
-SRC_URI_append_arm = " file://dyn-ldconfig-20041128.patch;patch=1"
-
-SRC_URI_append_openmn = " file://ldsocache-varrun.patch;patch=1"
-
-S = "${WORKDIR}/libc"
-B = "${WORKDIR}/build-${TARGET_SYS}"
-
-RDEPENDS_${PN}-dev = "linux-libc-headers-dev"
-RPROVIDES_${PN}-dev += "libc-dev virtual-libc-dev"
-
-EXTRA_OECONF = "--enable-kernel=${OLDEST_KERNEL} \
- --without-cvs --disable-profile --disable-debug --without-gd \
- --enable-clocale=gnu \
- --enable-add-ons=${GLIBC_ADDONS} \
- --with-headers=${STAGING_INCDIR} \
- --without-selinux \
- ${GLIBC_EXTRA_OECONF}"
-
-do_configure () {
-# override this function to avoid the autoconf/automake/aclocal/autoheader
-# calls for now
-# don't pass CPPFLAGS into configure, since it upsets the kernel-headers
-# version check and doesn't really help with anything
- if [ -z "`which rpcgen`" ]; then
- echo "rpcgen not found. Install glibc-devel."
- exit 1
- fi
- (cd ${S} && gnu-configize) || die "failure in running gnu-configize"
- CPPFLAGS="" oe_runconf
-}
-
-rpcsvc = "bootparam_prot.x nlm_prot.x rstat.x \
- yppasswd.x klm_prot.x rex.x sm_inter.x mount.x \
- rusers.x spray.x nfs_prot.x rquota.x key_prot.x"
-
-do_compile () {
- # this really is arm specific
- touch ${S}/sysdeps/arm/framestate.c
- # -Wl,-rpath-link <staging>/lib in LDFLAGS can cause breakage if another glibc is in staging
- unset LDFLAGS
- base_do_compile
- (
- cd ${S}/sunrpc/rpcsvc
- for r in ${rpcsvc}; do
- h=`echo $r|sed -e's,\.x$,.h,'`
- rpcgen -h $r -o $h || oewarn "unable to generate header for $r"
- done
- )
-}
-
-require glibc-stage.inc
-
-require glibc-package.inc
diff --git a/recipes/glibc/glibc_2.3.3+cvs20050420.bb b/recipes/glibc/glibc_2.3.3+cvs20050420.bb
deleted file mode 100644
index 36b2c2cfd0..0000000000
--- a/recipes/glibc/glibc_2.3.3+cvs20050420.bb
+++ /dev/null
@@ -1,84 +0,0 @@
-require glibc.inc
-
-DEFAULT_PREFERENCE_i586 = "0"
-
-DEFAULT_PREFERENCE_sh3 = "-99"
-
-FILESDIR = "${@os.path.dirname(bb.data.getVar('FILE',d,1))}/glibc-cvs"
-PR = "${INC_PR}.0"
-
-GLIBC_ADDONS ?= "linuxthreads"
-
-DEFAULT_PREFERENCE = "-1"
-
-# file://noinfo.patch;patch=1
-# file://ldconfig.patch;patch=1;pnum=0
-SRC_URI = "cvs://anoncvs@sources.redhat.com/cvs/glibc;module=libc;date=${@bb.data.getVar('PV', d, 1)[9:]} \
- file://arm-ioperm.patch;patch=1;pnum=0 \
- file://fhs-linux-paths.patch;patch=1 \
- file://arm-no-hwcap.patch;patch=1;pnum=0 \
- file://arm-memcpy.patch;patch=1;pnum=0 \
- file://arm-longlong.patch;patch=1;pnum=0 \
- file://arm-machine-gmon.patch;patch=1;pnum=0 \
- file://trampoline.patch;patch=1;pnum=0 \
- file://eabi-patch-1;patch=1 \
- file://eabi-patch-2;patch=1 \
- file://eabi-patch-3;patch=1 \
- file://5090_all_stubs-rule-fix.patch;patch=1 \
- file://etc/ld.so.conf \
- file://generate-supported.mk"
-
-# seems to fail on tls platforms
-SRC_URI_append_arm = " file://dyn-ldconfig-20041128.patch;patch=1"
-
-SRC_URI_append_openmn = " file://ldsocache-varrun.patch;patch=1"
-
-S = "${WORKDIR}/libc"
-B = "${WORKDIR}/build-${TARGET_SYS}"
-
-RDEPENDS_${PN}-dev = "linux-libc-headers-dev"
-RPROVIDES_${PN}-dev += "libc-dev virtual-libc-dev"
-
-EXTRA_OECONF = "--enable-kernel=${OLDEST_KERNEL} \
- --without-cvs --disable-profile --disable-debug --without-gd \
- --enable-clocale=gnu \
- --enable-add-ons=${GLIBC_ADDONS} \
- --with-headers=${STAGING_INCDIR} \
- --without-selinux \
- ${GLIBC_EXTRA_OECONF}"
-
-do_configure () {
-# override this function to avoid the autoconf/automake/aclocal/autoheader
-# calls for now
-# don't pass CPPFLAGS into configure, since it upsets the kernel-headers
-# version check and doesn't really help with anything
- if [ -z "`which rpcgen`" ]; then
- echo "rpcgen not found. Install glibc-devel."
- exit 1
- fi
- (cd ${S} && gnu-configize) || die "failure in running gnu-configize"
- CPPFLAGS="" oe_runconf
-}
-
-rpcsvc = "bootparam_prot.x nlm_prot.x rstat.x \
- yppasswd.x klm_prot.x rex.x sm_inter.x mount.x \
- rusers.x spray.x nfs_prot.x rquota.x key_prot.x"
-
-do_compile () {
- # this really is arm specific
- touch ${S}/sysdeps/arm/framestate.c
- # -Wl,-rpath-link <staging>/lib in LDFLAGS can cause breakage if another glibc is in staging
- unset LDFLAGS
- base_do_compile
- (
- cd ${S}/sunrpc/rpcsvc
- for r in ${rpcsvc}; do
- h=`echo $r|sed -e's,\.x$,.h,'`
- rpcgen -h $r -o $h || oewarn "unable to generate header for $r"
- done
- )
-}
-
-require glibc-stage.inc
-
-require glibc-package.inc
diff --git a/recipes/glibc/glibc_2.3.3.bb b/recipes/glibc/glibc_2.3.3.bb
index 3ca8b80ed9..6e0ed6bd68 100644
--- a/recipes/glibc/glibc_2.3.3.bb
+++ b/recipes/glibc/glibc_2.3.3.bb
@@ -49,10 +49,10 @@ SRC_URI = "ftp://ftp.gnu.org/gnu/glibc/glibc-${PV}.tar.gz;name=archive \
file://etc/ld.so.conf \
file://generate-supported.mk"
-SRC_URI_append_mtx-1 = " file://mips-abio32.patch;patch=1 \
- file://allow-gcc.patch;patch=1 "
-SRC_URI_append_mtx-2 = " file://mips-abio32.patch;patch=1 \
- file://allow-gcc.patch;patch=1 "
+SRC_URI_append_mtx-1 = " file://mips-abio32.patch \
+ file://allow-gcc.patch "
+SRC_URI_append_mtx-2 = " file://mips-abio32.patch \
+ file://allow-gcc.patch "
S = "${WORKDIR}/glibc-${PV}"
B = "${WORKDIR}/build-${TARGET_SYS}"
diff --git a/recipes/glibc/glibc_2.3.5+cvs20050627.bb b/recipes/glibc/glibc_2.3.5+cvs20050627.bb
index 02970c47d5..212445390f 100644
--- a/recipes/glibc/glibc_2.3.5+cvs20050627.bb
+++ b/recipes/glibc/glibc_2.3.5+cvs20050627.bb
@@ -30,39 +30,39 @@ python __anonymous () {
RDEPENDS_${PN}-dev = "linux-libc-headers-dev"
RPROVIDES_${PN}-dev += "libc-dev virtual-libc-dev"
-# file://noinfo.patch;patch=1
-# file://ldconfig.patch;patch=1;pnum=0
-# file://arm-machine-gmon.patch;patch=1;pnum=0 \
+# file://noinfo.patch
+# file://ldconfig.patch;striplevel=0
+# file://arm-machine-gmon.patch;striplevel=0 \
# \
-# file://arm-ioperm.patch;patch=1;pnum=0 \
-# file://ldd.patch;patch=1;pnum=0 \
+# file://arm-ioperm.patch;striplevel=0 \
+# file://ldd.patch;striplevel=0 \
SRC_URI = "http://familiar.handhelds.org/source/v0.8.3/stash_libc_sources.redhat.com__20050627.tar.gz;name=archive \
http://familiar.handhelds.org/source/v0.8.3/stash_ports_sources.redhat.com__20050627.tar.gz;name=ports \
- file://arm-audit.patch;patch=1 \
- file://arm-audit2.patch;patch=1 \
- file://arm-no-hwcap.patch;patch=1 \
- file://arm-memcpy.patch;patch=1 \
- file://arm-longlong.patch;patch=1;pnum=0 \
- file://fhs-linux-paths.patch;patch=1 \
- file://dl-cache-libcmp.patch;patch=1 \
- file://ldsocache-varrun.patch;patch=1 \
- file://5090_all_stubs-rule-fix.patch;patch=1 \
- file://raise.patch;patch=1 \
- file://zecke-sane-readelf.patch;patch=1 \
- file://glibc-2.3.5-fix-weak-alias-arm.patch;patch=1 \
- file://glibc-2.3.5-fix-weak-alias-arm-2.patch;patch=1 \
+ file://arm-audit.patch \
+ file://arm-audit2.patch \
+ file://arm-no-hwcap.patch \
+ file://arm-memcpy.patch \
+ file://arm-longlong.patch;striplevel=0 \
+ file://fhs-linux-paths.patch \
+ file://dl-cache-libcmp.patch \
+ file://ldsocache-varrun.patch \
+ file://5090_all_stubs-rule-fix.patch \
+ file://raise.patch \
+ file://zecke-sane-readelf.patch \
+ file://glibc-2.3.5-fix-weak-alias-arm.patch \
+ file://glibc-2.3.5-fix-weak-alias-arm-2.patch \
file://etc/ld.so.conf \
file://generate-supported.mk"
# seems to fail on tls platforms
-SRC_URI_append_arm = " file://dyn-ldconfig-20041128.patch;patch=1"
-SRC_URI_append_armeb = " file://dyn-ldconfig-20041128.patch;patch=1"
+SRC_URI_append_arm = " file://dyn-ldconfig-20041128.patch"
+SRC_URI_append_armeb = " file://dyn-ldconfig-20041128.patch"
# Build fails on sh3 and sh4 without additional patches
-SRC_URI_append_sh3 = " file://no-z-defs.patch;patch=1 \
- file://superh-fcntl.patch;patch=1;pnum=0"
-SRC_URI_append_sh4 = " file://no-z-defs.patch;patch=1 \
- file://superh-fcntl.patch;patch=1;pnum=0"
+SRC_URI_append_sh3 = " file://no-z-defs.patch \
+ file://superh-fcntl.patch;striplevel=0"
+SRC_URI_append_sh4 = " file://no-z-defs.patch \
+ file://superh-fcntl.patch;striplevel=0"
S = "${WORKDIR}/libc"
B = "${WORKDIR}/build-${TARGET_SYS}"
diff --git a/recipes/glibc/glibc_2.3.6.bb b/recipes/glibc/glibc_2.3.6.bb
deleted file mode 100644
index a78db96bc8..0000000000
--- a/recipes/glibc/glibc_2.3.6.bb
+++ /dev/null
@@ -1,118 +0,0 @@
-require glibc.inc
-
-PR = "${INC_PR}.0"
-
-GLIBC_ADDONS ?= "linuxthreads"
-
-# ${CROSSTOOL_PATCH_URL}glibc-2.3.5-cygwin.patch;patch=1
-
-CROSSTOOL_PATCH_URL = "http://www.kegel.com/crosstool/crosstool-0.43/patches/glibc-2.3.6/"
-SRC_URI = "ftp://ftp.gnu.org/pub/gnu/glibc/glibc-${PV}.tar.bz2;name=archive \
- ftp://ftp.gnu.org/pub/gnu/glibc/glibc-linuxthreads-${PV}.tar.bz2;name=linuxthreads \
- ${CROSSTOOL_PATCH_URL}glibc-2.3.5-sh-lowlevellock.patch;patch=1;name=crosspatch1 \
- ${CROSSTOOL_PATCH_URL}glibc-2.3.5-sh-memset.patch;patch=1;name=crosspatch2 \
- ${CROSSTOOL_PATCH_URL}glibc-2.3.6-allow-gcc-4.0-arm.patch;patch=1;name=crosspatch3 \
- ${CROSSTOOL_PATCH_URL}glibc-2.3.6-allow-gcc-4.0-elf.patch;patch=1;name=crosspatch4 \
- ${CROSSTOOL_PATCH_URL}glibc-2.3.6-configure-apple-as.patch;patch=1;name=crosspatch5 \
- ${CROSSTOOL_PATCH_URL}glibc-2.3.6-fix-pr631.patch;patch=1;name=crosspatch6 \
- ${CROSSTOOL_PATCH_URL}glibc-fp-byteorder.patch;patch=1;name=crosspatch7 \
- ${CROSSTOOL_PATCH_URL}glibc-mips-bootstrap-gcc-header-install.patch;patch=1;name=crosspatch8 \
- ${CROSSTOOL_PATCH_URL}arm-ctl_bus_isa.patch;patch=1;name=crosspatch9 \
- ${CROSSTOOL_PATCH_URL}make-install-lib-all.patch;patch=1;name=crosspatch10 \
- ${CROSSTOOL_PATCH_URL}maybe/glibc-2.3.6-allow-gcc-4.0-powerpc32.patch;patch=1;name=crosspatch11 \
- file://glibc-2.3.6-bind-already-defined-on-powerpc.patch;patch=1 \
- file://glibc-2.3.6-allow-gcc-4.1-powerpc32-initfini.s.patch;patch=1 \
- file://glibc-2.3.6-linuxthreads-allow-gcc-4.1-powerpc32-initfini.s.patch;patch=1 \
- file://late-install-loop-break.patch;patch=1 \
- file://glibc-arm-socket-weakalias.patch;patch=1 \
- file://glibc-2.3.6-linuxthreads-pthread-raise.patch;patch=1 \
- file://glibc-cross_sunrpc.patch;patch=1 \
- file://etc/ld.so.conf \
- file://generate-supported.mk"
-
-S = "${WORKDIR}/glibc-${PV}"
-B = "${WORKDIR}/build-${TARGET_SYS}"
-
-RDEPENDS_${PN}-dev = "linux-libc-headers-dev"
-RPROVIDES_${PN}-dev += "libc-dev virtual-libc-dev"
-
-EXTRA_OECONF = "--enable-kernel=${OLDEST_KERNEL} \
- --without-cvs --disable-profile --disable-debug --without-gd \
- --enable-clocale=gnu \
- --enable-add-ons=${GLIBC_ADDONS} \
- --with-headers=${STAGING_INCDIR} \
- ${GLIBC_EXTRA_OECONF}"
-
-EXTRA_OECONF += "${@get_glibc_fpu_setting(bb, d)}"
-
-glibc_do_unpack () {
- mv "${WORKDIR}/linuxthreads" "${WORKDIR}/linuxthreads_db" "${S}/"
-}
-
-python do_unpack () {
- bb.build.exec_func('base_do_unpack', d)
- bb.build.exec_func('glibc_do_unpack', d)
-}
-
-do_configure () {
-# override this function to avoid the autoconf/automake/aclocal/autoheader
-# calls for now
-# don't pass CPPFLAGS into configure, since it upsets the kernel-headers
-# version check and doesn't really help with anything
- if [ -z "`which rpcgen`" ]; then
- echo "rpcgen not found. Install glibc-devel."
- exit 1
- fi
- (cd ${S} && gnu-configize) || die "failure in running gnu-configize"
- CPPFLAGS="" libc_cv_forced_unwind=yes libc_cv_c_cleanup=yes oe_runconf
-}
-
-rpcsvc = "bootparam_prot.x nlm_prot.x rstat.x \
- yppasswd.x klm_prot.x rex.x sm_inter.x mount.x \
- rusers.x spray.x nfs_prot.x rquota.x key_prot.x"
-
-do_compile () {
- # this really is arm specific
- touch ${S}/sysdeps/arm/framestate.c
- # -Wl,-rpath-link <staging>/lib in LDFLAGS can cause breakage if another glibc is in staging
- unset LDFLAGS
- base_do_compile
- (
- cd ${S}/sunrpc/rpcsvc
- for r in ${rpcsvc}; do
- h=`echo $r|sed -e's,\.x$,.h,'`
- rpcgen -h $r -o $h || oewarn "unable to generate header for $r"
- done
- )
-}
-
-require glibc-stage.inc
-
-require glibc-package.inc
-
-SRC_URI[archive.md5sum] = "bfdce99f82d6dbcb64b7f11c05d6bc96"
-SRC_URI[archive.sha256sum] = "e73ff5eddea95d09238b41d3c9c4d9ccddcf99fcc93d04956599c91c704f4a8e"
-SRC_URI[linuxthreads.md5sum] = "d4eeda37472666a15cc1f407e9c987a9"
-SRC_URI[linuxthreads.sha256sum] = "6c3bc4a247d1e5308fb14f81956802f09095d3683219859fcad5795aa3aea638"
-SRC_URI[crosspatch1.md5sum] = "bb8da838930b8c6d06bafdbaad5dab1a"
-SRC_URI[crosspatch1.sha256sum] = "43cb2a382f30d189f0cacb71cbfa0b153a45a49e5fd73330893d24731fca4eb6"
-SRC_URI[crosspatch2.md5sum] = "1acb1e6c444ad45bb1390e7800dc4d7c"
-SRC_URI[crosspatch2.sha256sum] = "b301918536819d00b824e134fbdeba3cf4048da060e70e75c8ea56fd92689ad9"
-SRC_URI[crosspatch3.md5sum] = "709cb2283068145e557912b0907341a3"
-SRC_URI[crosspatch3.sha256sum] = "9dba644da5db0ec5104698706854dcd4ae8d6a10e9419eb049e3d6fcad9d81fe"
-SRC_URI[crosspatch4.md5sum] = "79ddbf5e5721442c5753344e4ecdda1c"
-SRC_URI[crosspatch4.sha256sum] = "c1ab6923fa4388407cd1dcb2ed441f25c2b9fa18cacf6aad549c31fed3c08f8c"
-SRC_URI[crosspatch5.md5sum] = "c4d41a712bf40dfb852e7bc18e1b6c52"
-SRC_URI[crosspatch5.sha256sum] = "81611592bf30b4c1fa0c58d170d74c970dbc145127e16cb90d648663e2970cbf"
-SRC_URI[crosspatch6.md5sum] = "336ce18c81fe8d7c17d2f7a0dbd62766"
-SRC_URI[crosspatch6.sha256sum] = "9487f1d4c05b9c94d94f8bcb34541ef04b77cfc0526dbb0b344c67f2ab388c5b"
-SRC_URI[crosspatch7.md5sum] = "c89aac92d100761a767b9d5619fe582f"
-SRC_URI[crosspatch7.sha256sum] = "3033d84fd9a62d20a8cb0d42645d7cd5a28d2d108afcb4cc2d89db3dc1e328df"
-SRC_URI[crosspatch8.md5sum] = "dc31c9e01df62cba9457af7e9b9c968e"
-SRC_URI[crosspatch8.sha256sum] = "a69760ed0ea54b66c31d58cb32c7b23185a6b1d16f38dab8380ec4f2183b122d"
-SRC_URI[crosspatch9.md5sum] = "88fa901c9a85633ab62365b0ee9df3b1"
-SRC_URI[crosspatch9.sha256sum] = "6651eb15c9f6dabf21af4067b723cb29a87827f66570bfab74fdc00d80cab129"
-SRC_URI[crosspatch10.md5sum] = "b94605c3b7ba90bc01648ca6e5cc1aaf"
-SRC_URI[crosspatch10.sha256sum] = "16ff3ea972065925338da1a1f37322dc4d8774f6d34d2dde2ce85121c08c99e0"
-SRC_URI[crosspatch11.md5sum] = "b89be3e1653ec6df317e30a10a0933b5"
-SRC_URI[crosspatch11.sha256sum] = "0b5dd58a5240440ab6dcc0e2278bb99ebb20d0b558578652da59007bf27ae2fe"
diff --git a/recipes/glibc/glibc_2.4.bb b/recipes/glibc/glibc_2.4.bb
deleted file mode 100644
index 2f255a65fe..0000000000
--- a/recipes/glibc/glibc_2.4.bb
+++ /dev/null
@@ -1,156 +0,0 @@
-require glibc.inc
-
-PR = "${INC_PR}.0"
-
-#add the hosts that are confirmed to be working to COMPATIBLE_HOSTi
-COMPATIBLE_HOST = '(i.86.*-linux|sh.*-linux)'
-DEFAULT_PREFERENCE_arm = "-1"
-
-# the -isystem in bitbake.conf screws up glibc do_stage
-BUILD_CPPFLAGS = "-I${STAGING_INCDIR_NATIVE}"
-TARGET_CPPFLAGS = "-I${STAGING_DIR_TARGET}${layout_includedir}"
-
-
-FILESDIR = "${@os.path.dirname(bb.data.getVar('FILE',d,1))}/glibc-2.4"
-
-GLIBC_ADDONS ?= "ports,nptl,libidn"
-
-GLIBC_BROKEN_LOCALES = "sid_ET tr_TR mn_MN gez_ET gez_ER bn_BD te_IN"
-
-#
-# For now, we will skip building of a gcc package if it is a uclibc one
-# and our build is not a uclibc one, and we skip a glibc one if our build
-# is a uclibc build.
-#
-# See the note in gcc/gcc_3.4.0.oe
-#
-
-python __anonymous () {
- import bb, re
- uc_os = (re.match('.*uclibc$', bb.data.getVar('TARGET_OS', d, 1)) != None)
- if uc_os:
- raise bb.parse.SkipPackage("incompatible with target %s" %
- bb.data.getVar('TARGET_OS', d, 1))
-}
-
-RDEPENDS_${PN}-dev = "linux-libc-headers-dev"
-RPROVIDES_${PN}-dev += "libc-dev virtual-libc-dev"
-
-# file://noinfo.patch;patch=1
-# file://ldconfig.patch;patch=1;pnum=0
-# file://arm-machine-gmon.patch;patch=1;pnum=0 \
-# \
-# file://arm-ioperm.patch;patch=1;pnum=0 \
-# file://ldd.patch;patch=1;pnum=0 \
-SRC_URI = "ftp://ftp.gnu.org/pub/gnu/glibc/glibc-2.4.tar.bz2;name=archive \
- ftp://ftp.gnu.org/pub/gnu/glibc/glibc-ports-2.4.tar.bz2;name=ports \
- ftp://ftp.gnu.org/pub/gnu/glibc/glibc-libidn-2.4.tar.bz2;name=libidn \
- file://arm-memcpy.patch;patch=1 \
- file://arm-longlong.patch;patch=1 \
- file://fhs-linux-paths.patch;patch=1 \
- file://dl-cache-libcmp.patch;patch=1 \
- file://ldsocache-varrun.patch;patch=1 \
- file://nptl-crosscompile.patch;patch=1 \
- file://glibc-2.4-compile.patch;patch=1 \
- file://glibc-2.4-openat-3.patch;patch=1 \
- file://fixup-aeabi-syscalls.patch;patch=1 \
- file://zecke-sane-readelf.patch;patch=1 \
- file://arm_eabi_ipc_fix.patch;patch=1 \
- file://generic-bits_select.h \
- file://generic-bits_types.h \
- file://generic-bits_typesizes.h \
- file://generic-bits_time.h \
- file://etc/ld.so.conf \
- file://generate-supported.mk"
-
-
-# Build fails on sh3 and sh4 without additional patches
-SRC_URI_append_sh3 = " file://no-z-defs.patch;patch=1"
-SRC_URI_append_sh4 = " file://no-z-defs.patch;patch=1"
-
-S = "${WORKDIR}/glibc-2.4"
-B = "${WORKDIR}/build-${TARGET_SYS}"
-
-EXTRA_OECONF = "--enable-kernel=${OLDEST_KERNEL} \
- --without-cvs --disable-profile --disable-debug --without-gd \
- --enable-clocale=gnu \
- --enable-add-ons=${GLIBC_ADDONS} \
- --with-headers=${STAGING_INCDIR} \
- --without-selinux \
- ${GLIBC_EXTRA_OECONF}"
-
-EXTRA_OECONF += "${@get_glibc_fpu_setting(bb, d)}"
-
-do_munge() {
- # Integrate ports and libidn into tree
- mv ${WORKDIR}/glibc-ports-${PV} ${S}/ports
- mv ${WORKDIR}/glibc-libidn-${PV} ${S}/libidn
-
- # Ports isn't really working... Fix it
- # Some of this is rather dirty, but it seems to be the only
- # quick way to get this cruft to compile
- rm -rf ${S}/ports/sysdeps/unix/sysv/linux/arm/linuxthreads
- ln -s nptl ${S}/ports/sysdeps/unix/sysv/linux/arm/linuxthreads
- cp ${S}/sysdeps/unix/sysv/linux/i386/bits/wchar.h ${S}/ports/sysdeps/unix/sysv/linux/arm/bits/
- cp ${S}/sysdeps/wordsize-32/bits/wordsize.h ${S}/ports/sysdeps/unix/sysv/linux/arm/bits/
- cp ${WORKDIR}/generic-bits_select.h ${S}/ports/sysdeps/unix/sysv/linux/arm/bits/select.h
- cp ${WORKDIR}/generic-bits_types.h ${S}/ports/sysdeps/unix/sysv/linux/arm/bits/types.h
- cp ${WORKDIR}/generic-bits_typesizes.h ${S}/ports/sysdeps/unix/sysv/linux/arm/bits/typesizes.h
- cp ${WORKDIR}/generic-bits_time.h ${S}/ports/sysdeps/unix/sysv/linux/arm/bits/time.h
- # Copy in generic stuff for not yet implemented headers
- for i in ${S}/bits/*.h; do
- F=`basename $i`
- [ "$F" = "local_lim.h" ] && continue
- [ "$F" = "errno.h" ] && continue
- test -e ${S}/ports/sysdeps/unix/sysv/linux/arm/bits/$F || test -e ${S}/ports/sysdeps/arm/bits/$F || test -e ${S}/sysdeps/unix/sysv/linux/bits/$F || test -e ${S}/sysdeps/ieee754/bits/$F || cp $i ${S}/ports/sysdeps/unix/sysv/linux/arm/bits/
- done
- # This is harmful; we need to get the one from nptl/sysdeps/pthreads
- rm -f ${S}/ports/sysdeps/unix/sysv/linux/arm/bits/libc-lock.h
- # Obsoleted by sysdeps/arm/{fpu,eabi}/bits/fenv.h
- rm -f ${S}/ports/sysdeps/unix/sysv/linux/arm/bits/fenv.h
- # Obsoleted by sysdeps/gnu/bits/utmp.h
- rm -f ${S}/ports/sysdeps/unix/sysv/linux/arm/bits/utmp.h
-}
-
-addtask munge before do_patch after do_unpack
-
-do_configure () {
-# override this function to avoid the autoconf/automake/aclocal/autoheader
-# calls for now
-# don't pass CPPFLAGS into configure, since it upsets the kernel-headers
-# version check and doesn't really help with anything
- if [ -z "`which rpcgen`" ]; then
- echo "rpcgen not found. Install glibc-devel."
- exit 1
- fi
- (cd ${S} && gnu-configize) || die "failure in running gnu-configize"
- CPPFLAGS="" oe_runconf
-}
-
-rpcsvc = "bootparam_prot.x nlm_prot.x rstat.x \
- yppasswd.x klm_prot.x rex.x sm_inter.x mount.x \
- rusers.x spray.x nfs_prot.x rquota.x key_prot.x"
-
-do_compile () {
- # -Wl,-rpath-link <staging>/lib in LDFLAGS can cause breakage if another glibc is in staging
- unset LDFLAGS
- base_do_compile
- (
- cd ${S}/sunrpc/rpcsvc
- for r in ${rpcsvc}; do
- h=`echo $r|sed -e's,\.x$,.h,'`
- rpcgen -h $r -o $h || oewarn "unable to generate header for $r"
- done
- )
-}
-
-require glibc-stage.inc
-
-require glibc-package.inc
-
-SRC_URI[archive.md5sum] = "7e9a88dcd41fbc53801dbe5bdacaf245"
-SRC_URI[archive.sha256sum] = "27aaaaa78b4ab5da76bb29385dc9be087ba7b855a9102eaaa78ce3ec5e2e7fcd"
-SRC_URI[ports.md5sum] = "7bb1b35654e94994925e66676acabd4e"
-SRC_URI[ports.sha256sum] = "2fbbcaad8a9f8560485c398a9066959fe2713c8bc7e653ec476fb56fed21d19a"
-SRC_URI[libidn.md5sum] = "e2d892b40d654c523ab26a26b7dd86a1"
-SRC_URI[libidn.sha256sum] = "2f29ec2b2b2f75f787a1eed8fdea20aff212dc3bad97651ca376914c49181977"
diff --git a/recipes/glibc/glibc_2.5.bb b/recipes/glibc/glibc_2.5.bb
index 21a2ae748e..cb3b5474fe 100644
--- a/recipes/glibc/glibc_2.5.bb
+++ b/recipes/glibc/glibc_2.5.bb
@@ -1,5 +1,7 @@
require glibc.inc
-PR = "${INC_PR}.1"
+PR = "${INC_PR}.2"
+
+COMPATIBLE_TARGET_SYS = "."
ARM_INSTRUCTION_SET = "arm"
@@ -10,8 +12,6 @@ RPROVIDES_${PN}-dev = "libc6-dev virtual-libc-dev"
BUILD_CPPFLAGS = "-I${STAGING_INCDIR_NATIVE}"
TARGET_CPPFLAGS = "-I${STAGING_DIR_TARGET}${layout_includedir}"
-FILESDIR = "${@os.path.dirname(bb.data.getVar('FILE',d,1))}/glibc-2.4"
-
GLIBC_ADDONS ?= "ports,nptl,libidn"
GLIBC_BROKEN_LOCALES = "sid_ET tr_TR mn_MN gez_ET gez_ER bn_BD te_IN"
@@ -38,18 +38,18 @@ SRC_URI = "\
ftp://ftp.gnu.org/pub/gnu/glibc/glibc-${PV}.tar.bz2;name=archive \
ftp://ftp.gnu.org/pub/gnu/glibc/glibc-ports-${PV}.tar.bz2;name=ports \
ftp://ftp.gnu.org/pub/gnu/glibc/glibc-libidn-${PV}.tar.bz2;name=libidn \
- file://arm-memcpy.patch;patch=1 \
- file://arm-longlong.patch;patch=1 \
- file://fhs-linux-paths.patch;patch=1 \
- file://dl-cache-libcmp.patch;patch=1 \
- file://ldsocache-varrun.patch;patch=1 \
- file://nptl-crosscompile.patch;patch=1 \
- file://glibc-2.5-local-dynamic-resolvconf.patch;patch=1;pnum=0 \
- file://glibc-check_pf.patch;patch=1;pnum=0 \
- file://zecke-sane-readelf.patch;patch=1 \
- file://ldd-unbash.patch;patch=1 \
- file://glibc-2.6.1-use-short-for-fnstsw.patch;patch=1 \
- file://glibc-arm-no-asm-page.patch;patch=1 \
+ file://arm-memcpy.patch \
+ file://arm-longlong.patch \
+ file://fhs-linux-paths.patch \
+ file://dl-cache-libcmp.patch \
+ file://ldsocache-varrun.patch \
+ file://nptl-crosscompile.patch \
+ file://glibc-2.5-local-dynamic-resolvconf.patch;striplevel=0 \
+ file://glibc-check_pf.patch;striplevel=0 \
+ file://zecke-sane-readelf.patch \
+ file://ldd-unbash.patch \
+ file://glibc-2.6.1-use-short-for-fnstsw.patch \
+ file://glibc-arm-no-asm-page.patch \
file://generic-bits_select.h \
file://generic-bits_types.h \
file://generic-bits_typesizes.h \
@@ -59,16 +59,23 @@ SRC_URI = "\
"
# Build fails on sh3 and sh4 without additional patches
-SRC_URI_append_sh3 = " file://no-z-defs.patch;patch=1"
-SRC_URI_append_sh4 = " file://no-z-defs.patch;patch=1"
+SRC_URI_append_sh3 = " file://no-z-defs.patch"
+SRC_URI_append_sh4 = " file://no-z-defs.patch"
# Powerpc patches to add support for soft-float
-SRC_URI_append_powerpc = " file://ppc-sfp-machine.patch;patch=1 \
- file://ppc-soft-fp-20070115.patch;patch=1 \
- file://ppc-ld-nofpu-20070104.patch;patch=1 \
- file://ppc-ports-ld-nofpu-20070114.patch;patch=1 \
- file://powerpc-sqrt-hack.diff;patch=1 \
- file://glibc-2.5-soft-fp-separate-strong-alias.patch;patch=1"
+SRC_URI_append_powerpc = " file://ppc-sfp-machine.patch \
+ file://ppc-soft-fp-20070115.patch \
+ file://ppc-ld-nofpu-20070104.patch \
+ file://ppc-ports-ld-nofpu-20070114.patch \
+ file://powerpc-sqrt-hack.diff \
+ file://glibc-2.5-soft-fp-separate-strong-alias.patch"
+
+SRC_URI_append_nios2 = " \
+ file://sysdeps-nios2.patch \
+ file://nios2-elf.patch \
+ file://nios2-iconv.patch \
+ file://nios2-ld-collate.patch \
+"
S = "${WORKDIR}/glibc-${PV}"
B = "${WORKDIR}/build-${TARGET_SYS}"
diff --git a/recipes/glibc/glibc_2.6.1.bb b/recipes/glibc/glibc_2.6.1.bb
index 86e6dca9b6..8acfeffad9 100644
--- a/recipes/glibc/glibc_2.6.1.bb
+++ b/recipes/glibc/glibc_2.6.1.bb
@@ -37,46 +37,46 @@ SRC_URI = "\
ftp://ftp.gnu.org/pub/gnu/glibc/glibc-${PV}.tar.bz2;name=archive \
ftp://ftp.gnu.org/pub/gnu/glibc/glibc-ports-${PV}.tar.bz2;name=ports \
ftp://ftp.gnu.org/pub/gnu/glibc/glibc-libidn-${PV}.tar.bz2;name=libidn \
- file://arm-memcpy.patch;patch=1 \
- file://arm-longlong.patch;patch=1 \
- file://fhs-linux-paths.patch;patch=1 \
- file://dl-cache-libcmp.patch;patch=1 \
- file://nptl-crosscompile.patch;patch=1 \
- file://glibc-2.5-local-dynamic-resolvconf.patch;patch=1;pnum=0 \
- file://glibc-check_pf.patch;patch=1;pnum=0 \
- file://zecke-sane-readelf.patch;patch=1 \
- file://ldd-unbash.patch;patch=1 \
+ file://arm-memcpy.patch \
+ file://arm-longlong.patch \
+ file://fhs-linux-paths.patch \
+ file://dl-cache-libcmp.patch \
+ file://nptl-crosscompile.patch \
+ file://glibc-2.5-local-dynamic-resolvconf.patch;striplevel=0 \
+ file://glibc-check_pf.patch;striplevel=0 \
+ file://zecke-sane-readelf.patch \
+ file://ldd-unbash.patch \
file://generic-bits_select.h \
file://generic-bits_types.h \
file://generic-bits_typesizes.h \
file://generic-bits_time.h \
file://etc/ld.so.conf \
file://generate-supported.mk \
- file://glibc-2.6.1-RTLD_SINGLE_THREAD_P-1.patch;patch=1 \
- file://glibc-2.6.1-use-short-for-fnstsw.patch;patch=1 \
- file://glibc-use-isystem-include-fixed.patch;patch=1 \
- file://glibc-arm-no-asm-page.patch;patch=1 \
- file://armv4t-interworking.patch;patch=1 \
- file://march-i686.patch;patch=1;pnum=0 \
+ file://glibc-2.6.1-RTLD_SINGLE_THREAD_P-1.patch \
+ file://glibc-2.6.1-use-short-for-fnstsw.patch \
+ file://glibc-use-isystem-include-fixed.patch \
+ file://glibc-arm-no-asm-page.patch \
+ file://armv4t-interworking.patch \
+ file://march-i686.patch;striplevel=0 \
"
SRC_URI_append_ep9312 = "\
- file://glibc-crunch-endian-littleword-littlebyte.patch;patch=1 \
- file://glibc-crunch-eabi-setjmp_longjmp.patch;patch=1 \
- file://glibc-crunch-eabi-unwind.patch;patch=1 \
- file://glibc-crunch-eabi.patch;patch=1 \
- file://glibc-crunch-eabi-force.patch;patch=1 \
- file://glibc-crunch-eabi-fraiseexcpt.patch;patch=1 \
+ file://glibc-crunch-endian-littleword-littlebyte.patch \
+ file://glibc-crunch-eabi-setjmp_longjmp.patch \
+ file://glibc-crunch-eabi-unwind.patch \
+ file://glibc-crunch-eabi.patch \
+ file://glibc-crunch-eabi-force.patch \
+ file://glibc-crunch-eabi-fraiseexcpt.patch \
"
# Build fails on sh3 and sh4 without additional patches
-SRC_URI_append_sh3 = " file://no-z-defs.patch;patch=1"
-SRC_URI_append_sh4 = " file://no-z-defs.patch;patch=1"
+SRC_URI_append_sh3 = " file://no-z-defs.patch"
+SRC_URI_append_sh4 = " file://no-z-defs.patch"
# PowerPC Patches to add support for soft-float
SRC_URI_append_powerpc = "\
- file://powerpc-sqrt-hack.diff;patch=1 \
- file://glibc-2.6.1-powerpc-nofpu.patch;patch=1 \
+ file://powerpc-sqrt-hack.diff \
+ file://glibc-2.6.1-powerpc-nofpu.patch \
"
S = "${WORKDIR}/glibc-${PV}"
diff --git a/recipes/glibc/glibc_2.7.bb b/recipes/glibc/glibc_2.7.bb
deleted file mode 100644
index 56275f8b12..0000000000
--- a/recipes/glibc/glibc_2.7.bb
+++ /dev/null
@@ -1,169 +0,0 @@
-require glibc.inc
-
-ARM_INSTRUCTION_SET = "arm"
-
-PACKAGES_DYNAMIC = "libc6*"
-RPROVIDES_${PN}-dev = "libc6-dev virtual-libc-dev"
-
-PR = "${INC_PR}.1"
-
-# the -isystem in bitbake.conf screws up glibc do_stage
-BUILD_CPPFLAGS = "-I${STAGING_INCDIR_NATIVE}"
-TARGET_CPPFLAGS = "-I${STAGING_DIR_TARGET}${layout_includedir}"
-
-
-FILESPATHPKG =. "glibc-2.4:"
-
-GLIBC_ADDONS ?= "ports,nptl,libidn"
-
-GLIBC_BROKEN_LOCALES = " _ER _ET so_ET yn_ER sid_ET tr_TR mn_MN gez_ET gez_ER bn_BD te_IN"
-
-#
-# For now, we will skip building of a gcc package if it is a uclibc one
-# and our build is not a uclibc one, and we skip a glibc one if our build
-# is a uclibc build.
-#
-# See the note in gcc/gcc_3.4.0.oe
-#
-
-python __anonymous () {
- import bb, re
- uc_os = (re.match('.*uclibc$', bb.data.getVar('TARGET_OS', d, 1)) != None)
- if uc_os:
- raise bb.parse.SkipPackage("incompatible with target %s" %
- bb.data.getVar('TARGET_OS', d, 1))
-}
-
-RDEPENDS_${PN}-dev = "linux-libc-headers-dev"
-
-# file://noinfo.patch;patch=1
-# file://ldconfig.patch;patch=1;pnum=0
-# file://arm-machine-gmon.patch;patch=1;pnum=0 \
-# \
-# file://arm-ioperm.patch;patch=1;pnum=0 \
-# file://ldd.patch;patch=1;pnum=0 \
-SRC_URI = "ftp://ftp.gnu.org/pub/gnu/glibc/glibc-${PV}.tar.bz2;name=archive \
- ftp://ftp.gnu.org/pub/gnu/glibc/glibc-ports-${PV}.tar.bz2;name=ports \
- ftp://ftp.gnu.org/pub/gnu/glibc/glibc-libidn-${PV}.tar.bz2;name=libidn \
- file://arm-memcpy.patch;patch=1 \
- file://arm-longlong.patch;patch=1 \
- file://fhs-linux-paths.patch;patch=1 \
- file://dl-cache-libcmp.patch;patch=1 \
- file://ldsocache-varrun.patch;patch=1 \
- file://nptl-crosscompile.patch;patch=1 \
- file://glibc-check_pf.patch;patch=1;pnum=0 \
-# file://glibc-2.4-compile.patch;patch=1 \
-# file://glibc-2.4-openat-3.patch;patch=1 \
-# file://fixup-aeabi-syscalls.patch;patch=1 \
-# file://zecke-sane-readelf.patch;patch=1 \
- file://ldd-unbash.patch;patch=1 \
- file://glibc-arm-IO-acquire-lock-fix.diff;patch=1 \
- file://all_glibc-i586-chk.patch;patch=1 \
- file://glibc-2.6.1-use-short-for-fnstsw.patch;patch=1 \
- file://glibc-use-isystem-include-fixed.patch;patch=1 \
- file://generic-bits_select.h \
- file://generic-bits_types.h \
- file://generic-bits_typesizes.h \
- file://generic-bits_time.h \
- file://etc/ld.so.conf \
- file://generate-supported.mk \
- file://march-i686.patch;patch=1;pnum=0 \
- file://glibc-arm-no-asm-page.patch;patch=1 \
- "
-
-
-# Build fails on sh3 and sh4 without additional patches
-SRC_URI_append_sh3 = " file://no-z-defs.patch;patch=1"
-SRC_URI_append_sh4 = " file://no-z-defs.patch;patch=1"
-
-#powerpc patches to add support for soft-float
-SRC_URI_append_powerpc= " file://powerpc-sqrt-hack.diff;patch=1"
-
-S = "${WORKDIR}/glibc-${PV}"
-B = "${WORKDIR}/build-${TARGET_SYS}"
-
-EXTRA_OECONF = "--enable-kernel=${OLDEST_KERNEL} \
- --without-cvs --disable-profile --disable-debug --without-gd \
- --enable-clocale=gnu \
- --enable-add-ons=${GLIBC_ADDONS} \
- --with-headers=${STAGING_INCDIR} \
- --without-selinux \
- ${GLIBC_EXTRA_OECONF}"
-
-EXTRA_OECONF += "${@get_glibc_fpu_setting(bb, d)}"
-
-do_munge() {
- # Integrate ports and libidn into tree
- mv ${WORKDIR}/glibc-ports-${PV} ${S}/ports
- mv ${WORKDIR}/glibc-libidn-${PV} ${S}/libidn
-
- # Ports isn't really working... Fix it
- # Some of this is rather dirty, but it seems to be the only
- # quick way to get this cruft to compile
- rm -rf ${S}/ports/sysdeps/unix/sysv/linux/arm/linuxthreads
- ln -s nptl ${S}/ports/sysdeps/unix/sysv/linux/arm/linuxthreads
- cp ${S}/nptl/sysdeps/pthread/bits/sigthread.h ${S}/ports/sysdeps/unix/sysv/linux/arm/bits/
- cp ${S}/sysdeps/unix/sysv/linux/i386/bits/wchar.h ${S}/ports/sysdeps/unix/sysv/linux/arm/bits/
- cp ${S}/sysdeps/wordsize-32/bits/wordsize.h ${S}/ports/sysdeps/unix/sysv/linux/arm/bits/
- cp ${WORKDIR}/generic-bits_select.h ${S}/ports/sysdeps/unix/sysv/linux/arm/bits/select.h
- cp ${WORKDIR}/generic-bits_types.h ${S}/ports/sysdeps/unix/sysv/linux/arm/bits/types.h
- cp ${WORKDIR}/generic-bits_typesizes.h ${S}/ports/sysdeps/unix/sysv/linux/arm/bits/typesizes.h
- cp ${WORKDIR}/generic-bits_time.h ${S}/ports/sysdeps/unix/sysv/linux/arm/bits/time.h
- # Copy in generic stuff for not yet implemented headers
- for i in ${S}/bits/*.h; do
- F=`basename $i`
- [ "$F" = "local_lim.h" ] && continue
- [ "$F" = "errno.h" ] && continue
- test -e ${S}/ports/sysdeps/unix/sysv/linux/arm/bits/$F || test -e ${S}/ports/sysdeps/arm/bits/$F || test -e ${S}/sysdeps/unix/sysv/linux/bits/$F || test -e ${S}/sysdeps/ieee754/bits/$F || cp $i ${S}/ports/sysdeps/unix/sysv/linux/arm/bits/
- done
- # This is harmful; we need to get the one from nptl/sysdeps/pthreads
- rm -f ${S}/ports/sysdeps/unix/sysv/linux/arm/bits/libc-lock.h
- # Obsoleted by sysdeps/arm/{fpu,eabi}/bits/fenv.h
- rm -f ${S}/ports/sysdeps/unix/sysv/linux/arm/bits/fenv.h
- # Obsoleted by sysdeps/gnu/bits/utmp.h
- rm -f ${S}/ports/sysdeps/unix/sysv/linux/arm/bits/utmp.h
-}
-
-addtask munge before do_patch after do_unpack
-
-
-do_configure () {
-# override this function to avoid the autoconf/automake/aclocal/autoheader
-# calls for now
-# don't pass CPPFLAGS into configure, since it upsets the kernel-headers
-# version check and doesn't really help with anything
- if [ -z "`which rpcgen`" ]; then
- echo "rpcgen not found. Install glibc-devel."
- exit 1
- fi
- (cd ${S} && gnu-configize) || die "failure in running gnu-configize"
- CPPFLAGS="" oe_runconf
-}
-
-rpcsvc = "bootparam_prot.x nlm_prot.x rstat.x \
- yppasswd.x klm_prot.x rex.x sm_inter.x mount.x \
- rusers.x spray.x nfs_prot.x rquota.x key_prot.x"
-
-do_compile () {
- # -Wl,-rpath-link <staging>/lib in LDFLAGS can cause breakage if another glibc is in staging
- unset LDFLAGS
- base_do_compile
- (
- cd ${S}/sunrpc/rpcsvc
- for r in ${rpcsvc}; do
- h=`echo $r|sed -e's,\.x$,.h,'`
- rpcgen -h $r -o $h || oewarn "unable to generate header for $r"
- done
- )
-}
-
-require glibc-stage.inc
-
-require glibc-package.inc
-
-SRC_URI[archive.md5sum] = "065c5952b439deba40083ccd67bcc8f7"
-SRC_URI[archive.sha256sum] = "4224a522ac4ee0fd89eb337e7505e280dfb05e2fe1ad44339ba8874081c0451a"
-SRC_URI[ports.md5sum] = "eaeb8527b8fa286c2d887157214f9998"
-SRC_URI[ports.sha256sum] = "3e481996259af87c3581da23481970a27de679e3c87cfa9a5a59751cd20c7b44"
-SRC_URI[libidn.md5sum] = "226809992fb1f3dc6ea23e0f26952ea4"
-SRC_URI[libidn.sha256sum] = "07de78810a5320d696792b67131c4cf3d6654aee015a6b74820d66fb00799000"
diff --git a/recipes/glibc/glibc_2.9.bb b/recipes/glibc/glibc_2.9.bb
index 43a4fcafaa..33326f3781 100644
--- a/recipes/glibc/glibc_2.9.bb
+++ b/recipes/glibc/glibc_2.9.bb
@@ -11,9 +11,6 @@ PR = "${INC_PR}.3"
BUILD_CPPFLAGS = "-I${STAGING_INCDIR_NATIVE}"
TARGET_CPPFLAGS = "-I${STAGING_DIR_TARGET}${layout_includedir}"
-
-FILESPATHPKG =. "glibc-2.4:"
-
GLIBC_ADDONS ?= "ports,nptl,libidn"
GLIBC_BROKEN_LOCALES = " _ER _ET so_ET yn_ER sid_ET tr_TR mn_MN gez_ET gez_ER bn_BD te_IN"
@@ -36,52 +33,52 @@ python __anonymous () {
RDEPENDS_${PN}-dev = "linux-libc-headers-dev"
-# file://noinfo.patch;patch=1
-# file://ldconfig.patch;patch=1;pnum=0
-# file://arm-machine-gmon.patch;patch=1;pnum=0 \
+# file://noinfo.patch
+# file://ldconfig.patch;striplevel=0
+# file://arm-machine-gmon.patch;striplevel=0 \
# \
-# file://arm-ioperm.patch;patch=1;pnum=0 \
-# file://ldd.patch;patch=1;pnum=0 \
+# file://arm-ioperm.patch;striplevel=0 \
+# file://ldd.patch;striplevel=0 \
SRC_URI = "ftp://ftp.gnu.org/pub/gnu/glibc/glibc-${PV}.tar.bz2;name=archive \
ftp://ftp.gnu.org/pub/gnu/glibc/glibc-ports-${PV}.tar.bz2;name=ports \
ftp://ftp.gnu.org/pub/gnu/glibc/glibc-libidn-${PV}.tar.bz2;name=libidn \
- file://nscd-init.patch;patch=1;pnum=0 \
- file://arm-memcpy.patch;patch=1 \
- file://arm-longlong.patch;patch=1 \
- file://fhs-linux-paths.patch;patch=1 \
- file://dl-cache-libcmp.patch;patch=1 \
- file://ldsocache-varrun.patch;patch=1 \
- file://nptl-crosscompile.patch;patch=1 \
- file://glibc-check_pf.patch;patch=1;pnum=0 \
- file://ldd-unbash.patch;patch=1 \
- file://glibc-arm-IO-acquire-lock-fix.diff;patch=1 \
+ file://nscd-init.patch;striplevel=0 \
+ file://arm-memcpy.patch \
+ file://arm-longlong.patch \
+ file://fhs-linux-paths.patch \
+ file://dl-cache-libcmp.patch \
+ file://ldsocache-varrun.patch \
+ file://nptl-crosscompile.patch \
+ file://glibc-check_pf.patch;striplevel=0 \
+ file://ldd-unbash.patch \
+ file://glibc-arm-IO-acquire-lock-fix.diff \
file://generic-bits_select.h \
file://generic-bits_types.h \
file://generic-bits_typesizes.h \
file://generic-bits_time.h \
file://etc/ld.so.conf \
file://generate-supported.mk \
- file://march-i686.patch;patch=1;pnum=0 \
- file://tls_i486.patch;patch=1 \
- file://glibc-2.9-use-_begin.patch;patch=1 \
- file://arm-lowlevellock-include-tls.patch;patch=1 \
- file://glibc-2.9-enable-binutils-2.2.patch;patch=1 \
+ file://march-i686.patch;striplevel=0 \
+ file://tls_i486.patch \
+ file://glibc-2.9-use-_begin.patch \
+ file://arm-lowlevellock-include-tls.patch \
+ file://glibc-2.9-enable-binutils-2.2.patch \
"
# patches to fix libmemusage.so
-SRC_URI_append = " file://0001-malloc-memusage.c-update_data-Fix-handling-of-wrappi.patch;patch=1 \
- file://0002-malloc-memusage.c-DEFAULT_BUFFER_SIZE-Change-to-3276.patch;patch=1 \
- file://0003-Fix-wrap-around-in-memusage.patch;patch=1 "
+SRC_URI_append = " file://0001-malloc-memusage.c-update_data-Fix-handling-of-wrappi.patch \
+ file://0002-malloc-memusage.c-DEFAULT_BUFFER_SIZE-Change-to-3276.patch \
+ file://0003-Fix-wrap-around-in-memusage.patch "
# Build fails on sh3 and sh4 without additional patches
-SRC_URI_append_sh3 = " file://no-z-defs.patch;patch=1 \
- file://glibc-2.9-sh-fix.patch;patch=1"
-SRC_URI_append_sh4 = " file://no-z-defs.patch;patch=1 \
- file://glibc-2.9-sh-fix.patch;patch=1"
+SRC_URI_append_sh3 = " file://no-z-defs.patch \
+ file://glibc-2.9-sh-fix.patch"
+SRC_URI_append_sh4 = " file://no-z-defs.patch \
+ file://glibc-2.9-sh-fix.patch"
#powerpc patches to add support for soft-float
-SRC_URI_append_powerpc= " file://powerpc-sqrt-hack.diff;patch=1"
+SRC_URI_append_powerpc= " file://powerpc-sqrt-hack.diff"
S = "${WORKDIR}/glibc-${PV}"
B = "${WORKDIR}/build-${TARGET_SYS}"
diff --git a/recipes/glibc/glibc_cvs.bb b/recipes/glibc/glibc_cvs.bb
index 22f48d29fc..1c7a785931 100644
--- a/recipes/glibc/glibc_cvs.bb
+++ b/recipes/glibc/glibc_cvs.bb
@@ -27,29 +27,29 @@ python __anonymous () {
RDEPENDS_${PN}-dev = "linux-libc-headers-dev"
RPROVIDES_${PN}-dev += "libc-dev virtual-libc-dev"
-# file://noinfo.patch;patch=1
-# file://ldconfig.patch;patch=1;pnum=0
-# file://arm-no-hwcap.patch;patch=1;pnum=0 \
-# file://arm-memcpy.patch;patch=1;pnum=0 \
-# file://arm-machine-gmon.patch;patch=1;pnum=0 \
+# file://noinfo.patch
+# file://ldconfig.patch;striplevel=0
+# file://arm-no-hwcap.patch;striplevel=0 \
+# file://arm-memcpy.patch;striplevel=0 \
+# file://arm-machine-gmon.patch;striplevel=0 \
# \
-# file://arm-ioperm.patch;patch=1;pnum=0 \
-# file://ldd.patch;patch=1;pnum=0 \
+# file://arm-ioperm.patch;striplevel=0 \
+# file://ldd.patch;striplevel=0 \
SRC_URI = "cvs://anoncvs@sources.redhat.com/cvs/glibc;module=libc \
cvs://anoncvs@sources.redhat.com/cvs/glibc;module=ports \
- file://nscd-init.patch;patch=1;pnum=0 \
- file://arm-audit.patch;patch=1 \
- file://arm-audit2.patch;patch=1 \
- file://arm-memcpy.patch;patch=1 \
- file://arm-longlong.patch;patch=1;pnum=0 \
- file://fhs-linux-paths.patch;patch=1 \
- file://dl-cache-libcmp.patch;patch=1 \
- file://ldsocache-varrun.patch;patch=1 \
+ file://nscd-init.patch;striplevel=0 \
+ file://arm-audit.patch \
+ file://arm-audit2.patch \
+ file://arm-memcpy.patch \
+ file://arm-longlong.patch;striplevel=0 \
+ file://fhs-linux-paths.patch \
+ file://dl-cache-libcmp.patch \
+ file://ldsocache-varrun.patch \
file://etc/ld.so.conf \
file://generate-supported.mk"
# seems to fail on tls platforms
-SRC_URI_append_arm = " file://dyn-ldconfig-20041128.patch;patch=1"
+SRC_URI_append_arm = " file://dyn-ldconfig-20041128.patch"
S = "${WORKDIR}/libc"
B = "${WORKDIR}/build-${TARGET_SYS}"