summaryrefslogtreecommitdiffstats
path: root/meta/recipes-core/eglibc/eglibc-2.15
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-core/eglibc/eglibc-2.15')
-rw-r--r--meta/recipes-core/eglibc/eglibc-2.15/IO-acquire-lock-fix.patch17
-rw-r--r--meta/recipes-core/eglibc/eglibc-2.15/armv4-eabi-compile-fix.patch25
-rw-r--r--meta/recipes-core/eglibc/eglibc-2.15/eglibc-rpc-export-again.patch72
-rw-r--r--meta/recipes-core/eglibc/eglibc-2.15/eglibc-svn-arm-lowlevellock-include-tls.patch21
-rw-r--r--meta/recipes-core/eglibc/eglibc-2.15/etc/ld.so.conf0
-rw-r--r--meta/recipes-core/eglibc/eglibc-2.15/generate-supported.mk11
-rw-r--r--meta/recipes-core/eglibc/eglibc-2.15/glibc-2.14-libdl-crash.patch133
-rw-r--r--meta/recipes-core/eglibc/eglibc-2.15/ld-search-order.patch56
-rw-r--r--meta/recipes-core/eglibc/eglibc-2.15/mips-rld-map-check.patch26
-rw-r--r--meta/recipes-core/eglibc/eglibc-2.15/multilib_readlib.patch17
-rw-r--r--meta/recipes-core/eglibc/eglibc-2.15/ppc-sqrt.patch538
-rw-r--r--meta/recipes-core/eglibc/eglibc-2.15/ppc-sqrt_finite.patch112
-rw-r--r--meta/recipes-core/eglibc/eglibc-2.15/stack-protector-test.patch35
-rw-r--r--meta/recipes-core/eglibc/eglibc-2.15/use-sysroot-cxx-headers.patch42
-rw-r--r--meta/recipes-core/eglibc/eglibc-2.15/x86_fenv.patch29
15 files changed, 1134 insertions, 0 deletions
diff --git a/meta/recipes-core/eglibc/eglibc-2.15/IO-acquire-lock-fix.patch b/meta/recipes-core/eglibc/eglibc-2.15/IO-acquire-lock-fix.patch
new file mode 100644
index 0000000000..cf5803585c
--- /dev/null
+++ b/meta/recipes-core/eglibc/eglibc-2.15/IO-acquire-lock-fix.patch
@@ -0,0 +1,17 @@
1import http://sourceware.org/ml/libc-ports/2007-12/msg00000.html
2
3Upstream-Status: Pending
4
5Index: libc/bits/stdio-lock.h
6===================================================================
7--- libc.orig/bits/stdio-lock.h 2009-10-28 14:34:19.000000000 -0700
8+++ libc/bits/stdio-lock.h 2009-10-28 14:34:54.000000000 -0700
9@@ -50,6 +50,8 @@ __libc_lock_define_recursive (typedef, _
10 _IO_cleanup_region_start ((void (*) (void *)) _IO_funlockfile, (_fp)); \
11 _IO_flockfile (_fp)
12
13+# define _IO_acquire_lock_clear_flags2(_fp) _IO_acquire_lock (_fp)
14+
15 # define _IO_release_lock(_fp) \
16 _IO_funlockfile (_fp); \
17 _IO_cleanup_region_end (0)
diff --git a/meta/recipes-core/eglibc/eglibc-2.15/armv4-eabi-compile-fix.patch b/meta/recipes-core/eglibc/eglibc-2.15/armv4-eabi-compile-fix.patch
new file mode 100644
index 0000000000..c2407eea09
--- /dev/null
+++ b/meta/recipes-core/eglibc/eglibc-2.15/armv4-eabi-compile-fix.patch
@@ -0,0 +1,25 @@
1Source: http://sourceware.org/bugzilla/show_bug.cgi?id=12097
2Upstream-Status: Submitted
3
4The patch should be merged into glibc-ports
5
6-Khem
7Index: libc/ports/sysdeps/unix/sysv/linux/arm/eabi/libc-do-syscall.S
8===================================================================
9--- libc.orig/ports/sysdeps/unix/sysv/linux/arm/eabi/libc-do-syscall.S
10+++ libc/ports/sysdeps/unix/sysv/linux/arm/eabi/libc-do-syscall.S
11@@ -16,6 +16,8 @@
12 Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
13 02111-1307 USA. */
14
15+#if defined(__thumb__)
16+
17 #include <sysdep.h>
18
19 /* Out-of-line syscall stub. We expect the system call number in ip
20@@ -41,3 +43,5 @@ ENTRY (__libc_do_syscall)
21 pop {r7, pc}
22 .fnend
23 END (__libc_do_syscall)
24+
25+#endif /* __thumb__ */
diff --git a/meta/recipes-core/eglibc/eglibc-2.15/eglibc-rpc-export-again.patch b/meta/recipes-core/eglibc/eglibc-2.15/eglibc-rpc-export-again.patch
new file mode 100644
index 0000000000..15bd2f8514
--- /dev/null
+++ b/meta/recipes-core/eglibc/eglibc-2.15/eglibc-rpc-export-again.patch
@@ -0,0 +1,72 @@
1
2Upstream-Status: Inappropriate [configuration]
3
4export the rpc symbols and headers again until we can get libtirpc sorted
5out as a proper and full replacement
6
7patch from fedora (if redhat can't get it to work as the maintainers of all
8these packages, then what chance do we have!)
9
10Index: libc/NEWS
11===================================================================
12--- libc.orig/NEWS 2011-09-09 10:46:36.000000000 -0700
13+++ libc/NEWS 2011-09-09 10:58:21.196279725 -0700
14@@ -20,16 +20,6 @@
15 12724, 12734, 12738, 12746, 12766, 12775, 12777, 12782, 12788, 12792,
16 12795, 12811, 12813, 12814, 12841
17
18-* The RPC implementation in libc is obsoleted. Old programs keep working
19- but new programs cannot be linked with the routines in libc anymore.
20- Programs in need of RPC functionality must be linked against TI-RPC.
21- The TI-RPC implementation is IPv6 enabled and there are other benefits.
22-
23- Visible changes of this change include (obviously) the inability to link
24- programs using RPC functions without referencing the TI-RPC library and the
25- removal of the RPC headers from the glibc headers.
26- Implemented by Ulrich Drepper.
27-
28 * New Linux interfaces: clock_adjtime, name_to_handle_at, open_by_handle_at,
29 syncfs, setns, sendmmsg
30
31Index: libc/include/libc-symbols.h
32===================================================================
33--- libc.orig/include/libc-symbols.h 2011-09-09 10:45:34.000000000 -0700
34+++ libc/include/libc-symbols.h 2011-09-09 10:58:21.196279725 -0700
35@@ -656,7 +656,7 @@
36 # define libc_hidden_proto(name, attrs...) hidden_proto (name, ##attrs)
37 # define libc_hidden_def(name) hidden_def (name)
38 # define libc_hidden_weak(name) hidden_weak (name)
39-# define libc_hidden_nolink(name, version) hidden_nolink (name, libc, version)
40+# define libc_hidden_nolink(name, version) hidden_def (name)
41 # define libc_hidden_ver(local, name) hidden_ver (local, name)
42 # define libc_hidden_data_def(name) hidden_data_def (name)
43 # define libc_hidden_data_weak(name) hidden_data_weak (name)
44Index: libc/nis/Makefile
45===================================================================
46--- libc.orig/nis/Makefile 2011-09-09 10:46:34.000000000 -0700
47+++ libc/nis/Makefile 2011-09-09 10:58:21.196279725 -0700
48@@ -25,9 +25,9 @@
49
50 aux := nis_hash
51
52+headers := $(wildcard rpcsvc/*.[hx])
53 distribute := nss-nis.h nss-nisplus.h nis_intern.h Banner \
54- nisplus-parser.h nis_xdr.h nss \
55- $(wildcard rpcsvc/*.[hx])
56+ nisplus-parser.h nis_xdr.h nss
57
58 # These are the databases available for the nis (and perhaps later nisplus)
59 # service. This must be a superset of the services in nss.
60Index: libc/sunrpc/Makefile
61===================================================================
62--- libc.orig/sunrpc/Makefile 2011-09-09 10:46:30.000000000 -0700
63+++ libc/sunrpc/Makefile 2011-09-09 10:59:10.726352375 -0700
64@@ -55,7 +55,7 @@
65 des_crypt.h)
66 headers-not-in-tirpc = $(addprefix rpc/,key_prot.h rpc_des.h) \
67 $(rpcsvc:%=rpcsvc/%) rpcsvc/bootparam.h
68-headers = rpc/netdb.h
69+headers = rpc/netdb.h $(headers-in-tirpc) $(headers-not-in-tirpc)
70 generated = $(rpcsvc:%.x=rpcsvc/%.h) $(rpcsvc:%.x=x%.c) $(rpcsvc:%.x=x%.stmp) \
71 $(rpcsvc:%.x=rpcsvc/%.stmp) rpcgen
72 generated-dirs := rpcsvc
diff --git a/meta/recipes-core/eglibc/eglibc-2.15/eglibc-svn-arm-lowlevellock-include-tls.patch b/meta/recipes-core/eglibc/eglibc-2.15/eglibc-svn-arm-lowlevellock-include-tls.patch
new file mode 100644
index 0000000000..4313aa5197
--- /dev/null
+++ b/meta/recipes-core/eglibc/eglibc-2.15/eglibc-svn-arm-lowlevellock-include-tls.patch
@@ -0,0 +1,21 @@
1In file included from ../nptl/sysdeps/unix/sysv/linux/libc-lowlevellock.c:21:
2../nptl/sysdeps/unix/sysv/linux/lowlevellock.c: In function '__lll_lock_wait_private':
3../nptl/sysdeps/unix/sysv/linux/lowlevellock.c:34: warning: implicit declaration of function 'THREAD_GETMEM'
4../nptl/sysdeps/unix/sysv/linux/lowlevellock.c:34: error: 'THREAD_SELF' undeclared (first use in this function)
5../nptl/sysdeps/unix/sysv/linux/lowlevellock.c:34: error: (Each undeclared identifier is reported only once
6../nptl/sysdeps/unix/sysv/linux/lowlevellock.c:34: error: for each function it appears in.)
7../nptl/sysdeps/unix/sysv/linux/lowlevellock.c:34: error: 'header' undeclared (first use in this function)
8make[4]: *** [/var/tmp/portage/sys-libs/glibc-2.7-r1/work/build-default-armv4l-unknown-linux-gnu-nptl/nptl/rtld-libc-lowlevellock.os] Error 1
9
10Upstream-Status: Pending
11
12--- libc/ports/sysdeps/unix/sysv/linux/arm/nptl/lowlevellock.h.orig
13+++ libc/ports/sysdeps/unix/sysv/linux/arm/nptl/lowlevellock.h
14@@ -25,6 +25,7 @@
15 #include <atomic.h>
16 #include <sysdep.h>
17 #include <kernel-features.h>
18+#include <tls.h>
19
20 #define FUTEX_WAIT 0
21 #define FUTEX_WAKE 1
diff --git a/meta/recipes-core/eglibc/eglibc-2.15/etc/ld.so.conf b/meta/recipes-core/eglibc/eglibc-2.15/etc/ld.so.conf
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/meta/recipes-core/eglibc/eglibc-2.15/etc/ld.so.conf
diff --git a/meta/recipes-core/eglibc/eglibc-2.15/generate-supported.mk b/meta/recipes-core/eglibc/eglibc-2.15/generate-supported.mk
new file mode 100644
index 0000000000..d2a28c2dc6
--- /dev/null
+++ b/meta/recipes-core/eglibc/eglibc-2.15/generate-supported.mk
@@ -0,0 +1,11 @@
1#!/usr/bin/make
2
3include $(IN)
4
5all:
6 rm -f $(OUT)
7 touch $(OUT)
8 for locale in $(SUPPORTED-LOCALES); do \
9 [ $$locale = true ] && continue; \
10 echo $$locale | sed 's,/, ,' >> $(OUT); \
11 done
diff --git a/meta/recipes-core/eglibc/eglibc-2.15/glibc-2.14-libdl-crash.patch b/meta/recipes-core/eglibc/eglibc-2.15/glibc-2.14-libdl-crash.patch
new file mode 100644
index 0000000000..1c30c9d833
--- /dev/null
+++ b/meta/recipes-core/eglibc/eglibc-2.15/glibc-2.14-libdl-crash.patch
@@ -0,0 +1,133 @@
1Without this patch programs using alsa-lib crash (alsamixer for example).
2Removed Copyright reverts
3
4Upstream-Status: Pending
5
6http://sourceware.org/git/?p=glibc.git;a=commitdiff;h=675155e9
7http://sourceware.org/ml/libc-alpha/2011-06/msg00006.html
8
9many distributions are using this already
10http://chakra-project.org/ccr/packages/glibc/glibc/PKGBUILD
11http://mailman.archlinux.org/pipermail/arch-commits/2011-June/137142.html
12http://svn.mandriva.com/cgi-bin/viewvc.cgi/packages/cooker/glibc/current/SOURCES/glibc-2.14-libdl-crash.patch?view=markup&pathrev=691343
13http://repos.archlinuxppc.org/wsvn/filedetails.php?repname=packages&path=%2Fglibc%2Ftrunk%2Fglibc-2.14-libdl-crash.patch
14
15Index: libc/elf/dl-close.c
16===================================================================
17--- libc.orig/elf/dl-close.c 2011-12-05 20:16:38.000000000 -0800
18+++ libc/elf/dl-close.c 2011-12-05 20:17:15.863326893 -0800
19@@ -119,17 +119,8 @@
20 if (map->l_direct_opencount > 0 || map->l_type != lt_loaded
21 || dl_close_state != not_pending)
22 {
23- if (map->l_direct_opencount == 0)
24- {
25- if (map->l_type == lt_loaded)
26- dl_close_state = rerun;
27- else if (map->l_type == lt_library)
28- {
29- struct link_map **oldp = map->l_initfini;
30- map->l_initfini = map->l_orig_initfini;
31- _dl_scope_free (oldp);
32- }
33- }
34+ if (map->l_direct_opencount == 0 && map->l_type == lt_loaded)
35+ dl_close_state = rerun;
36
37 /* There are still references to this object. Do nothing more. */
38 if (__builtin_expect (GLRO_dl_debug_mask & DL_DEBUG_FILES, 0))
39Index: libc/elf/dl-deps.c
40===================================================================
41--- libc.orig/elf/dl-deps.c 2011-12-05 20:16:38.000000000 -0800
42+++ libc/elf/dl-deps.c 2011-12-05 20:19:33.179326877 -0800
43@@ -478,6 +478,7 @@
44 nneeded * sizeof needed[0]);
45 atomic_write_barrier ();
46 l->l_initfini = l_initfini;
47+ l->l_free_initfini = 1;
48 }
49
50 /* If we have no auxiliary objects just go on to the next map. */
51@@ -678,6 +679,7 @@
52 l_initfini[nlist] = NULL;
53 atomic_write_barrier ();
54 map->l_initfini = l_initfini;
55+ map->l_free_initfini = 1;
56 if (l_reldeps != NULL)
57 {
58 atomic_write_barrier ();
59@@ -686,7 +688,7 @@
60 _dl_scope_free (old_l_reldeps);
61 }
62 if (old_l_initfini != NULL)
63- map->l_orig_initfini = old_l_initfini;
64+ _dl_scope_free (old_l_initfini);
65
66 if (errno_reason)
67 _dl_signal_error (errno_reason == -1 ? 0 : errno_reason, objname,
68Index: libc/elf/dl-libc.c
69===================================================================
70--- libc.orig/elf/dl-libc.c 2011-10-22 09:34:03.000000000 -0700
71+++ libc/elf/dl-libc.c 2011-12-05 20:17:15.863326893 -0800
72@@ -265,13 +265,13 @@
73
74 for (Lmid_t ns = 0; ns < GL(dl_nns); ++ns)
75 {
76- /* Remove all additional names added to the objects. */
77 for (l = GL(dl_ns)[ns]._ns_loaded; l != NULL; l = l->l_next)
78 {
79 struct libname_list *lnp = l->l_libname->next;
80
81 l->l_libname->next = NULL;
82
83+ /* Remove all additional names added to the objects. */
84 while (lnp != NULL)
85 {
86 struct libname_list *old = lnp;
87@@ -279,6 +279,10 @@
88 if (! old->dont_free)
89 free (old);
90 }
91+
92+ /* Free the initfini dependency list. */
93+ if (l->l_free_initfini)
94+ free (l->l_initfini);
95 }
96
97 if (__builtin_expect (GL(dl_ns)[ns]._ns_global_scope_alloc, 0) != 0
98Index: libc/elf/rtld.c
99===================================================================
100--- libc.orig/elf/rtld.c 2011-10-22 09:34:03.000000000 -0700
101+++ libc/elf/rtld.c 2011-12-05 20:17:15.863326893 -0800
102@@ -2264,6 +2264,7 @@
103 lnp->dont_free = 1;
104 lnp = lnp->next;
105 }
106+ l->l_free_initfini = 0;
107
108 if (l != &GL(dl_rtld_map))
109 _dl_relocate_object (l, l->l_scope, GLRO(dl_lazy) ? RTLD_LAZY : 0,
110Index: libc/include/link.h
111===================================================================
112--- libc.orig/include/link.h 2011-10-22 09:32:35.000000000 -0700
113+++ libc/include/link.h 2011-12-05 20:17:15.863326893 -0800
114@@ -192,6 +192,9 @@
115 during LD_TRACE_PRELINKING=1
116 contains any DT_SYMBOLIC
117 libraries. */
118+ unsigned int l_free_initfini:1; /* Nonzero if l_initfini can be
119+ freed, ie. not allocated with
120+ the dummy malloc in ld.so. */
121
122 /* Collected information about own RPATH directories. */
123 struct r_search_path_struct l_rpath_dirs;
124@@ -240,9 +243,6 @@
125
126 /* List of object in order of the init and fini calls. */
127 struct link_map **l_initfini;
128- /* The init and fini list generated at startup, saved when the
129- object is also loaded dynamically. */
130- struct link_map **l_orig_initfini;
131
132 /* List of the dependencies introduced through symbol binding. */
133 struct link_map_reldeps
diff --git a/meta/recipes-core/eglibc/eglibc-2.15/ld-search-order.patch b/meta/recipes-core/eglibc/eglibc-2.15/ld-search-order.patch
new file mode 100644
index 0000000000..40ae6d37f4
--- /dev/null
+++ b/meta/recipes-core/eglibc/eglibc-2.15/ld-search-order.patch
@@ -0,0 +1,56 @@
1Upstream-Status: Inappropriate [embedded specific]
2
3The default lib search path order is:
4
5 1) LD_LIBRARY_PATH
6 2) RPATH from the binary
7 3) ld.so.cache
8 4) default search paths embedded in the linker
9
10For nativesdk binaries which are being used alongside binaries on a host system, we
11need the search paths to firstly search the shipped nativesdk libs but then also
12cover the host system. For example we want the host system's libGL and this may be
13in a non-standard location like /usr/lib/mesa. The only place the location is know
14about is in the ld.so.cache of the host system.
15
16Since nativesdk has a simple structure and doesn't need to use a cache itself, we
17repurpose the cache for use as a last resort in finding host system binaries. This
18means we need to switch the order of 3 and 4 above to make this work effectively.
19
20RP 14/10/2010
21
22Index: libc/elf/dl-load.c
23===================================================================
24--- libc.orig/elf/dl-load.c
25+++ libc/elf/dl-load.c
26@@ -2107,6 +2107,15 @@ _dl_map_object (struct link_map *loader,
27 &loader->l_runpath_dirs, &realname, &fb, loader,
28 LA_SER_RUNPATH, &found_other_class);
29
30+ /* try the default path. */
31+ if (fd == -1
32+ && ((l = loader ?: GL(dl_ns)[nsid]._ns_loaded) == NULL
33+ || __builtin_expect (!(l->l_flags_1 & DF_1_NODEFLIB), 1))
34+ && rtld_search_dirs.dirs != (void *) -1)
35+ fd = open_path (name, namelen, mode & __RTLD_SECURE, &rtld_search_dirs,
36+ &realname, &fb, l, LA_SER_DEFAULT, &found_other_class);
37+
38+ /* Finally try ld.so.cache */
39 if (fd == -1
40 && (__builtin_expect (! (mode & __RTLD_SECURE), 1)
41 || ! INTUSE(__libc_enable_secure)))
42@@ -2169,14 +2178,6 @@ _dl_map_object (struct link_map *loader,
43 }
44 }
45
46- /* Finally, try the default path. */
47- if (fd == -1
48- && ((l = loader ?: GL(dl_ns)[nsid]._ns_loaded) == NULL
49- || __builtin_expect (!(l->l_flags_1 & DF_1_NODEFLIB), 1))
50- && rtld_search_dirs.dirs != (void *) -1)
51- fd = open_path (name, namelen, mode & __RTLD_SECURE, &rtld_search_dirs,
52- &realname, &fb, l, LA_SER_DEFAULT, &found_other_class);
53-
54 /* Add another newline when we are tracing the library loading. */
55 if (__builtin_expect (GLRO_dl_debug_mask & DL_DEBUG_LIBS, 0))
56 _dl_debug_printf ("\n");
diff --git a/meta/recipes-core/eglibc/eglibc-2.15/mips-rld-map-check.patch b/meta/recipes-core/eglibc/eglibc-2.15/mips-rld-map-check.patch
new file mode 100644
index 0000000000..9b646fea95
--- /dev/null
+++ b/meta/recipes-core/eglibc/eglibc-2.15/mips-rld-map-check.patch
@@ -0,0 +1,26 @@
1
2On mips target, binutils currently sets DT_MIPS_RLD_MAP to 0 in dynamic
3section if a --version-script sets _RLD_MAP to local. This is apparently
4a binutils bug, but libc shouldn't segfault in this case.
5
6see also: http://sourceware.org/bugilla/show_bug.cgi?id=11615
7
8Upstream-Status: Pending
9
109/19/2010 - added by Qing He <qing.he@intel.com>
11
12
13---
14diff -ru glibc-2.10.1.orig/ports/sysdeps/mips/dl-machine.h glibc-2.10.1/ports/sysdeps/mips/dl-machine.h
15--- glibc-2.10.1.orig/ports/sysdeps/mips/dl-machine.h 2009-05-16 16:36:20.000000000 +0800
16+++ glibc-2.10.1/ports/sysdeps/mips/dl-machine.h 2010-09-19 09:11:53.000000000 +0800
17@@ -70,7 +70,8 @@
18 /* If there is a DT_MIPS_RLD_MAP entry in the dynamic section, fill it in
19 with the run-time address of the r_debug structure */
20 #define ELF_MACHINE_DEBUG_SETUP(l,r) \
21-do { if ((l)->l_info[DT_MIPS (RLD_MAP)]) \
22+do { if ((l)->l_info[DT_MIPS (RLD_MAP)] && \
23+ (l)->l_info[DT_MIPS (RLD_MAP)]->d_un.d_ptr) \
24 *(ElfW(Addr) *)((l)->l_info[DT_MIPS (RLD_MAP)]->d_un.d_ptr) = \
25 (ElfW(Addr)) (r); \
26 } while (0)
diff --git a/meta/recipes-core/eglibc/eglibc-2.15/multilib_readlib.patch b/meta/recipes-core/eglibc/eglibc-2.15/multilib_readlib.patch
new file mode 100644
index 0000000000..1542b1b519
--- /dev/null
+++ b/meta/recipes-core/eglibc/eglibc-2.15/multilib_readlib.patch
@@ -0,0 +1,17 @@
1Upstream-Status: Inappropriate [embedded specific]
2
3Replace the OECORE_KNOWN_INTERPRETER_NAMES with the value of
4variable EGLIBC_KNOWN_INTERPRETER_NAMES.
5
6Lianhao Lu, 08/01/2011
7
8--- libc/elf/readlib.c.orig 2011-08-12 17:05:51.864470837 +0800
9+++ libc/elf/readlib.c 2011-08-12 17:06:39.346942074 +0800
10@@ -52,6 +52,7 @@
11 #ifdef SYSDEP_KNOWN_INTERPRETER_NAMES
12 SYSDEP_KNOWN_INTERPRETER_NAMES
13 #endif
14+ OECORE_KNOWN_INTERPRETER_NAMES
15 };
16
17 static struct known_names known_libs[] =
diff --git a/meta/recipes-core/eglibc/eglibc-2.15/ppc-sqrt.patch b/meta/recipes-core/eglibc/eglibc-2.15/ppc-sqrt.patch
new file mode 100644
index 0000000000..203040c15c
--- /dev/null
+++ b/meta/recipes-core/eglibc/eglibc-2.15/ppc-sqrt.patch
@@ -0,0 +1,538 @@
1Upstream-Status: Pending
2
32011-03-22 Joseph Myers <joseph@codesourcery.com>
4
5 Merge from SG++ 2.11:
6
7 2010-10-05 Nathan Froyd <froydnj@codesourcery.com>
8
9 Issue #9382
10
11 * sysdeps/powerpc/powerpc32/603e/: New directory.
12 * sysdeps/unix/sysv/linux/powerpc/powerpc32/e500mc/: New directory.
13 * sysdeps/unix/sysv/linux/powerpc/powerpc32/603e/: New directory.
14 * sysdeps/unix/sysv/linux/powerpc/powerpc32/7400/: New directory.
15 * sysdeps/powerpc/powerpc64/e5500/fpu/e_sqrtf.c: Update.
16 * sysdeps/powerpc/powerpc64/e5500/fpu/e_sqrt.c: Update.
17 * sysdeps/powerpc/powerpc64/e5500/fpu/Implies: New file.
18
19Index: libc/sysdeps/powerpc/powerpc32/603e/fpu/e_sqrt.c
20===================================================================
21--- /dev/null
22+++ libc/sysdeps/powerpc/powerpc32/603e/fpu/e_sqrt.c
23@@ -0,0 +1,134 @@
24+/* Double-precision floating point square root.
25+ Copyright (C) 2010 Free Software Foundation, Inc.
26+ This file is part of the GNU C Library.
27+
28+ The GNU C Library is free software; you can redistribute it and/or
29+ modify it under the terms of the GNU Lesser General Public
30+ License as published by the Free Software Foundation; either
31+ version 2.1 of the License, or (at your option) any later version.
32+
33+ The GNU C Library is distributed in the hope that it will be useful,
34+ but WITHOUT ANY WARRANTY; without even the implied warranty of
35+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
36+ Lesser General Public License for more details.
37+
38+ You should have received a copy of the GNU Lesser General Public
39+ License along with the GNU C Library; if not, write to the Free
40+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
41+ 02111-1307 USA. */
42+
43+#include <math.h>
44+#include <math_private.h>
45+#include <fenv_libc.h>
46+#include <inttypes.h>
47+
48+#include <sysdep.h>
49+#include <ldsodefs.h>
50+
51+static const ieee_float_shape_type a_nan = {.word = 0x7fc00000 };
52+static const ieee_float_shape_type a_inf = {.word = 0x7f800000 };
53+static const float two108 = 3.245185536584267269e+32;
54+static const float twom54 = 5.551115123125782702e-17;
55+static const float half = 0.5;
56+
57+/* The method is based on the descriptions in:
58+
59+ _The Handbook of Floating-Pointer Arithmetic_ by Muller et al., chapter 5;
60+ _IA-64 and Elementary Functions: Speed and Precision_ by Markstein, chapter 9
61+
62+ We find the actual square root and half of its reciprocal
63+ simultaneously. */
64+
65+#ifdef __STDC__
66+double
67+__ieee754_sqrt (double b)
68+#else
69+double
70+__ieee754_sqrt (b)
71+ double b;
72+#endif
73+{
74+ if (__builtin_expect (b > 0, 1))
75+ {
76+ double y, g, h, d, r;
77+ ieee_double_shape_type u;
78+
79+ if (__builtin_expect (b != a_inf.value, 1))
80+ {
81+ fenv_t fe;
82+
83+ fe = fegetenv_register ();
84+
85+ u.value = b;
86+
87+ relax_fenv_state ();
88+
89+ __asm__ ("frsqrte %[estimate], %[x]\n"
90+ : [estimate] "=f" (y) : [x] "f" (b));
91+
92+ /* Following Muller et al, page 168, equation 5.20.
93+
94+ h goes to 1/(2*sqrt(b))
95+ g goes to sqrt(b).
96+
97+ We need three iterations to get within 1ulp. */
98+
99+ /* Indicate that these can be performed prior to the branch. GCC
100+ insists on sinking them below the branch, however; it seems like
101+ they'd be better before the branch so that we can cover any latency
102+ from storing the argument and loading its high word. Oh well. */
103+
104+ g = b * y;
105+ h = 0.5 * y;
106+
107+ /* Handle small numbers by scaling. */
108+ if (__builtin_expect ((u.parts.msw & 0x7ff00000) <= 0x02000000, 0))
109+ return __ieee754_sqrt (b * two108) * twom54;
110+
111+#define FMADD(a_, c_, b_) \
112+ ({ double __r; \
113+ __asm__ ("fmadd %[r], %[a], %[c], %[b]\n" \
114+ : [r] "=f" (__r) : [a] "f" (a_), [c] "f" (c_), [b] "f" (b_)); \
115+ __r;})
116+#define FNMSUB(a_, c_, b_) \
117+ ({ double __r; \
118+ __asm__ ("fnmsub %[r], %[a], %[c], %[b]\n" \
119+ : [r] "=f" (__r) : [a] "f" (a_), [c] "f" (c_), [b] "f" (b_)); \
120+ __r;})
121+
122+ r = FNMSUB (g, h, half);
123+ g = FMADD (g, r, g);
124+ h = FMADD (h, r, h);
125+
126+ r = FNMSUB (g, h, half);
127+ g = FMADD (g, r, g);
128+ h = FMADD (h, r, h);
129+
130+ r = FNMSUB (g, h, half);
131+ g = FMADD (g, r, g);
132+ h = FMADD (h, r, h);
133+
134+ /* g is now +/- 1ulp, or exactly equal to, the square root of b. */
135+
136+ /* Final refinement. */
137+ d = FNMSUB (g, g, b);
138+
139+ fesetenv_register (fe);
140+ return FMADD (d, h, g);
141+ }
142+ }
143+ else if (b < 0)
144+ {
145+ /* For some reason, some PowerPC32 processors don't implement
146+ FE_INVALID_SQRT. */
147+#ifdef FE_INVALID_SQRT
148+ feraiseexcept (FE_INVALID_SQRT);
149+
150+ fenv_union_t u = { .fenv = fegetenv_register () };
151+ if ((u.l[1] & FE_INVALID) == 0)
152+#endif
153+ feraiseexcept (FE_INVALID);
154+ b = a_nan.value;
155+ }
156+ return f_wash (b);
157+}
158Index: libc/sysdeps/powerpc/powerpc32/603e/fpu/e_sqrtf.c
159===================================================================
160--- /dev/null
161+++ libc/sysdeps/powerpc/powerpc32/603e/fpu/e_sqrtf.c
162@@ -0,0 +1,101 @@
163+/* Single-precision floating point square root.
164+ Copyright (C) 2010 Free Software Foundation, Inc.
165+ This file is part of the GNU C Library.
166+
167+ The GNU C Library is free software; you can redistribute it and/or
168+ modify it under the terms of the GNU Lesser General Public
169+ License as published by the Free Software Foundation; either
170+ version 2.1 of the License, or (at your option) any later version.
171+
172+ The GNU C Library is distributed in the hope that it will be useful,
173+ but WITHOUT ANY WARRANTY; without even the implied warranty of
174+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
175+ Lesser General Public License for more details.
176+
177+ You should have received a copy of the GNU Lesser General Public
178+ License along with the GNU C Library; if not, write to the Free
179+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
180+ 02111-1307 USA. */
181+
182+#include <math.h>
183+#include <math_private.h>
184+#include <fenv_libc.h>
185+#include <inttypes.h>
186+
187+#include <sysdep.h>
188+#include <ldsodefs.h>
189+
190+static const ieee_float_shape_type a_nan = {.word = 0x7fc00000 };
191+static const ieee_float_shape_type a_inf = {.word = 0x7f800000 };
192+static const float threehalf = 1.5;
193+
194+/* The method is based on the descriptions in:
195+
196+ _The Handbook of Floating-Pointer Arithmetic_ by Muller et al., chapter 5;
197+ _IA-64 and Elementary Functions: Speed and Precision_ by Markstein, chapter 9
198+
199+ We find the reciprocal square root and use that to compute the actual
200+ square root. */
201+
202+#ifdef __STDC__
203+float
204+__ieee754_sqrtf (float b)
205+#else
206+float
207+__ieee754_sqrtf (b)
208+ float b;
209+#endif
210+{
211+ if (__builtin_expect (b > 0, 1))
212+ {
213+#define FMSUB(a_, c_, b_) \
214+ ({ double __r; \
215+ __asm__ ("fmsub %[r], %[a], %[c], %[b]\n" \
216+ : [r] "=f" (__r) : [a] "f" (a_), [c] "f" (c_), [b] "f" (b_)); \
217+ __r;})
218+#define FNMSUB(a_, c_, b_) \
219+ ({ double __r; \
220+ __asm__ ("fnmsub %[r], %[a], %[c], %[b]\n" \
221+ : [r] "=f" (__r) : [a] "f" (a_), [c] "f" (c_), [b] "f" (b_)); \
222+ __r;})
223+
224+ if (__builtin_expect (b != a_inf.value, 1))
225+ {
226+ double y, x;
227+ fenv_t fe;
228+
229+ fe = fegetenv_register ();
230+
231+ relax_fenv_state ();
232+
233+ /* Compute y = 1.5 * b - b. Uses fewer constants than y = 0.5 * b. */
234+ y = FMSUB (threehalf, b, b);
235+
236+ /* Initial estimate. */
237+ __asm__ ("frsqrte %[x], %[b]\n" : [x] "=f" (x) : [b] "f" (b));
238+
239+ /* Iterate. x_{n+1} = x_n * (1.5 - y * (x_n * x_n)). */
240+ x = x * FNMSUB (y, x * x, threehalf);
241+ x = x * FNMSUB (y, x * x, threehalf);
242+ x = x * FNMSUB (y, x * x, threehalf);
243+
244+ /* All done. */
245+ fesetenv_register (fe);
246+ return x * b;
247+ }
248+ }
249+ else if (b < 0)
250+ {
251+ /* For some reason, some PowerPC32 processors don't implement
252+ FE_INVALID_SQRT. */
253+#ifdef FE_INVALID_SQRT
254+ feraiseexcept (FE_INVALID_SQRT);
255+
256+ fenv_union_t u = { .fenv = fegetenv_register () };
257+ if ((u.l[1] & FE_INVALID) == 0)
258+#endif
259+ feraiseexcept (FE_INVALID);
260+ b = a_nan.value;
261+ }
262+ return f_washf (b);
263+}
264Index: libc/sysdeps/powerpc/powerpc64/e5500/fpu/e_sqrt.c
265===================================================================
266--- /dev/null
267+++ libc/sysdeps/powerpc/powerpc64/e5500/fpu/e_sqrt.c
268@@ -0,0 +1,134 @@
269+/* Double-precision floating point square root.
270+ Copyright (C) 2010 Free Software Foundation, Inc.
271+ This file is part of the GNU C Library.
272+
273+ The GNU C Library is free software; you can redistribute it and/or
274+ modify it under the terms of the GNU Lesser General Public
275+ License as published by the Free Software Foundation; either
276+ version 2.1 of the License, or (at your option) any later version.
277+
278+ The GNU C Library is distributed in the hope that it will be useful,
279+ but WITHOUT ANY WARRANTY; without even the implied warranty of
280+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
281+ Lesser General Public License for more details.
282+
283+ You should have received a copy of the GNU Lesser General Public
284+ License along with the GNU C Library; if not, write to the Free
285+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
286+ 02111-1307 USA. */
287+
288+#include <math.h>
289+#include <math_private.h>
290+#include <fenv_libc.h>
291+#include <inttypes.h>
292+
293+#include <sysdep.h>
294+#include <ldsodefs.h>
295+
296+static const ieee_float_shape_type a_nan = {.word = 0x7fc00000 };
297+static const ieee_float_shape_type a_inf = {.word = 0x7f800000 };
298+static const float two108 = 3.245185536584267269e+32;
299+static const float twom54 = 5.551115123125782702e-17;
300+static const float half = 0.5;
301+
302+/* The method is based on the descriptions in:
303+
304+ _The Handbook of Floating-Pointer Arithmetic_ by Muller et al., chapter 5;
305+ _IA-64 and Elementary Functions: Speed and Precision_ by Markstein, chapter 9
306+
307+ We find the actual square root and half of its reciprocal
308+ simultaneously. */
309+
310+#ifdef __STDC__
311+double
312+__ieee754_sqrt (double b)
313+#else
314+double
315+__ieee754_sqrt (b)
316+ double b;
317+#endif
318+{
319+ if (__builtin_expect (b > 0, 1))
320+ {
321+ double y, g, h, d, r;
322+ ieee_double_shape_type u;
323+
324+ if (__builtin_expect (b != a_inf.value, 1))
325+ {
326+ fenv_t fe;
327+
328+ fe = fegetenv_register ();
329+
330+ u.value = b;
331+
332+ relax_fenv_state ();
333+
334+ __asm__ ("frsqrte %[estimate], %[x]\n"
335+ : [estimate] "=f" (y) : [x] "f" (b));
336+
337+ /* Following Muller et al, page 168, equation 5.20.
338+
339+ h goes to 1/(2*sqrt(b))
340+ g goes to sqrt(b).
341+
342+ We need three iterations to get within 1ulp. */
343+
344+ /* Indicate that these can be performed prior to the branch. GCC
345+ insists on sinking them below the branch, however; it seems like
346+ they'd be better before the branch so that we can cover any latency
347+ from storing the argument and loading its high word. Oh well. */
348+
349+ g = b * y;
350+ h = 0.5 * y;
351+
352+ /* Handle small numbers by scaling. */
353+ if (__builtin_expect ((u.parts.msw & 0x7ff00000) <= 0x02000000, 0))
354+ return __ieee754_sqrt (b * two108) * twom54;
355+
356+#define FMADD(a_, c_, b_) \
357+ ({ double __r; \
358+ __asm__ ("fmadd %[r], %[a], %[c], %[b]\n" \
359+ : [r] "=f" (__r) : [a] "f" (a_), [c] "f" (c_), [b] "f" (b_)); \
360+ __r;})
361+#define FNMSUB(a_, c_, b_) \
362+ ({ double __r; \
363+ __asm__ ("fnmsub %[r], %[a], %[c], %[b]\n" \
364+ : [r] "=f" (__r) : [a] "f" (a_), [c] "f" (c_), [b] "f" (b_)); \
365+ __r;})
366+
367+ r = FNMSUB (g, h, half);
368+ g = FMADD (g, r, g);
369+ h = FMADD (h, r, h);
370+
371+ r = FNMSUB (g, h, half);
372+ g = FMADD (g, r, g);
373+ h = FMADD (h, r, h);
374+
375+ r = FNMSUB (g, h, half);
376+ g = FMADD (g, r, g);
377+ h = FMADD (h, r, h);
378+
379+ /* g is now +/- 1ulp, or exactly equal to, the square root of b. */
380+
381+ /* Final refinement. */
382+ d = FNMSUB (g, g, b);
383+
384+ fesetenv_register (fe);
385+ return FMADD (d, h, g);
386+ }
387+ }
388+ else if (b < 0)
389+ {
390+ /* For some reason, some PowerPC32 processors don't implement
391+ FE_INVALID_SQRT. */
392+#ifdef FE_INVALID_SQRT
393+ feraiseexcept (FE_INVALID_SQRT);
394+
395+ fenv_union_t u = { .fenv = fegetenv_register () };
396+ if ((u.l[1] & FE_INVALID) == 0)
397+#endif
398+ feraiseexcept (FE_INVALID);
399+ b = a_nan.value;
400+ }
401+ return f_wash (b);
402+}
403Index: libc/sysdeps/powerpc/powerpc64/e5500/fpu/e_sqrtf.c
404===================================================================
405--- /dev/null
406+++ libc/sysdeps/powerpc/powerpc64/e5500/fpu/e_sqrtf.c
407@@ -0,0 +1,101 @@
408+/* Single-precision floating point square root.
409+ Copyright (C) 2010 Free Software Foundation, Inc.
410+ This file is part of the GNU C Library.
411+
412+ The GNU C Library is free software; you can redistribute it and/or
413+ modify it under the terms of the GNU Lesser General Public
414+ License as published by the Free Software Foundation; either
415+ version 2.1 of the License, or (at your option) any later version.
416+
417+ The GNU C Library is distributed in the hope that it will be useful,
418+ but WITHOUT ANY WARRANTY; without even the implied warranty of
419+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
420+ Lesser General Public License for more details.
421+
422+ You should have received a copy of the GNU Lesser General Public
423+ License along with the GNU C Library; if not, write to the Free
424+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
425+ 02111-1307 USA. */
426+
427+#include <math.h>
428+#include <math_private.h>
429+#include <fenv_libc.h>
430+#include <inttypes.h>
431+
432+#include <sysdep.h>
433+#include <ldsodefs.h>
434+
435+static const ieee_float_shape_type a_nan = {.word = 0x7fc00000 };
436+static const ieee_float_shape_type a_inf = {.word = 0x7f800000 };
437+static const float threehalf = 1.5;
438+
439+/* The method is based on the descriptions in:
440+
441+ _The Handbook of Floating-Pointer Arithmetic_ by Muller et al., chapter 5;
442+ _IA-64 and Elementary Functions: Speed and Precision_ by Markstein, chapter 9
443+
444+ We find the reciprocal square root and use that to compute the actual
445+ square root. */
446+
447+#ifdef __STDC__
448+float
449+__ieee754_sqrtf (float b)
450+#else
451+float
452+__ieee754_sqrtf (b)
453+ float b;
454+#endif
455+{
456+ if (__builtin_expect (b > 0, 1))
457+ {
458+#define FMSUB(a_, c_, b_) \
459+ ({ double __r; \
460+ __asm__ ("fmsub %[r], %[a], %[c], %[b]\n" \
461+ : [r] "=f" (__r) : [a] "f" (a_), [c] "f" (c_), [b] "f" (b_)); \
462+ __r;})
463+#define FNMSUB(a_, c_, b_) \
464+ ({ double __r; \
465+ __asm__ ("fnmsub %[r], %[a], %[c], %[b]\n" \
466+ : [r] "=f" (__r) : [a] "f" (a_), [c] "f" (c_), [b] "f" (b_)); \
467+ __r;})
468+
469+ if (__builtin_expect (b != a_inf.value, 1))
470+ {
471+ double y, x;
472+ fenv_t fe;
473+
474+ fe = fegetenv_register ();
475+
476+ relax_fenv_state ();
477+
478+ /* Compute y = 1.5 * b - b. Uses fewer constants than y = 0.5 * b. */
479+ y = FMSUB (threehalf, b, b);
480+
481+ /* Initial estimate. */
482+ __asm__ ("frsqrte %[x], %[b]\n" : [x] "=f" (x) : [b] "f" (b));
483+
484+ /* Iterate. x_{n+1} = x_n * (1.5 - y * (x_n * x_n)). */
485+ x = x * FNMSUB (y, x * x, threehalf);
486+ x = x * FNMSUB (y, x * x, threehalf);
487+ x = x * FNMSUB (y, x * x, threehalf);
488+
489+ /* All done. */
490+ fesetenv_register (fe);
491+ return x * b;
492+ }
493+ }
494+ else if (b < 0)
495+ {
496+ /* For some reason, some PowerPC32 processors don't implement
497+ FE_INVALID_SQRT. */
498+#ifdef FE_INVALID_SQRT
499+ feraiseexcept (FE_INVALID_SQRT);
500+
501+ fenv_union_t u = { .fenv = fegetenv_register () };
502+ if ((u.l[1] & FE_INVALID) == 0)
503+#endif
504+ feraiseexcept (FE_INVALID);
505+ b = a_nan.value;
506+ }
507+ return f_washf (b);
508+}
509Index: libc/sysdeps/unix/sysv/linux/powerpc/powerpc32/603e/fpu/Implies
510===================================================================
511--- /dev/null
512+++ libc/sysdeps/unix/sysv/linux/powerpc/powerpc32/603e/fpu/Implies
513@@ -0,0 +1 @@
514+powerpc/powerpc32/603e/fpu
515Index: libc/sysdeps/unix/sysv/linux/powerpc/powerpc32/7400/fpu/Implies
516===================================================================
517--- /dev/null
518+++ libc/sysdeps/unix/sysv/linux/powerpc/powerpc32/7400/fpu/Implies
519@@ -0,0 +1 @@
520+powerpc/powerpc32/603e/fpu
521Index: libc/sysdeps/unix/sysv/linux/powerpc/powerpc32/e500mc/fpu/Implies
522===================================================================
523--- /dev/null
524+++ libc/sysdeps/unix/sysv/linux/powerpc/powerpc32/e500mc/fpu/Implies
525@@ -0,0 +1 @@
526+powerpc/powerpc32/603e/fpu
527Index: libc/sysdeps/unix/sysv/linux/powerpc/powerpc64/e5500/fpu/Implies
528===================================================================
529--- /dev/null
530+++ libc/sysdeps/unix/sysv/linux/powerpc/powerpc64/e5500/fpu/Implies
531@@ -0,0 +1 @@
532+powerpc/powerpc64/e5500/fpu
533Index: libc/sysdeps/unix/sysv/linux/powerpc/powerpc32/e5500/fpu/Implies
534===================================================================
535--- /dev/null
536+++ libc/sysdeps/unix/sysv/linux/powerpc/powerpc32/e5500/fpu/Implies
537@@ -0,0 +1 @@
538+powerpc/powerpc32/603e/fpu
diff --git a/meta/recipes-core/eglibc/eglibc-2.15/ppc-sqrt_finite.patch b/meta/recipes-core/eglibc/eglibc-2.15/ppc-sqrt_finite.patch
new file mode 100644
index 0000000000..52890510ce
--- /dev/null
+++ b/meta/recipes-core/eglibc/eglibc-2.15/ppc-sqrt_finite.patch
@@ -0,0 +1,112 @@
1on ppc fixes the errors like below
2| ./.libs/libpulsecore-1.1.so: undefined reference to `__sqrt_finite'
3| collect2: ld returned 1 exit status
4
5Upstream-Status: Pending
6
7ChangeLog
8
92012-01-06 Khem Raj <raj.khem@gmail.com>
10
11 * sysdeps/powerpc/powerpc64/e5500/fpu/e_sqrtf.c: Add __*_finite alias.
12 Remove cruft.
13 * sysdeps/powerpc/powerpc64/e5500/fpu/e_sqrt.c: Ditto.
14 * sysdeps/powerpc/powerpc32/603e/fpu/e_sqrt.c: Ditto.
15 * sysdeps/powerpc/powerpc32/603e/fpu/e_sqrtf.c: Ditto.
16
17Index: libc/sysdeps/powerpc/powerpc32/603e/fpu/e_sqrt.c
18===================================================================
19--- libc.orig/sysdeps/powerpc/powerpc32/603e/fpu/e_sqrt.c 2012-01-06 18:07:42.296909187 -0800
20+++ libc/sysdeps/powerpc/powerpc32/603e/fpu/e_sqrt.c 2012-01-06 18:09:22.572914856 -0800
21@@ -39,14 +39,8 @@
22 We find the actual square root and half of its reciprocal
23 simultaneously. */
24
25-#ifdef __STDC__
26 double
27 __ieee754_sqrt (double b)
28-#else
29-double
30-__ieee754_sqrt (b)
31- double b;
32-#endif
33 {
34 if (__builtin_expect (b > 0, 1))
35 {
36@@ -132,3 +126,4 @@
37 }
38 return f_wash (b);
39 }
40+strong_alias (__ieee754_sqrt, __sqrt_finite)
41Index: libc/sysdeps/powerpc/powerpc32/603e/fpu/e_sqrtf.c
42===================================================================
43--- libc.orig/sysdeps/powerpc/powerpc32/603e/fpu/e_sqrtf.c 2012-01-06 18:10:37.068917644 -0800
44+++ libc/sysdeps/powerpc/powerpc32/603e/fpu/e_sqrtf.c 2012-01-06 18:11:33.408920635 -0800
45@@ -37,14 +37,8 @@
46 We find the reciprocal square root and use that to compute the actual
47 square root. */
48
49-#ifdef __STDC__
50 float
51 __ieee754_sqrtf (float b)
52-#else
53-float
54-__ieee754_sqrtf (b)
55- float b;
56-#endif
57 {
58 if (__builtin_expect (b > 0, 1))
59 {
60@@ -99,3 +93,4 @@
61 }
62 return f_washf (b);
63 }
64+strong_alias (__ieee754_sqrtf, __sqrtf_finite)
65Index: libc/sysdeps/powerpc/powerpc64/e5500/fpu/e_sqrt.c
66===================================================================
67--- libc.orig/sysdeps/powerpc/powerpc64/e5500/fpu/e_sqrt.c 2012-01-06 18:11:51.460925644 -0800
68+++ libc/sysdeps/powerpc/powerpc64/e5500/fpu/e_sqrt.c 2012-01-06 18:12:39.344924405 -0800
69@@ -39,14 +39,8 @@
70 We find the actual square root and half of its reciprocal
71 simultaneously. */
72
73-#ifdef __STDC__
74 double
75 __ieee754_sqrt (double b)
76-#else
77-double
78-__ieee754_sqrt (b)
79- double b;
80-#endif
81 {
82 if (__builtin_expect (b > 0, 1))
83 {
84@@ -132,3 +126,4 @@
85 }
86 return f_wash (b);
87 }
88+strong_alias (__ieee754_sqrt, __sqrt_finite)
89Index: libc/sysdeps/powerpc/powerpc64/e5500/fpu/e_sqrtf.c
90===================================================================
91--- libc.orig/sysdeps/powerpc/powerpc64/e5500/fpu/e_sqrtf.c 2012-01-06 18:13:00.892924586 -0800
92+++ libc/sysdeps/powerpc/powerpc64/e5500/fpu/e_sqrtf.c 2012-01-06 18:15:27.992931106 -0800
93@@ -37,14 +37,8 @@
94 We find the reciprocal square root and use that to compute the actual
95 square root. */
96
97-#ifdef __STDC__
98 float
99 __ieee754_sqrtf (float b)
100-#else
101-float
102-__ieee754_sqrtf (b)
103- float b;
104-#endif
105 {
106 if (__builtin_expect (b > 0, 1))
107 {
108@@ -99,3 +93,4 @@
109 }
110 return f_washf (b);
111 }
112+strong_alias (__ieee754_sqrtf, __sqrtf_finite)
diff --git a/meta/recipes-core/eglibc/eglibc-2.15/stack-protector-test.patch b/meta/recipes-core/eglibc/eglibc-2.15/stack-protector-test.patch
new file mode 100644
index 0000000000..dbf70a974f
--- /dev/null
+++ b/meta/recipes-core/eglibc/eglibc-2.15/stack-protector-test.patch
@@ -0,0 +1,35 @@
1Test for -fstack-protector is compile only test. One might have the option but
2might have build the compiler with --disable-ssp which means ssp should not be
3enabled. Therefore we change the test to a link time test. It will fail if
4libssp is not available.
5
6Upstream-Status: Pending
7
8Signed-off-by: Khem Raj <raj.khem@gmail.com>
9
10Index: libc/configure
11===================================================================
12--- libc.orig/configure
13+++ libc/configure
14@@ -6937,7 +6937,7 @@ if test "${libc_cv_ssp+set}" = set; then
15 $as_echo_n "(cached) " >&6
16 else
17 if { ac_try='${CC-cc} $CFLAGS $CPPFLAGS -Werror -fstack-protector
18- -o /dev/null -c -x c /dev/null 1>&5'
19+ -o /dev/null -x c /dev/null 1>&5'
20 { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
21 (eval $ac_try) 2>&5
22 ac_status=$?
23Index: libc/configure.in
24===================================================================
25--- libc.orig/configure.in
26+++ libc/configure.in
27@@ -1787,7 +1787,7 @@ AC_SUBST(fno_unit_at_a_time)
28
29 AC_CACHE_CHECK(for -fstack-protector, libc_cv_ssp, [dnl
30 if AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS -Werror -fstack-protector
31- -o /dev/null -c -x c /dev/null 1>&AS_MESSAGE_LOG_FD])
32+ -o /dev/null -x c /dev/null 1>&AS_MESSAGE_LOG_FD])
33 then
34 libc_cv_ssp=yes
35 else
diff --git a/meta/recipes-core/eglibc/eglibc-2.15/use-sysroot-cxx-headers.patch b/meta/recipes-core/eglibc/eglibc-2.15/use-sysroot-cxx-headers.patch
new file mode 100644
index 0000000000..7f8225371c
--- /dev/null
+++ b/meta/recipes-core/eglibc/eglibc-2.15/use-sysroot-cxx-headers.patch
@@ -0,0 +1,42 @@
1build system of glibc currently adds the cxx headers path by detecting
2it using provided CXX and expects that they are installed w.r.t to standard
3installation location but in OE we install and use cxx headers from target
4sysroot therefore that code needs to be adapted for OE
5
6Upstream-Status: Inappropriate [OE-specific]
7
8-Khem
9
10
11--- a/configure.in
12+++ b/configure.in
13@@ -1094,11 +1094,10 @@ if test -n "$sysheaders"; then
14 -isystem `echo $sysheaders | sed 's/:/ -isystem /g'`"
15 if test -n "$CXX"; then
16 CXX_SYSINCLUDES=
17- cxxversion=`$CXX -dumpversion 2>&AS_MESSAGE_LOG_FD` &&
18 cxxmachine=`$CXX -dumpmachine 2>&AS_MESSAGE_LOG_FD` &&
19 for d in include "$cxxmachine/include"; do
20- i=../../../../$d/c++/$cxxversion
21- cxxheaders=`$CXX -print-file-name="$i"` &&
22+ i="$prefix/$d/c++"
23+ cxxheaders=`$CXX -print-sysroot`"$i" &&
24 test "x$cxxheaders" != x && test "x$i" != "x$cxxheaders" &&
25 CXX_SYSINCLUDES="$CXX_SYSINCLUDES -isystem $cxxheaders \
26 -isystem $cxxheaders/$cxxmachine -isystem $cxxheaders/backward"
27--- a/configure
28+++ b/configure
29@@ -5618,11 +5618,10 @@ if test -n "$sysheaders"; then
30 -isystem `echo $sysheaders | sed 's/:/ -isystem /g'`"
31 if test -n "$CXX"; then
32 CXX_SYSINCLUDES=
33- cxxversion=`$CXX -dumpversion 2>&5` &&
34 cxxmachine=`$CXX -dumpmachine 2>&5` &&
35 for d in include "$cxxmachine/include"; do
36- i=../../../../$d/c++/$cxxversion
37- cxxheaders=`$CXX -print-file-name="$i"` &&
38+ i="$prefix/$d/c++"
39+ cxxheaders=`$CXX -print-sysroot`"$i" &&
40 test "x$cxxheaders" != x && test "x$i" != "x$cxxheaders" &&
41 CXX_SYSINCLUDES="$CXX_SYSINCLUDES -isystem $cxxheaders \
42 -isystem $cxxheaders/$cxxmachine -isystem $cxxheaders/backward"
diff --git a/meta/recipes-core/eglibc/eglibc-2.15/x86_fenv.patch b/meta/recipes-core/eglibc/eglibc-2.15/x86_fenv.patch
new file mode 100644
index 0000000000..40c1c4d67e
--- /dev/null
+++ b/meta/recipes-core/eglibc/eglibc-2.15/x86_fenv.patch
@@ -0,0 +1,29 @@
1--- a/sysdeps/x86_64/fpu/bits/fenv.h
2+++ b/sysdeps/x86_64/fpu/bits/fenv.h
3@@ -112,16 +112,24 @@ __NTH (feraiseexcept (int __excepts))
4 {
5 /* One example of a invalid operation is 0.0 / 0.0. */
6 float __f = 0.0;
7-
8+# if defined __SSE_MATH__ || __WORDSIZE == 64
9 __asm__ __volatile__ ("divss %0, %0 " : : "x" (__f));
10+# else
11+ __asm__ __volatile__ ("fdiv %%st, %%st(0); fwait"
12+ : "=t" (__f) : "0" (__f));
13+# endif
14 (void) &__f;
15 }
16 if ((FE_DIVBYZERO & __excepts) != 0)
17 {
18 float __f = 1.0;
19 float __g = 0.0;
20-
21+# if defined __SSE_MATH__ || __WORDSIZE == 64
22 __asm__ __volatile__ ("divss %1, %0" : : "x" (__f), "x" (__g));
23+# else
24+ __asm__ __volatile__ ("fdivp %%st(1), %%st; fwait"
25+ : "=t" (__f) : "0" (__f), "u" (__g) : "st(1)");
26+# endif
27 (void) &__f;
28 }
29