summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKhem Raj <raj.khem@gmail.com>2012-07-03 23:58:29 -0700
committerRichard Purdie <richard.purdie@linuxfoundation.org>2012-07-17 10:54:03 +0100
commit83dda47b2e8ed8eafa9efb97d12a6ea201522c2f (patch)
treea72c3e995418f0f0c6806dc46ef21373bf37e437
parent85e5f2d8ac4e4096b5f4dbf4c5cb66680777d54d (diff)
downloadpoky-83dda47b2e8ed8eafa9efb97d12a6ea201522c2f.tar.gz
eglibc: Add recipes for 2.16 release
Drop the patches that were either applied or fixed differenly in 2.16 Add patches to fix ppc spe patches to match eglibc 2.16 Fix CPPFLAGS to contain correct includepaths so autoconf cache is generated correctly (From OE-Core rev: 705fe4dab44e623350fc32efece87a977d53bfc4) Signed-off-by: Khem Raj <raj.khem@gmail.com> Signed-off-by: Saul Wold <sgw@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--meta/recipes-core/eglibc/cross-localedef-native_2.16.bb44
-rw-r--r--meta/recipes-core/eglibc/eglibc-2.16/GLRO_dl_debug_mask.patch108
-rw-r--r--meta/recipes-core/eglibc/eglibc-2.16/IO-acquire-lock-fix.patch17
-rw-r--r--meta/recipes-core/eglibc/eglibc-2.16/eglibc-svn-arm-lowlevellock-include-tls.patch21
-rw-r--r--meta/recipes-core/eglibc/eglibc-2.16/eglibc_fix_findidx_parameters.patch38
-rw-r--r--meta/recipes-core/eglibc/eglibc-2.16/etc/ld.so.conf0
-rw-r--r--meta/recipes-core/eglibc/eglibc-2.16/generate-supported.mk11
-rw-r--r--meta/recipes-core/eglibc/eglibc-2.16/initgroups_keys.patch20
-rw-r--r--meta/recipes-core/eglibc/eglibc-2.16/ld-search-order.patch56
-rw-r--r--meta/recipes-core/eglibc/eglibc-2.16/mips-rld-map-check.patch26
-rw-r--r--meta/recipes-core/eglibc/eglibc-2.16/multilib_readlib.patch17
-rw-r--r--meta/recipes-core/eglibc/eglibc-2.16/ppc-sqrt.patch538
-rw-r--r--meta/recipes-core/eglibc/eglibc-2.16/ppc-sqrt_finite.patch112
-rw-r--r--meta/recipes-core/eglibc/eglibc-2.16/ppc_slow_ieee754_sqrt.patch123
-rw-r--r--meta/recipes-core/eglibc/eglibc-2.16/rpc-bootstrap.patch63
-rw-r--r--meta/recipes-core/eglibc/eglibc-2.16/use-sysroot-cxx-headers.patch42
-rw-r--r--meta/recipes-core/eglibc/eglibc-initial_2.16.bb6
-rw-r--r--meta/recipes-core/eglibc/eglibc-locale_2.16.bb1
-rw-r--r--meta/recipes-core/eglibc/eglibc_2.16.bb146
19 files changed, 1389 insertions, 0 deletions
diff --git a/meta/recipes-core/eglibc/cross-localedef-native_2.16.bb b/meta/recipes-core/eglibc/cross-localedef-native_2.16.bb
new file mode 100644
index 0000000000..88c701ebc9
--- /dev/null
+++ b/meta/recipes-core/eglibc/cross-localedef-native_2.16.bb
@@ -0,0 +1,44 @@
1DESCRIPTION = "Cross locale generation tool for eglibc"
2HOMEPAGE = "http://www.eglibc.org/home"
3SECTION = "libs"
4LICENSE = "LGPL-2.1"
5
6LIC_DIR = "${WORKDIR}/${EGLIBC_BRANCH}/libc"
7LIC_FILES_CHKSUM = "file://${LIC_DIR}/LICENSES;md5=98a1128c4b58120182cbea3b1752d8b9\
8 file://${LIC_DIR}/COPYING;md5=393a5ca445f6965873eca0259a17f833 \
9 file://${LIC_DIR}/posix/rxspencer/COPYRIGHT;md5=dc5485bb394a13b2332ec1c785f5d83a \
10 file://${LIC_DIR}/COPYING.LIB;md5=bbb461211a33b134d42ed5ee802b37ff "
11
12
13inherit native
14inherit autotools
15
16PR = "r0"
17SRCREV="19383"
18EGLIBC_BRANCH="eglibc-2_16"
19SRC_URI = "svn://www.eglibc.org/svn/branches/;module=${EGLIBC_BRANCH};proto=http "
20S = "${WORKDIR}/${EGLIBC_BRANCH}/localedef"
21
22do_unpack_append() {
23 bb.build.exec_func('do_move_ports', d)
24}
25
26do_move_ports() {
27 if test -d ${WORKDIR}/${EGLIBC_BRANCH}/ports ; then
28 rm -rf ${WORKDIR}/libc/ports
29 mv ${WORKDIR}/${EGLIBC_BRANCH}/ports ${WORKDIR}/libc/
30 fi
31}
32
33EXTRA_OECONF = "--with-glibc=${WORKDIR}/${EGLIBC_BRANCH}/libc"
34CFLAGS += "-DNOT_IN_libc=1"
35
36do_configure () {
37 ./configure ${EXTRA_OECONF}
38}
39
40
41do_install() {
42 install -d ${D}${bindir}
43 install -m 0755 ${S}/localedef ${D}${bindir}/cross-localedef
44}
diff --git a/meta/recipes-core/eglibc/eglibc-2.16/GLRO_dl_debug_mask.patch b/meta/recipes-core/eglibc/eglibc-2.16/GLRO_dl_debug_mask.patch
new file mode 100644
index 0000000000..b8995625aa
--- /dev/null
+++ b/meta/recipes-core/eglibc/eglibc-2.16/GLRO_dl_debug_mask.patch
@@ -0,0 +1,108 @@
1Its controlled by __OPTION_EGLIBC_RTLD_DEBUG
2so we should use GLRO_dl_debug_mask
3
4Singed-off-by: Khem Raj <raj.khem@gmail.com>
5
6Upstream-Status: Pending
7Index: libc/elf/dl-open.c
8===================================================================
9--- libc.orig/elf/dl-open.c 2012-03-09 08:54:34.691443995 -0800
10+++ libc/elf/dl-open.c 2012-03-09 08:55:31.275446730 -0800
11@@ -154,7 +154,7 @@
12 ns->_ns_main_searchlist->r_list[new_nlist++] = map;
13
14 /* We modify the global scope. Report this. */
15- if (__builtin_expect (GLRO(dl_debug_mask) & DL_DEBUG_SCOPES, 0))
16+ if (__builtin_expect (GLRO_dl_debug_mask & DL_DEBUG_SCOPES, 0))
17 _dl_debug_printf ("\nadd %s [%lu] to global scope\n",
18 map->l_name, map->l_ns);
19 }
20@@ -294,7 +294,7 @@
21 _dl_debug_state ();
22
23 /* Print scope information. */
24- if (__builtin_expect (GLRO(dl_debug_mask) & DL_DEBUG_SCOPES, 0))
25+ if (__builtin_expect (GLRO_dl_debug_mask & DL_DEBUG_SCOPES, 0))
26 _dl_show_scope (new, 0);
27
28 /* Only do lazy relocation if `LD_BIND_NOW' is not set. */
29@@ -438,7 +438,7 @@
30 }
31
32 /* Print scope information. */
33- if (__builtin_expect (GLRO(dl_debug_mask) & DL_DEBUG_SCOPES, 0))
34+ if (__builtin_expect (GLRO_dl_debug_mask & DL_DEBUG_SCOPES, 0))
35 _dl_show_scope (imap, from_scope);
36 }
37
38Index: libc/ports/sysdeps/mips/dl-lookup.c
39===================================================================
40--- libc.orig/ports/sysdeps/mips/dl-lookup.c 2012-03-09 08:54:34.707443996 -0800
41+++ libc/ports/sysdeps/mips/dl-lookup.c 2012-03-09 09:02:36.903467324 -0800
42@@ -111,7 +111,7 @@
43 continue;
44
45 /* Print some debugging info if wanted. */
46- if (__builtin_expect (GLRO(dl_debug_mask) & DL_DEBUG_SYMBOLS, 0))
47+ if (__builtin_expect (GLRO_dl_debug_mask & DL_DEBUG_SYMBOLS, 0))
48 _dl_debug_printf ("symbol=%s; lookup in file=%s [%lu]\n",
49 undef_name,
50 map->l_name[0] ? map->l_name : rtld_progname,
51@@ -432,7 +432,7 @@
52 hash table. */
53 if (__builtin_expect (tab->size, 0))
54 {
55- assert (GLRO(dl_debug_mask) & DL_DEBUG_PRELINK);
56+ assert (GLRO_dl_debug_mask & DL_DEBUG_PRELINK);
57 __rtld_lock_unlock_recursive (tab->lock);
58 goto success;
59 }
60@@ -681,7 +681,7 @@
61 }
62
63 /* Display information if we are debugging. */
64- if (__builtin_expect (GLRO(dl_debug_mask) & DL_DEBUG_FILES, 0))
65+ if (__builtin_expect (GLRO_dl_debug_mask & DL_DEBUG_FILES, 0))
66 _dl_debug_printf ("\
67 \nfile=%s [%lu]; needed by %s [%lu] (relocation dependency)\n\n",
68 map->l_name[0] ? map->l_name : rtld_progname,
69@@ -860,7 +860,7 @@
70 if (__builtin_expect (current_value.m->l_used == 0, 0))
71 current_value.m->l_used = 1;
72
73- if (__builtin_expect (GLRO(dl_debug_mask)
74+ if (__builtin_expect (GLRO_dl_debug_mask
75 & (DL_DEBUG_BINDINGS|DL_DEBUG_PRELINK), 0))
76 _dl_debug_bindings (undef_name, undef_map, ref,
77 &current_value, version, type_class, protected);
78@@ -925,7 +925,7 @@
79 {
80 const char *reference_name = undef_map->l_name;
81
82- if (GLRO(dl_debug_mask) & DL_DEBUG_BINDINGS)
83+ if (GLRO_dl_debug_mask & DL_DEBUG_BINDINGS)
84 {
85 _dl_debug_printf ("binding file %s [%lu] to %s [%lu]: %s symbol `%s'",
86 (reference_name[0]
87@@ -941,7 +941,7 @@
88 _dl_debug_printf_c ("\n");
89 }
90 #ifdef SHARED
91- if (GLRO(dl_debug_mask) & DL_DEBUG_PRELINK)
92+ if (GLRO_dl_debug_mask & DL_DEBUG_PRELINK)
93 {
94 int conflict = 0;
95 struct sym_val val = { NULL, NULL };
96Index: libc/elf/rtld.c
97===================================================================
98--- libc.orig/elf/rtld.c 2012-03-09 09:01:35.159464344 -0800
99+++ libc/elf/rtld.c 2012-03-09 09:01:56.247465364 -0800
100@@ -2198,7 +2198,7 @@
101 GLRO(dl_init_all_dirs) = GL(dl_all_dirs);
102
103 /* Print scope information. */
104- if (__builtin_expect (GLRO(dl_debug_mask) & DL_DEBUG_SCOPES, 0))
105+ if (__builtin_expect (GLRO_dl_debug_mask & DL_DEBUG_SCOPES, 0))
106 {
107 _dl_debug_printf ("\nInitial object scopes\n");
108
diff --git a/meta/recipes-core/eglibc/eglibc-2.16/IO-acquire-lock-fix.patch b/meta/recipes-core/eglibc/eglibc-2.16/IO-acquire-lock-fix.patch
new file mode 100644
index 0000000000..cf5803585c
--- /dev/null
+++ b/meta/recipes-core/eglibc/eglibc-2.16/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.16/eglibc-svn-arm-lowlevellock-include-tls.patch b/meta/recipes-core/eglibc/eglibc-2.16/eglibc-svn-arm-lowlevellock-include-tls.patch
new file mode 100644
index 0000000000..4313aa5197
--- /dev/null
+++ b/meta/recipes-core/eglibc/eglibc-2.16/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.16/eglibc_fix_findidx_parameters.patch b/meta/recipes-core/eglibc/eglibc-2.16/eglibc_fix_findidx_parameters.patch
new file mode 100644
index 0000000000..bbf4605505
--- /dev/null
+++ b/meta/recipes-core/eglibc/eglibc-2.16/eglibc_fix_findidx_parameters.patch
@@ -0,0 +1,38 @@
1Upstream-Status: backport
2
3Imported patch from: http://www.eglibc.org/archives/patches/msg01124.html
4
5Signed-Off-By: Nitin A Kamble <nitin.a.kamble@intel.com>
62012/05/09
7
8Index: libc/posix/xregex.c
9===================================================================
10--- libc.orig/posix/xregex.c
11+++ libc/posix/xregex.c
12@@ -2943,7 +2943,7 @@ PREFIX(regex_compile) (const char *ARG_P
13 _NL_CURRENT (LC_COLLATE,
14 _NL_COLLATE_INDIRECTWC);
15
16- idx = findidx ((const wint_t**)&cp);
17+ idx = findidx ((const wint_t**)&cp, -1);
18 if (idx == 0 || cp < (wint_t*) str + c1)
19 /* This is no valid character. */
20 FREE_STACK_RETURN (REG_ECOLLATE);
21@@ -3392,7 +3392,7 @@ PREFIX(regex_compile) (const char *ARG_P
22 indirect = (const int32_t *)
23 _NL_CURRENT (LC_COLLATE, _NL_COLLATE_INDIRECTMB);
24
25- idx = findidx (&cp);
26+ idx = findidx (&cp, -1);
27 if (idx == 0 || cp < str + c1)
28 /* This is no valid character. */
29 FREE_STACK_RETURN (REG_ECOLLATE);
30@@ -6363,7 +6363,7 @@ byte_re_match_2_internal (struct re_patt
31 }
32 str_buf[i] = TRANSLATE(*(d+i));
33 str_buf[i+1] = '\0'; /* sentinel */
34- idx2 = findidx ((const wint_t**)&cp);
35+ idx2 = findidx ((const wint_t**)&cp, -1);
36 }
37
38 /* Update d, however d will be incremented at
diff --git a/meta/recipes-core/eglibc/eglibc-2.16/etc/ld.so.conf b/meta/recipes-core/eglibc/eglibc-2.16/etc/ld.so.conf
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/meta/recipes-core/eglibc/eglibc-2.16/etc/ld.so.conf
diff --git a/meta/recipes-core/eglibc/eglibc-2.16/generate-supported.mk b/meta/recipes-core/eglibc/eglibc-2.16/generate-supported.mk
new file mode 100644
index 0000000000..d2a28c2dc6
--- /dev/null
+++ b/meta/recipes-core/eglibc/eglibc-2.16/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.16/initgroups_keys.patch b/meta/recipes-core/eglibc/eglibc-2.16/initgroups_keys.patch
new file mode 100644
index 0000000000..be29856b03
--- /dev/null
+++ b/meta/recipes-core/eglibc/eglibc-2.16/initgroups_keys.patch
@@ -0,0 +1,20 @@
1This is needed since initgroups belongs to NET group
2so when NET is disabled in eglibc build then it reports
3as undefined symbol
4
5Signed-off-by: Khem Raj <raj.khem@gmail.com>
6Upstream-Status: Pending
7
8Index: libc/nss/getent.c
9===================================================================
10--- libc.orig/nss/getent.c 2012-03-09 09:41:57.099581559 -0800
11+++ libc/nss/getent.c 2012-03-09 09:42:13.095582334 -0800
12@@ -898,7 +898,7 @@
13 D(group)
14 D(gshadow)
15 DN(hosts)
16-D(initgroups)
17+DN(initgroups)
18 DN(netgroup)
19 DN(networks)
20 D(passwd)
diff --git a/meta/recipes-core/eglibc/eglibc-2.16/ld-search-order.patch b/meta/recipes-core/eglibc/eglibc-2.16/ld-search-order.patch
new file mode 100644
index 0000000000..40ae6d37f4
--- /dev/null
+++ b/meta/recipes-core/eglibc/eglibc-2.16/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.16/mips-rld-map-check.patch b/meta/recipes-core/eglibc/eglibc-2.16/mips-rld-map-check.patch
new file mode 100644
index 0000000000..9b646fea95
--- /dev/null
+++ b/meta/recipes-core/eglibc/eglibc-2.16/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.16/multilib_readlib.patch b/meta/recipes-core/eglibc/eglibc-2.16/multilib_readlib.patch
new file mode 100644
index 0000000000..1542b1b519
--- /dev/null
+++ b/meta/recipes-core/eglibc/eglibc-2.16/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.16/ppc-sqrt.patch b/meta/recipes-core/eglibc/eglibc-2.16/ppc-sqrt.patch
new file mode 100644
index 0000000000..203040c15c
--- /dev/null
+++ b/meta/recipes-core/eglibc/eglibc-2.16/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.16/ppc-sqrt_finite.patch b/meta/recipes-core/eglibc/eglibc-2.16/ppc-sqrt_finite.patch
new file mode 100644
index 0000000000..52890510ce
--- /dev/null
+++ b/meta/recipes-core/eglibc/eglibc-2.16/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.16/ppc_slow_ieee754_sqrt.patch b/meta/recipes-core/eglibc/eglibc-2.16/ppc_slow_ieee754_sqrt.patch
new file mode 100644
index 0000000000..9a932ff0d7
--- /dev/null
+++ b/meta/recipes-core/eglibc/eglibc-2.16/ppc_slow_ieee754_sqrt.patch
@@ -0,0 +1,123 @@
1 __ieee754_sqrt{,f} are now inline functions and call out __slow versions
2
3
4Signed-off-by: Khem Raj <raj.khem@gmail.com>
5Upstream-Status: Pending
6Index: libc/sysdeps/powerpc/powerpc32/603e/fpu/e_sqrt.c
7===================================================================
8--- libc.orig/sysdeps/powerpc/powerpc32/603e/fpu/e_sqrt.c 2012-07-03 22:36:01.172386436 -0700
9+++ libc/sysdeps/powerpc/powerpc32/603e/fpu/e_sqrt.c 2012-07-03 23:04:37.396469515 -0700
10@@ -40,7 +40,7 @@
11 simultaneously. */
12
13 double
14-__ieee754_sqrt (double b)
15+__slow_ieee754_sqrt (double b)
16 {
17 if (__builtin_expect (b > 0, 1))
18 {
19@@ -77,7 +77,7 @@
20
21 /* Handle small numbers by scaling. */
22 if (__builtin_expect ((u.parts.msw & 0x7ff00000) <= 0x02000000, 0))
23- return __ieee754_sqrt (b * two108) * twom54;
24+ return __slow_ieee754_sqrt (b * two108) * twom54;
25
26 #define FMADD(a_, c_, b_) \
27 ({ double __r; \
28@@ -126,4 +126,12 @@
29 }
30 return f_wash (b);
31 }
32+
33+#undef __ieee754_sqrt
34+double
35+__ieee754_sqrt (double x)
36+{
37+ return __slow_ieee754_sqrt (x);
38+}
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-07-03 22:36:01.172386436 -0700
44+++ libc/sysdeps/powerpc/powerpc32/603e/fpu/e_sqrtf.c 2012-07-03 23:07:06.260476775 -0700
45@@ -38,7 +38,7 @@
46 square root. */
47
48 float
49-__ieee754_sqrtf (float b)
50+__slow_ieee754_sqrtf (float b)
51 {
52 if (__builtin_expect (b > 0, 1))
53 {
54@@ -93,4 +93,10 @@
55 }
56 return f_washf (b);
57 }
58+#undef __ieee754_sqrtf
59+float
60+__ieee754_sqrtf (float x)
61+{
62+ return __slow_ieee754_sqrtf (x);
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-07-03 22:36:01.176386435 -0700
68+++ libc/sysdeps/powerpc/powerpc64/e5500/fpu/e_sqrt.c 2012-07-03 23:14:16.328497458 -0700
69@@ -40,7 +40,7 @@
70 simultaneously. */
71
72 double
73-__ieee754_sqrt (double b)
74+__slow_ieee754_sqrt (double b)
75 {
76 if (__builtin_expect (b > 0, 1))
77 {
78@@ -77,7 +77,7 @@
79
80 /* Handle small numbers by scaling. */
81 if (__builtin_expect ((u.parts.msw & 0x7ff00000) <= 0x02000000, 0))
82- return __ieee754_sqrt (b * two108) * twom54;
83+ return __slow_ieee754_sqrt (b * two108) * twom54;
84
85 #define FMADD(a_, c_, b_) \
86 ({ double __r; \
87@@ -126,4 +126,12 @@
88 }
89 return f_wash (b);
90 }
91+
92+#undef __ieee754_sqrt
93+double
94+__ieee754_sqrt (double x)
95+{
96+ return __slow_ieee754_sqrt (x);
97+}
98+
99 strong_alias (__ieee754_sqrt, __sqrt_finite)
100Index: libc/sysdeps/powerpc/powerpc64/e5500/fpu/e_sqrtf.c
101===================================================================
102--- libc.orig/sysdeps/powerpc/powerpc64/e5500/fpu/e_sqrtf.c 2012-07-03 22:36:01.176386435 -0700
103+++ libc/sysdeps/powerpc/powerpc64/e5500/fpu/e_sqrtf.c 2012-07-03 23:13:52.732496373 -0700
104@@ -38,7 +38,7 @@
105 square root. */
106
107 float
108-__ieee754_sqrtf (float b)
109+__slow_ieee754_sqrtf (float b)
110 {
111 if (__builtin_expect (b > 0, 1))
112 {
113@@ -93,4 +93,10 @@
114 }
115 return f_washf (b);
116 }
117+#undef __ieee754_sqrtf
118+float
119+__ieee754_sqrtf (float x)
120+{
121+ return __slow_ieee754_sqrtf (x);
122+}
123 strong_alias (__ieee754_sqrtf, __sqrtf_finite)
diff --git a/meta/recipes-core/eglibc/eglibc-2.16/rpc-bootstrap.patch b/meta/recipes-core/eglibc/eglibc-2.16/rpc-bootstrap.patch
new file mode 100644
index 0000000000..130a816f62
--- /dev/null
+++ b/meta/recipes-core/eglibc/eglibc-2.16/rpc-bootstrap.patch
@@ -0,0 +1,63 @@
1Upstream-Status: Pending
2Signed-off-by: Khem Raj <raj.khem@gmail.com>
3
4
5From libc-alpha-return-31199-listarch-libc-alpha=sources dot redhat dot com at sourceware dot org Tue Jul 03 19:54:27 2012
6Return-Path: <libc-alpha-return-31199-listarch-libc-alpha=sources dot redhat dot com at sourceware dot org>
7Delivered-To: listarch-libc-alpha at sources dot redhat dot com
8Received: (qmail 20151 invoked by alias); 3 Jul 2012 19:54:25 -0000
9Received: (qmail 20139 invoked by uid 22791); 3 Jul 2012 19:54:23 -0000
10X-SWARE-Spam-Status: No, hits=-4.8 required=5.0
11 tests=AWL,BAYES_00,KHOP_RCVD_UNTRUST,RCVD_IN_DNSWL_HI,RCVD_IN_HOSTKARMA_W,T_RP_MATCHES_RCVD
12X-Spam-Check-By: sourceware.org
13From: Mike Frysinger <vapier at gentoo dot org>
14To: libc-alpha at sourceware dot org
15Subject: [PATCH] sunrpc: fix rpc bootstrap builds
16Date: Tue, 3 Jul 2012 15:54:11 -0400
17Message-Id: <1341345251-31730-1-git-send-email-vapier@gentoo.org>
18Mailing-List: contact libc-alpha-help at sourceware dot org; run by ezmlm
19Precedence: bulk
20List-Id: <libc-alpha.sourceware.org>
21List-Subscribe: <mailto:libc-alpha-subscribe at sourceware dot org>
22List-Archive: <http://sourceware.org/ml/libc-alpha/>
23List-Post: <mailto:libc-alpha at sourceware dot org>
24List-Help: <mailto:libc-alpha-help at sourceware dot org>, <http://sourceware dot org/ml/#faqs>
25Sender: libc-alpha-owner at sourceware dot org
26Delivered-To: mailing list libc-alpha at sourceware dot org
27
28If you build & install glibc w/rpc disabled, you no longer have headers in
29/usr/include/rpc/ (this is expected). But if you try to build glibc w/rpc
30enabled, this gets into a bad state due to the new rpc helpers that get
31cross-compiled:
32
33$ make
34...
35x86_64-pc-linux-gnu-gcc -m32 -D_RPC_THREAD_SAFE_ -D_GNU_SOURCE -DIS_IN_build \
36 -include $objdir/config.h rpc_clntout.c -o $objdir/sunrpc/cross-rpc_clntout.o \
37 -MMD -MP -MF $objdir/sunrpc/cross-rpc_clntout.o.dt -MT $objdir/sunrpc/cross-rpc_clntout.o -c
38rpc_clntout.c:34:23: fatal error: rpc/types.h: No such file or directory
39compilation terminated.
40make: *** [$objdir/sunrpc/cross-rpc_clntout.o] Error 1
41
42Signed-off-by: Mike Frysinger <vapier@gentoo.org>
43
442012-07-03 Mike Frysinger <vapier@gentoo.org>
45
46 * sunrpc/rpc_clntout.c: Change <rpc/types.h> to "rpc/types.h".
47---
48 sunrpc/rpc_clntout.c | 2 +-
49 1 file changed, 1 insertion(+), 1 deletion(-)
50
51Index: libc/sunrpc/rpc_clntout.c
52===================================================================
53--- libc.orig/sunrpc/rpc_clntout.c 2012-07-04 16:09:16.000000000 -0700
54+++ libc/sunrpc/rpc_clntout.c 2012-07-04 18:04:34.498085075 -0700
55@@ -31,7 +31,7 @@
56 */
57 #include <stdio.h>
58 #include <string.h>
59-#include <rpc/types.h>
60+#include "rpc/types.h"
61 #include "rpc_parse.h"
62 #include "rpc_util.h"
63 #include "proto.h"
diff --git a/meta/recipes-core/eglibc/eglibc-2.16/use-sysroot-cxx-headers.patch b/meta/recipes-core/eglibc/eglibc-2.16/use-sysroot-cxx-headers.patch
new file mode 100644
index 0000000000..7f8225371c
--- /dev/null
+++ b/meta/recipes-core/eglibc/eglibc-2.16/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-initial_2.16.bb b/meta/recipes-core/eglibc/eglibc-initial_2.16.bb
new file mode 100644
index 0000000000..787c762609
--- /dev/null
+++ b/meta/recipes-core/eglibc/eglibc-initial_2.16.bb
@@ -0,0 +1,6 @@
1require eglibc_${PV}.bb
2require eglibc-initial.inc
3
4do_configure_prepend () {
5 unset CFLAGS
6}
diff --git a/meta/recipes-core/eglibc/eglibc-locale_2.16.bb b/meta/recipes-core/eglibc/eglibc-locale_2.16.bb
new file mode 100644
index 0000000000..ce6c1d2320
--- /dev/null
+++ b/meta/recipes-core/eglibc/eglibc-locale_2.16.bb
@@ -0,0 +1 @@
require eglibc-locale.inc
diff --git a/meta/recipes-core/eglibc/eglibc_2.16.bb b/meta/recipes-core/eglibc/eglibc_2.16.bb
new file mode 100644
index 0000000000..09f5dbbe05
--- /dev/null
+++ b/meta/recipes-core/eglibc/eglibc_2.16.bb
@@ -0,0 +1,146 @@
1require eglibc.inc
2
3SRCREV = "19383"
4
5DEPENDS += "gperf-native"
6PR = "r0"
7PR_append = "+svnr${SRCPV}"
8
9EGLIBC_BRANCH="eglibc-2_16"
10SRC_URI = "svn://www.eglibc.org/svn/branches/;module=${EGLIBC_BRANCH};protocol=http \
11 file://eglibc-svn-arm-lowlevellock-include-tls.patch \
12 file://IO-acquire-lock-fix.patch \
13 file://mips-rld-map-check.patch \
14 file://etc/ld.so.conf \
15 file://generate-supported.mk \
16 file://ppc-sqrt.patch \
17 file://multilib_readlib.patch \
18 file://use-sysroot-cxx-headers.patch \
19 file://ppc-sqrt_finite.patch \
20 file://GLRO_dl_debug_mask.patch \
21 file://initgroups_keys.patch \
22 file://eglibc_fix_findidx_parameters.patch \
23 file://ppc_slow_ieee754_sqrt.patch \
24 file://rpc-bootstrap.patch \
25 "
26LIC_FILES_CHKSUM = "file://LICENSES;md5=98a1128c4b58120182cbea3b1752d8b9 \
27 file://COPYING;md5=393a5ca445f6965873eca0259a17f833 \
28 file://posix/rxspencer/COPYRIGHT;md5=dc5485bb394a13b2332ec1c785f5d83a \
29 file://COPYING.LIB;md5=bbb461211a33b134d42ed5ee802b37ff "
30
31SRC_URI_append_virtclass-nativesdk = " file://ld-search-order.patch"
32S = "${WORKDIR}/${EGLIBC_BRANCH}/libc"
33B = "${WORKDIR}/build-${TARGET_SYS}"
34
35PACKAGES_DYNAMIC = "libc6*"
36RPROVIDES_${PN}-dev = "libc6-dev virtual-libc-dev"
37PROVIDES_${PN}-dbg = "glibc-dbg"
38
39# the -isystem in bitbake.conf screws up glibc do_stage
40BUILD_CPPFLAGS = "-I${STAGING_INCDIR_NATIVE}"
41TARGET_CPPFLAGS = "-I${STAGING_DIR_TARGET}${includedir}"
42
43GLIBC_BROKEN_LOCALES = " _ER _ET so_ET yn_ER sid_ET tr_TR mn_MN gez_ET gez_ER bn_BD te_IN es_CR.ISO-8859-1"
44
45FILESPATH = "${@base_set_filespath([ '${FILE_DIRNAME}/eglibc-${PV}', '${FILE_DIRNAME}/eglibc', '${FILE_DIRNAME}/files', '${FILE_DIRNAME}' ], d)}"
46
47#
48# For now, we will skip building of a gcc package if it is a uclibc one
49# and our build is not a uclibc one, and we skip a glibc one if our build
50# is a uclibc build.
51#
52# See the note in gcc/gcc_3.4.0.oe
53#
54
55python __anonymous () {
56 import bb, re
57 uc_os = (re.match('.*uclibc$', d.getVar('TARGET_OS', True)) != None)
58 if uc_os:
59 raise bb.parse.SkipPackage("incompatible with target %s" %
60 d.getVar('TARGET_OS', True))
61}
62
63export libc_cv_slibdir = "${base_libdir}"
64
65EXTRA_OECONF = "--enable-kernel=${OLDEST_KERNEL} \
66 --without-cvs --disable-profile \
67 --disable-debug --without-gd \
68 --enable-clocale=gnu \
69 --enable-add-ons \
70 --with-headers=${STAGING_INCDIR} \
71 --without-selinux \
72 --enable-obsolete-rpc \
73 ${GLIBC_EXTRA_OECONF}"
74
75EXTRA_OECONF += "${@get_libc_fpu_setting(bb, d)}"
76
77do_unpack_append() {
78 bb.build.exec_func('do_move_ports', d)
79}
80
81do_move_ports() {
82 if test -d ${WORKDIR}/${EGLIBC_BRANCH}/ports ; then
83 rm -rf ${S}/ports
84 mv ${WORKDIR}/${EGLIBC_BRANCH}/ports ${S}/
85 fi
86}
87
88do_patch_append() {
89 bb.build.exec_func('do_fix_readlib_c', d)
90}
91
92# for mips eglibc now builds syscall tables for all abi's
93# so we make sure that we choose right march option which is
94# compatible with o32,n32 and n64 abi's
95# e.g. -march=mips32 is not compatible with n32 and n64 therefore
96# we filter it out in such case -march=from-abi which will be
97# mips1 when using o32 and mips3 when using n32/n64
98
99TUNE_CCARGS_mips := "${@oe_filter_out('-march=mips32', '${TUNE_CCARGS}', d)}"
100TUNE_CCARGS_mipsel := "${@oe_filter_out('-march=mips32', '${TUNE_CCARGS}', d)}"
101
102do_fix_readlib_c () {
103 sed -i -e 's#OECORE_KNOWN_INTERPRETER_NAMES#${EGLIBC_KNOWN_INTERPRETER_NAMES}#' ${S}/elf/readlib.c
104}
105
106do_configure () {
107# override this function to avoid the autoconf/automake/aclocal/autoheader
108# calls for now
109# don't pass CPPFLAGS into configure, since it upsets the kernel-headers
110# version check and doesn't really help with anything
111 if [ -z "`which rpcgen`" ]; then
112 echo "rpcgen not found. Install glibc-devel."
113 exit 1
114 fi
115 (cd ${S} && gnu-configize) || die "failure in running gnu-configize"
116 find ${S} -name "configure" | xargs touch
117 CPPFLAGS="" oe_runconf
118}
119
120rpcsvc = "bootparam_prot.x nlm_prot.x rstat.x \
121 yppasswd.x klm_prot.x rex.x sm_inter.x mount.x \
122 rusers.x spray.x nfs_prot.x rquota.x key_prot.x"
123
124do_compile () {
125 # -Wl,-rpath-link <staging>/lib in LDFLAGS can cause breakage if another glibc is in staging
126 unset LDFLAGS
127 base_do_compile
128 (
129 cd ${S}/sunrpc/rpcsvc
130 for r in ${rpcsvc}; do
131 h=`echo $r|sed -e's,\.x$,.h,'`
132 rpcgen -h $r -o $h || bbwarn "unable to generate header for $r"
133 done
134 )
135 echo "Adjust ldd script"
136 if [ -n "${RTLDLIST}" ]
137 then
138 sed -i ${B}/elf/ldd -e 's#^\(RTLDLIST=\)"\(.*\)"$#\1\2#'
139 sed -i ${B}/elf/ldd -e 's#^\(RTLDLIST=\)\(.*\)$#\1"${RTLDLIST} \2"#'
140 fi
141
142}
143
144require eglibc-package.inc
145
146BBCLASSEXTEND = "nativesdk"