summaryrefslogtreecommitdiffstats
path: root/meta/recipes-core/glibc/glibc
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-core/glibc/glibc')
-rw-r--r--meta/recipes-core/glibc/glibc/0001-localedef-Add-hardlink-resolver-from-util-linux.patch2
-rw-r--r--meta/recipes-core/glibc/glibc/0002-localedef-fix-ups-hardlink-to-make-it-compile.patch2
-rw-r--r--meta/recipes-core/glibc/glibc/0003-nativesdk-glibc-Look-for-host-system-ld.so.cache-as-.patch8
-rw-r--r--meta/recipes-core/glibc/glibc/0004-nativesdk-glibc-Fix-buffer-overrun-with-a-relocated-.patch6
-rw-r--r--meta/recipes-core/glibc/glibc/0005-nativesdk-glibc-Raise-the-size-of-arrays-containing-.patch47
-rw-r--r--meta/recipes-core/glibc/glibc/0006-nativesdk-glibc-Allow-64-bit-atomics-for-x86.patch14
-rw-r--r--meta/recipes-core/glibc/glibc/0007-nativesdk-glibc-Make-relocatable-install-for-locales.patch22
-rw-r--r--meta/recipes-core/glibc/glibc/0008-fsl-e500-e5500-e6500-603e-fsqrt-implementation.patch1581
-rw-r--r--meta/recipes-core/glibc/glibc/0008-nativesdk-glibc-Fall-back-to-faccessat-on-faccess2-r.patch32
-rw-r--r--meta/recipes-core/glibc/glibc/0009-ppc-sqrt-Fix-undefined-reference-to-__sqrt_finite.patch205
-rw-r--r--meta/recipes-core/glibc/glibc/0009-yes-within-the-path-sets-wrong-config-variables.patch (renamed from meta/recipes-core/glibc/glibc/0015-yes-within-the-path-sets-wrong-config-variables.patch)98
-rw-r--r--meta/recipes-core/glibc/glibc/0010-__ieee754_sqrt-f-are-now-inline-functions-and-call-o.patch384
-rw-r--r--meta/recipes-core/glibc/glibc/0010-eglibc-Cross-building-and-testing-instructions.patch (renamed from meta/recipes-core/glibc/glibc/0018-eglibc-Cross-building-and-testing-instructions.patch)2
-rw-r--r--meta/recipes-core/glibc/glibc/0011-Quote-from-bug-1443-which-explains-what-the-patch-do.patch58
-rw-r--r--meta/recipes-core/glibc/glibc/0011-eglibc-Help-bootstrap-cross-toolchain.patch (renamed from meta/recipes-core/glibc/glibc/0019-eglibc-Help-bootstrap-cross-toolchain.patch)8
-rw-r--r--meta/recipes-core/glibc/glibc/0012-eglibc-Resolve-__fpscr_values-on-SH4.patch (renamed from meta/recipes-core/glibc/glibc/0020-eglibc-Resolve-__fpscr_values-on-SH4.patch)8
-rw-r--r--meta/recipes-core/glibc/glibc/0012-eglibc-run-libm-err-tab.pl-with-specific-dirs-in-S.patch33
-rw-r--r--meta/recipes-core/glibc/glibc/0013-__ieee754_sqrt-f-are-now-inline-functions-and-call-o.patch58
-rw-r--r--meta/recipes-core/glibc/glibc/0013-eglibc-Forward-port-cross-locale-generation-support.patch (renamed from meta/recipes-core/glibc/glibc/0021-eglibc-Forward-port-cross-locale-generation-support.patch)104
-rw-r--r--meta/recipes-core/glibc/glibc/0014-localedef-add-to-archive-uses-a-hard-coded-locale-pa.patch (renamed from meta/recipes-core/glibc/glibc/0023-localedef-add-to-archive-uses-a-hard-coded-locale-pa.patch)10
-rw-r--r--meta/recipes-core/glibc/glibc/0015-powerpc-Do-not-ask-compiler-for-finding-arch.patch (renamed from meta/recipes-core/glibc/glibc/0030-powerpc-Do-not-ask-compiler-for-finding-arch.patch)4
-rw-r--r--meta/recipes-core/glibc/glibc/0016-timezone-re-written-tzselect-as-posix-sh.patch42
-rw-r--r--meta/recipes-core/glibc/glibc/0016-wordsize.h-Unify-the-header-between-arm-and-aarch64.patch49
-rw-r--r--meta/recipes-core/glibc/glibc/0017-Replace-echo-with-printf-builtin-in-nscd-init-script.patch (renamed from meta/recipes-core/glibc/glibc/0017-Remove-bash-dependency-for-nscd-init-script.patch)45
-rw-r--r--meta/recipes-core/glibc/glibc/0018-sysdeps-gnu-configure.ac-Set-libc_cv_rootsbindir-onl.patch (renamed from meta/recipes-core/glibc/glibc/0014-sysdeps-gnu-configure.ac-handle-correctly-libc_cv_ro.patch)20
-rw-r--r--meta/recipes-core/glibc/glibc/0019-timezone-Make-shell-interpreter-overridable-in-tzsel.patch47
-rw-r--r--meta/recipes-core/glibc/glibc/0020-tzselect.ksh-Use-bin-sh-default-shell-interpreter.patch27
-rw-r--r--meta/recipes-core/glibc/glibc/0021-fix-create-thread-failed-in-unprivileged-process-BZ-.patch86
-rw-r--r--meta/recipes-core/glibc/glibc/0022-Avoid-hardcoded-build-time-paths-in-the-output-binar.patch32
-rw-r--r--meta/recipes-core/glibc/glibc/0022-Define-DUMMY_LOCALE_T-if-not-defined.patch29
-rw-r--r--meta/recipes-core/glibc/glibc/0023-aarch64-configure-Pass-mcpu-along-with-march-to-dete.patch62
-rw-r--r--meta/recipes-core/glibc/glibc/0024-elf-dl-deps.c-Make-_dl_build_local_scope-breadth-fir.patch53
-rw-r--r--meta/recipes-core/glibc/glibc/0024-qemu-stale-process.patch45
-rw-r--r--meta/recipes-core/glibc/glibc/0025-intl-Emit-no-lines-in-bison-generated-files.patch31
-rw-r--r--meta/recipes-core/glibc/glibc/0027-locale-prevent-maybe-uninitialized-errors-with-Os-BZ.patch53
-rw-r--r--meta/recipes-core/glibc/glibc/0028-readlib-Add-OECORE_KNOWN_INTERPRETER_NAMES-to-known-.patch29
-rw-r--r--meta/recipes-core/glibc/glibc/0029-wordsize.h-Unify-the-header-between-arm-and-aarch64.patch75
-rw-r--r--meta/recipes-core/glibc/glibc/0031-x86-Require-full-ISA-support-for-x86-64-level-marker.patch116
-rw-r--r--meta/recipes-core/glibc/glibc/0032-string-Work-around-GCC-PR-98512-in-rawmemchr.patch58
-rw-r--r--meta/recipes-core/glibc/glibc/check-test-wrapper11
-rw-r--r--meta/recipes-core/glibc/glibc/faccessat2-perm.patch31
-rwxr-xr-xmeta/recipes-core/glibc/glibc/run-ptest37
42 files changed, 632 insertions, 3032 deletions
diff --git a/meta/recipes-core/glibc/glibc/0001-localedef-Add-hardlink-resolver-from-util-linux.patch b/meta/recipes-core/glibc/glibc/0001-localedef-Add-hardlink-resolver-from-util-linux.patch
index f96da83a9b..4f919078dd 100644
--- a/meta/recipes-core/glibc/glibc/0001-localedef-Add-hardlink-resolver-from-util-linux.patch
+++ b/meta/recipes-core/glibc/glibc/0001-localedef-Add-hardlink-resolver-from-util-linux.patch
@@ -1,4 +1,4 @@
1From d1f1671034a222417f9a829dcaa4f0c3d4f8954d Mon Sep 17 00:00:00 2001 1From 544d23dea91b2be793c805b9e4bce8cd1d28121f Mon Sep 17 00:00:00 2001
2From: Jason Wessel <jason.wessel@windriver.com> 2From: Jason Wessel <jason.wessel@windriver.com>
3Date: Sat, 7 Dec 2019 09:59:22 -0800 3Date: Sat, 7 Dec 2019 09:59:22 -0800
4Subject: [PATCH] localedef: Add hardlink resolver from util-linux 4Subject: [PATCH] localedef: Add hardlink resolver from util-linux
diff --git a/meta/recipes-core/glibc/glibc/0002-localedef-fix-ups-hardlink-to-make-it-compile.patch b/meta/recipes-core/glibc/glibc/0002-localedef-fix-ups-hardlink-to-make-it-compile.patch
index 3dc4582f47..7c8fa973ec 100644
--- a/meta/recipes-core/glibc/glibc/0002-localedef-fix-ups-hardlink-to-make-it-compile.patch
+++ b/meta/recipes-core/glibc/glibc/0002-localedef-fix-ups-hardlink-to-make-it-compile.patch
@@ -1,4 +1,4 @@
1From 14d256e2db009f8bac9a265e8393d7ed25050df9 Mon Sep 17 00:00:00 2001 1From ebb1e37285ab541135005cfe945b7a58e4b95040 Mon Sep 17 00:00:00 2001
2From: Jason Wessel <jason.wessel@windriver.com> 2From: Jason Wessel <jason.wessel@windriver.com>
3Date: Sat, 7 Dec 2019 10:01:37 -0800 3Date: Sat, 7 Dec 2019 10:01:37 -0800
4Subject: [PATCH] localedef: fix-ups hardlink to make it compile 4Subject: [PATCH] localedef: fix-ups hardlink to make it compile
diff --git a/meta/recipes-core/glibc/glibc/0003-nativesdk-glibc-Look-for-host-system-ld.so.cache-as-.patch b/meta/recipes-core/glibc/glibc/0003-nativesdk-glibc-Look-for-host-system-ld.so.cache-as-.patch
index c4718a106f..bd4b5aa98b 100644
--- a/meta/recipes-core/glibc/glibc/0003-nativesdk-glibc-Look-for-host-system-ld.so.cache-as-.patch
+++ b/meta/recipes-core/glibc/glibc/0003-nativesdk-glibc-Look-for-host-system-ld.so.cache-as-.patch
@@ -1,4 +1,4 @@
1From 32a4b8ae046fe4bb1b19f61378d079d44deaede7 Mon Sep 17 00:00:00 2001 1From 9770abfda8e85fe027f95871bc03450d05b1e2c8 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com> 2From: Khem Raj <raj.khem@gmail.com>
3Date: Wed, 18 Mar 2015 01:48:24 +0000 3Date: Wed, 18 Mar 2015 01:48:24 +0000
4Subject: [PATCH] nativesdk-glibc: Look for host system ld.so.cache as well 4Subject: [PATCH] nativesdk-glibc: Look for host system ld.so.cache as well
@@ -30,10 +30,10 @@ Signed-off-by: Khem Raj <raj.khem@gmail.com>
30 1 file changed, 8 insertions(+), 8 deletions(-) 30 1 file changed, 8 insertions(+), 8 deletions(-)
31 31
32diff --git a/elf/dl-load.c b/elf/dl-load.c 32diff --git a/elf/dl-load.c b/elf/dl-load.c
33index 9e2089cfaa..ad01674027 100644 33index ce8fdea302..1f502eb026 100644
34--- a/elf/dl-load.c 34--- a/elf/dl-load.c
35+++ b/elf/dl-load.c 35+++ b/elf/dl-load.c
36@@ -2175,6 +2175,14 @@ _dl_map_object (struct link_map *loader, const char *name, 36@@ -2105,6 +2105,14 @@ _dl_map_object (struct link_map *loader, const char *name,
37 } 37 }
38 } 38 }
39 39
@@ -48,7 +48,7 @@ index 9e2089cfaa..ad01674027 100644
48 #ifdef USE_LDCONFIG 48 #ifdef USE_LDCONFIG
49 if (fd == -1 49 if (fd == -1
50 && (__glibc_likely ((mode & __RTLD_SECURE) == 0) 50 && (__glibc_likely ((mode & __RTLD_SECURE) == 0)
51@@ -2233,14 +2241,6 @@ _dl_map_object (struct link_map *loader, const char *name, 51@@ -2163,14 +2171,6 @@ _dl_map_object (struct link_map *loader, const char *name,
52 } 52 }
53 #endif 53 #endif
54 54
diff --git a/meta/recipes-core/glibc/glibc/0004-nativesdk-glibc-Fix-buffer-overrun-with-a-relocated-.patch b/meta/recipes-core/glibc/glibc/0004-nativesdk-glibc-Fix-buffer-overrun-with-a-relocated-.patch
index a8e625d24c..19fc561a06 100644
--- a/meta/recipes-core/glibc/glibc/0004-nativesdk-glibc-Fix-buffer-overrun-with-a-relocated-.patch
+++ b/meta/recipes-core/glibc/glibc/0004-nativesdk-glibc-Fix-buffer-overrun-with-a-relocated-.patch
@@ -1,4 +1,4 @@
1From aa8393bff257e4badfd208b88473ead175c69362 Mon Sep 17 00:00:00 2001 1From 587b92ff99e6d8f59c461ee8beecae39d8818f7e Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com> 2From: Khem Raj <raj.khem@gmail.com>
3Date: Wed, 18 Mar 2015 01:50:00 +0000 3Date: Wed, 18 Mar 2015 01:50:00 +0000
4Subject: [PATCH] nativesdk-glibc: Fix buffer overrun with a relocated SDK 4Subject: [PATCH] nativesdk-glibc: Fix buffer overrun with a relocated SDK
@@ -21,10 +21,10 @@ Signed-off-by: Khem Raj <raj.khem@gmail.com>
21 1 file changed, 12 insertions(+) 21 1 file changed, 12 insertions(+)
22 22
23diff --git a/elf/dl-load.c b/elf/dl-load.c 23diff --git a/elf/dl-load.c b/elf/dl-load.c
24index ad01674027..f455207e79 100644 24index 1f502eb026..c4a543fb00 100644
25--- a/elf/dl-load.c 25--- a/elf/dl-load.c
26+++ b/elf/dl-load.c 26+++ b/elf/dl-load.c
27@@ -1871,7 +1871,19 @@ open_path (const char *name, size_t namelen, int mode, 27@@ -1802,7 +1802,19 @@ open_path (const char *name, size_t namelen, int mode,
28 given on the command line when rtld is run directly. */ 28 given on the command line when rtld is run directly. */
29 return -1; 29 return -1;
30 30
diff --git a/meta/recipes-core/glibc/glibc/0005-nativesdk-glibc-Raise-the-size-of-arrays-containing-.patch b/meta/recipes-core/glibc/glibc/0005-nativesdk-glibc-Raise-the-size-of-arrays-containing-.patch
index 197caae921..55892417f4 100644
--- a/meta/recipes-core/glibc/glibc/0005-nativesdk-glibc-Raise-the-size-of-arrays-containing-.patch
+++ b/meta/recipes-core/glibc/glibc/0005-nativesdk-glibc-Raise-the-size-of-arrays-containing-.patch
@@ -1,4 +1,4 @@
1From 3ea08e491a8494ff03e598b5e0fc2d8131e75da9 Mon Sep 17 00:00:00 2001 1From 49caf586b80ba030a0ee4af9f6128ff2979ea636 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com> 2From: Khem Raj <raj.khem@gmail.com>
3Date: Wed, 18 Mar 2015 01:51:38 +0000 3Date: Wed, 18 Mar 2015 01:51:38 +0000
4Subject: [PATCH] nativesdk-glibc: Raise the size of arrays containing dl paths 4Subject: [PATCH] nativesdk-glibc: Raise the size of arrays containing dl paths
@@ -19,17 +19,17 @@ Signed-off-by: Khem Raj <raj.khem@gmail.com>
19 elf/dl-load.c | 4 ++-- 19 elf/dl-load.c | 4 ++--
20 elf/dl-usage.c | 6 ++++-- 20 elf/dl-usage.c | 6 ++++--
21 elf/interp.c | 2 +- 21 elf/interp.c | 2 +-
22 elf/ldconfig.c | 3 +++ 22 elf/ldconfig.c | 2 ++
23 elf/rtld.c | 1 + 23 elf/rtld.c | 1 +
24 iconv/gconv_conf.c | 2 +- 24 iconv/gconv_conf.c | 2 +-
25 sysdeps/generic/dl-cache.h | 4 ---- 25 sysdeps/generic/dl-cache.h | 4 ----
26 8 files changed, 16 insertions(+), 10 deletions(-) 26 8 files changed, 15 insertions(+), 10 deletions(-)
27 27
28diff --git a/elf/dl-cache.c b/elf/dl-cache.c 28diff --git a/elf/dl-cache.c b/elf/dl-cache.c
29index 32f3bef5ea..71f3a82dc0 100644 29index 85f3f179ed..cc55887c56 100644
30--- a/elf/dl-cache.c 30--- a/elf/dl-cache.c
31+++ b/elf/dl-cache.c 31+++ b/elf/dl-cache.c
32@@ -359,6 +359,10 @@ search_cache (const char *string_table, uint32_t string_table_size, 32@@ -352,6 +352,10 @@ search_cache (const char *string_table, uint32_t string_table_size,
33 return best; 33 return best;
34 } 34 }
35 35
@@ -41,10 +41,10 @@ index 32f3bef5ea..71f3a82dc0 100644
41 _dl_cache_libcmp (const char *p1, const char *p2) 41 _dl_cache_libcmp (const char *p1, const char *p2)
42 { 42 {
43diff --git a/elf/dl-load.c b/elf/dl-load.c 43diff --git a/elf/dl-load.c b/elf/dl-load.c
44index f455207e79..a144e24fcf 100644 44index c4a543fb00..27fb70f09b 100644
45--- a/elf/dl-load.c 45--- a/elf/dl-load.c
46+++ b/elf/dl-load.c 46+++ b/elf/dl-load.c
47@@ -115,8 +115,8 @@ enum { ncapstr = 1, max_capstrlen = 0 }; 47@@ -117,8 +117,8 @@ enum { ncapstr = 1, max_capstrlen = 0 };
48 gen-trusted-dirs.awk. */ 48 gen-trusted-dirs.awk. */
49 #include "trusted-dirs.h" 49 #include "trusted-dirs.h"
50 50
@@ -56,7 +56,7 @@ index f455207e79..a144e24fcf 100644
56 SYSTEM_DIRS_LEN 56 SYSTEM_DIRS_LEN
57 }; 57 };
58diff --git a/elf/dl-usage.c b/elf/dl-usage.c 58diff --git a/elf/dl-usage.c b/elf/dl-usage.c
59index 6e26818bd7..f09e8b93e5 100644 59index 5baac4ba8e..60097ad0e2 100644
60--- a/elf/dl-usage.c 60--- a/elf/dl-usage.c
61+++ b/elf/dl-usage.c 61+++ b/elf/dl-usage.c
62@@ -25,6 +25,8 @@ 62@@ -25,6 +25,8 @@
@@ -68,7 +68,7 @@ index 6e26818bd7..f09e8b93e5 100644
68 void 68 void
69 _dl_usage (const char *argv0, const char *wrong_option) 69 _dl_usage (const char *argv0, const char *wrong_option)
70 { 70 {
71@@ -244,7 +246,7 @@ setting environment variables (which would be inherited by subprocesses).\n\ 71@@ -185,7 +187,7 @@ setting environment variables (which would be inherited by subprocesses).\n\
72 --list list all dependencies and how they are resolved\n\ 72 --list list all dependencies and how they are resolved\n\
73 --verify verify that given object really is a dynamically linked\n\ 73 --verify verify that given object really is a dynamically linked\n\
74 object we can handle\n\ 74 object we can handle\n\
@@ -77,7 +77,7 @@ index 6e26818bd7..f09e8b93e5 100644
77 --library-path PATH use given PATH instead of content of the environment\n\ 77 --library-path PATH use given PATH instead of content of the environment\n\
78 variable LD_LIBRARY_PATH\n\ 78 variable LD_LIBRARY_PATH\n\
79 --glibc-hwcaps-prepend LIST\n\ 79 --glibc-hwcaps-prepend LIST\n\
80@@ -266,7 +268,7 @@ setting environment variables (which would be inherited by subprocesses).\n\ 80@@ -204,7 +206,7 @@ setting environment variables (which would be inherited by subprocesses).\n\
81 \n\ 81 \n\
82 This program interpreter self-identifies as: " RTLD "\n\ 82 This program interpreter self-identifies as: " RTLD "\n\
83 ", 83 ",
@@ -85,9 +85,9 @@ index 6e26818bd7..f09e8b93e5 100644
85+ argv0, LD_SO_CACHE); 85+ argv0, LD_SO_CACHE);
86 print_search_path_for_help (state); 86 print_search_path_for_help (state);
87 print_hwcaps_subdirectories (state); 87 print_hwcaps_subdirectories (state);
88 print_legacy_hwcap_directories (); 88 _exit (EXIT_SUCCESS);
89diff --git a/elf/interp.c b/elf/interp.c 89diff --git a/elf/interp.c b/elf/interp.c
90index 91966702ca..dc86c20e83 100644 90index 8b705824bf..7d094829f3 100644
91--- a/elf/interp.c 91--- a/elf/interp.c
92+++ b/elf/interp.c 92+++ b/elf/interp.c
93@@ -18,5 +18,5 @@ 93@@ -18,5 +18,5 @@
@@ -98,24 +98,23 @@ index 91966702ca..dc86c20e83 100644
98+const char __invoke_dynamic_linker__[4096] __attribute__ ((section (".interp"))) 98+const char __invoke_dynamic_linker__[4096] __attribute__ ((section (".interp")))
99 = RUNTIME_LINKER; 99 = RUNTIME_LINKER;
100diff --git a/elf/ldconfig.c b/elf/ldconfig.c 100diff --git a/elf/ldconfig.c b/elf/ldconfig.c
101index 28ed637a29..5d38a60c5d 100644 101index b64c54b53e..caf7001745 100644
102--- a/elf/ldconfig.c 102--- a/elf/ldconfig.c
103+++ b/elf/ldconfig.c 103+++ b/elf/ldconfig.c
104@@ -176,6 +176,9 @@ static struct argp argp = 104@@ -150,6 +150,8 @@ static struct argp argp =
105 options, parse_opt, NULL, doc, NULL, more_help, NULL 105 options, parse_opt, NULL, doc, NULL, more_help, NULL
106 }; 106 };
107 107
108+
109+extern const char LD_SO_CACHE[4096] __attribute__ ((section (".ldsocache"))); 108+extern const char LD_SO_CACHE[4096] __attribute__ ((section (".ldsocache")));
110+ 109+
111 /* Check if string corresponds to an important hardware capability or 110 /* Handle program arguments. */
112 a platform. */ 111 static error_t
113 static int 112 parse_opt (int key, char *arg, struct argp_state *state)
114diff --git a/elf/rtld.c b/elf/rtld.c 113diff --git a/elf/rtld.c b/elf/rtld.c
115index 596b6ac3d9..1ccd33f668 100644 114index 4f494b792e..d1c1252188 100644
116--- a/elf/rtld.c 115--- a/elf/rtld.c
117+++ b/elf/rtld.c 116+++ b/elf/rtld.c
118@@ -185,6 +185,7 @@ dso_name_valid_for_suid (const char *p) 117@@ -190,6 +190,7 @@ dso_name_valid_for_suid (const char *p)
119 } 118 }
120 return *p != '\0'; 119 return *p != '\0';
121 } 120 }
@@ -124,11 +123,11 @@ index 596b6ac3d9..1ccd33f668 100644
124 static void 123 static void
125 audit_list_init (struct audit_list *list) 124 audit_list_init (struct audit_list *list)
126diff --git a/iconv/gconv_conf.c b/iconv/gconv_conf.c 125diff --git a/iconv/gconv_conf.c b/iconv/gconv_conf.c
127index 682f949834..7eed87bc9d 100644 126index 1063c31a2b..57fa832e52 100644
128--- a/iconv/gconv_conf.c 127--- a/iconv/gconv_conf.c
129+++ b/iconv/gconv_conf.c 128+++ b/iconv/gconv_conf.c
130@@ -36,7 +36,7 @@ 129@@ -35,7 +35,7 @@
131 130 #include <gconv_parseconfdir.h>
132 131
133 /* This is the default path where we look for module lists. */ 132 /* This is the default path where we look for module lists. */
134-static const char default_gconv_path[] = GCONV_PATH; 133-static const char default_gconv_path[] = GCONV_PATH;
@@ -137,7 +136,7 @@ index 682f949834..7eed87bc9d 100644
137 /* Type to represent search path. */ 136 /* Type to represent search path. */
138 struct path_elem 137 struct path_elem
139diff --git a/sysdeps/generic/dl-cache.h b/sysdeps/generic/dl-cache.h 138diff --git a/sysdeps/generic/dl-cache.h b/sysdeps/generic/dl-cache.h
140index 964d50a486..94bf68ca9d 100644 139index 919e49ffc8..cd3f8ba94b 100644
141--- a/sysdeps/generic/dl-cache.h 140--- a/sysdeps/generic/dl-cache.h
142+++ b/sysdeps/generic/dl-cache.h 141+++ b/sysdeps/generic/dl-cache.h
143@@ -34,10 +34,6 @@ 142@@ -34,10 +34,6 @@
diff --git a/meta/recipes-core/glibc/glibc/0006-nativesdk-glibc-Allow-64-bit-atomics-for-x86.patch b/meta/recipes-core/glibc/glibc/0006-nativesdk-glibc-Allow-64-bit-atomics-for-x86.patch
index 172ade8d97..56eaaed4b7 100644
--- a/meta/recipes-core/glibc/glibc/0006-nativesdk-glibc-Allow-64-bit-atomics-for-x86.patch
+++ b/meta/recipes-core/glibc/glibc/0006-nativesdk-glibc-Allow-64-bit-atomics-for-x86.patch
@@ -1,4 +1,4 @@
1From 19e3e45eb1838ee80af13c3d27fcff446773211e Mon Sep 17 00:00:00 2001 1From 3a94365c730d174a3c30c6d9282e6ca12d9ad091 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com> 2From: Khem Raj <raj.khem@gmail.com>
3Date: Thu, 31 Dec 2015 14:35:35 -0800 3Date: Thu, 31 Dec 2015 14:35:35 -0800
4Subject: [PATCH] nativesdk-glibc: Allow 64 bit atomics for x86 4Subject: [PATCH] nativesdk-glibc: Allow 64 bit atomics for x86
@@ -13,14 +13,14 @@ Signed-off-by: Juro Bystricky <juro.bystricky@intel.com>
13Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> 13Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
14Signed-off-by: Khem Raj <raj.khem@gmail.com> 14Signed-off-by: Khem Raj <raj.khem@gmail.com>
15--- 15---
16 sysdeps/x86/atomic-machine.h | 3 +-- 16 sysdeps/x86/atomic-machine.h | 7 +------
17 1 file changed, 1 insertion(+), 2 deletions(-) 17 1 file changed, 1 insertion(+), 6 deletions(-)
18 18
19diff --git a/sysdeps/x86/atomic-machine.h b/sysdeps/x86/atomic-machine.h 19diff --git a/sysdeps/x86/atomic-machine.h b/sysdeps/x86/atomic-machine.h
20index 695222e4fa..9d39bfdbd5 100644 20index cfd395087b..28a937c468 100644
21--- a/sysdeps/x86/atomic-machine.h 21--- a/sysdeps/x86/atomic-machine.h
22+++ b/sysdeps/x86/atomic-machine.h 22+++ b/sysdeps/x86/atomic-machine.h
23@@ -52,15 +52,14 @@ typedef uintmax_t uatomic_max_t; 23@@ -26,19 +26,14 @@
24 #define LOCK_PREFIX "lock;" 24 #define LOCK_PREFIX "lock;"
25 25
26 #define USE_ATOMIC_COMPILER_BUILTINS 1 26 #define USE_ATOMIC_COMPILER_BUILTINS 1
@@ -33,6 +33,10 @@ index 695222e4fa..9d39bfdbd5 100644
33 # define BR_CONSTRAINT "q" 33 # define BR_CONSTRAINT "q"
34 # define IBR_CONSTRAINT "iq" 34 # define IBR_CONSTRAINT "iq"
35 #else 35 #else
36-/* Since the Pentium, i386 CPUs have supported 64-bit atomics, but the
37- i386 psABI supplement provides only 4-byte alignment for uint64_t
38- inside structs, so it is currently not possible to use 64-bit
39- atomics on this platform. */
36-# define __HAVE_64B_ATOMICS 0 40-# define __HAVE_64B_ATOMICS 0
37 # define SP_REG "esp" 41 # define SP_REG "esp"
38 # define SEG_REG "gs" 42 # define SEG_REG "gs"
diff --git a/meta/recipes-core/glibc/glibc/0007-nativesdk-glibc-Make-relocatable-install-for-locales.patch b/meta/recipes-core/glibc/glibc/0007-nativesdk-glibc-Make-relocatable-install-for-locales.patch
index 14697567c2..54c085a714 100644
--- a/meta/recipes-core/glibc/glibc/0007-nativesdk-glibc-Make-relocatable-install-for-locales.patch
+++ b/meta/recipes-core/glibc/glibc/0007-nativesdk-glibc-Make-relocatable-install-for-locales.patch
@@ -1,4 +1,4 @@
1From 732d4f4954fe60718870048d0583a20a7a8a8540 Mon Sep 17 00:00:00 2001 1From 296bdde0683aa55cdea0fd0cab05ff8fbc462b17 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com> 2From: Khem Raj <raj.khem@gmail.com>
3Date: Fri, 3 Aug 2018 09:55:12 -0700 3Date: Fri, 3 Aug 2018 09:55:12 -0700
4Subject: [PATCH] nativesdk-glibc: Make relocatable install for locales 4Subject: [PATCH] nativesdk-glibc: Make relocatable install for locales
@@ -19,10 +19,10 @@ Signed-off-by: Khem Raj <raj.khem@gmail.com>
19 4 files changed, 8 insertions(+), 7 deletions(-) 19 4 files changed, 8 insertions(+), 7 deletions(-)
20 20
21diff --git a/locale/findlocale.c b/locale/findlocale.c 21diff --git a/locale/findlocale.c b/locale/findlocale.c
22index ab09122b0c..f42cc75780 100644 22index 8d6e4e33e3..bfe74f241d 100644
23--- a/locale/findlocale.c 23--- a/locale/findlocale.c
24+++ b/locale/findlocale.c 24+++ b/locale/findlocale.c
25@@ -56,7 +56,7 @@ struct __locale_data *const _nl_C[] attribute_hidden = 25@@ -55,7 +55,7 @@ struct __locale_data *const _nl_C[] attribute_hidden =
26 which are somehow addressed. */ 26 which are somehow addressed. */
27 struct loaded_l10nfile *_nl_locale_file_list[__LC_LAST]; 27 struct loaded_l10nfile *_nl_locale_file_list[__LC_LAST];
28 28
@@ -31,7 +31,7 @@ index ab09122b0c..f42cc75780 100644
31 31
32 /* Checks if the name is actually present, that is, not NULL and not 32 /* Checks if the name is actually present, that is, not NULL and not
33 empty. */ 33 empty. */
34@@ -166,7 +166,7 @@ _nl_find_locale (const char *locale_path, size_t locale_path_len, 34@@ -165,7 +165,7 @@ _nl_find_locale (const char *locale_path, size_t locale_path_len,
35 35
36 /* Nothing in the archive. Set the default path to search below. */ 36 /* Nothing in the archive. Set the default path to search below. */
37 locale_path = _nl_default_locale_path; 37 locale_path = _nl_default_locale_path;
@@ -41,7 +41,7 @@ index ab09122b0c..f42cc75780 100644
41 else 41 else
42 /* We really have to load some data. First see whether the name is 42 /* We really have to load some data. First see whether the name is
43diff --git a/locale/loadarchive.c b/locale/loadarchive.c 43diff --git a/locale/loadarchive.c b/locale/loadarchive.c
44index 4177fc8972..40247b1e68 100644 44index 452e3eb6e3..c7467aec42 100644
45--- a/locale/loadarchive.c 45--- a/locale/loadarchive.c
46+++ b/locale/loadarchive.c 46+++ b/locale/loadarchive.c
47@@ -42,7 +42,7 @@ 47@@ -42,7 +42,7 @@
@@ -54,10 +54,10 @@ index 4177fc8972..40247b1e68 100644
54 /* Size of initial mapping window, optimal if large enough to 54 /* Size of initial mapping window, optimal if large enough to
55 cover the header plus the initial locale. */ 55 cover the header plus the initial locale. */
56diff --git a/locale/localeinfo.h b/locale/localeinfo.h 56diff --git a/locale/localeinfo.h b/locale/localeinfo.h
57index b3d4da0185..22f9dc1140 100644 57index ed698faef1..f7efc288a5 100644
58--- a/locale/localeinfo.h 58--- a/locale/localeinfo.h
59+++ b/locale/localeinfo.h 59+++ b/locale/localeinfo.h
60@@ -331,7 +331,7 @@ _nl_lookup_word (locale_t l, int category, int item) 60@@ -347,7 +347,7 @@ _nl_lookup_word (locale_t l, int category, int item)
61 } 61 }
62 62
63 /* Default search path if no LOCPATH environment variable. */ 63 /* Default search path if no LOCPATH environment variable. */
@@ -67,10 +67,10 @@ index b3d4da0185..22f9dc1140 100644
67 /* Load the locale data for CATEGORY from the file specified by *NAME. 67 /* Load the locale data for CATEGORY from the file specified by *NAME.
68 If *NAME is "", use environment variables as specified by POSIX, and 68 If *NAME is "", use environment variables as specified by POSIX, and
69diff --git a/locale/programs/locale.c b/locale/programs/locale.c 69diff --git a/locale/programs/locale.c b/locale/programs/locale.c
70index 575b208e82..5ec630c3a4 100644 70index c7ee1874e8..8281e32236 100644
71--- a/locale/programs/locale.c 71--- a/locale/programs/locale.c
72+++ b/locale/programs/locale.c 72+++ b/locale/programs/locale.c
73@@ -632,6 +632,7 @@ nameentcmp (const void *a, const void *b) 73@@ -631,6 +631,7 @@ nameentcmp (const void *a, const void *b)
74 ((const struct nameent *) b)->name); 74 ((const struct nameent *) b)->name);
75 } 75 }
76 76
@@ -78,7 +78,7 @@ index 575b208e82..5ec630c3a4 100644
78 78
79 static int 79 static int
80 write_archive_locales (void **all_datap, char *linebuf) 80 write_archive_locales (void **all_datap, char *linebuf)
81@@ -645,7 +646,7 @@ write_archive_locales (void **all_datap, char *linebuf) 81@@ -644,7 +645,7 @@ write_archive_locales (void **all_datap, char *linebuf)
82 int fd, ret = 0; 82 int fd, ret = 0;
83 uint32_t cnt; 83 uint32_t cnt;
84 84
@@ -87,7 +87,7 @@ index 575b208e82..5ec630c3a4 100644
87 if (fd < 0) 87 if (fd < 0)
88 return 0; 88 return 0;
89 89
90@@ -700,8 +701,8 @@ write_archive_locales (void **all_datap, char *linebuf) 90@@ -699,8 +700,8 @@ write_archive_locales (void **all_datap, char *linebuf)
91 if (cnt) 91 if (cnt)
92 putchar_unlocked ('\n'); 92 putchar_unlocked ('\n');
93 93
diff --git a/meta/recipes-core/glibc/glibc/0008-fsl-e500-e5500-e6500-603e-fsqrt-implementation.patch b/meta/recipes-core/glibc/glibc/0008-fsl-e500-e5500-e6500-603e-fsqrt-implementation.patch
deleted file mode 100644
index 2162bf38c2..0000000000
--- a/meta/recipes-core/glibc/glibc/0008-fsl-e500-e5500-e6500-603e-fsqrt-implementation.patch
+++ /dev/null
@@ -1,1581 +0,0 @@
1From 3d58330390a7d4f4ed32f4a9c25628af3e0dd5c1 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Wed, 18 Mar 2015 00:01:50 +0000
4Subject: [PATCH] fsl e500/e5500/e6500/603e fsqrt implementation
5
6Upstream-Status: Pending
7Signed-off-by: Edmar Wienskoski <edmar@freescale.com>
8Signed-off-by: Khem Raj <raj.khem@gmail.com>
9---
10 sysdeps/powerpc/powerpc32/603e/fpu/e_sqrt.c | 134 ++++++++++++++++++
11 sysdeps/powerpc/powerpc32/603e/fpu/e_sqrtf.c | 101 +++++++++++++
12 sysdeps/powerpc/powerpc32/e500mc/fpu/e_sqrt.c | 134 ++++++++++++++++++
13 .../powerpc/powerpc32/e500mc/fpu/e_sqrtf.c | 101 +++++++++++++
14 sysdeps/powerpc/powerpc32/e5500/fpu/e_sqrt.c | 134 ++++++++++++++++++
15 sysdeps/powerpc/powerpc32/e5500/fpu/e_sqrtf.c | 101 +++++++++++++
16 sysdeps/powerpc/powerpc32/e6500/fpu/e_sqrt.c | 134 ++++++++++++++++++
17 sysdeps/powerpc/powerpc32/e6500/fpu/e_sqrtf.c | 101 +++++++++++++
18 sysdeps/powerpc/powerpc64/e5500/fpu/e_sqrt.c | 134 ++++++++++++++++++
19 sysdeps/powerpc/powerpc64/e5500/fpu/e_sqrtf.c | 101 +++++++++++++
20 sysdeps/powerpc/powerpc64/e6500/fpu/e_sqrt.c | 134 ++++++++++++++++++
21 sysdeps/powerpc/powerpc64/e6500/fpu/e_sqrtf.c | 101 +++++++++++++
22 .../linux/powerpc/powerpc32/603e/fpu/Implies | 1 +
23 .../powerpc/powerpc32/e300c3/fpu/Implies | 2 +
24 .../powerpc/powerpc32/e500mc/fpu/Implies | 1 +
25 .../linux/powerpc/powerpc32/e5500/fpu/Implies | 1 +
26 .../linux/powerpc/powerpc32/e6500/fpu/Implies | 1 +
27 .../linux/powerpc/powerpc64/e5500/fpu/Implies | 1 +
28 .../linux/powerpc/powerpc64/e6500/fpu/Implies | 1 +
29 19 files changed, 1418 insertions(+)
30 create mode 100644 sysdeps/powerpc/powerpc32/603e/fpu/e_sqrt.c
31 create mode 100644 sysdeps/powerpc/powerpc32/603e/fpu/e_sqrtf.c
32 create mode 100644 sysdeps/powerpc/powerpc32/e500mc/fpu/e_sqrt.c
33 create mode 100644 sysdeps/powerpc/powerpc32/e500mc/fpu/e_sqrtf.c
34 create mode 100644 sysdeps/powerpc/powerpc32/e5500/fpu/e_sqrt.c
35 create mode 100644 sysdeps/powerpc/powerpc32/e5500/fpu/e_sqrtf.c
36 create mode 100644 sysdeps/powerpc/powerpc32/e6500/fpu/e_sqrt.c
37 create mode 100644 sysdeps/powerpc/powerpc32/e6500/fpu/e_sqrtf.c
38 create mode 100644 sysdeps/powerpc/powerpc64/e5500/fpu/e_sqrt.c
39 create mode 100644 sysdeps/powerpc/powerpc64/e5500/fpu/e_sqrtf.c
40 create mode 100644 sysdeps/powerpc/powerpc64/e6500/fpu/e_sqrt.c
41 create mode 100644 sysdeps/powerpc/powerpc64/e6500/fpu/e_sqrtf.c
42 create mode 100644 sysdeps/unix/sysv/linux/powerpc/powerpc32/603e/fpu/Implies
43 create mode 100644 sysdeps/unix/sysv/linux/powerpc/powerpc32/e300c3/fpu/Implies
44 create mode 100644 sysdeps/unix/sysv/linux/powerpc/powerpc32/e500mc/fpu/Implies
45 create mode 100644 sysdeps/unix/sysv/linux/powerpc/powerpc32/e5500/fpu/Implies
46 create mode 100644 sysdeps/unix/sysv/linux/powerpc/powerpc32/e6500/fpu/Implies
47 create mode 100644 sysdeps/unix/sysv/linux/powerpc/powerpc64/e5500/fpu/Implies
48 create mode 100644 sysdeps/unix/sysv/linux/powerpc/powerpc64/e6500/fpu/Implies
49
50diff --git a/sysdeps/powerpc/powerpc32/603e/fpu/e_sqrt.c b/sysdeps/powerpc/powerpc32/603e/fpu/e_sqrt.c
51new file mode 100644
52index 0000000000..71e516d1c8
53--- /dev/null
54+++ b/sysdeps/powerpc/powerpc32/603e/fpu/e_sqrt.c
55@@ -0,0 +1,134 @@
56+/* Double-precision floating point square root.
57+ Copyright (C) 2010 Free Software Foundation, Inc.
58+ This file is part of the GNU C Library.
59+
60+ The GNU C Library is free software; you can redistribute it and/or
61+ modify it under the terms of the GNU Lesser General Public
62+ License as published by the Free Software Foundation; either
63+ version 2.1 of the License, or (at your option) any later version.
64+
65+ The GNU C Library is distributed in the hope that it will be useful,
66+ but WITHOUT ANY WARRANTY; without even the implied warranty of
67+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
68+ Lesser General Public License for more details.
69+
70+ You should have received a copy of the GNU Lesser General Public
71+ License along with the GNU C Library; if not, write to the Free
72+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
73+ 02111-1307 USA. */
74+
75+#include <math.h>
76+#include <math_private.h>
77+#include <fenv_libc.h>
78+#include <inttypes.h>
79+
80+#include <sysdep.h>
81+#include <ldsodefs.h>
82+
83+static const ieee_float_shape_type a_nan = {.word = 0x7fc00000 };
84+static const ieee_float_shape_type a_inf = {.word = 0x7f800000 };
85+static const float two108 = 3.245185536584267269e+32;
86+static const float twom54 = 5.551115123125782702e-17;
87+static const float half = 0.5;
88+
89+/* The method is based on the descriptions in:
90+
91+ _The Handbook of Floating-Pointer Arithmetic_ by Muller et al., chapter 5;
92+ _IA-64 and Elementary Functions: Speed and Precision_ by Markstein, chapter 9
93+
94+ We find the actual square root and half of its reciprocal
95+ simultaneously. */
96+
97+#ifdef __STDC__
98+double
99+__ieee754_sqrt (double b)
100+#else
101+double
102+__ieee754_sqrt (b)
103+ double b;
104+#endif
105+{
106+ if (__builtin_expect (b > 0, 1))
107+ {
108+ double y, g, h, d, r;
109+ ieee_double_shape_type u;
110+
111+ if (__builtin_expect (b != a_inf.value, 1))
112+ {
113+ fenv_t fe;
114+
115+ fe = fegetenv_register ();
116+
117+ u.value = b;
118+
119+ relax_fenv_state ();
120+
121+ __asm__ ("frsqrte %[estimate], %[x]\n"
122+ : [estimate] "=f" (y) : [x] "f" (b));
123+
124+ /* Following Muller et al, page 168, equation 5.20.
125+
126+ h goes to 1/(2*sqrt(b))
127+ g goes to sqrt(b).
128+
129+ We need three iterations to get within 1ulp. */
130+
131+ /* Indicate that these can be performed prior to the branch. GCC
132+ insists on sinking them below the branch, however; it seems like
133+ they'd be better before the branch so that we can cover any latency
134+ from storing the argument and loading its high word. Oh well. */
135+
136+ g = b * y;
137+ h = 0.5 * y;
138+
139+ /* Handle small numbers by scaling. */
140+ if (__builtin_expect ((u.parts.msw & 0x7ff00000) <= 0x02000000, 0))
141+ return __ieee754_sqrt (b * two108) * twom54;
142+
143+#define FMADD(a_, c_, b_) \
144+ ({ double __r; \
145+ __asm__ ("fmadd %[r], %[a], %[c], %[b]\n" \
146+ : [r] "=f" (__r) : [a] "f" (a_), [c] "f" (c_), [b] "f" (b_)); \
147+ __r;})
148+#define FNMSUB(a_, c_, b_) \
149+ ({ double __r; \
150+ __asm__ ("fnmsub %[r], %[a], %[c], %[b]\n" \
151+ : [r] "=f" (__r) : [a] "f" (a_), [c] "f" (c_), [b] "f" (b_)); \
152+ __r;})
153+
154+ r = FNMSUB (g, h, half);
155+ g = FMADD (g, r, g);
156+ h = FMADD (h, r, h);
157+
158+ r = FNMSUB (g, h, half);
159+ g = FMADD (g, r, g);
160+ h = FMADD (h, r, h);
161+
162+ r = FNMSUB (g, h, half);
163+ g = FMADD (g, r, g);
164+ h = FMADD (h, r, h);
165+
166+ /* g is now +/- 1ulp, or exactly equal to, the square root of b. */
167+
168+ /* Final refinement. */
169+ d = FNMSUB (g, g, b);
170+
171+ fesetenv_register (fe);
172+ return FMADD (d, h, g);
173+ }
174+ }
175+ else if (b < 0)
176+ {
177+ /* For some reason, some PowerPC32 processors don't implement
178+ FE_INVALID_SQRT. */
179+#ifdef FE_INVALID_SQRT
180+ feraiseexcept (FE_INVALID_SQRT);
181+
182+ fenv_union_t u = { .fenv = fegetenv_register () };
183+ if ((u.l & FE_INVALID) == 0)
184+#endif
185+ feraiseexcept (FE_INVALID);
186+ b = a_nan.value;
187+ }
188+ return f_wash (b);
189+}
190diff --git a/sysdeps/powerpc/powerpc32/603e/fpu/e_sqrtf.c b/sysdeps/powerpc/powerpc32/603e/fpu/e_sqrtf.c
191new file mode 100644
192index 0000000000..26fa067abf
193--- /dev/null
194+++ b/sysdeps/powerpc/powerpc32/603e/fpu/e_sqrtf.c
195@@ -0,0 +1,101 @@
196+/* Single-precision floating point square root.
197+ Copyright (C) 2010 Free Software Foundation, Inc.
198+ This file is part of the GNU C Library.
199+
200+ The GNU C Library is free software; you can redistribute it and/or
201+ modify it under the terms of the GNU Lesser General Public
202+ License as published by the Free Software Foundation; either
203+ version 2.1 of the License, or (at your option) any later version.
204+
205+ The GNU C Library is distributed in the hope that it will be useful,
206+ but WITHOUT ANY WARRANTY; without even the implied warranty of
207+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
208+ Lesser General Public License for more details.
209+
210+ You should have received a copy of the GNU Lesser General Public
211+ License along with the GNU C Library; if not, write to the Free
212+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
213+ 02111-1307 USA. */
214+
215+#include <math.h>
216+#include <math_private.h>
217+#include <fenv_libc.h>
218+#include <inttypes.h>
219+
220+#include <sysdep.h>
221+#include <ldsodefs.h>
222+
223+static const ieee_float_shape_type a_nan = {.word = 0x7fc00000 };
224+static const ieee_float_shape_type a_inf = {.word = 0x7f800000 };
225+static const float threehalf = 1.5;
226+
227+/* The method is based on the descriptions in:
228+
229+ _The Handbook of Floating-Pointer Arithmetic_ by Muller et al., chapter 5;
230+ _IA-64 and Elementary Functions: Speed and Precision_ by Markstein, chapter 9
231+
232+ We find the reciprocal square root and use that to compute the actual
233+ square root. */
234+
235+#ifdef __STDC__
236+float
237+__ieee754_sqrtf (float b)
238+#else
239+float
240+__ieee754_sqrtf (b)
241+ float b;
242+#endif
243+{
244+ if (__builtin_expect (b > 0, 1))
245+ {
246+#define FMSUB(a_, c_, b_) \
247+ ({ double __r; \
248+ __asm__ ("fmsub %[r], %[a], %[c], %[b]\n" \
249+ : [r] "=f" (__r) : [a] "f" (a_), [c] "f" (c_), [b] "f" (b_)); \
250+ __r;})
251+#define FNMSUB(a_, c_, b_) \
252+ ({ double __r; \
253+ __asm__ ("fnmsub %[r], %[a], %[c], %[b]\n" \
254+ : [r] "=f" (__r) : [a] "f" (a_), [c] "f" (c_), [b] "f" (b_)); \
255+ __r;})
256+
257+ if (__builtin_expect (b != a_inf.value, 1))
258+ {
259+ double y, x;
260+ fenv_t fe;
261+
262+ fe = fegetenv_register ();
263+
264+ relax_fenv_state ();
265+
266+ /* Compute y = 1.5 * b - b. Uses fewer constants than y = 0.5 * b. */
267+ y = FMSUB (threehalf, b, b);
268+
269+ /* Initial estimate. */
270+ __asm__ ("frsqrte %[x], %[b]\n" : [x] "=f" (x) : [b] "f" (b));
271+
272+ /* Iterate. x_{n+1} = x_n * (1.5 - y * (x_n * x_n)). */
273+ x = x * FNMSUB (y, x * x, threehalf);
274+ x = x * FNMSUB (y, x * x, threehalf);
275+ x = x * FNMSUB (y, x * x, threehalf);
276+
277+ /* All done. */
278+ fesetenv_register (fe);
279+ return x * b;
280+ }
281+ }
282+ else if (b < 0)
283+ {
284+ /* For some reason, some PowerPC32 processors don't implement
285+ FE_INVALID_SQRT. */
286+#ifdef FE_INVALID_SQRT
287+ feraiseexcept (FE_INVALID_SQRT);
288+
289+ fenv_union_t u = { .fenv = fegetenv_register () };
290+ if ((u.l & FE_INVALID) == 0)
291+#endif
292+ feraiseexcept (FE_INVALID);
293+ b = a_nan.value;
294+ }
295+ return f_washf (b);
296+}
297diff --git a/sysdeps/powerpc/powerpc32/e500mc/fpu/e_sqrt.c b/sysdeps/powerpc/powerpc32/e500mc/fpu/e_sqrt.c
298new file mode 100644
299index 0000000000..71e516d1c8
300--- /dev/null
301+++ b/sysdeps/powerpc/powerpc32/e500mc/fpu/e_sqrt.c
302@@ -0,0 +1,134 @@
303+/* Double-precision floating point square root.
304+ Copyright (C) 2010 Free Software Foundation, Inc.
305+ This file is part of the GNU C Library.
306+
307+ The GNU C Library is free software; you can redistribute it and/or
308+ modify it under the terms of the GNU Lesser General Public
309+ License as published by the Free Software Foundation; either
310+ version 2.1 of the License, or (at your option) any later version.
311+
312+ The GNU C Library is distributed in the hope that it will be useful,
313+ but WITHOUT ANY WARRANTY; without even the implied warranty of
314+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
315+ Lesser General Public License for more details.
316+
317+ You should have received a copy of the GNU Lesser General Public
318+ License along with the GNU C Library; if not, write to the Free
319+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
320+ 02111-1307 USA. */
321+
322+#include <math.h>
323+#include <math_private.h>
324+#include <fenv_libc.h>
325+#include <inttypes.h>
326+
327+#include <sysdep.h>
328+#include <ldsodefs.h>
329+
330+static const ieee_float_shape_type a_nan = {.word = 0x7fc00000 };
331+static const ieee_float_shape_type a_inf = {.word = 0x7f800000 };
332+static const float two108 = 3.245185536584267269e+32;
333+static const float twom54 = 5.551115123125782702e-17;
334+static const float half = 0.5;
335+
336+/* The method is based on the descriptions in:
337+
338+ _The Handbook of Floating-Pointer Arithmetic_ by Muller et al., chapter 5;
339+ _IA-64 and Elementary Functions: Speed and Precision_ by Markstein, chapter 9
340+
341+ We find the actual square root and half of its reciprocal
342+ simultaneously. */
343+
344+#ifdef __STDC__
345+double
346+__ieee754_sqrt (double b)
347+#else
348+double
349+__ieee754_sqrt (b)
350+ double b;
351+#endif
352+{
353+ if (__builtin_expect (b > 0, 1))
354+ {
355+ double y, g, h, d, r;
356+ ieee_double_shape_type u;
357+
358+ if (__builtin_expect (b != a_inf.value, 1))
359+ {
360+ fenv_t fe;
361+
362+ fe = fegetenv_register ();
363+
364+ u.value = b;
365+
366+ relax_fenv_state ();
367+
368+ __asm__ ("frsqrte %[estimate], %[x]\n"
369+ : [estimate] "=f" (y) : [x] "f" (b));
370+
371+ /* Following Muller et al, page 168, equation 5.20.
372+
373+ h goes to 1/(2*sqrt(b))
374+ g goes to sqrt(b).
375+
376+ We need three iterations to get within 1ulp. */
377+
378+ /* Indicate that these can be performed prior to the branch. GCC
379+ insists on sinking them below the branch, however; it seems like
380+ they'd be better before the branch so that we can cover any latency
381+ from storing the argument and loading its high word. Oh well. */
382+
383+ g = b * y;
384+ h = 0.5 * y;
385+
386+ /* Handle small numbers by scaling. */
387+ if (__builtin_expect ((u.parts.msw & 0x7ff00000) <= 0x02000000, 0))
388+ return __ieee754_sqrt (b * two108) * twom54;
389+
390+#define FMADD(a_, c_, b_) \
391+ ({ double __r; \
392+ __asm__ ("fmadd %[r], %[a], %[c], %[b]\n" \
393+ : [r] "=f" (__r) : [a] "f" (a_), [c] "f" (c_), [b] "f" (b_)); \
394+ __r;})
395+#define FNMSUB(a_, c_, b_) \
396+ ({ double __r; \
397+ __asm__ ("fnmsub %[r], %[a], %[c], %[b]\n" \
398+ : [r] "=f" (__r) : [a] "f" (a_), [c] "f" (c_), [b] "f" (b_)); \
399+ __r;})
400+
401+ r = FNMSUB (g, h, half);
402+ g = FMADD (g, r, g);
403+ h = FMADD (h, r, h);
404+
405+ r = FNMSUB (g, h, half);
406+ g = FMADD (g, r, g);
407+ h = FMADD (h, r, h);
408+
409+ r = FNMSUB (g, h, half);
410+ g = FMADD (g, r, g);
411+ h = FMADD (h, r, h);
412+
413+ /* g is now +/- 1ulp, or exactly equal to, the square root of b. */
414+
415+ /* Final refinement. */
416+ d = FNMSUB (g, g, b);
417+
418+ fesetenv_register (fe);
419+ return FMADD (d, h, g);
420+ }
421+ }
422+ else if (b < 0)
423+ {
424+ /* For some reason, some PowerPC32 processors don't implement
425+ FE_INVALID_SQRT. */
426+#ifdef FE_INVALID_SQRT
427+ feraiseexcept (FE_INVALID_SQRT);
428+
429+ fenv_union_t u = { .fenv = fegetenv_register () };
430+ if ((u.l & FE_INVALID) == 0)
431+#endif
432+ feraiseexcept (FE_INVALID);
433+ b = a_nan.value;
434+ }
435+ return f_wash (b);
436+}
437diff --git a/sysdeps/powerpc/powerpc32/e500mc/fpu/e_sqrtf.c b/sysdeps/powerpc/powerpc32/e500mc/fpu/e_sqrtf.c
438new file mode 100644
439index 0000000000..26fa067abf
440--- /dev/null
441+++ b/sysdeps/powerpc/powerpc32/e500mc/fpu/e_sqrtf.c
442@@ -0,0 +1,101 @@
443+/* Single-precision floating point square root.
444+ Copyright (C) 2010 Free Software Foundation, Inc.
445+ This file is part of the GNU C Library.
446+
447+ The GNU C Library is free software; you can redistribute it and/or
448+ modify it under the terms of the GNU Lesser General Public
449+ License as published by the Free Software Foundation; either
450+ version 2.1 of the License, or (at your option) any later version.
451+
452+ The GNU C Library is distributed in the hope that it will be useful,
453+ but WITHOUT ANY WARRANTY; without even the implied warranty of
454+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
455+ Lesser General Public License for more details.
456+
457+ You should have received a copy of the GNU Lesser General Public
458+ License along with the GNU C Library; if not, write to the Free
459+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
460+ 02111-1307 USA. */
461+
462+#include <math.h>
463+#include <math_private.h>
464+#include <fenv_libc.h>
465+#include <inttypes.h>
466+
467+#include <sysdep.h>
468+#include <ldsodefs.h>
469+
470+static const ieee_float_shape_type a_nan = {.word = 0x7fc00000 };
471+static const ieee_float_shape_type a_inf = {.word = 0x7f800000 };
472+static const float threehalf = 1.5;
473+
474+/* The method is based on the descriptions in:
475+
476+ _The Handbook of Floating-Pointer Arithmetic_ by Muller et al., chapter 5;
477+ _IA-64 and Elementary Functions: Speed and Precision_ by Markstein, chapter 9
478+
479+ We find the reciprocal square root and use that to compute the actual
480+ square root. */
481+
482+#ifdef __STDC__
483+float
484+__ieee754_sqrtf (float b)
485+#else
486+float
487+__ieee754_sqrtf (b)
488+ float b;
489+#endif
490+{
491+ if (__builtin_expect (b > 0, 1))
492+ {
493+#define FMSUB(a_, c_, b_) \
494+ ({ double __r; \
495+ __asm__ ("fmsub %[r], %[a], %[c], %[b]\n" \
496+ : [r] "=f" (__r) : [a] "f" (a_), [c] "f" (c_), [b] "f" (b_)); \
497+ __r;})
498+#define FNMSUB(a_, c_, b_) \
499+ ({ double __r; \
500+ __asm__ ("fnmsub %[r], %[a], %[c], %[b]\n" \
501+ : [r] "=f" (__r) : [a] "f" (a_), [c] "f" (c_), [b] "f" (b_)); \
502+ __r;})
503+
504+ if (__builtin_expect (b != a_inf.value, 1))
505+ {
506+ double y, x;
507+ fenv_t fe;
508+
509+ fe = fegetenv_register ();
510+
511+ relax_fenv_state ();
512+
513+ /* Compute y = 1.5 * b - b. Uses fewer constants than y = 0.5 * b. */
514+ y = FMSUB (threehalf, b, b);
515+
516+ /* Initial estimate. */
517+ __asm__ ("frsqrte %[x], %[b]\n" : [x] "=f" (x) : [b] "f" (b));
518+
519+ /* Iterate. x_{n+1} = x_n * (1.5 - y * (x_n * x_n)). */
520+ x = x * FNMSUB (y, x * x, threehalf);
521+ x = x * FNMSUB (y, x * x, threehalf);
522+ x = x * FNMSUB (y, x * x, threehalf);
523+
524+ /* All done. */
525+ fesetenv_register (fe);
526+ return x * b;
527+ }
528+ }
529+ else if (b < 0)
530+ {
531+ /* For some reason, some PowerPC32 processors don't implement
532+ FE_INVALID_SQRT. */
533+#ifdef FE_INVALID_SQRT
534+ feraiseexcept (FE_INVALID_SQRT);
535+
536+ fenv_union_t u = { .fenv = fegetenv_register () };
537+ if ((u.l & FE_INVALID) == 0)
538+#endif
539+ feraiseexcept (FE_INVALID);
540+ b = a_nan.value;
541+ }
542+ return f_washf (b);
543+}
544diff --git a/sysdeps/powerpc/powerpc32/e5500/fpu/e_sqrt.c b/sysdeps/powerpc/powerpc32/e5500/fpu/e_sqrt.c
545new file mode 100644
546index 0000000000..71e516d1c8
547--- /dev/null
548+++ b/sysdeps/powerpc/powerpc32/e5500/fpu/e_sqrt.c
549@@ -0,0 +1,134 @@
550+/* Double-precision floating point square root.
551+ Copyright (C) 2010 Free Software Foundation, Inc.
552+ This file is part of the GNU C Library.
553+
554+ The GNU C Library is free software; you can redistribute it and/or
555+ modify it under the terms of the GNU Lesser General Public
556+ License as published by the Free Software Foundation; either
557+ version 2.1 of the License, or (at your option) any later version.
558+
559+ The GNU C Library is distributed in the hope that it will be useful,
560+ but WITHOUT ANY WARRANTY; without even the implied warranty of
561+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
562+ Lesser General Public License for more details.
563+
564+ You should have received a copy of the GNU Lesser General Public
565+ License along with the GNU C Library; if not, write to the Free
566+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
567+ 02111-1307 USA. */
568+
569+#include <math.h>
570+#include <math_private.h>
571+#include <fenv_libc.h>
572+#include <inttypes.h>
573+
574+#include <sysdep.h>
575+#include <ldsodefs.h>
576+
577+static const ieee_float_shape_type a_nan = {.word = 0x7fc00000 };
578+static const ieee_float_shape_type a_inf = {.word = 0x7f800000 };
579+static const float two108 = 3.245185536584267269e+32;
580+static const float twom54 = 5.551115123125782702e-17;
581+static const float half = 0.5;
582+
583+/* The method is based on the descriptions in:
584+
585+ _The Handbook of Floating-Pointer Arithmetic_ by Muller et al., chapter 5;
586+ _IA-64 and Elementary Functions: Speed and Precision_ by Markstein, chapter 9
587+
588+ We find the actual square root and half of its reciprocal
589+ simultaneously. */
590+
591+#ifdef __STDC__
592+double
593+__ieee754_sqrt (double b)
594+#else
595+double
596+__ieee754_sqrt (b)
597+ double b;
598+#endif
599+{
600+ if (__builtin_expect (b > 0, 1))
601+ {
602+ double y, g, h, d, r;
603+ ieee_double_shape_type u;
604+
605+ if (__builtin_expect (b != a_inf.value, 1))
606+ {
607+ fenv_t fe;
608+
609+ fe = fegetenv_register ();
610+
611+ u.value = b;
612+
613+ relax_fenv_state ();
614+
615+ __asm__ ("frsqrte %[estimate], %[x]\n"
616+ : [estimate] "=f" (y) : [x] "f" (b));
617+
618+ /* Following Muller et al, page 168, equation 5.20.
619+
620+ h goes to 1/(2*sqrt(b))
621+ g goes to sqrt(b).
622+
623+ We need three iterations to get within 1ulp. */
624+
625+ /* Indicate that these can be performed prior to the branch. GCC
626+ insists on sinking them below the branch, however; it seems like
627+ they'd be better before the branch so that we can cover any latency
628+ from storing the argument and loading its high word. Oh well. */
629+
630+ g = b * y;
631+ h = 0.5 * y;
632+
633+ /* Handle small numbers by scaling. */
634+ if (__builtin_expect ((u.parts.msw & 0x7ff00000) <= 0x02000000, 0))
635+ return __ieee754_sqrt (b * two108) * twom54;
636+
637+#define FMADD(a_, c_, b_) \
638+ ({ double __r; \
639+ __asm__ ("fmadd %[r], %[a], %[c], %[b]\n" \
640+ : [r] "=f" (__r) : [a] "f" (a_), [c] "f" (c_), [b] "f" (b_)); \
641+ __r;})
642+#define FNMSUB(a_, c_, b_) \
643+ ({ double __r; \
644+ __asm__ ("fnmsub %[r], %[a], %[c], %[b]\n" \
645+ : [r] "=f" (__r) : [a] "f" (a_), [c] "f" (c_), [b] "f" (b_)); \
646+ __r;})
647+
648+ r = FNMSUB (g, h, half);
649+ g = FMADD (g, r, g);
650+ h = FMADD (h, r, h);
651+
652+ r = FNMSUB (g, h, half);
653+ g = FMADD (g, r, g);
654+ h = FMADD (h, r, h);
655+
656+ r = FNMSUB (g, h, half);
657+ g = FMADD (g, r, g);
658+ h = FMADD (h, r, h);
659+
660+ /* g is now +/- 1ulp, or exactly equal to, the square root of b. */
661+
662+ /* Final refinement. */
663+ d = FNMSUB (g, g, b);
664+
665+ fesetenv_register (fe);
666+ return FMADD (d, h, g);
667+ }
668+ }
669+ else if (b < 0)
670+ {
671+ /* For some reason, some PowerPC32 processors don't implement
672+ FE_INVALID_SQRT. */
673+#ifdef FE_INVALID_SQRT
674+ feraiseexcept (FE_INVALID_SQRT);
675+
676+ fenv_union_t u = { .fenv = fegetenv_register () };
677+ if ((u.l & FE_INVALID) == 0)
678+#endif
679+ feraiseexcept (FE_INVALID);
680+ b = a_nan.value;
681+ }
682+ return f_wash (b);
683+}
684diff --git a/sysdeps/powerpc/powerpc32/e5500/fpu/e_sqrtf.c b/sysdeps/powerpc/powerpc32/e5500/fpu/e_sqrtf.c
685new file mode 100644
686index 0000000000..26fa067abf
687--- /dev/null
688+++ b/sysdeps/powerpc/powerpc32/e5500/fpu/e_sqrtf.c
689@@ -0,0 +1,101 @@
690+/* Single-precision floating point square root.
691+ Copyright (C) 2010 Free Software Foundation, Inc.
692+ This file is part of the GNU C Library.
693+
694+ The GNU C Library is free software; you can redistribute it and/or
695+ modify it under the terms of the GNU Lesser General Public
696+ License as published by the Free Software Foundation; either
697+ version 2.1 of the License, or (at your option) any later version.
698+
699+ The GNU C Library is distributed in the hope that it will be useful,
700+ but WITHOUT ANY WARRANTY; without even the implied warranty of
701+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
702+ Lesser General Public License for more details.
703+
704+ You should have received a copy of the GNU Lesser General Public
705+ License along with the GNU C Library; if not, write to the Free
706+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
707+ 02111-1307 USA. */
708+
709+#include <math.h>
710+#include <math_private.h>
711+#include <fenv_libc.h>
712+#include <inttypes.h>
713+
714+#include <sysdep.h>
715+#include <ldsodefs.h>
716+
717+static const ieee_float_shape_type a_nan = {.word = 0x7fc00000 };
718+static const ieee_float_shape_type a_inf = {.word = 0x7f800000 };
719+static const float threehalf = 1.5;
720+
721+/* The method is based on the descriptions in:
722+
723+ _The Handbook of Floating-Pointer Arithmetic_ by Muller et al., chapter 5;
724+ _IA-64 and Elementary Functions: Speed and Precision_ by Markstein, chapter 9
725+
726+ We find the reciprocal square root and use that to compute the actual
727+ square root. */
728+
729+#ifdef __STDC__
730+float
731+__ieee754_sqrtf (float b)
732+#else
733+float
734+__ieee754_sqrtf (b)
735+ float b;
736+#endif
737+{
738+ if (__builtin_expect (b > 0, 1))
739+ {
740+#define FMSUB(a_, c_, b_) \
741+ ({ double __r; \
742+ __asm__ ("fmsub %[r], %[a], %[c], %[b]\n" \
743+ : [r] "=f" (__r) : [a] "f" (a_), [c] "f" (c_), [b] "f" (b_)); \
744+ __r;})
745+#define FNMSUB(a_, c_, b_) \
746+ ({ double __r; \
747+ __asm__ ("fnmsub %[r], %[a], %[c], %[b]\n" \
748+ : [r] "=f" (__r) : [a] "f" (a_), [c] "f" (c_), [b] "f" (b_)); \
749+ __r;})
750+
751+ if (__builtin_expect (b != a_inf.value, 1))
752+ {
753+ double y, x;
754+ fenv_t fe;
755+
756+ fe = fegetenv_register ();
757+
758+ relax_fenv_state ();
759+
760+ /* Compute y = 1.5 * b - b. Uses fewer constants than y = 0.5 * b. */
761+ y = FMSUB (threehalf, b, b);
762+
763+ /* Initial estimate. */
764+ __asm__ ("frsqrte %[x], %[b]\n" : [x] "=f" (x) : [b] "f" (b));
765+
766+ /* Iterate. x_{n+1} = x_n * (1.5 - y * (x_n * x_n)). */
767+ x = x * FNMSUB (y, x * x, threehalf);
768+ x = x * FNMSUB (y, x * x, threehalf);
769+ x = x * FNMSUB (y, x * x, threehalf);
770+
771+ /* All done. */
772+ fesetenv_register (fe);
773+ return x * b;
774+ }
775+ }
776+ else if (b < 0)
777+ {
778+ /* For some reason, some PowerPC32 processors don't implement
779+ FE_INVALID_SQRT. */
780+#ifdef FE_INVALID_SQRT
781+ feraiseexcept (FE_INVALID_SQRT);
782+
783+ fenv_union_t u = { .fenv = fegetenv_register () };
784+ if ((u.l & FE_INVALID) == 0)
785+#endif
786+ feraiseexcept (FE_INVALID);
787+ b = a_nan.value;
788+ }
789+ return f_washf (b);
790+}
791diff --git a/sysdeps/powerpc/powerpc32/e6500/fpu/e_sqrt.c b/sysdeps/powerpc/powerpc32/e6500/fpu/e_sqrt.c
792new file mode 100644
793index 0000000000..71e516d1c8
794--- /dev/null
795+++ b/sysdeps/powerpc/powerpc32/e6500/fpu/e_sqrt.c
796@@ -0,0 +1,134 @@
797+/* Double-precision floating point square root.
798+ Copyright (C) 2010 Free Software Foundation, Inc.
799+ This file is part of the GNU C Library.
800+
801+ The GNU C Library is free software; you can redistribute it and/or
802+ modify it under the terms of the GNU Lesser General Public
803+ License as published by the Free Software Foundation; either
804+ version 2.1 of the License, or (at your option) any later version.
805+
806+ The GNU C Library is distributed in the hope that it will be useful,
807+ but WITHOUT ANY WARRANTY; without even the implied warranty of
808+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
809+ Lesser General Public License for more details.
810+
811+ You should have received a copy of the GNU Lesser General Public
812+ License along with the GNU C Library; if not, write to the Free
813+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
814+ 02111-1307 USA. */
815+
816+#include <math.h>
817+#include <math_private.h>
818+#include <fenv_libc.h>
819+#include <inttypes.h>
820+
821+#include <sysdep.h>
822+#include <ldsodefs.h>
823+
824+static const ieee_float_shape_type a_nan = {.word = 0x7fc00000 };
825+static const ieee_float_shape_type a_inf = {.word = 0x7f800000 };
826+static const float two108 = 3.245185536584267269e+32;
827+static const float twom54 = 5.551115123125782702e-17;
828+static const float half = 0.5;
829+
830+/* The method is based on the descriptions in:
831+
832+ _The Handbook of Floating-Pointer Arithmetic_ by Muller et al., chapter 5;
833+ _IA-64 and Elementary Functions: Speed and Precision_ by Markstein, chapter 9
834+
835+ We find the actual square root and half of its reciprocal
836+ simultaneously. */
837+
838+#ifdef __STDC__
839+double
840+__ieee754_sqrt (double b)
841+#else
842+double
843+__ieee754_sqrt (b)
844+ double b;
845+#endif
846+{
847+ if (__builtin_expect (b > 0, 1))
848+ {
849+ double y, g, h, d, r;
850+ ieee_double_shape_type u;
851+
852+ if (__builtin_expect (b != a_inf.value, 1))
853+ {
854+ fenv_t fe;
855+
856+ fe = fegetenv_register ();
857+
858+ u.value = b;
859+
860+ relax_fenv_state ();
861+
862+ __asm__ ("frsqrte %[estimate], %[x]\n"
863+ : [estimate] "=f" (y) : [x] "f" (b));
864+
865+ /* Following Muller et al, page 168, equation 5.20.
866+
867+ h goes to 1/(2*sqrt(b))
868+ g goes to sqrt(b).
869+
870+ We need three iterations to get within 1ulp. */
871+
872+ /* Indicate that these can be performed prior to the branch. GCC
873+ insists on sinking them below the branch, however; it seems like
874+ they'd be better before the branch so that we can cover any latency
875+ from storing the argument and loading its high word. Oh well. */
876+
877+ g = b * y;
878+ h = 0.5 * y;
879+
880+ /* Handle small numbers by scaling. */
881+ if (__builtin_expect ((u.parts.msw & 0x7ff00000) <= 0x02000000, 0))
882+ return __ieee754_sqrt (b * two108) * twom54;
883+
884+#define FMADD(a_, c_, b_) \
885+ ({ double __r; \
886+ __asm__ ("fmadd %[r], %[a], %[c], %[b]\n" \
887+ : [r] "=f" (__r) : [a] "f" (a_), [c] "f" (c_), [b] "f" (b_)); \
888+ __r;})
889+#define FNMSUB(a_, c_, b_) \
890+ ({ double __r; \
891+ __asm__ ("fnmsub %[r], %[a], %[c], %[b]\n" \
892+ : [r] "=f" (__r) : [a] "f" (a_), [c] "f" (c_), [b] "f" (b_)); \
893+ __r;})
894+
895+ r = FNMSUB (g, h, half);
896+ g = FMADD (g, r, g);
897+ h = FMADD (h, r, h);
898+
899+ r = FNMSUB (g, h, half);
900+ g = FMADD (g, r, g);
901+ h = FMADD (h, r, h);
902+
903+ r = FNMSUB (g, h, half);
904+ g = FMADD (g, r, g);
905+ h = FMADD (h, r, h);
906+
907+ /* g is now +/- 1ulp, or exactly equal to, the square root of b. */
908+
909+ /* Final refinement. */
910+ d = FNMSUB (g, g, b);
911+
912+ fesetenv_register (fe);
913+ return FMADD (d, h, g);
914+ }
915+ }
916+ else if (b < 0)
917+ {
918+ /* For some reason, some PowerPC32 processors don't implement
919+ FE_INVALID_SQRT. */
920+#ifdef FE_INVALID_SQRT
921+ feraiseexcept (FE_INVALID_SQRT);
922+
923+ fenv_union_t u = { .fenv = fegetenv_register () };
924+ if ((u.l & FE_INVALID) == 0)
925+#endif
926+ feraiseexcept (FE_INVALID);
927+ b = a_nan.value;
928+ }
929+ return f_wash (b);
930+}
931diff --git a/sysdeps/powerpc/powerpc32/e6500/fpu/e_sqrtf.c b/sysdeps/powerpc/powerpc32/e6500/fpu/e_sqrtf.c
932new file mode 100644
933index 0000000000..26fa067abf
934--- /dev/null
935+++ b/sysdeps/powerpc/powerpc32/e6500/fpu/e_sqrtf.c
936@@ -0,0 +1,101 @@
937+/* Single-precision floating point square root.
938+ Copyright (C) 2010 Free Software Foundation, Inc.
939+ This file is part of the GNU C Library.
940+
941+ The GNU C Library is free software; you can redistribute it and/or
942+ modify it under the terms of the GNU Lesser General Public
943+ License as published by the Free Software Foundation; either
944+ version 2.1 of the License, or (at your option) any later version.
945+
946+ The GNU C Library is distributed in the hope that it will be useful,
947+ but WITHOUT ANY WARRANTY; without even the implied warranty of
948+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
949+ Lesser General Public License for more details.
950+
951+ You should have received a copy of the GNU Lesser General Public
952+ License along with the GNU C Library; if not, write to the Free
953+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
954+ 02111-1307 USA. */
955+
956+#include <math.h>
957+#include <math_private.h>
958+#include <fenv_libc.h>
959+#include <inttypes.h>
960+
961+#include <sysdep.h>
962+#include <ldsodefs.h>
963+
964+static const ieee_float_shape_type a_nan = {.word = 0x7fc00000 };
965+static const ieee_float_shape_type a_inf = {.word = 0x7f800000 };
966+static const float threehalf = 1.5;
967+
968+/* The method is based on the descriptions in:
969+
970+ _The Handbook of Floating-Pointer Arithmetic_ by Muller et al., chapter 5;
971+ _IA-64 and Elementary Functions: Speed and Precision_ by Markstein, chapter 9
972+
973+ We find the reciprocal square root and use that to compute the actual
974+ square root. */
975+
976+#ifdef __STDC__
977+float
978+__ieee754_sqrtf (float b)
979+#else
980+float
981+__ieee754_sqrtf (b)
982+ float b;
983+#endif
984+{
985+ if (__builtin_expect (b > 0, 1))
986+ {
987+#define FMSUB(a_, c_, b_) \
988+ ({ double __r; \
989+ __asm__ ("fmsub %[r], %[a], %[c], %[b]\n" \
990+ : [r] "=f" (__r) : [a] "f" (a_), [c] "f" (c_), [b] "f" (b_)); \
991+ __r;})
992+#define FNMSUB(a_, c_, b_) \
993+ ({ double __r; \
994+ __asm__ ("fnmsub %[r], %[a], %[c], %[b]\n" \
995+ : [r] "=f" (__r) : [a] "f" (a_), [c] "f" (c_), [b] "f" (b_)); \
996+ __r;})
997+
998+ if (__builtin_expect (b != a_inf.value, 1))
999+ {
1000+ double y, x;
1001+ fenv_t fe;
1002+
1003+ fe = fegetenv_register ();
1004+
1005+ relax_fenv_state ();
1006+
1007+ /* Compute y = 1.5 * b - b. Uses fewer constants than y = 0.5 * b. */
1008+ y = FMSUB (threehalf, b, b);
1009+
1010+ /* Initial estimate. */
1011+ __asm__ ("frsqrte %[x], %[b]\n" : [x] "=f" (x) : [b] "f" (b));
1012+
1013+ /* Iterate. x_{n+1} = x_n * (1.5 - y * (x_n * x_n)). */
1014+ x = x * FNMSUB (y, x * x, threehalf);
1015+ x = x * FNMSUB (y, x * x, threehalf);
1016+ x = x * FNMSUB (y, x * x, threehalf);
1017+
1018+ /* All done. */
1019+ fesetenv_register (fe);
1020+ return x * b;
1021+ }
1022+ }
1023+ else if (b < 0)
1024+ {
1025+ /* For some reason, some PowerPC32 processors don't implement
1026+ FE_INVALID_SQRT. */
1027+#ifdef FE_INVALID_SQRT
1028+ feraiseexcept (FE_INVALID_SQRT);
1029+
1030+ fenv_union_t u = { .fenv = fegetenv_register () };
1031+ if ((u.l & FE_INVALID) == 0)
1032+#endif
1033+ feraiseexcept (FE_INVALID);
1034+ b = a_nan.value;
1035+ }
1036+ return f_washf (b);
1037+}
1038diff --git a/sysdeps/powerpc/powerpc64/e5500/fpu/e_sqrt.c b/sysdeps/powerpc/powerpc64/e5500/fpu/e_sqrt.c
1039new file mode 100644
1040index 0000000000..71e516d1c8
1041--- /dev/null
1042+++ b/sysdeps/powerpc/powerpc64/e5500/fpu/e_sqrt.c
1043@@ -0,0 +1,134 @@
1044+/* Double-precision floating point square root.
1045+ Copyright (C) 2010 Free Software Foundation, Inc.
1046+ This file is part of the GNU C Library.
1047+
1048+ The GNU C Library is free software; you can redistribute it and/or
1049+ modify it under the terms of the GNU Lesser General Public
1050+ License as published by the Free Software Foundation; either
1051+ version 2.1 of the License, or (at your option) any later version.
1052+
1053+ The GNU C Library is distributed in the hope that it will be useful,
1054+ but WITHOUT ANY WARRANTY; without even the implied warranty of
1055+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
1056+ Lesser General Public License for more details.
1057+
1058+ You should have received a copy of the GNU Lesser General Public
1059+ License along with the GNU C Library; if not, write to the Free
1060+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
1061+ 02111-1307 USA. */
1062+
1063+#include <math.h>
1064+#include <math_private.h>
1065+#include <fenv_libc.h>
1066+#include <inttypes.h>
1067+
1068+#include <sysdep.h>
1069+#include <ldsodefs.h>
1070+
1071+static const ieee_float_shape_type a_nan = {.word = 0x7fc00000 };
1072+static const ieee_float_shape_type a_inf = {.word = 0x7f800000 };
1073+static const float two108 = 3.245185536584267269e+32;
1074+static const float twom54 = 5.551115123125782702e-17;
1075+static const float half = 0.5;
1076+
1077+/* The method is based on the descriptions in:
1078+
1079+ _The Handbook of Floating-Pointer Arithmetic_ by Muller et al., chapter 5;
1080+ _IA-64 and Elementary Functions: Speed and Precision_ by Markstein, chapter 9
1081+
1082+ We find the actual square root and half of its reciprocal
1083+ simultaneously. */
1084+
1085+#ifdef __STDC__
1086+double
1087+__ieee754_sqrt (double b)
1088+#else
1089+double
1090+__ieee754_sqrt (b)
1091+ double b;
1092+#endif
1093+{
1094+ if (__builtin_expect (b > 0, 1))
1095+ {
1096+ double y, g, h, d, r;
1097+ ieee_double_shape_type u;
1098+
1099+ if (__builtin_expect (b != a_inf.value, 1))
1100+ {
1101+ fenv_t fe;
1102+
1103+ fe = fegetenv_register ();
1104+
1105+ u.value = b;
1106+
1107+ relax_fenv_state ();
1108+
1109+ __asm__ ("frsqrte %[estimate], %[x]\n"
1110+ : [estimate] "=f" (y) : [x] "f" (b));
1111+
1112+ /* Following Muller et al, page 168, equation 5.20.
1113+
1114+ h goes to 1/(2*sqrt(b))
1115+ g goes to sqrt(b).
1116+
1117+ We need three iterations to get within 1ulp. */
1118+
1119+ /* Indicate that these can be performed prior to the branch. GCC
1120+ insists on sinking them below the branch, however; it seems like
1121+ they'd be better before the branch so that we can cover any latency
1122+ from storing the argument and loading its high word. Oh well. */
1123+
1124+ g = b * y;
1125+ h = 0.5 * y;
1126+
1127+ /* Handle small numbers by scaling. */
1128+ if (__builtin_expect ((u.parts.msw & 0x7ff00000) <= 0x02000000, 0))
1129+ return __ieee754_sqrt (b * two108) * twom54;
1130+
1131+#define FMADD(a_, c_, b_) \
1132+ ({ double __r; \
1133+ __asm__ ("fmadd %[r], %[a], %[c], %[b]\n" \
1134+ : [r] "=f" (__r) : [a] "f" (a_), [c] "f" (c_), [b] "f" (b_)); \
1135+ __r;})
1136+#define FNMSUB(a_, c_, b_) \
1137+ ({ double __r; \
1138+ __asm__ ("fnmsub %[r], %[a], %[c], %[b]\n" \
1139+ : [r] "=f" (__r) : [a] "f" (a_), [c] "f" (c_), [b] "f" (b_)); \
1140+ __r;})
1141+
1142+ r = FNMSUB (g, h, half);
1143+ g = FMADD (g, r, g);
1144+ h = FMADD (h, r, h);
1145+
1146+ r = FNMSUB (g, h, half);
1147+ g = FMADD (g, r, g);
1148+ h = FMADD (h, r, h);
1149+
1150+ r = FNMSUB (g, h, half);
1151+ g = FMADD (g, r, g);
1152+ h = FMADD (h, r, h);
1153+
1154+ /* g is now +/- 1ulp, or exactly equal to, the square root of b. */
1155+
1156+ /* Final refinement. */
1157+ d = FNMSUB (g, g, b);
1158+
1159+ fesetenv_register (fe);
1160+ return FMADD (d, h, g);
1161+ }
1162+ }
1163+ else if (b < 0)
1164+ {
1165+ /* For some reason, some PowerPC32 processors don't implement
1166+ FE_INVALID_SQRT. */
1167+#ifdef FE_INVALID_SQRT
1168+ feraiseexcept (FE_INVALID_SQRT);
1169+
1170+ fenv_union_t u = { .fenv = fegetenv_register () };
1171+ if ((u.l & FE_INVALID) == 0)
1172+#endif
1173+ feraiseexcept (FE_INVALID);
1174+ b = a_nan.value;
1175+ }
1176+ return f_wash (b);
1177+}
1178diff --git a/sysdeps/powerpc/powerpc64/e5500/fpu/e_sqrtf.c b/sysdeps/powerpc/powerpc64/e5500/fpu/e_sqrtf.c
1179new file mode 100644
1180index 0000000000..26fa067abf
1181--- /dev/null
1182+++ b/sysdeps/powerpc/powerpc64/e5500/fpu/e_sqrtf.c
1183@@ -0,0 +1,101 @@
1184+/* Single-precision floating point square root.
1185+ Copyright (C) 2010 Free Software Foundation, Inc.
1186+ This file is part of the GNU C Library.
1187+
1188+ The GNU C Library is free software; you can redistribute it and/or
1189+ modify it under the terms of the GNU Lesser General Public
1190+ License as published by the Free Software Foundation; either
1191+ version 2.1 of the License, or (at your option) any later version.
1192+
1193+ The GNU C Library is distributed in the hope that it will be useful,
1194+ but WITHOUT ANY WARRANTY; without even the implied warranty of
1195+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
1196+ Lesser General Public License for more details.
1197+
1198+ You should have received a copy of the GNU Lesser General Public
1199+ License along with the GNU C Library; if not, write to the Free
1200+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
1201+ 02111-1307 USA. */
1202+
1203+#include <math.h>
1204+#include <math_private.h>
1205+#include <fenv_libc.h>
1206+#include <inttypes.h>
1207+
1208+#include <sysdep.h>
1209+#include <ldsodefs.h>
1210+
1211+static const ieee_float_shape_type a_nan = {.word = 0x7fc00000 };
1212+static const ieee_float_shape_type a_inf = {.word = 0x7f800000 };
1213+static const float threehalf = 1.5;
1214+
1215+/* The method is based on the descriptions in:
1216+
1217+ _The Handbook of Floating-Pointer Arithmetic_ by Muller et al., chapter 5;
1218+ _IA-64 and Elementary Functions: Speed and Precision_ by Markstein, chapter 9
1219+
1220+ We find the reciprocal square root and use that to compute the actual
1221+ square root. */
1222+
1223+#ifdef __STDC__
1224+float
1225+__ieee754_sqrtf (float b)
1226+#else
1227+float
1228+__ieee754_sqrtf (b)
1229+ float b;
1230+#endif
1231+{
1232+ if (__builtin_expect (b > 0, 1))
1233+ {
1234+#define FMSUB(a_, c_, b_) \
1235+ ({ double __r; \
1236+ __asm__ ("fmsub %[r], %[a], %[c], %[b]\n" \
1237+ : [r] "=f" (__r) : [a] "f" (a_), [c] "f" (c_), [b] "f" (b_)); \
1238+ __r;})
1239+#define FNMSUB(a_, c_, b_) \
1240+ ({ double __r; \
1241+ __asm__ ("fnmsub %[r], %[a], %[c], %[b]\n" \
1242+ : [r] "=f" (__r) : [a] "f" (a_), [c] "f" (c_), [b] "f" (b_)); \
1243+ __r;})
1244+
1245+ if (__builtin_expect (b != a_inf.value, 1))
1246+ {
1247+ double y, x;
1248+ fenv_t fe;
1249+
1250+ fe = fegetenv_register ();
1251+
1252+ relax_fenv_state ();
1253+
1254+ /* Compute y = 1.5 * b - b. Uses fewer constants than y = 0.5 * b. */
1255+ y = FMSUB (threehalf, b, b);
1256+
1257+ /* Initial estimate. */
1258+ __asm__ ("frsqrte %[x], %[b]\n" : [x] "=f" (x) : [b] "f" (b));
1259+
1260+ /* Iterate. x_{n+1} = x_n * (1.5 - y * (x_n * x_n)). */
1261+ x = x * FNMSUB (y, x * x, threehalf);
1262+ x = x * FNMSUB (y, x * x, threehalf);
1263+ x = x * FNMSUB (y, x * x, threehalf);
1264+
1265+ /* All done. */
1266+ fesetenv_register (fe);
1267+ return x * b;
1268+ }
1269+ }
1270+ else if (b < 0)
1271+ {
1272+ /* For some reason, some PowerPC32 processors don't implement
1273+ FE_INVALID_SQRT. */
1274+#ifdef FE_INVALID_SQRT
1275+ feraiseexcept (FE_INVALID_SQRT);
1276+
1277+ fenv_union_t u = { .fenv = fegetenv_register () };
1278+ if ((u.l & FE_INVALID) == 0)
1279+#endif
1280+ feraiseexcept (FE_INVALID);
1281+ b = a_nan.value;
1282+ }
1283+ return f_washf (b);
1284+}
1285diff --git a/sysdeps/powerpc/powerpc64/e6500/fpu/e_sqrt.c b/sysdeps/powerpc/powerpc64/e6500/fpu/e_sqrt.c
1286new file mode 100644
1287index 0000000000..71e516d1c8
1288--- /dev/null
1289+++ b/sysdeps/powerpc/powerpc64/e6500/fpu/e_sqrt.c
1290@@ -0,0 +1,134 @@
1291+/* Double-precision floating point square root.
1292+ Copyright (C) 2010 Free Software Foundation, Inc.
1293+ This file is part of the GNU C Library.
1294+
1295+ The GNU C Library is free software; you can redistribute it and/or
1296+ modify it under the terms of the GNU Lesser General Public
1297+ License as published by the Free Software Foundation; either
1298+ version 2.1 of the License, or (at your option) any later version.
1299+
1300+ The GNU C Library is distributed in the hope that it will be useful,
1301+ but WITHOUT ANY WARRANTY; without even the implied warranty of
1302+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
1303+ Lesser General Public License for more details.
1304+
1305+ You should have received a copy of the GNU Lesser General Public
1306+ License along with the GNU C Library; if not, write to the Free
1307+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
1308+ 02111-1307 USA. */
1309+
1310+#include <math.h>
1311+#include <math_private.h>
1312+#include <fenv_libc.h>
1313+#include <inttypes.h>
1314+
1315+#include <sysdep.h>
1316+#include <ldsodefs.h>
1317+
1318+static const ieee_float_shape_type a_nan = {.word = 0x7fc00000 };
1319+static const ieee_float_shape_type a_inf = {.word = 0x7f800000 };
1320+static const float two108 = 3.245185536584267269e+32;
1321+static const float twom54 = 5.551115123125782702e-17;
1322+static const float half = 0.5;
1323+
1324+/* The method is based on the descriptions in:
1325+
1326+ _The Handbook of Floating-Pointer Arithmetic_ by Muller et al., chapter 5;
1327+ _IA-64 and Elementary Functions: Speed and Precision_ by Markstein, chapter 9
1328+
1329+ We find the actual square root and half of its reciprocal
1330+ simultaneously. */
1331+
1332+#ifdef __STDC__
1333+double
1334+__ieee754_sqrt (double b)
1335+#else
1336+double
1337+__ieee754_sqrt (b)
1338+ double b;
1339+#endif
1340+{
1341+ if (__builtin_expect (b > 0, 1))
1342+ {
1343+ double y, g, h, d, r;
1344+ ieee_double_shape_type u;
1345+
1346+ if (__builtin_expect (b != a_inf.value, 1))
1347+ {
1348+ fenv_t fe;
1349+
1350+ fe = fegetenv_register ();
1351+
1352+ u.value = b;
1353+
1354+ relax_fenv_state ();
1355+
1356+ __asm__ ("frsqrte %[estimate], %[x]\n"
1357+ : [estimate] "=f" (y) : [x] "f" (b));
1358+
1359+ /* Following Muller et al, page 168, equation 5.20.
1360+
1361+ h goes to 1/(2*sqrt(b))
1362+ g goes to sqrt(b).
1363+
1364+ We need three iterations to get within 1ulp. */
1365+
1366+ /* Indicate that these can be performed prior to the branch. GCC
1367+ insists on sinking them below the branch, however; it seems like
1368+ they'd be better before the branch so that we can cover any latency
1369+ from storing the argument and loading its high word. Oh well. */
1370+
1371+ g = b * y;
1372+ h = 0.5 * y;
1373+
1374+ /* Handle small numbers by scaling. */
1375+ if (__builtin_expect ((u.parts.msw & 0x7ff00000) <= 0x02000000, 0))
1376+ return __ieee754_sqrt (b * two108) * twom54;
1377+
1378+#define FMADD(a_, c_, b_) \
1379+ ({ double __r; \
1380+ __asm__ ("fmadd %[r], %[a], %[c], %[b]\n" \
1381+ : [r] "=f" (__r) : [a] "f" (a_), [c] "f" (c_), [b] "f" (b_)); \
1382+ __r;})
1383+#define FNMSUB(a_, c_, b_) \
1384+ ({ double __r; \
1385+ __asm__ ("fnmsub %[r], %[a], %[c], %[b]\n" \
1386+ : [r] "=f" (__r) : [a] "f" (a_), [c] "f" (c_), [b] "f" (b_)); \
1387+ __r;})
1388+
1389+ r = FNMSUB (g, h, half);
1390+ g = FMADD (g, r, g);
1391+ h = FMADD (h, r, h);
1392+
1393+ r = FNMSUB (g, h, half);
1394+ g = FMADD (g, r, g);
1395+ h = FMADD (h, r, h);
1396+
1397+ r = FNMSUB (g, h, half);
1398+ g = FMADD (g, r, g);
1399+ h = FMADD (h, r, h);
1400+
1401+ /* g is now +/- 1ulp, or exactly equal to, the square root of b. */
1402+
1403+ /* Final refinement. */
1404+ d = FNMSUB (g, g, b);
1405+
1406+ fesetenv_register (fe);
1407+ return FMADD (d, h, g);
1408+ }
1409+ }
1410+ else if (b < 0)
1411+ {
1412+ /* For some reason, some PowerPC32 processors don't implement
1413+ FE_INVALID_SQRT. */
1414+#ifdef FE_INVALID_SQRT
1415+ feraiseexcept (FE_INVALID_SQRT);
1416+
1417+ fenv_union_t u = { .fenv = fegetenv_register () };
1418+ if ((u.l & FE_INVALID) == 0)
1419+#endif
1420+ feraiseexcept (FE_INVALID);
1421+ b = a_nan.value;
1422+ }
1423+ return f_wash (b);
1424+}
1425diff --git a/sysdeps/powerpc/powerpc64/e6500/fpu/e_sqrtf.c b/sysdeps/powerpc/powerpc64/e6500/fpu/e_sqrtf.c
1426new file mode 100644
1427index 0000000000..26fa067abf
1428--- /dev/null
1429+++ b/sysdeps/powerpc/powerpc64/e6500/fpu/e_sqrtf.c
1430@@ -0,0 +1,101 @@
1431+/* Single-precision floating point square root.
1432+ Copyright (C) 2010 Free Software Foundation, Inc.
1433+ This file is part of the GNU C Library.
1434+
1435+ The GNU C Library is free software; you can redistribute it and/or
1436+ modify it under the terms of the GNU Lesser General Public
1437+ License as published by the Free Software Foundation; either
1438+ version 2.1 of the License, or (at your option) any later version.
1439+
1440+ The GNU C Library is distributed in the hope that it will be useful,
1441+ but WITHOUT ANY WARRANTY; without even the implied warranty of
1442+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
1443+ Lesser General Public License for more details.
1444+
1445+ You should have received a copy of the GNU Lesser General Public
1446+ License along with the GNU C Library; if not, write to the Free
1447+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
1448+ 02111-1307 USA. */
1449+
1450+#include <math.h>
1451+#include <math_private.h>
1452+#include <fenv_libc.h>
1453+#include <inttypes.h>
1454+
1455+#include <sysdep.h>
1456+#include <ldsodefs.h>
1457+
1458+static const ieee_float_shape_type a_nan = {.word = 0x7fc00000 };
1459+static const ieee_float_shape_type a_inf = {.word = 0x7f800000 };
1460+static const float threehalf = 1.5;
1461+
1462+/* The method is based on the descriptions in:
1463+
1464+ _The Handbook of Floating-Pointer Arithmetic_ by Muller et al., chapter 5;
1465+ _IA-64 and Elementary Functions: Speed and Precision_ by Markstein, chapter 9
1466+
1467+ We find the reciprocal square root and use that to compute the actual
1468+ square root. */
1469+
1470+#ifdef __STDC__
1471+float
1472+__ieee754_sqrtf (float b)
1473+#else
1474+float
1475+__ieee754_sqrtf (b)
1476+ float b;
1477+#endif
1478+{
1479+ if (__builtin_expect (b > 0, 1))
1480+ {
1481+#define FMSUB(a_, c_, b_) \
1482+ ({ double __r; \
1483+ __asm__ ("fmsub %[r], %[a], %[c], %[b]\n" \
1484+ : [r] "=f" (__r) : [a] "f" (a_), [c] "f" (c_), [b] "f" (b_)); \
1485+ __r;})
1486+#define FNMSUB(a_, c_, b_) \
1487+ ({ double __r; \
1488+ __asm__ ("fnmsub %[r], %[a], %[c], %[b]\n" \
1489+ : [r] "=f" (__r) : [a] "f" (a_), [c] "f" (c_), [b] "f" (b_)); \
1490+ __r;})
1491+
1492+ if (__builtin_expect (b != a_inf.value, 1))
1493+ {
1494+ double y, x;
1495+ fenv_t fe;
1496+
1497+ fe = fegetenv_register ();
1498+
1499+ relax_fenv_state ();
1500+
1501+ /* Compute y = 1.5 * b - b. Uses fewer constants than y = 0.5 * b. */
1502+ y = FMSUB (threehalf, b, b);
1503+
1504+ /* Initial estimate. */
1505+ __asm__ ("frsqrte %[x], %[b]\n" : [x] "=f" (x) : [b] "f" (b));
1506+
1507+ /* Iterate. x_{n+1} = x_n * (1.5 - y * (x_n * x_n)). */
1508+ x = x * FNMSUB (y, x * x, threehalf);
1509+ x = x * FNMSUB (y, x * x, threehalf);
1510+ x = x * FNMSUB (y, x * x, threehalf);
1511+
1512+ /* All done. */
1513+ fesetenv_register (fe);
1514+ return x * b;
1515+ }
1516+ }
1517+ else if (b < 0)
1518+ {
1519+ /* For some reason, some PowerPC32 processors don't implement
1520+ FE_INVALID_SQRT. */
1521+#ifdef FE_INVALID_SQRT
1522+ feraiseexcept (FE_INVALID_SQRT);
1523+
1524+ fenv_union_t u = { .fenv = fegetenv_register () };
1525+ if ((u.l & FE_INVALID) == 0)
1526+#endif
1527+ feraiseexcept (FE_INVALID);
1528+ b = a_nan.value;
1529+ }
1530+ return f_washf (b);
1531+}
1532diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/603e/fpu/Implies b/sysdeps/unix/sysv/linux/powerpc/powerpc32/603e/fpu/Implies
1533new file mode 100644
1534index 0000000000..b103b4dea5
1535--- /dev/null
1536+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/603e/fpu/Implies
1537@@ -0,0 +1 @@
1538+powerpc/powerpc32/603e/fpu
1539diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/e300c3/fpu/Implies b/sysdeps/unix/sysv/linux/powerpc/powerpc32/e300c3/fpu/Implies
1540new file mode 100644
1541index 0000000000..64db17fada
1542--- /dev/null
1543+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/e300c3/fpu/Implies
1544@@ -0,0 +1,2 @@
1545+# e300c3 is a variant of 603e so use the same optimizations for sqrt
1546+powerpc/powerpc32/603e/fpu
1547diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/e500mc/fpu/Implies b/sysdeps/unix/sysv/linux/powerpc/powerpc32/e500mc/fpu/Implies
1548new file mode 100644
1549index 0000000000..7eac5fcf02
1550--- /dev/null
1551+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/e500mc/fpu/Implies
1552@@ -0,0 +1 @@
1553+powerpc/powerpc32/e500mc/fpu
1554diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/e5500/fpu/Implies b/sysdeps/unix/sysv/linux/powerpc/powerpc32/e5500/fpu/Implies
1555new file mode 100644
1556index 0000000000..264b2a7700
1557--- /dev/null
1558+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/e5500/fpu/Implies
1559@@ -0,0 +1 @@
1560+powerpc/powerpc32/e5500/fpu
1561diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/e6500/fpu/Implies b/sysdeps/unix/sysv/linux/powerpc/powerpc32/e6500/fpu/Implies
1562new file mode 100644
1563index 0000000000..a25934467b
1564--- /dev/null
1565+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/e6500/fpu/Implies
1566@@ -0,0 +1 @@
1567+powerpc/powerpc32/e6500/fpu
1568diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/e5500/fpu/Implies b/sysdeps/unix/sysv/linux/powerpc/powerpc64/e5500/fpu/Implies
1569new file mode 100644
1570index 0000000000..a7bc854be8
1571--- /dev/null
1572+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/e5500/fpu/Implies
1573@@ -0,0 +1 @@
1574+powerpc/powerpc64/e5500/fpu
1575diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/e6500/fpu/Implies b/sysdeps/unix/sysv/linux/powerpc/powerpc64/e6500/fpu/Implies
1576new file mode 100644
1577index 0000000000..04ff8cc181
1578--- /dev/null
1579+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/e6500/fpu/Implies
1580@@ -0,0 +1 @@
1581+powerpc/powerpc64/e6500/fpu
diff --git a/meta/recipes-core/glibc/glibc/0008-nativesdk-glibc-Fall-back-to-faccessat-on-faccess2-r.patch b/meta/recipes-core/glibc/glibc/0008-nativesdk-glibc-Fall-back-to-faccessat-on-faccess2-r.patch
new file mode 100644
index 0000000000..096764009a
--- /dev/null
+++ b/meta/recipes-core/glibc/glibc/0008-nativesdk-glibc-Fall-back-to-faccessat-on-faccess2-r.patch
@@ -0,0 +1,32 @@
1From 70da806febac8b2eead6ddc32451bbc1787a1d7d Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Sat, 6 Mar 2021 14:48:56 -0800
4Subject: [PATCH] nativesdk-glibc: Fall back to faccessat on faccess2 returns
5 EPERM
6
7Fedora-specific workaround for systemd-nspawn
8
9Upstream-Status: Inappropriate [Distro Specific]
10
11Signed-off-by: Khem Raj <raj.khem@gmail.com>
12---
13 sysdeps/unix/sysv/linux/faccessat.c | 6 +++++-
14 1 file changed, 5 insertions(+), 1 deletion(-)
15
16diff --git a/sysdeps/unix/sysv/linux/faccessat.c b/sysdeps/unix/sysv/linux/faccessat.c
17index 2fa57fd63d..4d0d5ff0c4 100644
18--- a/sysdeps/unix/sysv/linux/faccessat.c
19+++ b/sysdeps/unix/sysv/linux/faccessat.c
20@@ -30,7 +30,11 @@ __faccessat (int fd, const char *file, int mode, int flag)
21 #if __ASSUME_FACCESSAT2
22 return ret;
23 #else
24- if (ret == 0 || errno != ENOSYS)
25+ /* Fedora-specific workaround:
26+ As a workround for a broken systemd-nspawn that returns
27+ EPERM when a syscall is not allowed instead of ENOSYS
28+ we must check for EPERM here and fall back to faccessat. */
29+ if (ret == 0 || !(errno == ENOSYS || errno == EPERM))
30 return ret;
31
32 if (flag & ~(AT_SYMLINK_NOFOLLOW | AT_EACCESS))
diff --git a/meta/recipes-core/glibc/glibc/0009-ppc-sqrt-Fix-undefined-reference-to-__sqrt_finite.patch b/meta/recipes-core/glibc/glibc/0009-ppc-sqrt-Fix-undefined-reference-to-__sqrt_finite.patch
deleted file mode 100644
index 0c8bf94a75..0000000000
--- a/meta/recipes-core/glibc/glibc/0009-ppc-sqrt-Fix-undefined-reference-to-__sqrt_finite.patch
+++ /dev/null
@@ -1,205 +0,0 @@
1From 3b5fe5b1a7390cde0f07351415e3891f62d1f7e0 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Wed, 18 Mar 2015 00:15:07 +0000
4Subject: [PATCH] ppc/sqrt: Fix undefined reference to `__sqrt_finite'
5
6on ppc fixes the errors like below
7| ./.libs/libpulsecore-1.1.so: undefined reference to `__sqrt_finite'
8| collect2: ld returned 1 exit status
9
10Upstream-Status: Pending
11
12ChangeLog
13
142012-01-06 Khem Raj <raj.khem@gmail.com>
15
16 * sysdeps/powerpc/powerpc64/e5500/fpu/e_sqrtf.c: Add __*_finite alias.
17 Remove cruft.
18 * sysdeps/powerpc/powerpc64/e5500/fpu/e_sqrt.c: Ditto.
19 * sysdeps/powerpc/powerpc32/603e/fpu/e_sqrt.c: Ditto.
20 * sysdeps/powerpc/powerpc32/603e/fpu/e_sqrtf.c: Ditto.
21
22Signed-off-by: Khem Raj <raj.khem@gmail.com>
23---
24 sysdeps/powerpc/powerpc32/603e/fpu/e_sqrt.c | 7 +------
25 sysdeps/powerpc/powerpc32/603e/fpu/e_sqrtf.c | 7 +------
26 sysdeps/powerpc/powerpc32/e500mc/fpu/e_sqrt.c | 1 +
27 sysdeps/powerpc/powerpc32/e500mc/fpu/e_sqrtf.c | 1 +
28 sysdeps/powerpc/powerpc32/e5500/fpu/e_sqrt.c | 1 +
29 sysdeps/powerpc/powerpc32/e5500/fpu/e_sqrtf.c | 1 +
30 sysdeps/powerpc/powerpc32/e6500/fpu/e_sqrt.c | 1 +
31 sysdeps/powerpc/powerpc32/e6500/fpu/e_sqrtf.c | 1 +
32 sysdeps/powerpc/powerpc64/e5500/fpu/e_sqrt.c | 7 +------
33 sysdeps/powerpc/powerpc64/e5500/fpu/e_sqrtf.c | 7 +------
34 sysdeps/powerpc/powerpc64/e6500/fpu/e_sqrt.c | 1 +
35 sysdeps/powerpc/powerpc64/e6500/fpu/e_sqrtf.c | 1 +
36 12 files changed, 12 insertions(+), 24 deletions(-)
37
38diff --git a/sysdeps/powerpc/powerpc32/603e/fpu/e_sqrt.c b/sysdeps/powerpc/powerpc32/603e/fpu/e_sqrt.c
39index 71e516d1c8..1795fd6c3e 100644
40--- a/sysdeps/powerpc/powerpc32/603e/fpu/e_sqrt.c
41+++ b/sysdeps/powerpc/powerpc32/603e/fpu/e_sqrt.c
42@@ -39,14 +39,8 @@ static const float half = 0.5;
43 We find the actual square root and half of its reciprocal
44 simultaneously. */
45
46-#ifdef __STDC__
47 double
48 __ieee754_sqrt (double b)
49-#else
50-double
51-__ieee754_sqrt (b)
52- double b;
53-#endif
54 {
55 if (__builtin_expect (b > 0, 1))
56 {
57@@ -132,3 +126,4 @@ __ieee754_sqrt (b)
58 }
59 return f_wash (b);
60 }
61+strong_alias (__ieee754_sqrt, __sqrt_finite)
62diff --git a/sysdeps/powerpc/powerpc32/603e/fpu/e_sqrtf.c b/sysdeps/powerpc/powerpc32/603e/fpu/e_sqrtf.c
63index 26fa067abf..a917f313ab 100644
64--- a/sysdeps/powerpc/powerpc32/603e/fpu/e_sqrtf.c
65+++ b/sysdeps/powerpc/powerpc32/603e/fpu/e_sqrtf.c
66@@ -37,14 +37,8 @@ static const float threehalf = 1.5;
67 We find the reciprocal square root and use that to compute the actual
68 square root. */
69
70-#ifdef __STDC__
71 float
72 __ieee754_sqrtf (float b)
73-#else
74-float
75-__ieee754_sqrtf (b)
76- float b;
77-#endif
78 {
79 if (__builtin_expect (b > 0, 1))
80 {
81@@ -99,3 +93,4 @@ __ieee754_sqrtf (b)
82 }
83 return f_washf (b);
84 }
85+strong_alias (__ieee754_sqrtf, __sqrtf_finite)
86diff --git a/sysdeps/powerpc/powerpc32/e500mc/fpu/e_sqrt.c b/sysdeps/powerpc/powerpc32/e500mc/fpu/e_sqrt.c
87index 71e516d1c8..fc4a74990e 100644
88--- a/sysdeps/powerpc/powerpc32/e500mc/fpu/e_sqrt.c
89+++ b/sysdeps/powerpc/powerpc32/e500mc/fpu/e_sqrt.c
90@@ -132,3 +132,4 @@ __ieee754_sqrt (b)
91 }
92 return f_wash (b);
93 }
94+strong_alias (__ieee754_sqrt, __sqrt_finite)
95diff --git a/sysdeps/powerpc/powerpc32/e500mc/fpu/e_sqrtf.c b/sysdeps/powerpc/powerpc32/e500mc/fpu/e_sqrtf.c
96index 26fa067abf..9d175122a8 100644
97--- a/sysdeps/powerpc/powerpc32/e500mc/fpu/e_sqrtf.c
98+++ b/sysdeps/powerpc/powerpc32/e500mc/fpu/e_sqrtf.c
99@@ -99,3 +99,4 @@ __ieee754_sqrtf (b)
100 }
101 return f_washf (b);
102 }
103+strong_alias (__ieee754_sqrtf, __sqrtf_finite)
104diff --git a/sysdeps/powerpc/powerpc32/e5500/fpu/e_sqrt.c b/sysdeps/powerpc/powerpc32/e5500/fpu/e_sqrt.c
105index 71e516d1c8..fc4a74990e 100644
106--- a/sysdeps/powerpc/powerpc32/e5500/fpu/e_sqrt.c
107+++ b/sysdeps/powerpc/powerpc32/e5500/fpu/e_sqrt.c
108@@ -132,3 +132,4 @@ __ieee754_sqrt (b)
109 }
110 return f_wash (b);
111 }
112+strong_alias (__ieee754_sqrt, __sqrt_finite)
113diff --git a/sysdeps/powerpc/powerpc32/e5500/fpu/e_sqrtf.c b/sysdeps/powerpc/powerpc32/e5500/fpu/e_sqrtf.c
114index 26fa067abf..9d175122a8 100644
115--- a/sysdeps/powerpc/powerpc32/e5500/fpu/e_sqrtf.c
116+++ b/sysdeps/powerpc/powerpc32/e5500/fpu/e_sqrtf.c
117@@ -99,3 +99,4 @@ __ieee754_sqrtf (b)
118 }
119 return f_washf (b);
120 }
121+strong_alias (__ieee754_sqrtf, __sqrtf_finite)
122diff --git a/sysdeps/powerpc/powerpc32/e6500/fpu/e_sqrt.c b/sysdeps/powerpc/powerpc32/e6500/fpu/e_sqrt.c
123index 71e516d1c8..fc4a74990e 100644
124--- a/sysdeps/powerpc/powerpc32/e6500/fpu/e_sqrt.c
125+++ b/sysdeps/powerpc/powerpc32/e6500/fpu/e_sqrt.c
126@@ -132,3 +132,4 @@ __ieee754_sqrt (b)
127 }
128 return f_wash (b);
129 }
130+strong_alias (__ieee754_sqrt, __sqrt_finite)
131diff --git a/sysdeps/powerpc/powerpc32/e6500/fpu/e_sqrtf.c b/sysdeps/powerpc/powerpc32/e6500/fpu/e_sqrtf.c
132index 26fa067abf..9d175122a8 100644
133--- a/sysdeps/powerpc/powerpc32/e6500/fpu/e_sqrtf.c
134+++ b/sysdeps/powerpc/powerpc32/e6500/fpu/e_sqrtf.c
135@@ -99,3 +99,4 @@ __ieee754_sqrtf (b)
136 }
137 return f_washf (b);
138 }
139+strong_alias (__ieee754_sqrtf, __sqrtf_finite)
140diff --git a/sysdeps/powerpc/powerpc64/e5500/fpu/e_sqrt.c b/sysdeps/powerpc/powerpc64/e5500/fpu/e_sqrt.c
141index 71e516d1c8..1795fd6c3e 100644
142--- a/sysdeps/powerpc/powerpc64/e5500/fpu/e_sqrt.c
143+++ b/sysdeps/powerpc/powerpc64/e5500/fpu/e_sqrt.c
144@@ -39,14 +39,8 @@ static const float half = 0.5;
145 We find the actual square root and half of its reciprocal
146 simultaneously. */
147
148-#ifdef __STDC__
149 double
150 __ieee754_sqrt (double b)
151-#else
152-double
153-__ieee754_sqrt (b)
154- double b;
155-#endif
156 {
157 if (__builtin_expect (b > 0, 1))
158 {
159@@ -132,3 +126,4 @@ __ieee754_sqrt (b)
160 }
161 return f_wash (b);
162 }
163+strong_alias (__ieee754_sqrt, __sqrt_finite)
164diff --git a/sysdeps/powerpc/powerpc64/e5500/fpu/e_sqrtf.c b/sysdeps/powerpc/powerpc64/e5500/fpu/e_sqrtf.c
165index 26fa067abf..a917f313ab 100644
166--- a/sysdeps/powerpc/powerpc64/e5500/fpu/e_sqrtf.c
167+++ b/sysdeps/powerpc/powerpc64/e5500/fpu/e_sqrtf.c
168@@ -37,14 +37,8 @@ static const float threehalf = 1.5;
169 We find the reciprocal square root and use that to compute the actual
170 square root. */
171
172-#ifdef __STDC__
173 float
174 __ieee754_sqrtf (float b)
175-#else
176-float
177-__ieee754_sqrtf (b)
178- float b;
179-#endif
180 {
181 if (__builtin_expect (b > 0, 1))
182 {
183@@ -99,3 +93,4 @@ __ieee754_sqrtf (b)
184 }
185 return f_washf (b);
186 }
187+strong_alias (__ieee754_sqrtf, __sqrtf_finite)
188diff --git a/sysdeps/powerpc/powerpc64/e6500/fpu/e_sqrt.c b/sysdeps/powerpc/powerpc64/e6500/fpu/e_sqrt.c
189index 71e516d1c8..fc4a74990e 100644
190--- a/sysdeps/powerpc/powerpc64/e6500/fpu/e_sqrt.c
191+++ b/sysdeps/powerpc/powerpc64/e6500/fpu/e_sqrt.c
192@@ -132,3 +132,4 @@ __ieee754_sqrt (b)
193 }
194 return f_wash (b);
195 }
196+strong_alias (__ieee754_sqrt, __sqrt_finite)
197diff --git a/sysdeps/powerpc/powerpc64/e6500/fpu/e_sqrtf.c b/sysdeps/powerpc/powerpc64/e6500/fpu/e_sqrtf.c
198index 26fa067abf..9d175122a8 100644
199--- a/sysdeps/powerpc/powerpc64/e6500/fpu/e_sqrtf.c
200+++ b/sysdeps/powerpc/powerpc64/e6500/fpu/e_sqrtf.c
201@@ -99,3 +99,4 @@ __ieee754_sqrtf (b)
202 }
203 return f_washf (b);
204 }
205+strong_alias (__ieee754_sqrtf, __sqrtf_finite)
diff --git a/meta/recipes-core/glibc/glibc/0015-yes-within-the-path-sets-wrong-config-variables.patch b/meta/recipes-core/glibc/glibc/0009-yes-within-the-path-sets-wrong-config-variables.patch
index 15e83f8917..364e5cfde8 100644
--- a/meta/recipes-core/glibc/glibc/0015-yes-within-the-path-sets-wrong-config-variables.patch
+++ b/meta/recipes-core/glibc/glibc/0009-yes-within-the-path-sets-wrong-config-variables.patch
@@ -1,4 +1,4 @@
1From 0bd39d8907953f18e01742f42b24647ac7689d0a Mon Sep 17 00:00:00 2001 1From 2192588942c5bc3b5fa10fc6d7433923f42e9ba0 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com> 2From: Khem Raj <raj.khem@gmail.com>
3Date: Wed, 18 Mar 2015 00:31:06 +0000 3Date: Wed, 18 Mar 2015 00:31:06 +0000
4Subject: [PATCH] 'yes' within the path sets wrong config variables 4Subject: [PATCH] 'yes' within the path sets wrong config variables
@@ -29,10 +29,10 @@ Signed-off-by: Khem Raj <raj.khem@gmail.com>
29 12 files changed, 28 insertions(+), 28 deletions(-) 29 12 files changed, 28 insertions(+), 28 deletions(-)
30 30
31diff --git a/sysdeps/aarch64/configure b/sysdeps/aarch64/configure 31diff --git a/sysdeps/aarch64/configure b/sysdeps/aarch64/configure
32index 83c3a23e44..a68c946277 100644 32index ca57edce47..5e91fab023 100644
33--- a/sysdeps/aarch64/configure 33--- a/sysdeps/aarch64/configure
34+++ b/sysdeps/aarch64/configure 34+++ b/sysdeps/aarch64/configure
35@@ -157,12 +157,12 @@ else 35@@ -165,12 +165,12 @@ else $as_nop
36 cat confdefs.h - <<_ACEOF >conftest.$ac_ext 36 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
37 /* end confdefs.h. */ 37 /* end confdefs.h. */
38 #ifdef __AARCH64EB__ 38 #ifdef __AARCH64EB__
@@ -42,16 +42,16 @@ index 83c3a23e44..a68c946277 100644
42 42
43 _ACEOF 43 _ACEOF
44 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | 44 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
45- $EGREP "yes" >/dev/null 2>&1; then : 45- $EGREP "yes" >/dev/null 2>&1
46+ $EGREP "is_aarch64_be" >/dev/null 2>&1; then : 46+ $EGREP "is_aarch64_be" >/dev/null 2>&1
47 then :
47 libc_cv_aarch64_be=yes 48 libc_cv_aarch64_be=yes
48 else 49 else $as_nop
49 libc_cv_aarch64_be=no
50diff --git a/sysdeps/aarch64/configure.ac b/sysdeps/aarch64/configure.ac 50diff --git a/sysdeps/aarch64/configure.ac b/sysdeps/aarch64/configure.ac
51index 66f755078a..a32b265bbe 100644 51index 27874eceb4..8a708f2ef4 100644
52--- a/sysdeps/aarch64/configure.ac 52--- a/sysdeps/aarch64/configure.ac
53+++ b/sysdeps/aarch64/configure.ac 53+++ b/sysdeps/aarch64/configure.ac
54@@ -17,8 +17,8 @@ AC_DEFINE(SUPPORT_STATIC_PIE) 54@@ -13,8 +13,8 @@ AC_DEFINE(SUPPORT_STATIC_PIE)
55 # the dynamic linker via %ifdef. 55 # the dynamic linker via %ifdef.
56 AC_CACHE_CHECK([for big endian], 56 AC_CACHE_CHECK([for big endian],
57 [libc_cv_aarch64_be], 57 [libc_cv_aarch64_be],
@@ -63,10 +63,10 @@ index 66f755078a..a32b265bbe 100644
63 ], libc_cv_aarch64_be=yes, libc_cv_aarch64_be=no)]) 63 ], libc_cv_aarch64_be=yes, libc_cv_aarch64_be=no)])
64 if test $libc_cv_aarch64_be = yes; then 64 if test $libc_cv_aarch64_be = yes; then
65diff --git a/sysdeps/arm/configure b/sysdeps/arm/configure 65diff --git a/sysdeps/arm/configure b/sysdeps/arm/configure
66index 431e843b2b..e152461138 100644 66index 35e2918922..94d7fbe8bb 100644
67--- a/sysdeps/arm/configure 67--- a/sysdeps/arm/configure
68+++ b/sysdeps/arm/configure 68+++ b/sysdeps/arm/configure
69@@ -151,12 +151,12 @@ else 69@@ -161,12 +161,12 @@ else $as_nop
70 cat confdefs.h - <<_ACEOF >conftest.$ac_ext 70 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
71 /* end confdefs.h. */ 71 /* end confdefs.h. */
72 #ifdef __ARM_PCS_VFP 72 #ifdef __ARM_PCS_VFP
@@ -76,16 +76,16 @@ index 431e843b2b..e152461138 100644
76 76
77 _ACEOF 77 _ACEOF
78 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | 78 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
79- $EGREP "yes" >/dev/null 2>&1; then : 79- $EGREP "yes" >/dev/null 2>&1
80+ $EGREP "use_arm_pcs_vfp" >/dev/null 2>&1; then : 80+ $EGREP "use_arm_pcs_vfp" >/dev/null 2>&1
81 then :
81 libc_cv_arm_pcs_vfp=yes 82 libc_cv_arm_pcs_vfp=yes
82 else 83 else $as_nop
83 libc_cv_arm_pcs_vfp=no
84diff --git a/sysdeps/arm/configure.ac b/sysdeps/arm/configure.ac 84diff --git a/sysdeps/arm/configure.ac b/sysdeps/arm/configure.ac
85index 90cdd69c75..05a262ba00 100644 85index 5172e30bbe..f06dedd7c5 100644
86--- a/sysdeps/arm/configure.ac 86--- a/sysdeps/arm/configure.ac
87+++ b/sysdeps/arm/configure.ac 87+++ b/sysdeps/arm/configure.ac
88@@ -15,8 +15,8 @@ AC_DEFINE(PI_STATIC_AND_HIDDEN) 88@@ -10,8 +10,8 @@ GLIBC_PROVIDES dnl See aclocal.m4 in the top level source directory.
89 # the dynamic linker via %ifdef. 89 # the dynamic linker via %ifdef.
90 AC_CACHE_CHECK([whether the compiler is using the ARM hard-float ABI], 90 AC_CACHE_CHECK([whether the compiler is using the ARM hard-float ABI],
91 [libc_cv_arm_pcs_vfp], 91 [libc_cv_arm_pcs_vfp],
@@ -97,10 +97,10 @@ index 90cdd69c75..05a262ba00 100644
97 ], libc_cv_arm_pcs_vfp=yes, libc_cv_arm_pcs_vfp=no)]) 97 ], libc_cv_arm_pcs_vfp=yes, libc_cv_arm_pcs_vfp=no)])
98 if test $libc_cv_arm_pcs_vfp = yes; then 98 if test $libc_cv_arm_pcs_vfp = yes; then
99diff --git a/sysdeps/mips/configure b/sysdeps/mips/configure 99diff --git a/sysdeps/mips/configure b/sysdeps/mips/configure
100index 4e13248c03..f14af952d0 100644 100index 1e8c6711e6..ae52ccd929 100644
101--- a/sysdeps/mips/configure 101--- a/sysdeps/mips/configure
102+++ b/sysdeps/mips/configure 102+++ b/sysdeps/mips/configure
103@@ -143,11 +143,11 @@ else 103@@ -158,11 +158,11 @@ else $as_nop
104 /* end confdefs.h. */ 104 /* end confdefs.h. */
105 dnl 105 dnl
106 #ifdef __mips_nan2008 106 #ifdef __mips_nan2008
@@ -109,17 +109,17 @@ index 4e13248c03..f14af952d0 100644
109 #endif 109 #endif
110 _ACEOF 110 _ACEOF
111 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | 111 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
112- $EGREP "yes" >/dev/null 2>&1; then : 112- $EGREP "yes" >/dev/null 2>&1
113+ $EGREP "use_mips_nan2008" >/dev/null 2>&1; then : 113+ $EGREP "use_mips_nan2008" >/dev/null 2>&1
114 then :
114 libc_cv_mips_nan2008=yes 115 libc_cv_mips_nan2008=yes
115 else 116 else $as_nop
116 libc_cv_mips_nan2008=no
117diff --git a/sysdeps/mips/configure.ac b/sysdeps/mips/configure.ac 117diff --git a/sysdeps/mips/configure.ac b/sysdeps/mips/configure.ac
118index bcbdaffd9f..ad3057f4cc 100644 118index d3cd780d78..250223d206 100644
119--- a/sysdeps/mips/configure.ac 119--- a/sysdeps/mips/configure.ac
120+++ b/sysdeps/mips/configure.ac 120+++ b/sysdeps/mips/configure.ac
121@@ -6,9 +6,9 @@ dnl position independent way. 121@@ -6,9 +6,9 @@ dnl position independent way.
122 dnl AC_DEFINE(PI_STATIC_AND_HIDDEN) 122 AC_DEFINE(HIDDEN_VAR_NEEDS_DYNAMIC_RELOC)
123 123
124 AC_CACHE_CHECK([whether the compiler is using the 2008 NaN encoding], 124 AC_CACHE_CHECK([whether the compiler is using the 2008 NaN encoding],
125- libc_cv_mips_nan2008, [AC_EGREP_CPP(yes, [dnl 125- libc_cv_mips_nan2008, [AC_EGREP_CPP(yes, [dnl
@@ -131,10 +131,10 @@ index bcbdaffd9f..ad3057f4cc 100644
131 if test x$libc_cv_mips_nan2008 = xyes; then 131 if test x$libc_cv_mips_nan2008 = xyes; then
132 AC_DEFINE(HAVE_MIPS_NAN2008) 132 AC_DEFINE(HAVE_MIPS_NAN2008)
133diff --git a/sysdeps/nios2/configure b/sysdeps/nios2/configure 133diff --git a/sysdeps/nios2/configure b/sysdeps/nios2/configure
134index 14c8a3a014..dde3814ef2 100644 134index 2fb230cbaa..1959d0a444 100644
135--- a/sysdeps/nios2/configure 135--- a/sysdeps/nios2/configure
136+++ b/sysdeps/nios2/configure 136+++ b/sysdeps/nios2/configure
137@@ -142,12 +142,12 @@ else 137@@ -155,12 +155,12 @@ else $as_nop
138 cat confdefs.h - <<_ACEOF >conftest.$ac_ext 138 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
139 /* end confdefs.h. */ 139 /* end confdefs.h. */
140 #ifdef __nios2_big_endian__ 140 #ifdef __nios2_big_endian__
@@ -144,13 +144,13 @@ index 14c8a3a014..dde3814ef2 100644
144 144
145 _ACEOF 145 _ACEOF
146 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | 146 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
147- $EGREP "yes" >/dev/null 2>&1; then : 147- $EGREP "yes" >/dev/null 2>&1
148+ $EGREP "is_nios2_be" >/dev/null 2>&1; then : 148+ $EGREP "is_nios2_be" >/dev/null 2>&1
149 then :
149 libc_cv_nios2_be=yes 150 libc_cv_nios2_be=yes
150 else 151 else $as_nop
151 libc_cv_nios2_be=no
152diff --git a/sysdeps/nios2/configure.ac b/sysdeps/nios2/configure.ac 152diff --git a/sysdeps/nios2/configure.ac b/sysdeps/nios2/configure.ac
153index f05f43802b..dc8639902d 100644 153index f738e9a7ed..4085851cbc 100644
154--- a/sysdeps/nios2/configure.ac 154--- a/sysdeps/nios2/configure.ac
155+++ b/sysdeps/nios2/configure.ac 155+++ b/sysdeps/nios2/configure.ac
156@@ -4,8 +4,8 @@ GLIBC_PROVIDES dnl See aclocal.m4 in the top level source directory. 156@@ -4,8 +4,8 @@ GLIBC_PROVIDES dnl See aclocal.m4 in the top level source directory.
@@ -165,10 +165,10 @@ index f05f43802b..dc8639902d 100644
165 ], libc_cv_nios2_be=yes, libc_cv_nios2_be=no)]) 165 ], libc_cv_nios2_be=yes, libc_cv_nios2_be=no)])
166 if test $libc_cv_nios2_be = yes; then 166 if test $libc_cv_nios2_be = yes; then
167diff --git a/sysdeps/unix/sysv/linux/mips/configure b/sysdeps/unix/sysv/linux/mips/configure 167diff --git a/sysdeps/unix/sysv/linux/mips/configure b/sysdeps/unix/sysv/linux/mips/configure
168index f25f2a3a65..1b7483e6c6 100644 168index a060901de4..0ac7019438 100644
169--- a/sysdeps/unix/sysv/linux/mips/configure 169--- a/sysdeps/unix/sysv/linux/mips/configure
170+++ b/sysdeps/unix/sysv/linux/mips/configure 170+++ b/sysdeps/unix/sysv/linux/mips/configure
171@@ -414,11 +414,11 @@ else 171@@ -441,11 +441,11 @@ else $as_nop
172 /* end confdefs.h. */ 172 /* end confdefs.h. */
173 dnl 173 dnl
174 #ifdef __mips_nan2008 174 #ifdef __mips_nan2008
@@ -177,11 +177,11 @@ index f25f2a3a65..1b7483e6c6 100644
177 #endif 177 #endif
178 _ACEOF 178 _ACEOF
179 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | 179 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
180- $EGREP "yes" >/dev/null 2>&1; then : 180- $EGREP "yes" >/dev/null 2>&1
181+ $EGREP "use_mips_nan2008" >/dev/null 2>&1; then : 181+ $EGREP "use_mips_nan2008" >/dev/null 2>&1
182 then :
182 libc_cv_mips_nan2008=yes 183 libc_cv_mips_nan2008=yes
183 else 184 else $as_nop
184 libc_cv_mips_nan2008=no
185diff --git a/sysdeps/unix/sysv/linux/mips/configure.ac b/sysdeps/unix/sysv/linux/mips/configure.ac 185diff --git a/sysdeps/unix/sysv/linux/mips/configure.ac b/sysdeps/unix/sysv/linux/mips/configure.ac
186index 049a0f4bdf..005526d4e8 100644 186index 049a0f4bdf..005526d4e8 100644
187--- a/sysdeps/unix/sysv/linux/mips/configure.ac 187--- a/sysdeps/unix/sysv/linux/mips/configure.ac
@@ -199,10 +199,10 @@ index 049a0f4bdf..005526d4e8 100644
199 199
200 libc_mips_nan= 200 libc_mips_nan=
201diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/configure b/sysdeps/unix/sysv/linux/powerpc/powerpc64/configure 201diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/configure b/sysdeps/unix/sysv/linux/powerpc/powerpc64/configure
202index ae7f254da4..874519000b 100644 202index cf1b70c745..0dccf6cd76 100644
203--- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/configure 203--- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/configure
204+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/configure 204+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/configure
205@@ -155,12 +155,12 @@ else 205@@ -168,12 +168,12 @@ else $as_nop
206 cat confdefs.h - <<_ACEOF >conftest.$ac_ext 206 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
207 /* end confdefs.h. */ 207 /* end confdefs.h. */
208 #if _CALL_ELF == 2 208 #if _CALL_ELF == 2
@@ -212,12 +212,12 @@ index ae7f254da4..874519000b 100644
212 212
213 _ACEOF 213 _ACEOF
214 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | 214 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
215- $EGREP "yes" >/dev/null 2>&1; then : 215- $EGREP "yes" >/dev/null 2>&1
216+ $EGREP "use_ppc_elfv2_abi" >/dev/null 2>&1; then : 216+ $EGREP "use_ppc_elfv2_abi" >/dev/null 2>&1
217 then :
217 libc_cv_ppc64_elfv2_abi=yes 218 libc_cv_ppc64_elfv2_abi=yes
218 else 219 else $as_nop
219 libc_cv_ppc64_elfv2_abi=no 220@@ -203,12 +203,12 @@ else $as_nop
220@@ -188,12 +188,12 @@ else
221 cat confdefs.h - <<_ACEOF >conftest.$ac_ext 221 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
222 /* end confdefs.h. */ 222 /* end confdefs.h. */
223 #ifdef _CALL_ELF 223 #ifdef _CALL_ELF
@@ -227,11 +227,11 @@ index ae7f254da4..874519000b 100644
227 227
228 _ACEOF 228 _ACEOF
229 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | 229 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
230- $EGREP "yes" >/dev/null 2>&1; then : 230- $EGREP "yes" >/dev/null 2>&1
231+ $EGREP "is_def_call_elf" >/dev/null 2>&1; then : 231+ $EGREP "is_def_call_elf" >/dev/null 2>&1
232 then :
232 libc_cv_ppc64_def_call_elf=yes 233 libc_cv_ppc64_def_call_elf=yes
233 else 234 else $as_nop
234 libc_cv_ppc64_def_call_elf=no
235diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/configure.ac b/sysdeps/unix/sysv/linux/powerpc/powerpc64/configure.ac 235diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/configure.ac b/sysdeps/unix/sysv/linux/powerpc/powerpc64/configure.ac
236index f9cba6e15d..b21f72f1e4 100644 236index f9cba6e15d..b21f72f1e4 100644
237--- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/configure.ac 237--- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/configure.ac
diff --git a/meta/recipes-core/glibc/glibc/0010-__ieee754_sqrt-f-are-now-inline-functions-and-call-o.patch b/meta/recipes-core/glibc/glibc/0010-__ieee754_sqrt-f-are-now-inline-functions-and-call-o.patch
deleted file mode 100644
index cadaa0b2e2..0000000000
--- a/meta/recipes-core/glibc/glibc/0010-__ieee754_sqrt-f-are-now-inline-functions-and-call-o.patch
+++ /dev/null
@@ -1,384 +0,0 @@
1From 6b6e1dcd707017598ea3bdc2d91a761943b62218 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Wed, 18 Mar 2015 00:16:38 +0000
4Subject: [PATCH] __ieee754_sqrt{,f} are now inline functions and call out
5 __slow versions
6
7Upstream-Status: Pending
8
9Signed-off-by: Khem Raj <raj.khem@gmail.com>
10---
11 sysdeps/powerpc/powerpc32/603e/fpu/e_sqrt.c | 12 ++++++++++--
12 sysdeps/powerpc/powerpc32/603e/fpu/e_sqrtf.c | 8 +++++++-
13 sysdeps/powerpc/powerpc32/e500mc/fpu/e_sqrt.c | 14 +++++++++++---
14 sysdeps/powerpc/powerpc32/e500mc/fpu/e_sqrtf.c | 12 ++++++++++--
15 sysdeps/powerpc/powerpc32/e5500/fpu/e_sqrt.c | 14 +++++++++++---
16 sysdeps/powerpc/powerpc32/e5500/fpu/e_sqrtf.c | 12 ++++++++++--
17 sysdeps/powerpc/powerpc32/e6500/fpu/e_sqrt.c | 8 ++++++++
18 sysdeps/powerpc/powerpc32/e6500/fpu/e_sqrtf.c | 8 ++++++++
19 sysdeps/powerpc/powerpc64/e5500/fpu/e_sqrt.c | 12 ++++++++++--
20 sysdeps/powerpc/powerpc64/e5500/fpu/e_sqrtf.c | 9 ++++++++-
21 sysdeps/powerpc/powerpc64/e6500/fpu/e_sqrt.c | 14 +++++++++++---
22 sysdeps/powerpc/powerpc64/e6500/fpu/e_sqrtf.c | 12 ++++++++++--
23 12 files changed, 114 insertions(+), 21 deletions(-)
24
25diff --git a/sysdeps/powerpc/powerpc32/603e/fpu/e_sqrt.c b/sysdeps/powerpc/powerpc32/603e/fpu/e_sqrt.c
26index 1795fd6c3e..daa83f3fe8 100644
27--- a/sysdeps/powerpc/powerpc32/603e/fpu/e_sqrt.c
28+++ b/sysdeps/powerpc/powerpc32/603e/fpu/e_sqrt.c
29@@ -40,7 +40,7 @@ static const float half = 0.5;
30 simultaneously. */
31
32 double
33-__ieee754_sqrt (double b)
34+__slow_ieee754_sqrt (double b)
35 {
36 if (__builtin_expect (b > 0, 1))
37 {
38@@ -77,7 +77,7 @@ __ieee754_sqrt (double b)
39
40 /* Handle small numbers by scaling. */
41 if (__builtin_expect ((u.parts.msw & 0x7ff00000) <= 0x02000000, 0))
42- return __ieee754_sqrt (b * two108) * twom54;
43+ return __slow_ieee754_sqrt (b * two108) * twom54;
44
45 #define FMADD(a_, c_, b_) \
46 ({ double __r; \
47@@ -126,4 +126,12 @@ __ieee754_sqrt (double b)
48 }
49 return f_wash (b);
50 }
51+
52+#undef __ieee754_sqrt
53+double
54+__ieee754_sqrt (double x)
55+{
56+ return __slow_ieee754_sqrt (x);
57+}
58+
59 strong_alias (__ieee754_sqrt, __sqrt_finite)
60diff --git a/sysdeps/powerpc/powerpc32/603e/fpu/e_sqrtf.c b/sysdeps/powerpc/powerpc32/603e/fpu/e_sqrtf.c
61index a917f313ab..b812cf1705 100644
62--- a/sysdeps/powerpc/powerpc32/603e/fpu/e_sqrtf.c
63+++ b/sysdeps/powerpc/powerpc32/603e/fpu/e_sqrtf.c
64@@ -38,7 +38,7 @@ static const float threehalf = 1.5;
65 square root. */
66
67 float
68-__ieee754_sqrtf (float b)
69+__slow_ieee754_sqrtf (float b)
70 {
71 if (__builtin_expect (b > 0, 1))
72 {
73@@ -93,4 +93,10 @@ __ieee754_sqrtf (float b)
74 }
75 return f_washf (b);
76 }
77+#undef __ieee754_sqrtf
78+float
79+__ieee754_sqrtf (float x)
80+{
81+ return __slow_ieee754_sqrtf (x);
82+}
83 strong_alias (__ieee754_sqrtf, __sqrtf_finite)
84diff --git a/sysdeps/powerpc/powerpc32/e500mc/fpu/e_sqrt.c b/sysdeps/powerpc/powerpc32/e500mc/fpu/e_sqrt.c
85index fc4a74990e..7038a70b47 100644
86--- a/sysdeps/powerpc/powerpc32/e500mc/fpu/e_sqrt.c
87+++ b/sysdeps/powerpc/powerpc32/e500mc/fpu/e_sqrt.c
88@@ -41,10 +41,10 @@ static const float half = 0.5;
89
90 #ifdef __STDC__
91 double
92-__ieee754_sqrt (double b)
93+__slow_ieee754_sqrt (double b)
94 #else
95 double
96-__ieee754_sqrt (b)
97+__slow_ieee754_sqrt (b)
98 double b;
99 #endif
100 {
101@@ -83,7 +83,7 @@ __ieee754_sqrt (b)
102
103 /* Handle small numbers by scaling. */
104 if (__builtin_expect ((u.parts.msw & 0x7ff00000) <= 0x02000000, 0))
105- return __ieee754_sqrt (b * two108) * twom54;
106+ return __slow_ieee754_sqrt (b * two108) * twom54;
107
108 #define FMADD(a_, c_, b_) \
109 ({ double __r; \
110@@ -132,4 +132,12 @@ __ieee754_sqrt (b)
111 }
112 return f_wash (b);
113 }
114+
115+#undef __ieee754_sqrt
116+double
117+__ieee754_sqrt (double x)
118+{
119+ return __slow_ieee754_sqrt (x);
120+}
121+
122 strong_alias (__ieee754_sqrt, __sqrt_finite)
123diff --git a/sysdeps/powerpc/powerpc32/e500mc/fpu/e_sqrtf.c b/sysdeps/powerpc/powerpc32/e500mc/fpu/e_sqrtf.c
124index 9d175122a8..10de1f0cc3 100644
125--- a/sysdeps/powerpc/powerpc32/e500mc/fpu/e_sqrtf.c
126+++ b/sysdeps/powerpc/powerpc32/e500mc/fpu/e_sqrtf.c
127@@ -39,10 +39,10 @@ static const float threehalf = 1.5;
128
129 #ifdef __STDC__
130 float
131-__ieee754_sqrtf (float b)
132+__slow_ieee754_sqrtf (float b)
133 #else
134 float
135-__ieee754_sqrtf (b)
136+__slow_ieee754_sqrtf (b)
137 float b;
138 #endif
139 {
140@@ -99,4 +99,12 @@ __ieee754_sqrtf (b)
141 }
142 return f_washf (b);
143 }
144+
145+#undef __ieee754_sqrtf
146+float
147+__ieee754_sqrtf (float x)
148+{
149+ return __slow_ieee754_sqrtf (x);
150+}
151+
152 strong_alias (__ieee754_sqrtf, __sqrtf_finite)
153diff --git a/sysdeps/powerpc/powerpc32/e5500/fpu/e_sqrt.c b/sysdeps/powerpc/powerpc32/e5500/fpu/e_sqrt.c
154index fc4a74990e..7038a70b47 100644
155--- a/sysdeps/powerpc/powerpc32/e5500/fpu/e_sqrt.c
156+++ b/sysdeps/powerpc/powerpc32/e5500/fpu/e_sqrt.c
157@@ -41,10 +41,10 @@ static const float half = 0.5;
158
159 #ifdef __STDC__
160 double
161-__ieee754_sqrt (double b)
162+__slow_ieee754_sqrt (double b)
163 #else
164 double
165-__ieee754_sqrt (b)
166+__slow_ieee754_sqrt (b)
167 double b;
168 #endif
169 {
170@@ -83,7 +83,7 @@ __ieee754_sqrt (b)
171
172 /* Handle small numbers by scaling. */
173 if (__builtin_expect ((u.parts.msw & 0x7ff00000) <= 0x02000000, 0))
174- return __ieee754_sqrt (b * two108) * twom54;
175+ return __slow_ieee754_sqrt (b * two108) * twom54;
176
177 #define FMADD(a_, c_, b_) \
178 ({ double __r; \
179@@ -132,4 +132,12 @@ __ieee754_sqrt (b)
180 }
181 return f_wash (b);
182 }
183+
184+#undef __ieee754_sqrt
185+double
186+__ieee754_sqrt (double x)
187+{
188+ return __slow_ieee754_sqrt (x);
189+}
190+
191 strong_alias (__ieee754_sqrt, __sqrt_finite)
192diff --git a/sysdeps/powerpc/powerpc32/e5500/fpu/e_sqrtf.c b/sysdeps/powerpc/powerpc32/e5500/fpu/e_sqrtf.c
193index 9d175122a8..10de1f0cc3 100644
194--- a/sysdeps/powerpc/powerpc32/e5500/fpu/e_sqrtf.c
195+++ b/sysdeps/powerpc/powerpc32/e5500/fpu/e_sqrtf.c
196@@ -39,10 +39,10 @@ static const float threehalf = 1.5;
197
198 #ifdef __STDC__
199 float
200-__ieee754_sqrtf (float b)
201+__slow_ieee754_sqrtf (float b)
202 #else
203 float
204-__ieee754_sqrtf (b)
205+__slow_ieee754_sqrtf (b)
206 float b;
207 #endif
208 {
209@@ -99,4 +99,12 @@ __ieee754_sqrtf (b)
210 }
211 return f_washf (b);
212 }
213+
214+#undef __ieee754_sqrtf
215+float
216+__ieee754_sqrtf (float x)
217+{
218+ return __slow_ieee754_sqrtf (x);
219+}
220+
221 strong_alias (__ieee754_sqrtf, __sqrtf_finite)
222diff --git a/sysdeps/powerpc/powerpc32/e6500/fpu/e_sqrt.c b/sysdeps/powerpc/powerpc32/e6500/fpu/e_sqrt.c
223index fc4a74990e..1c34244bd8 100644
224--- a/sysdeps/powerpc/powerpc32/e6500/fpu/e_sqrt.c
225+++ b/sysdeps/powerpc/powerpc32/e6500/fpu/e_sqrt.c
226@@ -132,4 +132,12 @@ __ieee754_sqrt (b)
227 }
228 return f_wash (b);
229 }
230+
231+#undef __ieee754_sqrt
232+double
233+__ieee754_sqrt (double x)
234+{
235+ return __slow_ieee754_sqrt (x);
236+}
237+
238 strong_alias (__ieee754_sqrt, __sqrt_finite)
239diff --git a/sysdeps/powerpc/powerpc32/e6500/fpu/e_sqrtf.c b/sysdeps/powerpc/powerpc32/e6500/fpu/e_sqrtf.c
240index 9d175122a8..812653558f 100644
241--- a/sysdeps/powerpc/powerpc32/e6500/fpu/e_sqrtf.c
242+++ b/sysdeps/powerpc/powerpc32/e6500/fpu/e_sqrtf.c
243@@ -99,4 +99,12 @@ __ieee754_sqrtf (b)
244 }
245 return f_washf (b);
246 }
247+
248+#undef __ieee754_sqrtf
249+float
250+__ieee754_sqrtf (float x)
251+{
252+ return __slow_ieee754_sqrtf (x);
253+}
254+
255 strong_alias (__ieee754_sqrtf, __sqrtf_finite)
256diff --git a/sysdeps/powerpc/powerpc64/e5500/fpu/e_sqrt.c b/sysdeps/powerpc/powerpc64/e5500/fpu/e_sqrt.c
257index 1795fd6c3e..13a81973e3 100644
258--- a/sysdeps/powerpc/powerpc64/e5500/fpu/e_sqrt.c
259+++ b/sysdeps/powerpc/powerpc64/e5500/fpu/e_sqrt.c
260@@ -40,7 +40,7 @@ static const float half = 0.5;
261 simultaneously. */
262
263 double
264-__ieee754_sqrt (double b)
265+__slow_ieee754_sqrt (double b)
266 {
267 if (__builtin_expect (b > 0, 1))
268 {
269@@ -77,7 +77,7 @@ __ieee754_sqrt (double b)
270
271 /* Handle small numbers by scaling. */
272 if (__builtin_expect ((u.parts.msw & 0x7ff00000) <= 0x02000000, 0))
273- return __ieee754_sqrt (b * two108) * twom54;
274+ return __slow_ieee754_sqrt (b * two108) * twom54;
275
276 #define FMADD(a_, c_, b_) \
277 ({ double __r; \
278@@ -126,4 +126,12 @@ __ieee754_sqrt (double b)
279 }
280 return f_wash (b);
281 }
282+
283+#undef __ieee754_sqrt
284+double
285+__ieee754_sqrt (double x)
286+{
287+ return __slow_ieee754_sqrt (x);
288+}
289+
290 strong_alias (__ieee754_sqrt, __sqrt_finite)
291diff --git a/sysdeps/powerpc/powerpc64/e5500/fpu/e_sqrtf.c b/sysdeps/powerpc/powerpc64/e5500/fpu/e_sqrtf.c
292index a917f313ab..fae2d81210 100644
293--- a/sysdeps/powerpc/powerpc64/e5500/fpu/e_sqrtf.c
294+++ b/sysdeps/powerpc/powerpc64/e5500/fpu/e_sqrtf.c
295@@ -38,7 +38,7 @@ static const float threehalf = 1.5;
296 square root. */
297
298 float
299-__ieee754_sqrtf (float b)
300+__slow_ieee754_sqrtf (float b)
301 {
302 if (__builtin_expect (b > 0, 1))
303 {
304@@ -93,4 +93,11 @@ __ieee754_sqrtf (float b)
305 }
306 return f_washf (b);
307 }
308+#undef __ieee754_sqrtf
309+float
310+__ieee754_sqrtf (float x)
311+{
312+ return __slow_ieee754_sqrtf (x);
313+}
314+
315 strong_alias (__ieee754_sqrtf, __sqrtf_finite)
316diff --git a/sysdeps/powerpc/powerpc64/e6500/fpu/e_sqrt.c b/sysdeps/powerpc/powerpc64/e6500/fpu/e_sqrt.c
317index fc4a74990e..7038a70b47 100644
318--- a/sysdeps/powerpc/powerpc64/e6500/fpu/e_sqrt.c
319+++ b/sysdeps/powerpc/powerpc64/e6500/fpu/e_sqrt.c
320@@ -41,10 +41,10 @@ static const float half = 0.5;
321
322 #ifdef __STDC__
323 double
324-__ieee754_sqrt (double b)
325+__slow_ieee754_sqrt (double b)
326 #else
327 double
328-__ieee754_sqrt (b)
329+__slow_ieee754_sqrt (b)
330 double b;
331 #endif
332 {
333@@ -83,7 +83,7 @@ __ieee754_sqrt (b)
334
335 /* Handle small numbers by scaling. */
336 if (__builtin_expect ((u.parts.msw & 0x7ff00000) <= 0x02000000, 0))
337- return __ieee754_sqrt (b * two108) * twom54;
338+ return __slow_ieee754_sqrt (b * two108) * twom54;
339
340 #define FMADD(a_, c_, b_) \
341 ({ double __r; \
342@@ -132,4 +132,12 @@ __ieee754_sqrt (b)
343 }
344 return f_wash (b);
345 }
346+
347+#undef __ieee754_sqrt
348+double
349+__ieee754_sqrt (double x)
350+{
351+ return __slow_ieee754_sqrt (x);
352+}
353+
354 strong_alias (__ieee754_sqrt, __sqrt_finite)
355diff --git a/sysdeps/powerpc/powerpc64/e6500/fpu/e_sqrtf.c b/sysdeps/powerpc/powerpc64/e6500/fpu/e_sqrtf.c
356index 9d175122a8..10de1f0cc3 100644
357--- a/sysdeps/powerpc/powerpc64/e6500/fpu/e_sqrtf.c
358+++ b/sysdeps/powerpc/powerpc64/e6500/fpu/e_sqrtf.c
359@@ -39,10 +39,10 @@ static const float threehalf = 1.5;
360
361 #ifdef __STDC__
362 float
363-__ieee754_sqrtf (float b)
364+__slow_ieee754_sqrtf (float b)
365 #else
366 float
367-__ieee754_sqrtf (b)
368+__slow_ieee754_sqrtf (b)
369 float b;
370 #endif
371 {
372@@ -99,4 +99,12 @@ __ieee754_sqrtf (b)
373 }
374 return f_washf (b);
375 }
376+
377+#undef __ieee754_sqrtf
378+float
379+__ieee754_sqrtf (float x)
380+{
381+ return __slow_ieee754_sqrtf (x);
382+}
383+
384 strong_alias (__ieee754_sqrtf, __sqrtf_finite)
diff --git a/meta/recipes-core/glibc/glibc/0018-eglibc-Cross-building-and-testing-instructions.patch b/meta/recipes-core/glibc/glibc/0010-eglibc-Cross-building-and-testing-instructions.patch
index 826e5af465..d7f15c1cfa 100644
--- a/meta/recipes-core/glibc/glibc/0018-eglibc-Cross-building-and-testing-instructions.patch
+++ b/meta/recipes-core/glibc/glibc/0010-eglibc-Cross-building-and-testing-instructions.patch
@@ -1,4 +1,4 @@
1From 060ba13b5ac5e90517d540f009ebdcdcf62f9685 Mon Sep 17 00:00:00 2001 1From ce8b13bdf488058754fce573754cea0b022c37e2 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com> 2From: Khem Raj <raj.khem@gmail.com>
3Date: Wed, 18 Mar 2015 00:42:58 +0000 3Date: Wed, 18 Mar 2015 00:42:58 +0000
4Subject: [PATCH] eglibc: Cross building and testing instructions 4Subject: [PATCH] eglibc: Cross building and testing instructions
diff --git a/meta/recipes-core/glibc/glibc/0011-Quote-from-bug-1443-which-explains-what-the-patch-do.patch b/meta/recipes-core/glibc/glibc/0011-Quote-from-bug-1443-which-explains-what-the-patch-do.patch
deleted file mode 100644
index e4c78b5c79..0000000000
--- a/meta/recipes-core/glibc/glibc/0011-Quote-from-bug-1443-which-explains-what-the-patch-do.patch
+++ /dev/null
@@ -1,58 +0,0 @@
1From 297bac9429260f8df495b81d3fae8ae4c6913f5f Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Wed, 18 Mar 2015 00:20:09 +0000
4Subject: [PATCH] Quote from bug 1443 which explains what the patch does :
5
6 We build some random program and link it with -lust. When we run it,
7 it dies with a SIGSEGV before reaching main().
8
9 Libust.so depends on liburcu-bp.so from the usermode-rcu package.
10 Although libust.so is not prelinked, liburcu-bp.so IS prelinked; this
11 is critical.
12
13 Libust.so uses a TLS / __thread variable that is defined in liburcu-
14 bp.so. There are special ARM-specific relocation types that allow two
15 shared libraries to share thread-specific data. This is critical too.
16
17 One more critical issue: although liburcu-bp.so is prelinked, we can't
18 load it at its prelinked address, because we also link against
19 librt.so, and librt.so uses that address.
20
21 The dynamic linker is forced to relink liburcu-bp.so at a different
22 address. In the course of relinking, it processes the special ARM
23 relocation record mentioned above. The prelinker has already filled
24 in the information, which is a short offset into a table of thread-
25 specific data that is allocated per-thread for each library that uses
26 TLS. Because the normal behavior of a relocation is to add the symbol
27 value to an addend stored at the address being relocated, we end up
28 adding the short offset to itself, doubling it.
29
30 Now we have an awkward situation. The libust.so library doesn't know
31 about the addend, so its TLS data for this element is correct. The
32 liburcu-bp.so library has a different offset for the element. When we
33 go to initialize the element for the first time in liburcu-bp.so, we
34 write the address of the result at the doubled (broken) offset.
35 Later, when we refer to the address from libust.so, we check the value
36 at the correct offset, but it's NULL, so we eat hot SIGSEGV.
37
38Upstream-Status: Pending
39
40Signed-off-by: Andrei Dinu <andrei.adrianx.dinu@intel.com>
41Signed-off-by: Khem Raj <raj.khem@gmail.com>
42---
43 sysdeps/arm/dl-machine.h | 2 +-
44 1 file changed, 1 insertion(+), 1 deletion(-)
45
46diff --git a/sysdeps/arm/dl-machine.h b/sysdeps/arm/dl-machine.h
47index ff5e09e207..d68bfe5cbe 100644
48--- a/sysdeps/arm/dl-machine.h
49+++ b/sysdeps/arm/dl-machine.h
50@@ -510,7 +510,7 @@ elf_machine_rel (struct link_map *map, const Elf32_Rel *reloc,
51
52 case R_ARM_TLS_DTPOFF32:
53 if (sym != NULL)
54- *reloc_addr += sym->st_value;
55+ *reloc_addr = sym->st_value;
56 break;
57
58 case R_ARM_TLS_TPOFF32:
diff --git a/meta/recipes-core/glibc/glibc/0019-eglibc-Help-bootstrap-cross-toolchain.patch b/meta/recipes-core/glibc/glibc/0011-eglibc-Help-bootstrap-cross-toolchain.patch
index afac2e04f6..82a3292655 100644
--- a/meta/recipes-core/glibc/glibc/0019-eglibc-Help-bootstrap-cross-toolchain.patch
+++ b/meta/recipes-core/glibc/glibc/0011-eglibc-Help-bootstrap-cross-toolchain.patch
@@ -1,4 +1,4 @@
1From f13c2f525e9bc82ce13e4cf486f7fe0831fc3fac Mon Sep 17 00:00:00 2001 1From 65b79161b9e2848a174d3519a03348884f182975 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com> 2From: Khem Raj <raj.khem@gmail.com>
3Date: Wed, 18 Mar 2015 00:49:28 +0000 3Date: Wed, 18 Mar 2015 00:49:28 +0000
4Subject: [PATCH] eglibc: Help bootstrap cross toolchain 4Subject: [PATCH] eglibc: Help bootstrap cross toolchain
@@ -29,7 +29,7 @@ Signed-off-by: Khem Raj <raj.khem@gmail.com>
29 create mode 100644 include/stubs-bootstrap.h 29 create mode 100644 include/stubs-bootstrap.h
30 30
31diff --git a/Makefile b/Makefile 31diff --git a/Makefile b/Makefile
32index 50f99ca611..31eed15f02 100644 32index 7052b46df8..46073abaa8 100644
33--- a/Makefile 33--- a/Makefile
34+++ b/Makefile 34+++ b/Makefile
35@@ -79,9 +79,18 @@ subdir-dirs = include 35@@ -79,9 +79,18 @@ subdir-dirs = include
@@ -52,7 +52,7 @@ index 50f99ca611..31eed15f02 100644
52 ifeq (yes,$(build-shared)) 52 ifeq (yes,$(build-shared))
53 headers += gnu/lib-names.h 53 headers += gnu/lib-names.h
54 endif 54 endif
55@@ -416,6 +425,16 @@ others: $(common-objpfx)testrun.sh $(common-objpfx)debugglibc.sh 55@@ -421,6 +430,16 @@ others: $(common-objpfx)testrun.sh $(common-objpfx)debugglibc.sh
56 56
57 subdir-stubs := $(foreach dir,$(subdirs),$(common-objpfx)$(dir)/stubs) 57 subdir-stubs := $(foreach dir,$(subdirs),$(common-objpfx)$(dir)/stubs)
58 58
@@ -69,7 +69,7 @@ index 50f99ca611..31eed15f02 100644
69 ifndef abi-variants 69 ifndef abi-variants
70 installed-stubs = $(inst_includedir)/gnu/stubs.h 70 installed-stubs = $(inst_includedir)/gnu/stubs.h
71 else 71 else
72@@ -442,6 +461,7 @@ $(inst_includedir)/gnu/stubs.h: $(+force) 72@@ -447,6 +466,7 @@ $(inst_includedir)/gnu/stubs.h: $(+force)
73 73
74 install-others-nosubdir: $(installed-stubs) 74 install-others-nosubdir: $(installed-stubs)
75 endif 75 endif
diff --git a/meta/recipes-core/glibc/glibc/0020-eglibc-Resolve-__fpscr_values-on-SH4.patch b/meta/recipes-core/glibc/glibc/0012-eglibc-Resolve-__fpscr_values-on-SH4.patch
index 9a610c6703..e726a9e76f 100644
--- a/meta/recipes-core/glibc/glibc/0020-eglibc-Resolve-__fpscr_values-on-SH4.patch
+++ b/meta/recipes-core/glibc/glibc/0012-eglibc-Resolve-__fpscr_values-on-SH4.patch
@@ -1,4 +1,4 @@
1From 330c4e50e28e29c31fb8d6ab39cdbb2af4d3def7 Mon Sep 17 00:00:00 2001 1From 07a5fa22a9a8bbd43982c1b35132f8c2d5276bfe Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com> 2From: Khem Raj <raj.khem@gmail.com>
3Date: Wed, 18 Mar 2015 00:55:53 +0000 3Date: Wed, 18 Mar 2015 00:55:53 +0000
4Subject: [PATCH] eglibc: Resolve __fpscr_values on SH4 4Subject: [PATCH] eglibc: Resolve __fpscr_values on SH4
@@ -21,10 +21,10 @@ Signed-off-by: Khem Raj <raj.khem@gmail.com>
21 2 files changed, 12 insertions(+) 21 2 files changed, 12 insertions(+)
22 22
23diff --git a/sysdeps/unix/sysv/linux/sh/Versions b/sysdeps/unix/sysv/linux/sh/Versions 23diff --git a/sysdeps/unix/sysv/linux/sh/Versions b/sysdeps/unix/sysv/linux/sh/Versions
24index e0938c4165..ca1d7da339 100644 24index 3ad702e165..931985b5d6 100644
25--- a/sysdeps/unix/sysv/linux/sh/Versions 25--- a/sysdeps/unix/sysv/linux/sh/Versions
26+++ b/sysdeps/unix/sysv/linux/sh/Versions 26+++ b/sysdeps/unix/sysv/linux/sh/Versions
27@@ -2,6 +2,7 @@ libc { 27@@ -3,6 +3,7 @@ libc {
28 GLIBC_2.2 { 28 GLIBC_2.2 {
29 # functions used in other libraries 29 # functions used in other libraries
30 __xstat64; __fxstat64; __lxstat64; 30 __xstat64; __fxstat64; __lxstat64;
@@ -33,7 +33,7 @@ index e0938c4165..ca1d7da339 100644
33 # a* 33 # a*
34 alphasort64; 34 alphasort64;
35diff --git a/sysdeps/unix/sysv/linux/sh/sysdep.S b/sysdeps/unix/sysv/linux/sh/sysdep.S 35diff --git a/sysdeps/unix/sysv/linux/sh/sysdep.S b/sysdeps/unix/sysv/linux/sh/sysdep.S
36index a18fbb2e8b..59421bfbb0 100644 36index d5d8c5e033..f356d02077 100644
37--- a/sysdeps/unix/sysv/linux/sh/sysdep.S 37--- a/sysdeps/unix/sysv/linux/sh/sysdep.S
38+++ b/sysdeps/unix/sysv/linux/sh/sysdep.S 38+++ b/sysdeps/unix/sysv/linux/sh/sysdep.S
39@@ -30,3 +30,14 @@ ENTRY (__syscall_error) 39@@ -30,3 +30,14 @@ ENTRY (__syscall_error)
diff --git a/meta/recipes-core/glibc/glibc/0012-eglibc-run-libm-err-tab.pl-with-specific-dirs-in-S.patch b/meta/recipes-core/glibc/glibc/0012-eglibc-run-libm-err-tab.pl-with-specific-dirs-in-S.patch
deleted file mode 100644
index c5e8e6473a..0000000000
--- a/meta/recipes-core/glibc/glibc/0012-eglibc-run-libm-err-tab.pl-with-specific-dirs-in-S.patch
+++ /dev/null
@@ -1,33 +0,0 @@
1From f389babf3c920e68b7d7391556a78ebf62a21ebe Mon Sep 17 00:00:00 2001
2From: Ting Liu <b28495@freescale.com>
3Date: Wed, 19 Dec 2012 04:39:57 -0600
4Subject: [PATCH] eglibc: run libm-err-tab.pl with specific dirs in ${S}
5
6libm-err-tab.pl will parse all the files named "libm-test-ulps"
7in the given dir recursively. To avoid parsing the one in
8${S}/.pc/ (it does exist after eglibc adds aarch64 support,
9${S}/.pc/aarch64-0001-glibc-fsf-v1-eaf6f205.patch/ports/sysdeps/
10aarch64/libm-test-ulps), run libm-err-tab.pl with specific dirs
11in ${S}.
12
13Upstream-Status: inappropriate [OE specific]
14
15Signed-off-by: Ting Liu <b28495@freescale.com>
16---
17 manual/Makefile | 3 ++-
18 1 file changed, 2 insertions(+), 1 deletion(-)
19
20diff --git a/manual/Makefile b/manual/Makefile
21index e83444341e..aa2645bc55 100644
22--- a/manual/Makefile
23+++ b/manual/Makefile
24@@ -103,7 +103,8 @@ $(objpfx)stamp-libm-err: $(..)math/gen-libm-test.py \
25 $(wildcard $(foreach dir,$(sysdirs),\
26 $(dir)/libm-test-ulps))
27 pwd=`pwd`; \
28- $(PYTHON) $< -s $$pwd/.. -m $(objpfx)libm-err-tmp
29+ $(PYTHON) $< -s $$pwd/../ports -m $(objpfx)libm-err-tmp
30+ $(PYTHON) $< -s $$pwd/../sysdeps -m $(objpfx)libm-err-tmp
31 $(move-if-change) $(objpfx)libm-err-tmp $(objpfx)libm-err.texi
32 touch $@
33
diff --git a/meta/recipes-core/glibc/glibc/0013-__ieee754_sqrt-f-are-now-inline-functions-and-call-o.patch b/meta/recipes-core/glibc/glibc/0013-__ieee754_sqrt-f-are-now-inline-functions-and-call-o.patch
deleted file mode 100644
index 7f362cace0..0000000000
--- a/meta/recipes-core/glibc/glibc/0013-__ieee754_sqrt-f-are-now-inline-functions-and-call-o.patch
+++ /dev/null
@@ -1,58 +0,0 @@
1From 4b0d41a315e66f688fef7b0c2e2b6ce9fa16ec93 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Wed, 18 Mar 2015 00:24:46 +0000
4Subject: [PATCH] __ieee754_sqrt{,f} are now inline functions and call out
5 __slow versions
6
7Upstream-Status: Pending
8
9Signed-off-by: chunrong guo <B40290@freescale.com>
10Signed-off-by: Khem Raj <raj.khem@gmail.com>
11---
12 sysdeps/powerpc/powerpc32/e6500/fpu/e_sqrt.c | 6 +++---
13 sysdeps/powerpc/powerpc32/e6500/fpu/e_sqrtf.c | 4 ++--
14 2 files changed, 5 insertions(+), 5 deletions(-)
15
16diff --git a/sysdeps/powerpc/powerpc32/e6500/fpu/e_sqrt.c b/sysdeps/powerpc/powerpc32/e6500/fpu/e_sqrt.c
17index 1c34244bd8..7038a70b47 100644
18--- a/sysdeps/powerpc/powerpc32/e6500/fpu/e_sqrt.c
19+++ b/sysdeps/powerpc/powerpc32/e6500/fpu/e_sqrt.c
20@@ -41,10 +41,10 @@ static const float half = 0.5;
21
22 #ifdef __STDC__
23 double
24-__ieee754_sqrt (double b)
25+__slow_ieee754_sqrt (double b)
26 #else
27 double
28-__ieee754_sqrt (b)
29+__slow_ieee754_sqrt (b)
30 double b;
31 #endif
32 {
33@@ -83,7 +83,7 @@ __ieee754_sqrt (b)
34
35 /* Handle small numbers by scaling. */
36 if (__builtin_expect ((u.parts.msw & 0x7ff00000) <= 0x02000000, 0))
37- return __ieee754_sqrt (b * two108) * twom54;
38+ return __slow_ieee754_sqrt (b * two108) * twom54;
39
40 #define FMADD(a_, c_, b_) \
41 ({ double __r; \
42diff --git a/sysdeps/powerpc/powerpc32/e6500/fpu/e_sqrtf.c b/sysdeps/powerpc/powerpc32/e6500/fpu/e_sqrtf.c
43index 812653558f..10de1f0cc3 100644
44--- a/sysdeps/powerpc/powerpc32/e6500/fpu/e_sqrtf.c
45+++ b/sysdeps/powerpc/powerpc32/e6500/fpu/e_sqrtf.c
46@@ -39,10 +39,10 @@ static const float threehalf = 1.5;
47
48 #ifdef __STDC__
49 float
50-__ieee754_sqrtf (float b)
51+__slow_ieee754_sqrtf (float b)
52 #else
53 float
54-__ieee754_sqrtf (b)
55+__slow_ieee754_sqrtf (b)
56 float b;
57 #endif
58 {
diff --git a/meta/recipes-core/glibc/glibc/0021-eglibc-Forward-port-cross-locale-generation-support.patch b/meta/recipes-core/glibc/glibc/0013-eglibc-Forward-port-cross-locale-generation-support.patch
index 0b2f020fdd..f36b7f6f4c 100644
--- a/meta/recipes-core/glibc/glibc/0021-eglibc-Forward-port-cross-locale-generation-support.patch
+++ b/meta/recipes-core/glibc/glibc/0013-eglibc-Forward-port-cross-locale-generation-support.patch
@@ -1,4 +1,4 @@
1From 557ed640b26bd208ce8d4a6fd725b124893668d7 Mon Sep 17 00:00:00 2001 1From 33e9867758e830e19d181d5a0aa7f2f3cc4a08b3 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com> 2From: Khem Raj <raj.khem@gmail.com>
3Date: Wed, 18 Mar 2015 01:33:49 +0000 3Date: Wed, 18 Mar 2015 01:33:49 +0000
4Subject: [PATCH] eglibc: Forward port cross locale generation support 4Subject: [PATCH] eglibc: Forward port cross locale generation support
@@ -7,7 +7,7 @@ Upstream-Status: Pending
7 7
8Signed-off-by: Khem Raj <raj.khem@gmail.com> 8Signed-off-by: Khem Raj <raj.khem@gmail.com>
9--- 9---
10 locale/Makefile | 3 +- 10 locale/Makefile | 1 +
11 locale/catnames.c | 46 +++++++++++++++++++++++++++ 11 locale/catnames.c | 46 +++++++++++++++++++++++++++
12 locale/localeinfo.h | 2 +- 12 locale/localeinfo.h | 2 +-
13 locale/programs/charmap-dir.c | 6 ++++ 13 locale/programs/charmap-dir.c | 6 ++++
@@ -19,23 +19,21 @@ Signed-off-by: Khem Raj <raj.khem@gmail.com>
19 locale/programs/locfile.c | 5 ++- 19 locale/programs/locfile.c | 5 ++-
20 locale/programs/locfile.h | 59 +++++++++++++++++++++++++++++++++-- 20 locale/programs/locfile.h | 59 +++++++++++++++++++++++++++++++++--
21 locale/setlocale.c | 29 ----------------- 21 locale/setlocale.c | 29 -----------------
22 12 files changed, 167 insertions(+), 68 deletions(-) 22 12 files changed, 166 insertions(+), 67 deletions(-)
23 create mode 100644 locale/catnames.c 23 create mode 100644 locale/catnames.c
24 24
25diff --git a/locale/Makefile b/locale/Makefile 25diff --git a/locale/Makefile b/locale/Makefile
26index b7c60681fa..07c606cde3 100644 26index 2810f28605..05f847f9a6 100644
27--- a/locale/Makefile 27--- a/locale/Makefile
28+++ b/locale/Makefile 28+++ b/locale/Makefile
29@@ -26,7 +26,8 @@ headers = langinfo.h locale.h bits/locale.h \ 29@@ -30,6 +30,7 @@ headers = \
30 bits/types/locale_t.h bits/types/__locale_t.h 30 locale.h \
31 routines = setlocale findlocale loadlocale loadarchive \ 31 # headers
32 localeconv nl_langinfo nl_langinfo_l mb_cur_max \ 32 routines = \
33- newlocale duplocale freelocale uselocale 33+ catnames \
34+ newlocale duplocale freelocale uselocale \ 34 duplocale \
35+ catnames 35 findlocale \
36 tests = tst-C-locale tst-locname tst-duplocale 36 freelocale \
37 tests-container = tst-localedef-path-norm
38 categories = ctype messages monetary numeric time paper name \
39diff --git a/locale/catnames.c b/locale/catnames.c 37diff --git a/locale/catnames.c b/locale/catnames.c
40new file mode 100644 38new file mode 100644
41index 0000000000..538f3f5edb 39index 0000000000..538f3f5edb
@@ -89,10 +87,10 @@ index 0000000000..538f3f5edb
89+ [LC_ALL] = sizeof ("LC_ALL") - 1 87+ [LC_ALL] = sizeof ("LC_ALL") - 1
90+ }; 88+ };
91diff --git a/locale/localeinfo.h b/locale/localeinfo.h 89diff --git a/locale/localeinfo.h b/locale/localeinfo.h
92index 22f9dc1140..fa31b3c5ea 100644 90index f7efc288a5..6ef082eb25 100644
93--- a/locale/localeinfo.h 91--- a/locale/localeinfo.h
94+++ b/locale/localeinfo.h 92+++ b/locale/localeinfo.h
95@@ -230,7 +230,7 @@ __libc_tsd_define (extern, locale_t, LOCALE) 93@@ -246,7 +246,7 @@ __libc_tsd_define (extern, locale_t, LOCALE)
96 unused. We can manage this playing some tricks with weak references. 94 unused. We can manage this playing some tricks with weak references.
97 But with thread-local locale settings, it becomes quite ungainly unless 95 But with thread-local locale settings, it becomes quite ungainly unless
98 we can use __thread variables. So only in that case do we attempt this. */ 96 we can use __thread variables. So only in that case do we attempt this. */
@@ -102,7 +100,7 @@ index 22f9dc1140..fa31b3c5ea 100644
102 # define NL_CURRENT_INDIRECT 1 100 # define NL_CURRENT_INDIRECT 1
103 #endif 101 #endif
104diff --git a/locale/programs/charmap-dir.c b/locale/programs/charmap-dir.c 102diff --git a/locale/programs/charmap-dir.c b/locale/programs/charmap-dir.c
105index 4841bfd05d..ffcba1fd79 100644 103index 36504f238d..56ee97e61b 100644
106--- a/locale/programs/charmap-dir.c 104--- a/locale/programs/charmap-dir.c
107+++ b/locale/programs/charmap-dir.c 105+++ b/locale/programs/charmap-dir.c
108@@ -18,7 +18,9 @@ 106@@ -18,7 +18,9 @@
@@ -148,10 +146,10 @@ index 4841bfd05d..ffcba1fd79 100644
148 return NULL; 146 return NULL;
149 } 147 }
150diff --git a/locale/programs/ld-collate.c b/locale/programs/ld-collate.c 148diff --git a/locale/programs/ld-collate.c b/locale/programs/ld-collate.c
151index 0af21e05e2..4980b0c52f 100644 149index 5048adbd9f..4232834ead 100644
152--- a/locale/programs/ld-collate.c 150--- a/locale/programs/ld-collate.c
153+++ b/locale/programs/ld-collate.c 151+++ b/locale/programs/ld-collate.c
154@@ -349,7 +349,7 @@ new_element (struct locale_collate_t *collate, const char *mbs, size_t mbslen, 152@@ -352,7 +352,7 @@ new_element (struct locale_collate_t *collate, const char *mbs, size_t mbslen,
155 } 153 }
156 if (wcs != NULL) 154 if (wcs != NULL)
157 { 155 {
@@ -160,7 +158,7 @@ index 0af21e05e2..4980b0c52f 100644
160 uint32_t zero = 0; 158 uint32_t zero = 0;
161 /* Handle <U0000> as a single character. */ 159 /* Handle <U0000> as a single character. */
162 if (nwcs == 0) 160 if (nwcs == 0)
163@@ -1772,8 +1772,7 @@ symbol `%s' has the same encoding as"), (*eptr)->name); 161@@ -1776,8 +1776,7 @@ symbol `%s' has the same encoding as"), (*eptr)->name);
164 162
165 if ((*eptr)->nwcs == runp->nwcs) 163 if ((*eptr)->nwcs == runp->nwcs)
166 { 164 {
@@ -170,7 +168,7 @@ index 0af21e05e2..4980b0c52f 100644
170 168
171 if (c == 0) 169 if (c == 0)
172 { 170 {
173@@ -2000,9 +1999,9 @@ add_to_tablewc (uint32_t ch, struct element_t *runp) 171@@ -2004,9 +2003,9 @@ add_to_tablewc (uint32_t ch, struct element_t *runp)
174 one consecutive entry. */ 172 one consecutive entry. */
175 if (runp->wcnext != NULL 173 if (runp->wcnext != NULL
176 && runp->nwcs == runp->wcnext->nwcs 174 && runp->nwcs == runp->wcnext->nwcs
@@ -183,7 +181,7 @@ index 0af21e05e2..4980b0c52f 100644
183 && (runp->wcs[runp->nwcs - 1] 181 && (runp->wcs[runp->nwcs - 1]
184 == runp->wcnext->wcs[runp->nwcs - 1] + 1)) 182 == runp->wcnext->wcs[runp->nwcs - 1] + 1))
185 { 183 {
186@@ -2026,9 +2025,9 @@ add_to_tablewc (uint32_t ch, struct element_t *runp) 184@@ -2030,9 +2029,9 @@ add_to_tablewc (uint32_t ch, struct element_t *runp)
187 runp = runp->wcnext; 185 runp = runp->wcnext;
188 while (runp->wcnext != NULL 186 while (runp->wcnext != NULL
189 && runp->nwcs == runp->wcnext->nwcs 187 && runp->nwcs == runp->wcnext->nwcs
@@ -197,10 +195,10 @@ index 0af21e05e2..4980b0c52f 100644
197 == runp->wcnext->wcs[runp->nwcs - 1] + 1)); 195 == runp->wcnext->wcs[runp->nwcs - 1] + 1));
198 196
199diff --git a/locale/programs/ld-ctype.c b/locale/programs/ld-ctype.c 197diff --git a/locale/programs/ld-ctype.c b/locale/programs/ld-ctype.c
200index 2fb579bbbf..d0be99581c 100644 198index eb6e7e145c..14736d1cac 100644
201--- a/locale/programs/ld-ctype.c 199--- a/locale/programs/ld-ctype.c
202+++ b/locale/programs/ld-ctype.c 200+++ b/locale/programs/ld-ctype.c
203@@ -915,7 +915,7 @@ ctype_output (struct localedef_t *locale, const struct charmap_t *charmap, 201@@ -914,7 +914,7 @@ ctype_output (struct localedef_t *locale, const struct charmap_t *charmap,
204 allocate_arrays (ctype, charmap, ctype->repertoire); 202 allocate_arrays (ctype, charmap, ctype->repertoire);
205 203
206 default_missing_len = (ctype->default_missing 204 default_missing_len = (ctype->default_missing
@@ -209,7 +207,7 @@ index 2fb579bbbf..d0be99581c 100644
209 : 0); 207 : 0);
210 208
211 init_locale_data (&file, nelems); 209 init_locale_data (&file, nelems);
212@@ -1927,7 +1927,7 @@ read_translit_entry (struct linereader *ldfile, struct locale_ctype_t *ctype, 210@@ -1926,7 +1926,7 @@ read_translit_entry (struct linereader *ldfile, struct locale_ctype_t *ctype,
213 ignore = 1; 211 ignore = 1;
214 else 212 else
215 /* This value is usable. */ 213 /* This value is usable. */
@@ -218,7 +216,7 @@ index 2fb579bbbf..d0be99581c 100644
218 216
219 first = 0; 217 first = 0;
220 } 218 }
221@@ -2461,8 +2461,8 @@ with character code range values one must use the absolute ellipsis `...'")); 219@@ -2460,8 +2460,8 @@ with character code range values one must use the absolute ellipsis `...'"));
222 } 220 }
223 221
224 handle_tok_digit: 222 handle_tok_digit:
@@ -229,7 +227,7 @@ index 2fb579bbbf..d0be99581c 100644
229 handle_digits = 1; 227 handle_digits = 1;
230 goto read_charclass; 228 goto read_charclass;
231 229
232@@ -3904,8 +3904,7 @@ allocate_arrays (struct locale_ctype_t *ctype, const struct charmap_t *charmap, 230@@ -3876,8 +3876,7 @@ allocate_arrays (struct locale_ctype_t *ctype, const struct charmap_t *charmap,
233 231
234 while (idx < number) 232 while (idx < number)
235 { 233 {
@@ -239,7 +237,7 @@ index 2fb579bbbf..d0be99581c 100644
239 if (res == 0) 237 if (res == 0)
240 { 238 {
241 replace = 1; 239 replace = 1;
242@@ -3942,11 +3941,11 @@ allocate_arrays (struct locale_ctype_t *ctype, const struct charmap_t *charmap, 240@@ -3914,11 +3913,11 @@ allocate_arrays (struct locale_ctype_t *ctype, const struct charmap_t *charmap,
243 for (size_t cnt = 0; cnt < number; ++cnt) 241 for (size_t cnt = 0; cnt < number; ++cnt)
244 { 242 {
245 struct translit_to_t *srunp; 243 struct translit_to_t *srunp;
@@ -253,7 +251,7 @@ index 2fb579bbbf..d0be99581c 100644
253 srunp = srunp->next; 251 srunp = srunp->next;
254 } 252 }
255 /* Plus one for the extra NUL character marking the end of 253 /* Plus one for the extra NUL character marking the end of
256@@ -3970,18 +3969,18 @@ allocate_arrays (struct locale_ctype_t *ctype, const struct charmap_t *charmap, 254@@ -3942,18 +3941,18 @@ allocate_arrays (struct locale_ctype_t *ctype, const struct charmap_t *charmap,
257 ctype->translit_from_idx[cnt] = from_len; 255 ctype->translit_from_idx[cnt] = from_len;
258 ctype->translit_to_idx[cnt] = to_len; 256 ctype->translit_to_idx[cnt] = to_len;
259 257
@@ -279,10 +277,10 @@ index 2fb579bbbf..d0be99581c 100644
279 srunp = srunp->next; 277 srunp = srunp->next;
280 } 278 }
281diff --git a/locale/programs/ld-time.c b/locale/programs/ld-time.c 279diff --git a/locale/programs/ld-time.c b/locale/programs/ld-time.c
282index dcd2a2386d..6814740325 100644 280index 1abff3cf53..8a2f2b820a 100644
283--- a/locale/programs/ld-time.c 281--- a/locale/programs/ld-time.c
284+++ b/locale/programs/ld-time.c 282+++ b/locale/programs/ld-time.c
285@@ -220,8 +220,10 @@ No definition for %s category found"), "LC_TIME"); 283@@ -219,8 +219,10 @@ No definition for %s category found"), "LC_TIME");
286 } 284 }
287 else 285 else
288 { 286 {
@@ -294,7 +292,7 @@ index dcd2a2386d..6814740325 100644
294 } 292 }
295 } 293 }
296 294
297@@ -231,7 +233,7 @@ No definition for %s category found"), "LC_TIME"); 295@@ -230,7 +232,7 @@ No definition for %s category found"), "LC_TIME");
298 const int days_per_month[12] = { 31, 29, 31, 30, 31, 30, 296 const int days_per_month[12] = { 31, 29, 31, 30, 31, 30,
299 31, 31, 30, 31 ,30, 31 }; 297 31, 31, 30, 31 ,30, 31 };
300 size_t idx; 298 size_t idx;
@@ -303,7 +301,7 @@ index dcd2a2386d..6814740325 100644
303 301
304 time->era_entries = 302 time->era_entries =
305 (struct era_data *) xmalloc (time->num_era 303 (struct era_data *) xmalloc (time->num_era
306@@ -457,18 +459,18 @@ No definition for %s category found"), "LC_TIME"); 304@@ -456,18 +458,18 @@ No definition for %s category found"), "LC_TIME");
307 } 305 }
308 306
309 /* Now generate the wide character name and format. */ 307 /* Now generate the wide character name and format. */
@@ -329,7 +327,7 @@ index dcd2a2386d..6814740325 100644
329 } 327 }
330 else 328 else
331 time->era_entries[idx].wname = 329 time->era_entries[idx].wname =
332@@ -527,7 +529,16 @@ No definition for %s category found"), "LC_TIME"); 330@@ -526,7 +528,16 @@ No definition for %s category found"), "LC_TIME");
333 if (time->date_fmt == NULL) 331 if (time->date_fmt == NULL)
334 time->date_fmt = "%a %b %e %H:%M:%S %Z %Y"; 332 time->date_fmt = "%a %b %e %H:%M:%S %Z %Y";
335 if (time->wdate_fmt == NULL) 333 if (time->wdate_fmt == NULL)
@@ -348,23 +346,23 @@ index dcd2a2386d..6814740325 100644
348 346
349 347
350diff --git a/locale/programs/linereader.c b/locale/programs/linereader.c 348diff --git a/locale/programs/linereader.c b/locale/programs/linereader.c
351index 96d3ab66db..3af379d2c3 100644 349index 61373d2657..7ec5726377 100644
352--- a/locale/programs/linereader.c 350--- a/locale/programs/linereader.c
353+++ b/locale/programs/linereader.c 351+++ b/locale/programs/linereader.c
354@@ -595,7 +595,7 @@ get_string (struct linereader *lr, const struct charmap_t *charmap, 352@@ -776,7 +776,7 @@ get_string (struct linereader *lr, const struct charmap_t *charmap,
355 { 353 {
356 int return_widestr = lr->return_widestr; 354 int return_widestr = lr->return_widestr;
357 char *buf; 355 struct lr_buffer lrb;
358- wchar_t *buf2 = NULL; 356- wchar_t *buf2 = NULL;
359+ uint32_t *buf2 = NULL; 357+ uint32_t *buf2 = NULL;
360 size_t bufact; 358
361 size_t bufmax = 56; 359 lr_buffer_init (&lrb);
362 360
363diff --git a/locale/programs/localedef.c b/locale/programs/localedef.c 361diff --git a/locale/programs/localedef.c b/locale/programs/localedef.c
364index 832c8fd1fc..fe689b3ae1 100644 362index 907bb5fb25..3106529043 100644
365--- a/locale/programs/localedef.c 363--- a/locale/programs/localedef.c
366+++ b/locale/programs/localedef.c 364+++ b/locale/programs/localedef.c
367@@ -109,6 +109,7 @@ void (*argp_program_version_hook) (FILE *, struct argp_state *) = print_version; 365@@ -108,6 +108,7 @@ void (*argp_program_version_hook) (FILE *, struct argp_state *) = print_version;
368 #define OPT_NO_WARN 402 366 #define OPT_NO_WARN 402
369 #define OPT_WARN 403 367 #define OPT_WARN 403
370 #define OPT_NO_HARD_LINKS 404 368 #define OPT_NO_HARD_LINKS 404
@@ -372,7 +370,7 @@ index 832c8fd1fc..fe689b3ae1 100644
372 370
373 /* Definitions of arguments for argp functions. */ 371 /* Definitions of arguments for argp functions. */
374 static const struct argp_option options[] = 372 static const struct argp_option options[] =
375@@ -153,6 +154,8 @@ static const struct argp_option options[] = 373@@ -152,6 +153,8 @@ static const struct argp_option options[] =
376 N_("Generate little-endian output") }, 374 N_("Generate little-endian output") },
377 { "big-endian", OPT_BIG_ENDIAN, NULL, 0, 375 { "big-endian", OPT_BIG_ENDIAN, NULL, 0,
378 N_("Generate big-endian output") }, 376 N_("Generate big-endian output") },
@@ -381,7 +379,7 @@ index 832c8fd1fc..fe689b3ae1 100644
381 { NULL, 0, NULL, 0, NULL } 379 { NULL, 0, NULL, 0, NULL }
382 }; 380 };
383 381
384@@ -243,12 +246,14 @@ main (int argc, char *argv[]) 382@@ -242,12 +245,14 @@ main (int argc, char *argv[])
385 ctype locale. (P1003.2 4.35.5.2) */ 383 ctype locale. (P1003.2 4.35.5.2) */
386 setlocale (LC_CTYPE, "POSIX"); 384 setlocale (LC_CTYPE, "POSIX");
387 385
@@ -396,7 +394,7 @@ index 832c8fd1fc..fe689b3ae1 100644
396 394
397 /* Process charmap file. */ 395 /* Process charmap file. */
398 charmap = charmap_read (charmap_file, verbose, 1, be_quiet, 1); 396 charmap = charmap_read (charmap_file, verbose, 1, be_quiet, 1);
399@@ -400,6 +405,9 @@ parse_opt (int key, char *arg, struct argp_state *state) 397@@ -399,6 +404,9 @@ parse_opt (int key, char *arg, struct argp_state *state)
400 /* Do not hard link to other locales. */ 398 /* Do not hard link to other locales. */
401 hard_links = false; 399 hard_links = false;
402 break; 400 break;
@@ -407,10 +405,10 @@ index 832c8fd1fc..fe689b3ae1 100644
407 force_output = 1; 405 force_output = 1;
408 break; 406 break;
409diff --git a/locale/programs/locfile.c b/locale/programs/locfile.c 407diff --git a/locale/programs/locfile.c b/locale/programs/locfile.c
410index 0f1affa1d4..7d86fae801 100644 408index 6c6ebf2dd6..cc02ab82bf 100644
411--- a/locale/programs/locfile.c 409--- a/locale/programs/locfile.c
412+++ b/locale/programs/locfile.c 410+++ b/locale/programs/locfile.c
413@@ -544,6 +544,9 @@ compare_files (const char *filename1, const char *filename2, size_t size, 411@@ -543,6 +543,9 @@ compare_files (const char *filename1, const char *filename2, size_t size,
414 machine running localedef. */ 412 machine running localedef. */
415 bool swap_endianness_p; 413 bool swap_endianness_p;
416 414
@@ -420,7 +418,7 @@ index 0f1affa1d4..7d86fae801 100644
420 /* When called outside a start_locale_structure/end_locale_structure 418 /* When called outside a start_locale_structure/end_locale_structure
421 or start_locale_prelude/end_locale_prelude block, record that the 419 or start_locale_prelude/end_locale_prelude block, record that the
422 next byte in FILE's obstack will be the first byte of a new element. 420 next byte in FILE's obstack will be the first byte of a new element.
423@@ -621,7 +624,7 @@ add_locale_string (struct locale_file *file, const char *string) 421@@ -620,7 +623,7 @@ add_locale_string (struct locale_file *file, const char *string)
424 void 422 void
425 add_locale_wstring (struct locale_file *file, const uint32_t *string) 423 add_locale_wstring (struct locale_file *file, const uint32_t *string)
426 { 424 {
@@ -430,10 +428,10 @@ index 0f1affa1d4..7d86fae801 100644
430 428
431 /* Record that FILE's next element is the 32-bit integer VALUE. */ 429 /* Record that FILE's next element is the 32-bit integer VALUE. */
432diff --git a/locale/programs/locfile.h b/locale/programs/locfile.h 430diff --git a/locale/programs/locfile.h b/locale/programs/locfile.h
433index c986d599ec..222a779176 100644 431index 3afb0a8d29..46785374e8 100644
434--- a/locale/programs/locfile.h 432--- a/locale/programs/locfile.h
435+++ b/locale/programs/locfile.h 433+++ b/locale/programs/locfile.h
436@@ -71,6 +71,8 @@ extern void write_all_categories (struct localedef_t *definitions, 434@@ -70,6 +70,8 @@ extern void write_all_categories (struct localedef_t *definitions,
437 435
438 extern bool swap_endianness_p; 436 extern bool swap_endianness_p;
439 437
@@ -442,7 +440,7 @@ index c986d599ec..222a779176 100644
442 /* Change the output to be big-endian if BIG_ENDIAN is true and 440 /* Change the output to be big-endian if BIG_ENDIAN is true and
443 little-endian otherwise. */ 441 little-endian otherwise. */
444 static inline void 442 static inline void
445@@ -89,7 +91,8 @@ maybe_swap_uint32 (uint32_t value) 443@@ -88,7 +90,8 @@ maybe_swap_uint32 (uint32_t value)
446 } 444 }
447 445
448 /* Likewise, but munge an array of N uint32_ts starting at ARRAY. */ 446 /* Likewise, but munge an array of N uint32_ts starting at ARRAY. */
@@ -452,7 +450,7 @@ index c986d599ec..222a779176 100644
452 maybe_swap_uint32_array (uint32_t *array, size_t n) 450 maybe_swap_uint32_array (uint32_t *array, size_t n)
453 { 451 {
454 if (swap_endianness_p) 452 if (swap_endianness_p)
455@@ -99,7 +102,8 @@ maybe_swap_uint32_array (uint32_t *array, size_t n) 453@@ -98,7 +101,8 @@ maybe_swap_uint32_array (uint32_t *array, size_t n)
456 454
457 /* Like maybe_swap_uint32_array, but the array of N elements is at 455 /* Like maybe_swap_uint32_array, but the array of N elements is at
458 the end of OBSTACK's current object. */ 456 the end of OBSTACK's current object. */
@@ -462,7 +460,7 @@ index c986d599ec..222a779176 100644
462 maybe_swap_uint32_obstack (struct obstack *obstack, size_t n) 460 maybe_swap_uint32_obstack (struct obstack *obstack, size_t n)
463 { 461 {
464 maybe_swap_uint32_array ((uint32_t *) obstack_next_free (obstack) - n, n); 462 maybe_swap_uint32_array ((uint32_t *) obstack_next_free (obstack) - n, n);
465@@ -276,4 +280,55 @@ extern void identification_output (struct localedef_t *locale, 463@@ -275,4 +279,55 @@ extern void identification_output (struct localedef_t *locale,
466 const struct charmap_t *charmap, 464 const struct charmap_t *charmap,
467 const char *output_path); 465 const char *output_path);
468 466
@@ -519,7 +517,7 @@ index c986d599ec..222a779176 100644
519+ 517+
520 #endif /* locfile.h */ 518 #endif /* locfile.h */
521diff --git a/locale/setlocale.c b/locale/setlocale.c 519diff --git a/locale/setlocale.c b/locale/setlocale.c
522index 19ed85ae8e..f28ca11446 100644 520index 7bd27e5398..2f194bad7c 100644
523--- a/locale/setlocale.c 521--- a/locale/setlocale.c
524+++ b/locale/setlocale.c 522+++ b/locale/setlocale.c
525@@ -63,35 +63,6 @@ static char *const _nl_current_used[] = 523@@ -63,35 +63,6 @@ static char *const _nl_current_used[] =
diff --git a/meta/recipes-core/glibc/glibc/0023-localedef-add-to-archive-uses-a-hard-coded-locale-pa.patch b/meta/recipes-core/glibc/glibc/0014-localedef-add-to-archive-uses-a-hard-coded-locale-pa.patch
index a5a7a0cad7..daeff7b065 100644
--- a/meta/recipes-core/glibc/glibc/0023-localedef-add-to-archive-uses-a-hard-coded-locale-pa.patch
+++ b/meta/recipes-core/glibc/glibc/0014-localedef-add-to-archive-uses-a-hard-coded-locale-pa.patch
@@ -1,4 +1,4 @@
1From 2ec233ce078b74030de9195096058cd502fdc395 Mon Sep 17 00:00:00 2001 1From f4b1d6429298c0f8a2aa29ff559eb2093ea0188f Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com> 2From: Khem Raj <raj.khem@gmail.com>
3Date: Fri, 3 Aug 2018 09:42:06 -0700 3Date: Fri, 3 Aug 2018 09:42:06 -0700
4Subject: [PATCH] localedef --add-to-archive uses a hard-coded locale path 4Subject: [PATCH] localedef --add-to-archive uses a hard-coded locale path
@@ -18,10 +18,10 @@ Signed-off-by: Khem Raj <raj.khem@gmail.com>
18 1 file changed, 25 insertions(+), 10 deletions(-) 18 1 file changed, 25 insertions(+), 10 deletions(-)
19 19
20diff --git a/locale/programs/locarchive.c b/locale/programs/locarchive.c 20diff --git a/locale/programs/locarchive.c b/locale/programs/locarchive.c
21index 6bb189ae37..0711c5c44e 100644 21index 8d79a1b6d1..6dc7ecd4e7 100644
22--- a/locale/programs/locarchive.c 22--- a/locale/programs/locarchive.c
23+++ b/locale/programs/locarchive.c 23+++ b/locale/programs/locarchive.c
24@@ -340,12 +340,24 @@ enlarge_archive (struct locarhandle *ah, const struct locarhead *head) 24@@ -339,12 +339,24 @@ enlarge_archive (struct locarhandle *ah, const struct locarhead *head)
25 struct namehashent *oldnamehashtab; 25 struct namehashent *oldnamehashtab;
26 struct locarhandle new_ah; 26 struct locarhandle new_ah;
27 size_t prefix_len = output_prefix ? strlen (output_prefix) : 0; 27 size_t prefix_len = output_prefix ? strlen (output_prefix) : 0;
@@ -51,7 +51,7 @@ index 6bb189ae37..0711c5c44e 100644
51 strcpy (stpcpy (fname, archivefname), ".XXXXXX"); 51 strcpy (stpcpy (fname, archivefname), ".XXXXXX");
52 52
53 /* Not all of the old file has to be mapped. Change this now this 53 /* Not all of the old file has to be mapped. Change this now this
54@@ -569,10 +581,13 @@ open_archive (struct locarhandle *ah, bool readonly) 54@@ -568,10 +580,13 @@ open_archive (struct locarhandle *ah, bool readonly)
55 /* If ah has a non-NULL fname open that otherwise open the default. */ 55 /* If ah has a non-NULL fname open that otherwise open the default. */
56 if (archivefname == NULL) 56 if (archivefname == NULL)
57 { 57 {
@@ -69,7 +69,7 @@ index 6bb189ae37..0711c5c44e 100644
69 } 69 }
70 70
71 while (1) 71 while (1)
72@@ -585,7 +600,7 @@ open_archive (struct locarhandle *ah, bool readonly) 72@@ -584,7 +599,7 @@ open_archive (struct locarhandle *ah, bool readonly)
73 the default locale archive we ignore the failure and 73 the default locale archive we ignore the failure and
74 list an empty archive, otherwise we print an error 74 list an empty archive, otherwise we print an error
75 and exit. */ 75 and exit. */
diff --git a/meta/recipes-core/glibc/glibc/0030-powerpc-Do-not-ask-compiler-for-finding-arch.patch b/meta/recipes-core/glibc/glibc/0015-powerpc-Do-not-ask-compiler-for-finding-arch.patch
index 5ef1ac2ed7..8dd1f0a656 100644
--- a/meta/recipes-core/glibc/glibc/0030-powerpc-Do-not-ask-compiler-for-finding-arch.patch
+++ b/meta/recipes-core/glibc/glibc/0015-powerpc-Do-not-ask-compiler-for-finding-arch.patch
@@ -1,4 +1,4 @@
1From 5cc14938f05ae1354c8062f017a21f39d5fc9729 Mon Sep 17 00:00:00 2001 1From 2d064c0c1243ea0bf405909285d7cddca92cf097 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com> 2From: Khem Raj <raj.khem@gmail.com>
3Date: Fri, 7 Aug 2020 14:31:16 -0700 3Date: Fri, 7 Aug 2020 14:31:16 -0700
4Subject: [PATCH] powerpc: Do not ask compiler for finding arch 4Subject: [PATCH] powerpc: Do not ask compiler for finding arch
@@ -15,7 +15,7 @@ Signed-off-by: Khem Raj <raj.khem@gmail.com>
15 2 files changed, 2 insertions(+), 8 deletions(-) 15 2 files changed, 2 insertions(+), 8 deletions(-)
16 16
17diff --git a/sysdeps/powerpc/preconfigure b/sysdeps/powerpc/preconfigure 17diff --git a/sysdeps/powerpc/preconfigure b/sysdeps/powerpc/preconfigure
18index dfe8e20399..bbff040f0f 100644 18index 4de94089a3..428ad7b162 100644
19--- a/sysdeps/powerpc/preconfigure 19--- a/sysdeps/powerpc/preconfigure
20+++ b/sysdeps/powerpc/preconfigure 20+++ b/sysdeps/powerpc/preconfigure
21@@ -29,10 +29,7 @@ esac 21@@ -29,10 +29,7 @@ esac
diff --git a/meta/recipes-core/glibc/glibc/0016-timezone-re-written-tzselect-as-posix-sh.patch b/meta/recipes-core/glibc/glibc/0016-timezone-re-written-tzselect-as-posix-sh.patch
deleted file mode 100644
index 79bd704153..0000000000
--- a/meta/recipes-core/glibc/glibc/0016-timezone-re-written-tzselect-as-posix-sh.patch
+++ /dev/null
@@ -1,42 +0,0 @@
1From 3feb4213628f1485000ffe1d3fd26e37a7b14336 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Wed, 18 Mar 2015 00:33:03 +0000
4Subject: [PATCH] timezone: re-written tzselect as posix sh
5
6To avoid the bash dependency.
7
8Upstream-Status: Pending
9
10Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
11Signed-off-by: Khem Raj <raj.khem@gmail.com>
12---
13 timezone/Makefile | 2 +-
14 timezone/tzselect.ksh | 2 +-
15 2 files changed, 2 insertions(+), 2 deletions(-)
16
17diff --git a/timezone/Makefile b/timezone/Makefile
18index 395abfeebd..2d939edf75 100644
19--- a/timezone/Makefile
20+++ b/timezone/Makefile
21@@ -123,7 +123,7 @@ $(testdata)/XT%: testdata/XT%
22 cp $< $@
23
24 $(objpfx)tzselect: tzselect.ksh $(common-objpfx)config.make
25- sed -e 's|/bin/bash|$(BASH)|' \
26+ sed -e 's|/bin/bash|/bin/sh|' \
27 -e 's|TZDIR=[^}]*|TZDIR=$(zonedir)|' \
28 -e '/TZVERSION=/s|see_Makefile|"$(version)"|' \
29 -e '/PKGVERSION=/s|=.*|="$(PKGVERSION)"|' \
30diff --git a/timezone/tzselect.ksh b/timezone/tzselect.ksh
31index 18fce27e24..70745f9d36 100755
32--- a/timezone/tzselect.ksh
33+++ b/timezone/tzselect.ksh
34@@ -34,7 +34,7 @@ REPORT_BUGS_TO=tz@iana.org
35
36 # Specify default values for environment variables if they are unset.
37 : ${AWK=awk}
38-: ${TZDIR=`pwd`}
39+: ${TZDIR=$(pwd)}
40
41 # Output one argument as-is to standard output.
42 # Safer than 'echo', which can mishandle '\' or leading '-'.
diff --git a/meta/recipes-core/glibc/glibc/0016-wordsize.h-Unify-the-header-between-arm-and-aarch64.patch b/meta/recipes-core/glibc/glibc/0016-wordsize.h-Unify-the-header-between-arm-and-aarch64.patch
new file mode 100644
index 0000000000..066c3b1ea2
--- /dev/null
+++ b/meta/recipes-core/glibc/glibc/0016-wordsize.h-Unify-the-header-between-arm-and-aarch64.patch
@@ -0,0 +1,49 @@
1From b1c374f7ede81a98f2d02def2c7ca17f1001f7cb Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Fri, 15 May 2020 17:05:45 -0700
4Subject: [PATCH] wordsize.h: Unify the header between arm and aarch64
5
6This helps OE multilibs to not sythesize this header which causes all
7kind of recursions and other issues since wordsize is fundamental header
8and ends up including itself in many case e.g. clang tidy, bpf etc.
9
10Upstream-Status: Inappropriate [ OE-Specific ]
11
12Signed-off-by: Khem Raj <raj.khem@gmail.com>
13---
14 sysdeps/aarch64/bits/wordsize.h | 8 ++++++--
15 sysdeps/arm/bits/wordsize.h | 1 +
16 2 files changed, 7 insertions(+), 2 deletions(-)
17 create mode 120000 sysdeps/arm/bits/wordsize.h
18
19diff --git a/sysdeps/aarch64/bits/wordsize.h b/sysdeps/aarch64/bits/wordsize.h
20index 118e59172d..b4b0692eb5 100644
21--- a/sysdeps/aarch64/bits/wordsize.h
22+++ b/sysdeps/aarch64/bits/wordsize.h
23@@ -17,12 +17,16 @@
24 License along with the GNU C Library; if not, see
25 <https://www.gnu.org/licenses/>. */
26
27-#ifdef __LP64__
28+#if defined (__aarch64__) && defined (__LP64__)
29 # define __WORDSIZE 64
30-#else
31+#elif defined (__aarch64__)
32 # define __WORDSIZE 32
33 # define __WORDSIZE32_SIZE_ULONG 1
34 # define __WORDSIZE32_PTRDIFF_LONG 1
35+#else
36+# define __WORDSIZE 32
37+# define __WORDSIZE32_SIZE_ULONG 0
38+# define __WORDSIZE32_PTRDIFF_LONG 0
39 #endif
40
41 #define __WORDSIZE_TIME64_COMPAT32 0
42diff --git a/sysdeps/arm/bits/wordsize.h b/sysdeps/arm/bits/wordsize.h
43new file mode 120000
44index 0000000000..4c4a788ec2
45--- /dev/null
46+++ b/sysdeps/arm/bits/wordsize.h
47@@ -0,0 +1 @@
48+../../aarch64/bits/wordsize.h
49\ No newline at end of file
diff --git a/meta/recipes-core/glibc/glibc/0017-Remove-bash-dependency-for-nscd-init-script.patch b/meta/recipes-core/glibc/glibc/0017-Replace-echo-with-printf-builtin-in-nscd-init-script.patch
index c32d70b593..d8c0b1b4ad 100644
--- a/meta/recipes-core/glibc/glibc/0017-Remove-bash-dependency-for-nscd-init-script.patch
+++ b/meta/recipes-core/glibc/glibc/0017-Replace-echo-with-printf-builtin-in-nscd-init-script.patch
@@ -1,21 +1,22 @@
1From f6119b98a9caa80642d69a97edc98f57ecef5c3c Mon Sep 17 00:00:00 2001 1From 0aac3b8ee5b13e289b6969da51de384443286a5b Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com> 2From: Khem Raj <raj.khem@gmail.com>
3Date: Thu, 31 Dec 2015 14:33:02 -0800 3Date: Thu, 31 Dec 2015 14:33:02 -0800
4Subject: [PATCH] Remove bash dependency for nscd init script 4Subject: [PATCH] Replace echo with printf builtin in nscd init script
5 5
6The nscd init script uses #! /bin/bash but only really uses one bashism 6The nscd init script calls for #! /bin/bash interpreter
7(translated strings), so remove them and switch the shell to #!/bin/sh. 7since it uses bash specific extentions namely (translated strings)
8and echo -n command, replace echo with printf and
9switch the shell interpreter to #!/bin/sh.
8 10
9Upstream-Status: Pending 11Upstream-Status: Pending
10 12Signed-off-by: Ross Burton <ross.burton@arm.com>
11Signed-off-by: Ross Burton <ross.burton@intel.com>
12Signed-off-by: Khem Raj <raj.khem@gmail.com> 13Signed-off-by: Khem Raj <raj.khem@gmail.com>
13--- 14---
14 nscd/nscd.init | 14 +++++++------- 15 nscd/nscd.init | 20 ++++++++++----------
15 1 file changed, 7 insertions(+), 7 deletions(-) 16 1 file changed, 10 insertions(+), 10 deletions(-)
16 17
17diff --git a/nscd/nscd.init b/nscd/nscd.init 18diff --git a/nscd/nscd.init b/nscd/nscd.init
18index a882da7d8b..b02986ec15 100644 19index a882da7d8b..857b541381 100644
19--- a/nscd/nscd.init 20--- a/nscd/nscd.init
20+++ b/nscd/nscd.init 21+++ b/nscd/nscd.init
21@@ -1,4 +1,4 @@ 22@@ -1,4 +1,4 @@
@@ -24,25 +25,27 @@ index a882da7d8b..b02986ec15 100644
24 # 25 #
25 # nscd: Starts the Name Switch Cache Daemon 26 # nscd: Starts the Name Switch Cache Daemon
26 # 27 #
27@@ -49,7 +49,7 @@ prog=nscd 28@@ -49,16 +49,16 @@ prog=nscd
28 start () { 29 start () {
29 [ -d /var/run/nscd ] || mkdir /var/run/nscd 30 [ -d /var/run/nscd ] || mkdir /var/run/nscd
30 [ -d /var/db/nscd ] || mkdir /var/db/nscd 31 [ -d /var/db/nscd ] || mkdir /var/db/nscd
31- echo -n $"Starting $prog: " 32- echo -n $"Starting $prog: "
32+ echo -n "Starting $prog: " 33+ printf "Starting $prog: "
33 daemon /usr/sbin/nscd 34 daemon /usr/sbin/nscd
34 RETVAL=$? 35 RETVAL=$?
35 echo 36- echo
36@@ -58,7 +58,7 @@ start () { 37+ printf "\n"
38 [ $RETVAL -eq 0 ] && touch /var/lock/subsys/nscd
39 return $RETVAL
37 } 40 }
38 41
39 stop () { 42 stop () {
40- echo -n $"Stopping $prog: " 43- echo -n $"Stopping $prog: "
41+ echo -n "Stopping $prog: " 44+ printf "Stopping $prog: "
42 /usr/sbin/nscd -K 45 /usr/sbin/nscd -K
43 RETVAL=$? 46 RETVAL=$?
44 if [ $RETVAL -eq 0 ]; then 47 if [ $RETVAL -eq 0 ]; then
45@@ -67,9 +67,9 @@ stop () { 48@@ -67,11 +67,11 @@ stop () {
46 # a non-privileged user 49 # a non-privileged user
47 rm -f /var/run/nscd/nscd.pid 50 rm -f /var/run/nscd/nscd.pid
48 rm -f /var/run/nscd/socket 51 rm -f /var/run/nscd/socket
@@ -52,21 +55,25 @@ index a882da7d8b..b02986ec15 100644
52- failure $"$prog shutdown" 55- failure $"$prog shutdown"
53+ failure "$prog shutdown" 56+ failure "$prog shutdown"
54 fi 57 fi
55 echo 58- echo
59+ printf "\n"
56 return $RETVAL 60 return $RETVAL
61 }
62
57@@ -103,13 +103,13 @@ case "$1" in 63@@ -103,13 +103,13 @@ case "$1" in
58 RETVAL=$? 64 RETVAL=$?
59 ;; 65 ;;
60 force-reload | reload) 66 force-reload | reload)
61- echo -n $"Reloading $prog: " 67- echo -n $"Reloading $prog: "
62+ echo -n "Reloading $prog: " 68+ printf "Reloading $prog: "
63 killproc /usr/sbin/nscd -HUP 69 killproc /usr/sbin/nscd -HUP
64 RETVAL=$? 70 RETVAL=$?
65 echo 71- echo
72+ printf "\n"
66 ;; 73 ;;
67 *) 74 *)
68- echo $"Usage: $0 {start|stop|status|restart|reload|condrestart}" 75- echo $"Usage: $0 {start|stop|status|restart|reload|condrestart}"
69+ echo "Usage: $0 {start|stop|status|restart|reload|condrestart}" 76+ printf "Usage: $0 {start|stop|status|restart|reload|condrestart}\n"
70 RETVAL=1 77 RETVAL=1
71 ;; 78 ;;
72 esac 79 esac
diff --git a/meta/recipes-core/glibc/glibc/0014-sysdeps-gnu-configure.ac-handle-correctly-libc_cv_ro.patch b/meta/recipes-core/glibc/glibc/0018-sysdeps-gnu-configure.ac-Set-libc_cv_rootsbindir-onl.patch
index 4da0e003c0..c81f82f433 100644
--- a/meta/recipes-core/glibc/glibc/0014-sysdeps-gnu-configure.ac-handle-correctly-libc_cv_ro.patch
+++ b/meta/recipes-core/glibc/glibc/0018-sysdeps-gnu-configure.ac-Set-libc_cv_rootsbindir-onl.patch
@@ -1,11 +1,12 @@
1From c062a462fee53a30a85d693c8288b5bd8fe4ec6e Mon Sep 17 00:00:00 2001 1From 7a25d4796411f22f824742092a4c2a08df99752d Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com> 2From: Khem Raj <raj.khem@gmail.com>
3Date: Wed, 18 Mar 2015 00:27:10 +0000 3Date: Wed, 18 Mar 2015 00:27:10 +0000
4Subject: [PATCH] sysdeps/gnu/configure.ac: handle correctly 4Subject: [PATCH] sysdeps/gnu/configure.ac: Set libc_cv_rootsbindir only if its
5 $libc_cv_rootsbindir 5 empty
6 6
7Upstream-Status:Pending 7This ensures that it can be set in build environment
8 8
9Upstream-Status: Pending
9Signed-off-by: Matthieu Crapet <Matthieu.Crapet@ingenico.com> 10Signed-off-by: Matthieu Crapet <Matthieu.Crapet@ingenico.com>
10Signed-off-by: Khem Raj <raj.khem@gmail.com> 11Signed-off-by: Khem Raj <raj.khem@gmail.com>
11--- 12---
@@ -14,19 +15,20 @@ Signed-off-by: Khem Raj <raj.khem@gmail.com>
14 2 files changed, 2 insertions(+), 2 deletions(-) 15 2 files changed, 2 insertions(+), 2 deletions(-)
15 16
16diff --git a/sysdeps/gnu/configure b/sysdeps/gnu/configure 17diff --git a/sysdeps/gnu/configure b/sysdeps/gnu/configure
17index c15d1087e8..37cc983f2a 100644 18index 18c9d7945a..ef22cc845d 100644
18--- a/sysdeps/gnu/configure 19--- a/sysdeps/gnu/configure
19+++ b/sysdeps/gnu/configure 20+++ b/sysdeps/gnu/configure
20@@ -32,6 +32,6 @@ case "$prefix" in 21@@ -32,7 +32,7 @@ case "$prefix" in
21 else 22 else
22 libc_cv_localstatedir=$localstatedir 23 libc_cv_localstatedir=$localstatedir
23 fi 24 fi
24- libc_cv_rootsbindir=/sbin 25- libc_cv_rootsbindir=/sbin
25+ test -n "$libc_cv_rootsbindir" || libc_cv_rootsbindir=/sbin 26+ libc_cv_rootsbindir=${libc_cv_rootsbindir:=/sbin}
26 ;; 27 ;;
27 esac 28 esac
29
28diff --git a/sysdeps/gnu/configure.ac b/sysdeps/gnu/configure.ac 30diff --git a/sysdeps/gnu/configure.ac b/sysdeps/gnu/configure.ac
29index 634fe4de2a..3db1697f4f 100644 31index 634fe4de2a..492112e0fd 100644
30--- a/sysdeps/gnu/configure.ac 32--- a/sysdeps/gnu/configure.ac
31+++ b/sysdeps/gnu/configure.ac 33+++ b/sysdeps/gnu/configure.ac
32@@ -21,6 +21,6 @@ case "$prefix" in 34@@ -21,6 +21,6 @@ case "$prefix" in
@@ -34,6 +36,6 @@ index 634fe4de2a..3db1697f4f 100644
34 libc_cv_localstatedir=$localstatedir 36 libc_cv_localstatedir=$localstatedir
35 fi 37 fi
36- libc_cv_rootsbindir=/sbin 38- libc_cv_rootsbindir=/sbin
37+ test -n "$libc_cv_rootsbindir" || libc_cv_rootsbindir=/sbin 39+ libc_cv_rootsbindir=${libc_cv_rootsbindir:=/sbin}
38 ;; 40 ;;
39 esac 41 esac
diff --git a/meta/recipes-core/glibc/glibc/0019-timezone-Make-shell-interpreter-overridable-in-tzsel.patch b/meta/recipes-core/glibc/glibc/0019-timezone-Make-shell-interpreter-overridable-in-tzsel.patch
new file mode 100644
index 0000000000..d724c3e968
--- /dev/null
+++ b/meta/recipes-core/glibc/glibc/0019-timezone-Make-shell-interpreter-overridable-in-tzsel.patch
@@ -0,0 +1,47 @@
1From 6aa1b835d95482287851e02abd3a406cbd0ef8c7 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Thu, 9 Dec 2021 15:14:42 -0800
4Subject: [PATCH] timezone: Make shell interpreter overridable in tzselect.ksh
5
6define new macro called KSHELL which can be used to define default shell
7use Bash by default
8
9Upstream-Status: Pending
10Signed-off-by: Khem Raj <raj.khem@gmail.com>
11---
12 Makeconfig | 9 +++++++++
13 timezone/Makefile | 1 +
14 2 files changed, 10 insertions(+)
15
16diff --git a/Makeconfig b/Makeconfig
17index 85e00cef94..643724108a 100644
18--- a/Makeconfig
19+++ b/Makeconfig
20@@ -309,6 +309,15 @@ ifndef sysincludedir
21 sysincludedir = /usr/include
22 endif
23
24+# The full path name of a Posix-compliant shell, preferably one that supports
25+# the Korn shell's 'select' statement as an extension.
26+# These days, Bash is the most popular.
27+# It should be OK to set this to /bin/sh, on platforms where /bin/sh
28+# lacks 'select' or doesn't completely conform to Posix, but /bin/bash
29+# is typically nicer if it works.
30+ifndef KSHELL
31+KSHELL = /bin/bash
32+endif
33
34 # Commands to install files.
35 ifndef INSTALL_DATA
36diff --git a/timezone/Makefile b/timezone/Makefile
37index d7acb387ba..ec79326f66 100644
38--- a/timezone/Makefile
39+++ b/timezone/Makefile
40@@ -136,6 +136,7 @@ $(objpfx)tzselect: tzselect.ksh $(common-objpfx)config.make
41 -e '/TZVERSION=/s|see_Makefile|"$(version)"|' \
42 -e '/PKGVERSION=/s|=.*|="$(PKGVERSION)"|' \
43 -e '/REPORT_BUGS_TO=/s|=.*|="$(REPORT_BUGS_TO)"|' \
44+ -e 's|#!/bin/bash|#!$(KSHELL)|g' \
45 < $< > $@.new
46 chmod 555 $@.new
47 mv -f $@.new $@
diff --git a/meta/recipes-core/glibc/glibc/0020-tzselect.ksh-Use-bin-sh-default-shell-interpreter.patch b/meta/recipes-core/glibc/glibc/0020-tzselect.ksh-Use-bin-sh-default-shell-interpreter.patch
new file mode 100644
index 0000000000..08c60a271b
--- /dev/null
+++ b/meta/recipes-core/glibc/glibc/0020-tzselect.ksh-Use-bin-sh-default-shell-interpreter.patch
@@ -0,0 +1,27 @@
1From ef47e6199986c4951e681ed74f064042db1ae2e1 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Wed, 15 Dec 2021 21:47:53 -0800
4Subject: [PATCH] tzselect.ksh: Use /bin/sh default shell interpreter
5
6checkbashism reports no issues with tzselect.ksh, therefore using
7/bin/sh instead of /bin/bash should be safe and portable across systems
8which don't ship bash ( embedded systems )
9
10Upstream-Status: Pending
11Signed-off-by: Khem Raj <raj.khem@gmail.com>
12Cc: Adhemerval Zanella <adhemerval.zanella@linaro.org>
13Cc: Paul Eggert <eggert@cs.ucla.edu>
14---
15 timezone/tzselect.ksh | 2 +-
16 1 file changed, 1 insertion(+), 1 deletion(-)
17
18diff --git a/timezone/tzselect.ksh b/timezone/tzselect.ksh
19index 18fce27e24..cc08efb0fb 100755
20--- a/timezone/tzselect.ksh
21+++ b/timezone/tzselect.ksh
22@@ -1,4 +1,4 @@
23-#!/bin/bash
24+#!/bin/sh
25 # Ask the user about the time zone, and output the resulting TZ value to stdout.
26 # Interact with the user via stderr and stdin.
27
diff --git a/meta/recipes-core/glibc/glibc/0021-fix-create-thread-failed-in-unprivileged-process-BZ-.patch b/meta/recipes-core/glibc/glibc/0021-fix-create-thread-failed-in-unprivileged-process-BZ-.patch
new file mode 100644
index 0000000000..d57dce125c
--- /dev/null
+++ b/meta/recipes-core/glibc/glibc/0021-fix-create-thread-failed-in-unprivileged-process-BZ-.patch
@@ -0,0 +1,86 @@
1From 7254706544be5100843fc0a332e836fccffc9ef1 Mon Sep 17 00:00:00 2001
2From: Hongxu Jia <hongxu.jia@windriver.com>
3Date: Sun, 29 Aug 2021 20:49:16 +0800
4Subject: [PATCH] fix create thread failed in unprivileged process [BZ #28287]
5
6Since commit [d8ea0d0168 Add an internal wrapper for clone, clone2 and clone3]
7applied, start a unprivileged container (docker run without --privileged),
8it creates a thread failed in container.
9
10In commit d8ea0d0168, it calls __clone3 if HAVE_CLONE3_WAPPER is defined. If
11__clone3 returns -1 with ENOSYS, fall back to clone or clone2.
12
13As known from [1], cloneXXX fails with EPERM if CLONE_NEWCGROUP,
14CLONE_NEWIPC, CLONE_NEWNET, CLONE_NEWNS, CLONE_NEWPID, or CLONE_NEWUTS
15was specified by an unprivileged process (process without CAP_SYS_ADMIN)
16
17[1] https://man7.org/linux/man-pages/man2/clone3.2.html
18
19So if __clone3 returns -1 with EPERM, fall back to clone or clone2 could
20fix the issue. Here are the test steps:
21
221) Prepare test code
23cat > conftest.c <<ENDOF
24 #include <pthread.h>
25 #include <stdio.h>
26
27int check_me = 0;
28void* func(void* data) {check_me = 42; printf("start thread: check_me %d\n", check_me); return &check_me;}
29int main()
30{
31 pthread_t t;
32 void *ret;
33 pthread_create (&t, 0, func, 0);
34 pthread_join (t, &ret);
35 printf("check_me %d, p %p\n", check_me, &ret);
36 return (check_me != 42 || ret != &check_me);
37}
38
39ENDOF
40
412) Compile
42gcc -o conftest -pthread conftest.c
43
443) Start a container with glibc 2.34 installed
45[skip details]
46docker run -it <container-image-name> bash
47
484) Run conftest without this patch
49$ ./conftest
50check_me 0, p 0x7ffd91ccd400
51
525) Run conftest with this patch
53$ ./conftest
54start thread: check_me 42
55check_me 42, p 0x7ffe253c6f20
56
57Upstream-Status: Inappropriate [Rejected by upstream]
58
59Upstream glibc rejected it because the latest docker has resolved the issue [1],
60and upstream glibc does not backward compatibility with old docker[2]
61
62In order to build Yocto with uninative in old docker, we need this local
63patch
64
65[1] https://github.com/moby/moby/commit/9f6b562dd12ef7b1f9e2f8e6f2ab6477790a6594
66[2] https://sourceware.org/pipermail/libc-alpha/2021-August/130590.html
67
68Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
69Signed-off-by: Khem Raj <raj.khem@gmail.com>
70---
71 sysdeps/unix/sysv/linux/clone-internal.c | 2 +-
72 1 file changed, 1 insertion(+), 1 deletion(-)
73
74diff --git a/sysdeps/unix/sysv/linux/clone-internal.c b/sysdeps/unix/sysv/linux/clone-internal.c
75index 40ef30303f..f97b1f6900 100644
76--- a/sysdeps/unix/sysv/linux/clone-internal.c
77+++ b/sysdeps/unix/sysv/linux/clone-internal.c
78@@ -98,7 +98,7 @@ __clone_internal (struct clone_args *cl_args,
79 #ifdef HAVE_CLONE3_WRAPPER
80 int saved_errno = errno;
81 int ret = __clone3_internal (cl_args, func, arg);
82- if (ret != -1 || errno != ENOSYS)
83+ if (ret != -1 || (errno != ENOSYS && errno != EPERM))
84 return ret;
85
86 /* NB: Restore errno since errno may be checked against non-zero
diff --git a/meta/recipes-core/glibc/glibc/0022-Avoid-hardcoded-build-time-paths-in-the-output-binar.patch b/meta/recipes-core/glibc/glibc/0022-Avoid-hardcoded-build-time-paths-in-the-output-binar.patch
new file mode 100644
index 0000000000..b527ddffc8
--- /dev/null
+++ b/meta/recipes-core/glibc/glibc/0022-Avoid-hardcoded-build-time-paths-in-the-output-binar.patch
@@ -0,0 +1,32 @@
1From d39779afc72d34f87f052097592008cc38e20615 Mon Sep 17 00:00:00 2001
2From: Richard Purdie <richard.purdie@linuxfoundation.org>
3Date: Sun, 24 Jul 2022 07:07:29 -0700
4Subject: [PATCH] Avoid hardcoded build time paths in the output binaries
5
6replace the compile definitions with the output locations.
7
8Upstream-Status: Inappropriate [would need reworking somehow to be acceptable upstream]
9
10Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
11Signed-off-by: Khem Raj <raj.khem@gmail.com>
12---
13 support/Makefile | 6 +++---
14 1 file changed, 3 insertions(+), 3 deletions(-)
15
16diff --git a/support/Makefile b/support/Makefile
17index 362a51f882..56d2b37058 100644
18--- a/support/Makefile
19+++ b/support/Makefile
20@@ -228,9 +228,9 @@ libsupport-inhibit-o += .o
21 endif
22
23 CFLAGS-support_paths.c = \
24- -DSRCDIR_PATH=\"`cd .. ; pwd`\" \
25- -DOBJDIR_PATH=\"`cd $(objpfx)/..; pwd`\" \
26- -DOBJDIR_ELF_LDSO_PATH=\"`cd $(objpfx)/..; pwd`/elf/$(rtld-installed-name)\" \
27+ -DSRCDIR_PATH=\"$(oe_srcdir)\" \
28+ -DOBJDIR_PATH=\"$(libdir)/glibc-tests/ptest/tests/glibc-ptest\" \
29+ -DOBJDIR_ELF_LDSO_PATH=\"$(slibdir)/$(rtld-installed-name)\" \
30 -DINSTDIR_PATH=\"$(prefix)\" \
31 -DLIBDIR_PATH=\"$(libdir)\" \
32 -DBINDIR_PATH=\"$(bindir)\" \
diff --git a/meta/recipes-core/glibc/glibc/0022-Define-DUMMY_LOCALE_T-if-not-defined.patch b/meta/recipes-core/glibc/glibc/0022-Define-DUMMY_LOCALE_T-if-not-defined.patch
deleted file mode 100644
index 33d912d356..0000000000
--- a/meta/recipes-core/glibc/glibc/0022-Define-DUMMY_LOCALE_T-if-not-defined.patch
+++ /dev/null
@@ -1,29 +0,0 @@
1From c8df3cf4556d8d78a98675865395ce42f3b67109 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Wed, 20 Apr 2016 21:11:00 -0700
4Subject: [PATCH] Define DUMMY_LOCALE_T if not defined
5
6This is a hack to fix building the locale bits on an older
7CentOs 5.X machine
8
9Upstream-Status: Inappropriate [other]
10
11Signed-off-by: Khem Raj <raj.khem@gmail.com>
12---
13 locale/programs/config.h | 3 +++
14 1 file changed, 3 insertions(+)
15
16diff --git a/locale/programs/config.h b/locale/programs/config.h
17index 2edcf3696c..5350101e38 100644
18--- a/locale/programs/config.h
19+++ b/locale/programs/config.h
20@@ -19,6 +19,9 @@
21 #ifndef _LD_CONFIG_H
22 #define _LD_CONFIG_H 1
23
24+#ifndef DUMMY_LOCALE_T
25+#define DUMMY_LOCALE_T
26+#endif
27 /* Use the internal textdomain used for libc messages. */
28 #define PACKAGE _libc_intl_domainname
29 #ifndef VERSION
diff --git a/meta/recipes-core/glibc/glibc/0023-aarch64-configure-Pass-mcpu-along-with-march-to-dete.patch b/meta/recipes-core/glibc/glibc/0023-aarch64-configure-Pass-mcpu-along-with-march-to-dete.patch
new file mode 100644
index 0000000000..f6523c5498
--- /dev/null
+++ b/meta/recipes-core/glibc/glibc/0023-aarch64-configure-Pass-mcpu-along-with-march-to-dete.patch
@@ -0,0 +1,62 @@
1From 73c26018ed0ecd9c807bb363cc2c2ab4aca66a82 Mon Sep 17 00:00:00 2001
2From: Szabolcs Nagy <szabolcs.nagy@arm.com>
3Date: Wed, 13 Mar 2024 14:34:14 +0000
4Subject: [PATCH] aarch64: fix check for SVE support in assembler
5
6Due to GCC bug 110901 -mcpu can override -march setting when compiling
7asm code and thus a compiler targetting a specific cpu can fail the
8configure check even when binutils gas supports SVE.
9
10The workaround is that explicit .arch directive overrides both -mcpu
11and -march, and since that's what the actual SVE memcpy uses the
12configure check should use that too even if the GCC issue is fixed
13independently.
14
15Upstream-Status: Backport [https://sourceware.org/git/?p=glibc.git;a=commit;h=73c26018ed0ecd9c807bb363cc2c2ab4aca66a82]
16Signed-off-by: Khem Raj <raj.khem@gmail.com>
17Reviewed-by: Florian Weimer <fweimer@redhat.com>
18---
19 sysdeps/aarch64/configure | 5 +++--
20 sysdeps/aarch64/configure.ac | 5 +++--
21 2 files changed, 6 insertions(+), 4 deletions(-)
22 mode change 100644 => 100755 sysdeps/aarch64/configure
23
24diff --git a/sysdeps/aarch64/configure b/sysdeps/aarch64/configure
25old mode 100644
26new mode 100755
27index ca57edce47..9606137e8d
28--- a/sysdeps/aarch64/configure
29+++ b/sysdeps/aarch64/configure
30@@ -325,9 +325,10 @@ then :
31 printf %s "(cached) " >&6
32 else $as_nop
33 cat > conftest.s <<\EOF
34- ptrue p0.b
35+ .arch armv8.2-a+sve
36+ ptrue p0.b
37 EOF
38-if { ac_try='${CC-cc} -c -march=armv8.2-a+sve conftest.s 1>&5'
39+if { ac_try='${CC-cc} -c conftest.s 1>&5'
40 { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
41 (eval $ac_try) 2>&5
42 ac_status=$?
43diff --git a/sysdeps/aarch64/configure.ac b/sysdeps/aarch64/configure.ac
44index 27874eceb4..56d12d661d 100644
45--- a/sysdeps/aarch64/configure.ac
46+++ b/sysdeps/aarch64/configure.ac
47@@ -90,9 +90,10 @@ LIBC_CONFIG_VAR([aarch64-variant-pcs], [$libc_cv_aarch64_variant_pcs])
48 # Check if asm support armv8.2-a+sve
49 AC_CACHE_CHECK([for SVE support in assembler], [libc_cv_aarch64_sve_asm], [dnl
50 cat > conftest.s <<\EOF
51- ptrue p0.b
52+ .arch armv8.2-a+sve
53+ ptrue p0.b
54 EOF
55-if AC_TRY_COMMAND(${CC-cc} -c -march=armv8.2-a+sve conftest.s 1>&AS_MESSAGE_LOG_FD); then
56+if AC_TRY_COMMAND(${CC-cc} -c conftest.s 1>&AS_MESSAGE_LOG_FD); then
57 libc_cv_aarch64_sve_asm=yes
58 else
59 libc_cv_aarch64_sve_asm=no
60--
612.44.0
62
diff --git a/meta/recipes-core/glibc/glibc/0024-elf-dl-deps.c-Make-_dl_build_local_scope-breadth-fir.patch b/meta/recipes-core/glibc/glibc/0024-elf-dl-deps.c-Make-_dl_build_local_scope-breadth-fir.patch
deleted file mode 100644
index d2691e1ee7..0000000000
--- a/meta/recipes-core/glibc/glibc/0024-elf-dl-deps.c-Make-_dl_build_local_scope-breadth-fir.patch
+++ /dev/null
@@ -1,53 +0,0 @@
1From f8289aa320b00f6db43213979cceab2325a7a611 Mon Sep 17 00:00:00 2001
2From: Mark Hatle <mark.hatle@windriver.com>
3Date: Thu, 18 Aug 2016 14:07:58 -0500
4Subject: [PATCH] elf/dl-deps.c: Make _dl_build_local_scope breadth first
5
6According to the ELF specification:
7
8When resolving symbolic references, the dynamic linker examines the symbol
9tables with a breadth-first search.
10
11This function was using a depth first search. By doing so the conflict
12resolution reported to the prelinker (when LD_TRACE_PRELINKING=1 is set)
13was incorrect. This caused problems when their were various circular
14dependencies between libraries. The problem usually manifested itself by
15the wrong IFUNC being executed.
16
17[BZ# 20488]
18
19Upstream-Status: Submitted [libc-alpha]
20
21Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
22---
23 elf/dl-deps.c | 14 ++++++++++----
24 1 file changed, 10 insertions(+), 4 deletions(-)
25
26diff --git a/elf/dl-deps.c b/elf/dl-deps.c
27index 087a49b212..c09f9334f2 100644
28--- a/elf/dl-deps.c
29+++ b/elf/dl-deps.c
30@@ -73,13 +73,19 @@ _dl_build_local_scope (struct link_map **list, struct link_map *map)
31 {
32 struct link_map **p = list;
33 struct link_map **q;
34+ struct link_map **r;
35
36 *p++ = map;
37 map->l_reserved = 1;
38- if (map->l_initfini)
39- for (q = map->l_initfini + 1; *q; ++q)
40- if (! (*q)->l_reserved)
41- p += _dl_build_local_scope (p, *q);
42+
43+ for (r = list; r < p; ++r)
44+ if ((*r)->l_initfini)
45+ for (q = (*r)->l_initfini + 1; *q; ++q)
46+ if (! (*q)->l_reserved)
47+ {
48+ *p++ = *q;
49+ (*q)->l_reserved = 1;
50+ }
51 return p - list;
52 }
53
diff --git a/meta/recipes-core/glibc/glibc/0024-qemu-stale-process.patch b/meta/recipes-core/glibc/glibc/0024-qemu-stale-process.patch
new file mode 100644
index 0000000000..c0a467fcec
--- /dev/null
+++ b/meta/recipes-core/glibc/glibc/0024-qemu-stale-process.patch
@@ -0,0 +1,45 @@
1glibc: Skip 2 qemu tests that can hang in oe-selftest
2
3qemumips and qemuppc were leaving stale processes behind after
4running glibc oe-selftest. During analysis, it was found that
5it was due to "tst-scm_rights" and "tst-scm_rights-time64" tests.
6Disable them so that there are no stale processes left behind.
7
8[YOCTO #15423]
9https://bugzilla.yoctoproject.org/show_bug.cgi?id=15423
10
11Upstream-Status: Inappropriate [oe-core specific]
12Signed-off-by: Yash Shinde <Yash.Shinde@windriver.com>
13---
14diff --git a/sysdeps/unix/sysv/linux/Makefile b/sysdeps/unix/sysv/linux/Makefile
15--- a/sysdeps/unix/sysv/linux/Makefile 2024-03-18 01:15:49.019202881 -0700
16+++ b/sysdeps/unix/sysv/linux/Makefile 2024-03-14 06:26:18.581404107 -0700
17@@ -222,7 +222,6 @@
18 tst-process_mrelease \
19 tst-quota \
20 tst-rlimit-infinity \
21- tst-scm_rights \
22 tst-sigtimedwait \
23 tst-sync_file_range \
24 tst-sysconf-iov_max \
25@@ -233,6 +232,8 @@
26 tst-timerfd \
27 tst-ttyname-direct \
28 tst-ttyname-namespace \
29+ # Skip this test to avoid stale qemu process
30+ # tst-scm_rights \
31 # tests
32
33 # process_madvise requires CAP_SYS_ADMIN.
34@@ -270,9 +271,10 @@
35 tst-ntp_gettimex-time64 \
36 tst-ppoll-time64 \
37 tst-prctl-time64 \
38- tst-scm_rights-time64 \
39 tst-sigtimedwait-time64 \
40 tst-timerfd-time64 \
41+ # Skip this test to avoid stale qemu process
42+ # tst-scm_rights-time64 \
43 # tests-time64
44
45 tests-clone-internal = \
diff --git a/meta/recipes-core/glibc/glibc/0025-intl-Emit-no-lines-in-bison-generated-files.patch b/meta/recipes-core/glibc/glibc/0025-intl-Emit-no-lines-in-bison-generated-files.patch
deleted file mode 100644
index 32f8fd22b8..0000000000
--- a/meta/recipes-core/glibc/glibc/0025-intl-Emit-no-lines-in-bison-generated-files.patch
+++ /dev/null
@@ -1,31 +0,0 @@
1From 3156464f9a95bf1dafd2e22d19d7bf89c520acc1 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Fri, 3 Aug 2018 09:44:00 -0700
4Subject: [PATCH] intl: Emit no lines in bison generated files
5
6Improve reproducibility:
7Do not put any #line preprocessor commands in bison generated files.
8These lines contain absolute paths containing file locations on
9the host build machine.
10
11Upstream-Status: Pending
12
13Signed-off-by: Juro Bystricky <juro.bystricky@intel.com>
14Signed-off-by: Khem Raj <raj.khem@gmail.com>
15---
16 intl/Makefile | 2 +-
17 1 file changed, 1 insertion(+), 1 deletion(-)
18
19diff --git a/intl/Makefile b/intl/Makefile
20index 93478d87e8..b27a7935eb 100644
21--- a/intl/Makefile
22+++ b/intl/Makefile
23@@ -155,7 +155,7 @@ $(objpfx)tst-gettext6.out: $(objpfx)tst-gettext.out
24
25 CPPFLAGS += -D'LOCALEDIR="$(localedir)"' \
26 -D'LOCALE_ALIAS_PATH="$(localedir)"'
27-BISONFLAGS = --yacc --name-prefix=__gettext --output
28+BISONFLAGS = --yacc --no-lines --name-prefix=__gettext --output
29
30 $(inst_localedir)/locale.alias: locale.alias $(+force)
31 $(do-install)
diff --git a/meta/recipes-core/glibc/glibc/0027-locale-prevent-maybe-uninitialized-errors-with-Os-BZ.patch b/meta/recipes-core/glibc/glibc/0027-locale-prevent-maybe-uninitialized-errors-with-Os-BZ.patch
deleted file mode 100644
index 782d931f22..0000000000
--- a/meta/recipes-core/glibc/glibc/0027-locale-prevent-maybe-uninitialized-errors-with-Os-BZ.patch
+++ /dev/null
@@ -1,53 +0,0 @@
1From 881f5b8134afd9a30049b93fc79dda7a44947a5f Mon Sep 17 00:00:00 2001
2From: Martin Jansa <martin.jansa@gmail.com>
3Date: Mon, 17 Dec 2018 21:36:18 +0000
4Subject: [PATCH] locale: prevent maybe-uninitialized errors with -Os [BZ
5 #19444]
6
7Fixes following error when building for aarch64 with -Os:
8| In file included from strcoll_l.c:43:
9| strcoll_l.c: In function '__strcoll_l':
10| ../locale/weight.h:31:26: error: 'seq2.back_us' may be used uninitialized in this function [-Werror=maybe-uninitialized]
11| int_fast32_t i = table[*(*cpp)++];
12| ^~~~~~~~~
13| strcoll_l.c:304:18: note: 'seq2.back_us' was declared here
14| coll_seq seq1, seq2;
15| ^~~~
16| In file included from strcoll_l.c:43:
17| ../locale/weight.h:31:26: error: 'seq1.back_us' may be used uninitialized in this function [-Werror=maybe-uninitialized]
18| int_fast32_t i = table[*(*cpp)++];
19| ^~~~~~~~~
20| strcoll_l.c:304:12: note: 'seq1.back_us' was declared here
21| coll_seq seq1, seq2;
22| ^~~~
23
24 Partial fix for [BZ #19444]
25 * locale/weight.h: Fix build with -Os.
26
27Upstream-Status: Submitted [https://patchwork.ozlabs.org/patch/1014766]
28
29Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
30Signed-off-by: Khem Raj <raj.khem@gmail.com>
31---
32 locale/weight.h | 7 +++++++
33 1 file changed, 7 insertions(+)
34
35diff --git a/locale/weight.h b/locale/weight.h
36index 723e1fefda..f5798d379a 100644
37--- a/locale/weight.h
38+++ b/locale/weight.h
39@@ -28,7 +28,14 @@ findidx (const int32_t *table,
40 const unsigned char *extra,
41 const unsigned char **cpp, size_t len)
42 {
43+ /* With GCC 8 when compiling with -Os the compiler warns that
44+ seq1.back_us and seq2.back_us might be used uninitialized.
45+ This uninitialized use is impossible for the same reason
46+ as described in comments in locale/weightwc.h. */
47+ DIAG_PUSH_NEEDS_COMMENT;
48+ DIAG_IGNORE_Os_NEEDS_COMMENT (8, "-Wmaybe-uninitialized");
49 int_fast32_t i = table[*(*cpp)++];
50+ DIAG_POP_NEEDS_COMMENT;
51 const unsigned char *cp;
52 const unsigned char *usrc;
53
diff --git a/meta/recipes-core/glibc/glibc/0028-readlib-Add-OECORE_KNOWN_INTERPRETER_NAMES-to-known-.patch b/meta/recipes-core/glibc/glibc/0028-readlib-Add-OECORE_KNOWN_INTERPRETER_NAMES-to-known-.patch
deleted file mode 100644
index d273cab4a3..0000000000
--- a/meta/recipes-core/glibc/glibc/0028-readlib-Add-OECORE_KNOWN_INTERPRETER_NAMES-to-known-.patch
+++ /dev/null
@@ -1,29 +0,0 @@
1From b4e0a034b12b313dcb82d22341bef6a66b3e9ef9 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Wed, 18 Mar 2015 00:11:22 +0000
4Subject: [PATCH] readlib: Add OECORE_KNOWN_INTERPRETER_NAMES to known names
5
6This bolts in a hook for OE to pass its own version of interpreter
7names into glibc especially for multilib case, where it differs from any
8other distros
9
10Upstream-Status: Inappropriate [OE specific]
11
12Signed-off-by: Lianhao Lu <lianhao.lu@intel.com>
13Signed-off-by: Khem Raj <raj.khem@gmail.com>
14---
15 elf/readlib.c | 1 +
16 1 file changed, 1 insertion(+)
17
18diff --git a/elf/readlib.c b/elf/readlib.c
19index 7383c23249..e97ea9449d 100644
20--- a/elf/readlib.c
21+++ b/elf/readlib.c
22@@ -51,6 +51,7 @@ static struct known_names interpreters[] =
23 #ifdef SYSDEP_KNOWN_INTERPRETER_NAMES
24 SYSDEP_KNOWN_INTERPRETER_NAMES
25 #endif
26+ OECORE_KNOWN_INTERPRETER_NAMES
27 };
28
29 static struct known_names known_libs[] =
diff --git a/meta/recipes-core/glibc/glibc/0029-wordsize.h-Unify-the-header-between-arm-and-aarch64.patch b/meta/recipes-core/glibc/glibc/0029-wordsize.h-Unify-the-header-between-arm-and-aarch64.patch
deleted file mode 100644
index 11a77cdf93..0000000000
--- a/meta/recipes-core/glibc/glibc/0029-wordsize.h-Unify-the-header-between-arm-and-aarch64.patch
+++ /dev/null
@@ -1,75 +0,0 @@
1From 2ae3ff3ae28abb1d0d100b4722da7ff188de9a30 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Fri, 15 May 2020 17:05:45 -0700
4Subject: [PATCH] wordsize.h: Unify the header between arm and aarch64
5
6This helps OE multilibs to not sythesize this header which causes all
7kind of recursions and other issues since wordsize is fundamental header
8and ends up including itself in many case e.g. clang tidy, bpf etc.
9
10Upstream-Status: Inappropriate [ OE-Specific ]
11
12Signed-off-by: Khem Raj <raj.khem@gmail.com>
13---
14 sysdeps/aarch64/bits/wordsize.h | 8 ++++++--
15 sysdeps/{aarch64 => arm}/bits/wordsize.h | 10 +++++++---
16 2 files changed, 13 insertions(+), 5 deletions(-)
17 copy sysdeps/{aarch64 => arm}/bits/wordsize.h (80%)
18
19diff --git a/sysdeps/aarch64/bits/wordsize.h b/sysdeps/aarch64/bits/wordsize.h
20index 91da566b74..9a754514b3 100644
21--- a/sysdeps/aarch64/bits/wordsize.h
22+++ b/sysdeps/aarch64/bits/wordsize.h
23@@ -17,12 +17,16 @@
24 License along with the GNU C Library; if not, see
25 <https://www.gnu.org/licenses/>. */
26
27-#ifdef __LP64__
28+#if defined (__aarch64__) && defined (__LP64__)
29 # define __WORDSIZE 64
30-#else
31+#elif defined (__aarch64__)
32 # define __WORDSIZE 32
33 # define __WORDSIZE32_SIZE_ULONG 1
34 # define __WORDSIZE32_PTRDIFF_LONG 1
35+#else
36+# define __WORDSIZE 32
37+# define __WORDSIZE32_SIZE_ULONG 0
38+# define __WORDSIZE32_PTRDIFF_LONG 0
39 #endif
40
41 #define __WORDSIZE_TIME64_COMPAT32 0
42diff --git a/sysdeps/aarch64/bits/wordsize.h b/sysdeps/arm/bits/wordsize.h
43similarity index 80%
44copy from sysdeps/aarch64/bits/wordsize.h
45copy to sysdeps/arm/bits/wordsize.h
46index 91da566b74..34fcdef1f1 100644
47--- a/sysdeps/aarch64/bits/wordsize.h
48+++ b/sysdeps/arm/bits/wordsize.h
49@@ -1,6 +1,6 @@
50 /* Determine the wordsize from the preprocessor defines.
51
52- Copyright (C) 2016-2021 Free Software Foundation, Inc.
53+ Copyright (C) 2016-2021 Free Software Foundation, Inc.
54 This file is part of the GNU C Library.
55
56 The GNU C Library is free software; you can redistribute it and/or
57@@ -17,12 +17,16 @@
58 License along with the GNU C Library; if not, see
59 <https://www.gnu.org/licenses/>. */
60
61-#ifdef __LP64__
62+#if defined (__aarch64__) && defined (__LP64__)
63 # define __WORDSIZE 64
64-#else
65+#elif defined (__aarch64__)
66 # define __WORDSIZE 32
67 # define __WORDSIZE32_SIZE_ULONG 1
68 # define __WORDSIZE32_PTRDIFF_LONG 1
69+#else
70+# define __WORDSIZE 32
71+# define __WORDSIZE32_SIZE_ULONG 0
72+# define __WORDSIZE32_PTRDIFF_LONG 0
73 #endif
74
75 #define __WORDSIZE_TIME64_COMPAT32 0
diff --git a/meta/recipes-core/glibc/glibc/0031-x86-Require-full-ISA-support-for-x86-64-level-marker.patch b/meta/recipes-core/glibc/glibc/0031-x86-Require-full-ISA-support-for-x86-64-level-marker.patch
deleted file mode 100644
index 3cb60b2e55..0000000000
--- a/meta/recipes-core/glibc/glibc/0031-x86-Require-full-ISA-support-for-x86-64-level-marker.patch
+++ /dev/null
@@ -1,116 +0,0 @@
1From b1971f6f1331d738d1d6b376b4741668a7546125 Mon Sep 17 00:00:00 2001
2From: "H.J. Lu" <hjl.tools@gmail.com>
3Date: Tue, 2 Feb 2021 13:45:58 -0800
4Subject: [PATCH] x86: Require full ISA support for x86-64 level marker [BZ #27318]
5
6Since -march=sandybridge enables ISAs in x86-64 ISA level v3, the v3
7marker is set on libc.so. We couldn't set the needed ISA marker to v2
8since this libc won't run on all v2 machines. Technically, the v3 marker
9is correct. But the resulting libc.so won't run on Sandy Brigde, which
10is a v2 machine, even when libc is compiled with -march=sandybridge:
11
12$ ./elf/ld.so ./libc.so
13./libc.so: (p) CPU ISA level is lower than required: needed: 7; got: 3
14
15Instead, we require full ISA support for x86-64 level marker and disable
16x86-64 level marker for -march=sandybridge which enables ISAs between v2
17and v3.
18
19Upstream-Status: Submitted [https://sourceware.org/pipermail/libc-alpha/2021-February/122297.html]
20Signed-off-by: Khem Raj <raj.khem@gmail.com>
21---
22
23 sysdeps/x86/configure | 7 ++++++-
24 sysdeps/x86/configure.ac | 2 +-
25 sysdeps/x86/isa-level.c | 21 ++++++++++++++++++++-
26 3 files changed, 27 insertions(+), 3 deletions(-)
27
28diff --git a/sysdeps/x86/configure b/sysdeps/x86/configure
29index 5e32dc62b3..5b20646843 100644
30--- a/sysdeps/x86/configure
31+++ b/sysdeps/x86/configure
32@@ -133,7 +133,12 @@ if { ac_try='${CC-cc} $CFLAGS $CPPFLAGS -nostartfiles -nostdlib -r -o conftest c
33 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
34 test $ac_status = 0; }; }; then
35 count=`LC_ALL=C $READELF -n conftest | grep NT_GNU_PROPERTY_TYPE_0 | wc -l`
36- if test "$count" = 1; then
37+ if test "$count" = 1 && { ac_try='${CC-cc} $CFLAGS $CPPFLAGS -DINCLUDE_X86_ISA_LEVEL -S -o conftest.s $srcdir/sysdeps/x86/isa-level.c'
38+ { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
39+ (eval $ac_try) 2>&5
40+ ac_status=$?
41+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
42+ test $ac_status = 0; }; }; then
43 libc_cv_include_x86_isa_level=yes
44 fi
45 fi
46diff --git a/sysdeps/x86/configure.ac b/sysdeps/x86/configure.ac
47index f94088f377..54ecd33d2c 100644
48--- a/sysdeps/x86/configure.ac
49+++ b/sysdeps/x86/configure.ac
50@@ -100,7 +100,7 @@ EOF
51 libc_cv_include_x86_isa_level=no
52 if AC_TRY_COMMAND(${CC-cc} $CFLAGS $CPPFLAGS -nostartfiles -nostdlib -r -o conftest conftest1.S conftest2.S); then
53 count=`LC_ALL=C $READELF -n conftest | grep NT_GNU_PROPERTY_TYPE_0 | wc -l`
54- if test "$count" = 1; then
55+ if test "$count" = 1 && AC_TRY_COMMAND(${CC-cc} $CFLAGS $CPPFLAGS -DINCLUDE_X86_ISA_LEVEL -S -o conftest.s $srcdir/sysdeps/x86/isa-level.c); then
56 libc_cv_include_x86_isa_level=yes
57 fi
58 fi
59diff --git a/sysdeps/x86/isa-level.c b/sysdeps/x86/isa-level.c
60index aaf524cb56..7f83449061 100644
61--- a/sysdeps/x86/isa-level.c
62+++ b/sysdeps/x86/isa-level.c
63@@ -25,12 +25,17 @@
64 License along with the GNU C Library; if not, see
65 <https://www.gnu.org/licenses/>. */
66
67-#include <elf.h>
68+#ifdef _LIBC
69+# include <elf.h>
70+#endif
71
72 /* ELF program property for x86 ISA level. */
73 #ifdef INCLUDE_X86_ISA_LEVEL
74 # if defined __x86_64__ || defined __FXSR__ || !defined _SOFT_FLOAT \
75 || defined __MMX__ || defined __SSE__ || defined __SSE2__
76+# if !defined __SSE__ || !defined __SSE2__
77+# error "Missing ISAs for x86-64 ISA level baseline"
78+# endif
79 # define ISA_BASELINE GNU_PROPERTY_X86_ISA_1_BASELINE
80 # else
81 # define ISA_BASELINE 0
82@@ -40,6 +45,11 @@
83 || (defined __x86_64__ && defined __LAHF_SAHF__) \
84 || defined __POPCNT__ || defined __SSE3__ \
85 || defined __SSSE3__ || defined __SSE4_1__ || defined __SSE4_2__
86+# if !defined __GCC_HAVE_SYNC_COMPARE_AND_SWAP_16 \
87+ || !defined __POPCNT__ || !defined __SSE3__ \
88+ || !defined __SSSE3__ || !defined __SSE4_1__ || !defined __SSE4_2__
89+# error "Missing ISAs for x86-64 ISA level v2"
90+# endif
91 # define ISA_V2 GNU_PROPERTY_X86_ISA_1_V2
92 # else
93 # define ISA_V2 0
94@@ -48,6 +58,10 @@
95 # if defined __AVX__ || defined __AVX2__ || defined __F16C__ \
96 || defined __FMA__ || defined __LZCNT__ || defined __MOVBE__ \
97 || defined __XSAVE__
98+# if !defined __AVX__ || !defined __AVX2__ || !defined __F16C__ \
99+ || !defined __FMA__ || !defined __LZCNT__
100+# error "Missing ISAs for x86-64 ISA level v3"
101+# endif
102 # define ISA_V3 GNU_PROPERTY_X86_ISA_1_V3
103 # else
104 # define ISA_V3 0
105@@ -55,6 +69,11 @@
106
107 # if defined __AVX512F__ || defined __AVX512BW__ || defined __AVX512CD__ \
108 || defined __AVX512DQ__ || defined __AVX512VL__
109+# if !defined __AVX512F__ || !defined __AVX512BW__ \
110+ || !defined __AVX512CD__ || !defined __AVX512DQ__ \
111+ || !defined __AVX512VL__
112+# error "Missing ISAs for x86-64 ISA level v4"
113+# endif
114 # define ISA_V4 GNU_PROPERTY_X86_ISA_1_V4
115 # else
116 # define ISA_V4 0
diff --git a/meta/recipes-core/glibc/glibc/0032-string-Work-around-GCC-PR-98512-in-rawmemchr.patch b/meta/recipes-core/glibc/glibc/0032-string-Work-around-GCC-PR-98512-in-rawmemchr.patch
deleted file mode 100644
index e904b28a05..0000000000
--- a/meta/recipes-core/glibc/glibc/0032-string-Work-around-GCC-PR-98512-in-rawmemchr.patch
+++ /dev/null
@@ -1,58 +0,0 @@
1From 044e603b698093cf48f6e6229e0b66acf05227e4 Mon Sep 17 00:00:00 2001
2From: Florian Weimer <fweimer@redhat.com>
3Date: Fri, 19 Feb 2021 13:29:00 +0100
4Subject: [PATCH] string: Work around GCC PR 98512 in rawmemchr
5
6Upstream-Status: Backport [https://sourceware.org/git/?p=glibc.git;a=commit;h=044e603b698093cf48f6e6229e0b66acf05227e4]
7Signed-off-by: Khem Raj <raj.khem@gmail.com>
8---
9 string/rawmemchr.c | 26 +++++++++++++++-----------
10 1 file changed, 15 insertions(+), 11 deletions(-)
11
12diff --git a/string/rawmemchr.c b/string/rawmemchr.c
13index 59bbeeaa42..b8523118e5 100644
14--- a/string/rawmemchr.c
15+++ b/string/rawmemchr.c
16@@ -22,24 +22,28 @@
17 # define RAWMEMCHR __rawmemchr
18 #endif
19
20-/* Find the first occurrence of C in S. */
21-void *
22-RAWMEMCHR (const void *s, int c)
23-{
24- DIAG_PUSH_NEEDS_COMMENT;
25+/* The pragmata should be nested inside RAWMEMCHR below, but that
26+ triggers GCC PR 98512. */
27+DIAG_PUSH_NEEDS_COMMENT;
28 #if __GNUC_PREREQ (7, 0)
29- /* GCC 8 warns about the size passed to memchr being larger than
30- PTRDIFF_MAX; the use of SIZE_MAX is deliberate here. */
31- DIAG_IGNORE_NEEDS_COMMENT (8, "-Wstringop-overflow=");
32+/* GCC 8 warns about the size passed to memchr being larger than
33+ PTRDIFF_MAX; the use of SIZE_MAX is deliberate here. */
34+DIAG_IGNORE_NEEDS_COMMENT (8, "-Wstringop-overflow=");
35 #endif
36 #if __GNUC_PREREQ (11, 0)
37- /* Likewise GCC 11, with a different warning option. */
38- DIAG_IGNORE_NEEDS_COMMENT (11, "-Wstringop-overread");
39+/* Likewise GCC 11, with a different warning option. */
40+DIAG_IGNORE_NEEDS_COMMENT (11, "-Wstringop-overread");
41 #endif
42+
43+/* Find the first occurrence of C in S. */
44+void *
45+RAWMEMCHR (const void *s, int c)
46+{
47 if (c != '\0')
48 return memchr (s, c, (size_t)-1);
49- DIAG_POP_NEEDS_COMMENT;
50 return (char *)s + strlen (s);
51 }
52 libc_hidden_def (__rawmemchr)
53 weak_alias (__rawmemchr, rawmemchr)
54+
55+DIAG_POP_NEEDS_COMMENT;
56--
572.30.1
58
diff --git a/meta/recipes-core/glibc/glibc/check-test-wrapper b/meta/recipes-core/glibc/glibc/check-test-wrapper
index f8e04e02d2..5cc993f718 100644
--- a/meta/recipes-core/glibc/glibc/check-test-wrapper
+++ b/meta/recipes-core/glibc/glibc/check-test-wrapper
@@ -2,6 +2,7 @@
2import sys 2import sys
3import os 3import os
4import subprocess 4import subprocess
5import resource
5 6
6env = os.environ.copy() 7env = os.environ.copy()
7args = sys.argv[1:] 8args = sys.argv[1:]
@@ -44,12 +45,20 @@ if targettype == "user":
44 qemuargs += ["-L", sysroot] 45 qemuargs += ["-L", sysroot]
45 qemuargs += ["-E", "LD_LIBRARY_PATH={}".format(":".join(libpaths))] 46 qemuargs += ["-E", "LD_LIBRARY_PATH={}".format(":".join(libpaths))]
46 command = qemuargs + args 47 command = qemuargs + args
48
49 # We've seen qemu-arm using up all system memory for some glibc
50 # tests e.g. nptl/tst-pthread-timedlock-lockloop
51 # Cap at 8GB since no test should need more than that
52 # (5GB adds 7 failures for qemuarm glibc test run)
53 limit = 8*1024*1024*1024
54 resource.setrlimit(resource.RLIMIT_AS, (limit, limit))
55
47elif targettype == "ssh": 56elif targettype == "ssh":
48 host = os.environ.get("SSH_HOST", None) 57 host = os.environ.get("SSH_HOST", None)
49 user = os.environ.get("SSH_HOST_USER", None) 58 user = os.environ.get("SSH_HOST_USER", None)
50 port = os.environ.get("SSH_HOST_PORT", None) 59 port = os.environ.get("SSH_HOST_PORT", None)
51 60
52 command = ["ssh", "-o", "UserKnownHostsFile=/dev/null", "-o", "StrictHostKeyChecking=no"] 61 command = ["ssh", "-o", "UserKnownHostsFile=/dev/null", "-o", "StrictHostKeyChecking=no", "-o", "LogLevel=quiet"]
53 if port: 62 if port:
54 command += ["-p", str(port)] 63 command += ["-p", str(port)]
55 if not host: 64 if not host:
diff --git a/meta/recipes-core/glibc/glibc/faccessat2-perm.patch b/meta/recipes-core/glibc/glibc/faccessat2-perm.patch
deleted file mode 100644
index 2ee7110ca1..0000000000
--- a/meta/recipes-core/glibc/glibc/faccessat2-perm.patch
+++ /dev/null
@@ -1,31 +0,0 @@
1Older seccomp-based filters used in container frameworks will block faccessat2
2calls as it's a relatively new syscall. This isn't a big problem with
3glibc <2.33 but 2.33 will call faccessat2 itself, get EPERM, and thenn be confused
4about what to do as EPERM isn't an expected error code.
5
6This manifests itself as mysterious errors, for example a kernel failing to link.
7
8The root cause of bad seccomp filters is mostly fixed (systemd 247, Docker 20.10.0)
9but we can't expect everyone to upgrade, so add a workaound (originally from
10Red Hat) to handle EPERM like ENOSYS and fallback to faccessat().
11
12Upstream-Status: Inappropriate
13Signed-off-by: Ross Burton <ross.burton@arm.com>
14
15diff --git a/sysdeps/unix/sysv/linux/faccessat.c b/sysdeps/unix/sysv/linux/faccessat.c
16index 56cb6dcc8b4d58d3..5de75032bbc93a2c 100644
17--- a/sysdeps/unix/sysv/linux/faccessat.c
18+++ b/sysdeps/unix/sysv/linux/faccessat.c
19@@ -34,7 +34,11 @@ faccessat (int fd, const char *file, int mode, int flag)
20 #if __ASSUME_FACCESSAT2
21 return ret;
22 #else
23- if (ret == 0 || errno != ENOSYS)
24+ /* Fedora-specific workaround:
25+ As a workround for a broken systemd-nspawn that returns
26+ EPERM when a syscall is not allowed instead of ENOSYS
27+ we must check for EPERM here and fall back to faccessat. */
28+ if (ret == 0 || !(errno == ENOSYS || errno == EPERM))
29 return ret;
30
31 if (flag & ~(AT_SYMLINK_NOFOLLOW | AT_EACCESS))
diff --git a/meta/recipes-core/glibc/glibc/run-ptest b/meta/recipes-core/glibc/glibc/run-ptest
new file mode 100755
index 0000000000..cb71c75682
--- /dev/null
+++ b/meta/recipes-core/glibc/glibc/run-ptest
@@ -0,0 +1,37 @@
1#!/bin/bash
2# ptest script for glibc - to run time related tests to
3# facilitate Y2038 validation
4# Run with 'ptest-runner glibc-tests'
5
6output() {
7 retcode=$?
8 if [ $retcode -eq 0 ]
9 then echo "PASS: $i"
10 elif [ $retcode -eq 77 ]
11 then echo "SKIP: $i"
12 else echo "FAIL: $i"
13 fi
14}
15
16# Allow altering time on the target
17export GLIBC_TEST_ALLOW_TIME_SETTING="1"
18
19tst_time64=$(ls -r ${PWD}/tests/glibc-ptest/*-time64)
20
21# Remove '-time64' suffix - those tests are also time
22# related
23tst_time_tmp=$(sed -e "s/-time64$//" <<< ${tst_time64})
24
25# Do not run tests supporting only 32 bit time
26#for i in ${tst_time_tmp}
27#do
28# $i >/dev/null 2>&1
29# output
30#done
31
32# Run tests supporting only 64 bit time
33for i in ${tst_time64}
34do
35 $i >/dev/null 2>&1
36 output
37done