diff options
Diffstat (limited to 'meta/recipes-core/eglibc/eglibc-2.18')
28 files changed, 4326 insertions, 0 deletions
diff --git a/meta/recipes-core/eglibc/eglibc-2.18/0001-ARM-Pass-dl_hwcap-to-IFUNC-resolver.patch b/meta/recipes-core/eglibc/eglibc-2.18/0001-ARM-Pass-dl_hwcap-to-IFUNC-resolver.patch new file mode 100644 index 0000000000..24d4772728 --- /dev/null +++ b/meta/recipes-core/eglibc/eglibc-2.18/0001-ARM-Pass-dl_hwcap-to-IFUNC-resolver.patch | |||
@@ -0,0 +1,43 @@ | |||
1 | Upstream-Status: Backport | ||
2 | |||
3 | From d0721e703d222c01a9e8c329311c4fb01dac6972 Mon Sep 17 00:00:00 2001 | ||
4 | From: Carlos O'Donell <carlos@redhat.com> | ||
5 | Date: Thu, 29 Aug 2013 00:17:33 -0400 | ||
6 | Subject: [PATCH] ARM: Pass dl_hwcap to IFUNC resolver. | ||
7 | |||
8 | For REL relocs pass dl_hwcap to the IFUNC resolver | ||
9 | as is required by the IFUNC API (bug 15905). | ||
10 | --- | ||
11 | NEWS | 2 +- | ||
12 | ports/ChangeLog.arm | 7 +++++++ | ||
13 | ports/sysdeps/arm/dl-machine.h | 2 +- | ||
14 | 3 files changed, 9 insertions(+), 2 deletions(-) | ||
15 | |||
16 | Index: libc/ports/ChangeLog.arm | ||
17 | =================================================================== | ||
18 | --- libc.orig/ports/ChangeLog.arm 2013-07-14 16:08:52.000000000 -0700 | ||
19 | +++ libc/ports/ChangeLog.arm 2013-09-12 17:17:24.174387150 -0700 | ||
20 | @@ -1,3 +1,10 @@ | ||
21 | +2013-08-28 Kyle McMartin <kyle@redhat.com> | ||
22 | + Carlos O'Donell <carlos@redhat.com> | ||
23 | + | ||
24 | + [BZ #15905] | ||
25 | + * sysdeps/arm/dl-machine [!RTLD_BOOTSTRAP] (elf_machine_rel): | ||
26 | + Pass GLRO(dl_hwcap) to the IFUNC resolver. | ||
27 | + | ||
28 | 2013-07-03 Joseph Myers <joseph@codesourcery.com> | ||
29 | |||
30 | * sysdeps/arm/include/bits/setjmp.h [_ISOMAC] (JMP_BUF_REGLIST): | ||
31 | Index: libc/ports/sysdeps/arm/dl-machine.h | ||
32 | =================================================================== | ||
33 | --- libc.orig/ports/sysdeps/arm/dl-machine.h 2013-09-12 08:56:03.641743520 -0700 | ||
34 | +++ libc/ports/sysdeps/arm/dl-machine.h 2013-09-12 17:17:24.174387150 -0700 | ||
35 | @@ -503,7 +503,7 @@ | ||
36 | break; | ||
37 | case R_ARM_IRELATIVE: | ||
38 | value = map->l_addr + *reloc_addr; | ||
39 | - value = ((Elf32_Addr (*) (void)) value) (); | ||
40 | + value = ((Elf32_Addr (*) (int)) value) (GLRO(dl_hwcap)); | ||
41 | *reloc_addr = value; | ||
42 | break; | ||
43 | #endif | ||
diff --git a/meta/recipes-core/eglibc/eglibc-2.18/0001-R_ARM_TLS_DTPOFF32.patch b/meta/recipes-core/eglibc/eglibc-2.18/0001-R_ARM_TLS_DTPOFF32.patch new file mode 100644 index 0000000000..b4489e9ae9 --- /dev/null +++ b/meta/recipes-core/eglibc/eglibc-2.18/0001-R_ARM_TLS_DTPOFF32.patch | |||
@@ -0,0 +1,56 @@ | |||
1 | |||
2 | Quote from bug 1443 which explains what the patch does : | ||
3 | |||
4 | We build some random program and link it with -lust. When we run it, | ||
5 | it dies with a SIGSEGV before reaching main(). | ||
6 | |||
7 | Libust.so depends on liburcu-bp.so from the usermode-rcu package. | ||
8 | Although libust.so is not prelinked, liburcu-bp.so IS prelinked; this | ||
9 | is critical. | ||
10 | |||
11 | Libust.so uses a TLS / __thread variable that is defined in liburcu- | ||
12 | bp.so. There are special ARM-specific relocation types that allow two | ||
13 | shared libraries to share thread-specific data. This is critical too. | ||
14 | |||
15 | One more critical issue: although liburcu-bp.so is prelinked, we can't | ||
16 | load it at its prelinked address, because we also link against | ||
17 | librt.so, and librt.so uses that address. | ||
18 | |||
19 | The dynamic linker is forced to relink liburcu-bp.so at a different | ||
20 | address. In the course of relinking, it processes the special ARM | ||
21 | relocation record mentioned above. The prelinker has already filled | ||
22 | in the information, which is a short offset into a table of thread- | ||
23 | specific data that is allocated per-thread for each library that uses | ||
24 | TLS. Because the normal behavior of a relocation is to add the symbol | ||
25 | value to an addend stored at the address being relocated, we end up | ||
26 | adding the short offset to itself, doubling it. | ||
27 | |||
28 | Now we have an awkward situation. The libust.so library doesn't know | ||
29 | about the addend, so its TLS data for this element is correct. The | ||
30 | liburcu-bp.so library has a different offset for the element. When we | ||
31 | go to initialize the element for the first time in liburcu-bp.so, we | ||
32 | write the address of the result at the doubled (broken) offset. | ||
33 | Later, when we refer to the address from libust.so, we check the value | ||
34 | at the correct offset, but it's NULL, so we eat hot SIGSEGV. | ||
35 | |||
36 | Upstream-Status: Pending | ||
37 | |||
38 | Signed-off-by: Andrei Dinu <andrei.adrianx.dinu@intel.com> | ||
39 | --- | ||
40 | .../libc/ports/sysdeps/arm/dl-machine.h | 2 +- | ||
41 | 1 file changed, 1 insertion(+), 1 deletion(-) | ||
42 | |||
43 | ndex 8d905e8..dcfa71e 100644 | ||
44 | --- libc.orig/ports/sysdeps/arm/dl-machine.h | ||
45 | +++ libc/ports/sysdeps/arm/dl-machine.h | ||
46 | @@ -503,7 +503,7 @@ elf_machine_rel (struct link_map *map, const Elf32_Rel *reloc, | ||
47 | |||
48 | case R_ARM_TLS_DTPOFF32: | ||
49 | if (sym != NULL) | ||
50 | - *reloc_addr += sym->st_value; | ||
51 | + *reloc_addr = sym->st_value; | ||
52 | break; | ||
53 | |||
54 | case R_ARM_TLS_TPOFF32: | ||
55 | -- | ||
56 | |||
diff --git a/meta/recipes-core/eglibc/eglibc-2.18/0001-eglibc-menuconfig-support.patch b/meta/recipes-core/eglibc/eglibc-2.18/0001-eglibc-menuconfig-support.patch new file mode 100644 index 0000000000..9e23e7cda2 --- /dev/null +++ b/meta/recipes-core/eglibc/eglibc-2.18/0001-eglibc-menuconfig-support.patch | |||
@@ -0,0 +1,912 @@ | |||
1 | Pulled from | ||
2 | http://www.eglibc.org/archives/patches/msg01042.html | ||
3 | |||
4 | Upstream-Status: Pending | ||
5 | Signed-off-by: Khem | ||
6 | |||
7 | Hi, | ||
8 | |||
9 | This patch adds 'make menuconfig' support to EGLIBC. | ||
10 | |||
11 | |||
12 | EGLIBC can re-use the Linux kernel kconfig host tools ('conf' and 'mconf') unmodified, by passing appropriate environment variables and with some pre- and post-processing on the input/output config files. | ||
13 | |||
14 | There are three new make targets supported, which all are defined in the new libc/options-config/Makefile, which is included by the top-level libc/Makefile: | ||
15 | |||
16 | - 'make defconfig'. This passes 'libc/option-groups.defaults' to 'conf' as a default config, and outputs 'option-groups.config' to the top-level build directory, which will be the same as the default config. | ||
17 | |||
18 | - 'make config'. This is the same line-oriented interface as in the Linux kernel. Input and output is 'option-groups.config' in the top-level build directory. | ||
19 | |||
20 | - 'make menuconfig'. This is the same menu-based interface as in the Linux kernel. Input and output is 'option-groups.config' in the top-level build directory. | ||
21 | |||
22 | |||
23 | Pre-Processing: | ||
24 | |||
25 | |||
26 | The Linux kernel kconfig tools expect a prefix of "CONFIG_" on all config option names, but EGLIBC expects a prefix of "OPTION_". The pre-processing script, libc/options-config/config-preproc.pl, simply replaces "CONFIG_ with "OPTION_" in the given config file. The libc/options-config/Makefile passes the script output to a temporary config file, which is then passed to 'conf' or 'mconf'. | ||
27 | |||
28 | Post-Processing (libc/options-config/config-postproc.pl): | ||
29 | |||
30 | |||
31 | - Disabled options are output as a comment line of the form "# CONFIG_FOO is not set". This needs to be changed to an explicit "CONFIG_FOO=n" in order to be compatible with 'option-groups.awk' which generates the option-groups.h header. | ||
32 | |||
33 | - "CONFIG_" prefix is changed back to "OPTION_". | ||
34 | |||
35 | |||
36 | - The kconfig tools will not output anything for options that depend on a parent option, when the parent option is disabled. This implicit disable must be converted to an explicit "CONFIG_FOO=n" in order to be compatible with the way EGLIBC overrides the default option settings in 'libc/option-groups.defaults' with those in 'option-groups.config'. | ||
37 | |||
38 | |||
39 | A new configure option, '--with-kconfig=<PATH>', tells EGLIBC where to find the pre-built 'conf' and 'mconf' host tools from Linux kernel builds. | ||
40 | |||
41 | libc/EGLIBC.cross-building is updated to include instructions for using '--with-kconfig' for the final EGLIBC build, and shows how and when to run 'make *config'. | ||
42 | |||
43 | libc/EGLIBC.option-groups is updated to include new information on the menuconfig support. | ||
44 | |||
45 | Thanks, | ||
46 | |||
47 | attached is the updated patch to address above issues. | ||
48 | |||
49 | Steve | ||
50 | |||
51 | -- | ||
52 | Steve Longerbeam | Senior Embedded Engineer, ESD Services | ||
53 | Mentor Embedded(tm) | 46871 Bayside Parkway, Fremont, CA 94538 | ||
54 | P 510.354.5838 | M 408.410.2735 | ||
55 | Nucleus(r) | Linux(r) | Android(tm) | Services | UI | Multi-OS | ||
56 | |||
57 | |||
58 | Index: libc/EGLIBC.cross-building | ||
59 | =================================================================== | ||
60 | --- libc.orig/EGLIBC.cross-building 2007-04-20 16:15:03.000000000 -0700 | ||
61 | +++ libc/EGLIBC.cross-building 2013-06-26 00:45:15.788885570 -0700 | ||
62 | @@ -243,9 +243,29 @@ | ||
63 | > $src/libc/configure \ | ||
64 | > --prefix=/usr \ | ||
65 | > --with-headers=$sysroot/usr/include \ | ||
66 | + > --with-kconfig=$obj/linux/scripts/kconfig \ | ||
67 | > --build=$build \ | ||
68 | > --host=$target \ | ||
69 | > --disable-profile --without-gd --without-cvs --enable-add-ons | ||
70 | + | ||
71 | +Note the additional '--with-kconfig' option. This tells EGLIBC where to | ||
72 | +find the host config tools used by the kernel 'make config' and 'make | ||
73 | +menuconfig'. These tools can be re-used by EGLIBC for its own 'make | ||
74 | +*config' support, which will create 'option-groups.config' for you. | ||
75 | +But first make sure those tools have been built by running some | ||
76 | +dummy 'make *config' calls in the kernel directory: | ||
77 | + | ||
78 | + $ cd $obj/linux | ||
79 | + $ PATH=$tools/bin:$PATH make config \ | ||
80 | + > ARCH=$linux_arch CROSS_COMPILE=$target- \ | ||
81 | + $ PATH=$tools/bin:$PATH make menuconfig \ | ||
82 | + > ARCH=$linux_arch CROSS_COMPILE=$target- \ | ||
83 | + | ||
84 | +Now we can configure and build the full EGLIBC: | ||
85 | + | ||
86 | + $ cd $obj/eglibc | ||
87 | + $ PATH=$tools/bin:$PATH make defconfig | ||
88 | + $ PATH=$tools/bin:$PATH make menuconfig | ||
89 | $ PATH=$tools/bin:$PATH make | ||
90 | $ PATH=$tools/bin:$PATH make install install_root=$sysroot | ||
91 | |||
92 | Index: libc/configure.in | ||
93 | =================================================================== | ||
94 | --- libc.orig/configure.in 2013-06-24 15:42:26.000000000 -0700 | ||
95 | +++ libc/configure.in 2013-06-26 00:45:15.792885570 -0700 | ||
96 | @@ -127,6 +127,16 @@ | ||
97 | [sysheaders='']) | ||
98 | AC_SUBST(sysheaders) | ||
99 | |||
100 | +AC_ARG_WITH([kconfig], | ||
101 | + AC_HELP_STRING([--with-kconfig=PATH], | ||
102 | + [location of kconfig tools to use (from Linux | ||
103 | + kernel builds) to re-use for configuring EGLIBC | ||
104 | + option groups]), | ||
105 | + [KCONFIG_TOOLS=$withval], | ||
106 | + [KCONFIG_TOOLS='']) | ||
107 | +AC_SUBST(KCONFIG_TOOLS) | ||
108 | + | ||
109 | + | ||
110 | AC_SUBST(use_default_link) | ||
111 | AC_ARG_WITH([default-link], | ||
112 | AC_HELP_STRING([--with-default-link], | ||
113 | Index: libc/config.make.in | ||
114 | =================================================================== | ||
115 | --- libc.orig/config.make.in 2013-04-28 08:21:50.000000000 -0700 | ||
116 | +++ libc/config.make.in 2013-06-26 00:45:15.792885570 -0700 | ||
117 | @@ -45,6 +45,8 @@ | ||
118 | c++-sysincludes = @CXX_SYSINCLUDES@ | ||
119 | all-warnings = @all_warnings@ | ||
120 | |||
121 | +kconfig_tools = @KCONFIG_TOOLS@ | ||
122 | + | ||
123 | have-z-combreloc = @libc_cv_z_combreloc@ | ||
124 | have-z-execstack = @libc_cv_z_execstack@ | ||
125 | have-Bgroup = @libc_cv_Bgroup@ | ||
126 | Index: libc/options-config/config-postproc.pl | ||
127 | =================================================================== | ||
128 | --- /dev/null 1970-01-01 00:00:00.000000000 +0000 | ||
129 | +++ libc/options-config/config-postproc.pl 2013-06-26 00:45:15.792885570 -0700 | ||
130 | @@ -0,0 +1,54 @@ | ||
131 | +#!/usr/bin/perl | ||
132 | + | ||
133 | +$usage = "usage: $0 <default config file> <config file>\n"; | ||
134 | + | ||
135 | +die "$usage" unless @ARGV; | ||
136 | +$defaults = shift @ARGV; | ||
137 | +die "$usage" unless @ARGV; | ||
138 | +die "Could not open $ARGV[0]" unless -T $ARGV[0]; | ||
139 | + | ||
140 | +sub yank { | ||
141 | + @option = grep($_ ne $_[0], @option); | ||
142 | +} | ||
143 | + | ||
144 | +open(DEFAULTS, $defaults) || die "Could not open $defaults\n"; | ||
145 | + | ||
146 | +# get the full list of available options using the default config file | ||
147 | +$i = 0; | ||
148 | +while (<DEFAULTS>) { | ||
149 | + if (/^\s*OPTION_(\w+)\s*=/) { | ||
150 | + $option[$i++] = $1; | ||
151 | + } | ||
152 | +} | ||
153 | + | ||
154 | +# now go through the config file, making the necessary changes | ||
155 | +while (<>) { | ||
156 | + if (/Linux Kernel Configuration/) { | ||
157 | + # change title | ||
158 | + s/Linux Kernel/Option Groups/; | ||
159 | + print; | ||
160 | + } elsif (/^\s*CONFIG_(\w+)\s*=/) { | ||
161 | + # this is an explicit option set line, change CONFIG_ to OPTION_ | ||
162 | + # before printing and remove this option from option list | ||
163 | + $opt = $1; | ||
164 | + yank($opt); | ||
165 | + s/CONFIG_/OPTION_/g; | ||
166 | + print; | ||
167 | + } elsif (/^\s*#\s+CONFIG_(\w+) is not set/) { | ||
168 | + # this is a comment line, change CONFIG_ to OPTION_, remove this | ||
169 | + # option from option list, and convert to explicit OPTION_FOO=n | ||
170 | + $opt = $1; | ||
171 | + yank($opt); | ||
172 | + s/CONFIG_/OPTION_/g; | ||
173 | + print "OPTION_$opt=n\n"; | ||
174 | + } else { | ||
175 | + print; | ||
176 | + } | ||
177 | +} | ||
178 | + | ||
179 | +# any options left in @options, are options that were not mentioned in | ||
180 | +# the config file, and implicitly that means the option must be set =n, | ||
181 | +# so do that here. | ||
182 | +foreach $opt (@option) { | ||
183 | + print "OPTION_$opt=n\n"; | ||
184 | +} | ||
185 | Index: libc/options-config/config-preproc.pl | ||
186 | =================================================================== | ||
187 | --- /dev/null 1970-01-01 00:00:00.000000000 +0000 | ||
188 | +++ libc/options-config/config-preproc.pl 2013-06-26 00:45:15.792885570 -0700 | ||
189 | @@ -0,0 +1,8 @@ | ||
190 | +#!/usr/bin/perl | ||
191 | + | ||
192 | +if (@ARGV) { | ||
193 | + while (<>) { | ||
194 | + s/OPTION_/CONFIG_/g; | ||
195 | + print; | ||
196 | + } | ||
197 | +} | ||
198 | Index: libc/options-config/Makefile | ||
199 | =================================================================== | ||
200 | --- /dev/null 1970-01-01 00:00:00.000000000 +0000 | ||
201 | +++ libc/options-config/Makefile 2013-06-26 00:45:15.792885570 -0700 | ||
202 | @@ -0,0 +1,55 @@ | ||
203 | +# =========================================================================== | ||
204 | +# EGLIBC option-groups configuration targets | ||
205 | +# These targets are included from top-level makefile | ||
206 | + | ||
207 | +ifneq ($(kconfig_tools),) | ||
208 | +ifneq (no,$(PERL)) | ||
209 | + | ||
210 | +ocdir := options-config | ||
211 | + | ||
212 | +OconfigDefaults := option-groups.defaults | ||
213 | +OconfigDefaults_tmp := $(common-objpfx).tmp.defconfig | ||
214 | +OconfigDef := option-groups.def | ||
215 | +Oconfig := $(common-objpfx)option-groups.config | ||
216 | +Oconfig_tmp := $(common-objpfx).tmp.config | ||
217 | + | ||
218 | +conf := $(kconfig_tools)/conf | ||
219 | +mconf := $(kconfig_tools)/mconf | ||
220 | + | ||
221 | +preproc := $(PERL) $(ocdir)/config-preproc.pl | ||
222 | +postproc := $(PERL) $(ocdir)/config-postproc.pl | ||
223 | + | ||
224 | +PHONY += defconfig config menuconfig | ||
225 | + | ||
226 | +defconfig: $(conf) $(OconfigDefaults) $(OconfigDef) | ||
227 | + rm -f $(OconfigDefaults_tmp) | ||
228 | + rm -f $(Oconfig_tmp) | ||
229 | + $(preproc) $(OconfigDefaults) > $(OconfigDefaults_tmp) | ||
230 | + KCONFIG_CONFIG=$(Oconfig_tmp) $< --defconfig=$(OconfigDefaults_tmp) \ | ||
231 | + $(OconfigDef) | ||
232 | + $(postproc) $(OconfigDefaults) $(Oconfig_tmp) > $(Oconfig) | ||
233 | + rm $(Oconfig_tmp) | ||
234 | + rm $(OconfigDefaults_tmp) | ||
235 | + | ||
236 | +config: $(conf) $(OconfigDefaults) $(OconfigDef) | ||
237 | + rm -f $(Oconfig_tmp) | ||
238 | + $(preproc) $(wildcard $(Oconfig)) > $(Oconfig_tmp) | ||
239 | + KCONFIG_CONFIG=$(Oconfig_tmp) $< --oldaskconfig $(OconfigDef) | ||
240 | + $(postproc) $(OconfigDefaults) $(Oconfig_tmp) > $(Oconfig) | ||
241 | + rm $(Oconfig_tmp) | ||
242 | + | ||
243 | +menuconfig: $(mconf) $(OconfigDefaults) $(OconfigDef) | ||
244 | + rm -f $(Oconfig_tmp) | ||
245 | + $(preproc) $(wildcard $(Oconfig)) > $(Oconfig_tmp) | ||
246 | + KCONFIG_CONFIG=$(Oconfig_tmp) $< $(OconfigDef) | ||
247 | + $(postproc) $(OconfigDefaults) $(Oconfig_tmp) > $(Oconfig) | ||
248 | + rm $(Oconfig_tmp) | ||
249 | + | ||
250 | +# Help text used by make help | ||
251 | +help: | ||
252 | + @echo ' defconfig - New config with default from default config' | ||
253 | + @echo ' config - Update current config utilising a line-oriented program' | ||
254 | + @echo ' menuconfig - Update current config utilising a menu based program' | ||
255 | + | ||
256 | +endif | ||
257 | +endif | ||
258 | Index: libc/option-groups.def | ||
259 | =================================================================== | ||
260 | --- libc.orig/option-groups.def 2013-05-17 17:12:09.000000000 -0700 | ||
261 | +++ libc/option-groups.def 2013-06-26 00:45:15.796885570 -0700 | ||
262 | @@ -4,19 +4,19 @@ | ||
263 | # | ||
264 | # An entry of the form: | ||
265 | # | ||
266 | -# config OPTION_GROUP_NAME | ||
267 | +# config GROUP_NAME | ||
268 | # bool "one-line explanation of what this option group controls" | ||
269 | # help | ||
270 | # Multi-line help explaining the option group's meaning in | ||
271 | # some detail, terminated by indentation level. | ||
272 | # | ||
273 | -# defines an option group whose variable is OPTION_GROUP_NAME, with | ||
274 | +# defines an option group whose variable is GROUP_NAME, with | ||
275 | # meaningful values 'y' (enabled) and 'n' (disabled). The | ||
276 | # documentation is formatted to be consumed by some sort of | ||
277 | # interactive configuration interface, but EGLIBC doesn't have such an | ||
278 | # interface yet. | ||
279 | # | ||
280 | -# An option may have a 'depends' line, indicating which other options | ||
281 | +# An option may have a 'depends on' line, indicating which other options | ||
282 | # must also be enabled if this option is. At present, EGLIBC doesn't | ||
283 | # check that these dependencies are satisfied. | ||
284 | # | ||
285 | @@ -41,9 +41,9 @@ | ||
286 | # although this simply reestablishes the value already set by | ||
287 | # 'option-groups.defaults'. | ||
288 | |||
289 | -config OPTION_EGLIBC_ADVANCED_INET6 | ||
290 | +config EGLIBC_ADVANCED_INET6 | ||
291 | bool "IPv6 Advanced Sockets API support (RFC3542)" | ||
292 | - depends OPTION_EGLIBC_INET | ||
293 | + depends on EGLIBC_INET | ||
294 | help | ||
295 | This option group includes the functions specified by RFC 3542, | ||
296 | "Advanced Sockets Application Program Interface (API) for | ||
297 | @@ -71,7 +71,7 @@ | ||
298 | inet6_rth_segments | ||
299 | inet6_rth_space | ||
300 | |||
301 | -config OPTION_EGLIBC_BACKTRACE | ||
302 | +config EGLIBC_BACKTRACE | ||
303 | bool "Functions for producing backtraces" | ||
304 | help | ||
305 | This option group includes functions for producing a list of | ||
306 | @@ -85,7 +85,7 @@ | ||
307 | backtrace_symbols | ||
308 | backtrace_symbols_fd | ||
309 | |||
310 | -config OPTION_EGLIBC_BIG_MACROS | ||
311 | +config EGLIBC_BIG_MACROS | ||
312 | bool "Use extensive inline code" | ||
313 | help | ||
314 | This option group specifies whether certain pieces of code | ||
315 | @@ -93,7 +93,7 @@ | ||
316 | group is not selected, function calls will be used instead, | ||
317 | hence reducing the library footprint. | ||
318 | |||
319 | -config OPTION_EGLIBC_BSD | ||
320 | +config EGLIBC_BSD | ||
321 | bool "BSD-specific functions, and their compatibility stubs" | ||
322 | help | ||
323 | This option group includes functions specific to BSD kernels. | ||
324 | @@ -109,10 +109,9 @@ | ||
325 | revoke | ||
326 | setlogin | ||
327 | |||
328 | -config OPTION_EGLIBC_CXX_TESTS | ||
329 | +config EGLIBC_CXX_TESTS | ||
330 | bool "Tests that link against the standard C++ library." | ||
331 | - depends OPTION_POSIX_WIDE_CHAR_DEVICE_IO | ||
332 | - depends OPTION_EGLIBC_LIBM | ||
333 | + depends on POSIX_WIDE_CHAR_DEVICE_IO && EGLIBC_LIBM | ||
334 | help | ||
335 | This option group does not include any C library functions; | ||
336 | instead, it controls which EGLIBC tests an ordinary 'make | ||
337 | @@ -121,23 +120,22 @@ | ||
338 | run. | ||
339 | |||
340 | The standard C++ library depends on the math library 'libm' and | ||
341 | - the wide character I/O functions included in EGLIBC. If those | ||
342 | - option groups are disabled, this test must also be disabled. | ||
343 | + the wide character I/O functions included in EGLIBC. So those | ||
344 | + option groups must be enabled if this test is enabled. | ||
345 | |||
346 | -config OPTION_EGLIBC_CATGETS | ||
347 | +config EGLIBC_CATGETS | ||
348 | bool "Functions for accessing message catalogs" | ||
349 | - depends OPTION_EGLIBC_LOCALE_CODE | ||
350 | + depends on EGLIBC_LOCALE_CODE | ||
351 | help | ||
352 | This option group includes functions for accessing message | ||
353 | catalogs: catopen, catclose, and catgets. | ||
354 | |||
355 | - This option group depends on the OPTION_EGLIBC_LOCALE_CODE | ||
356 | - option group; if you disable that, you must also disable this. | ||
357 | + This option group depends on the EGLIBC_LOCALE_CODE | ||
358 | + option group. | ||
359 | |||
360 | -config OPTION_EGLIBC_CHARSETS | ||
361 | +config EGLIBC_CHARSETS | ||
362 | bool "iconv/gconv character set conversion libraries" | ||
363 | help | ||
364 | - | ||
365 | This option group includes support for character sets other | ||
366 | than ASCII (ANSI_X3.4-1968) and Unicode and ISO-10646 in their | ||
367 | various encodings. This affects both the character sets | ||
368 | @@ -198,16 +196,16 @@ | ||
369 | WCHAR_T - EGLIBC's internal form (target-endian, | ||
370 | 32-bit ISO 10646) | ||
371 | |||
372 | -config OPTION_EGLIBC_CRYPT | ||
373 | +config EGLIBC_CRYPT | ||
374 | bool "Encryption library" | ||
375 | help | ||
376 | This option group includes the `libcrypt' library which | ||
377 | provides functions for one-way encryption. Supported | ||
378 | encryption algorithms include MD5, SHA-256, SHA-512 and DES. | ||
379 | |||
380 | -config OPTION_EGLIBC_CRYPT_UFC | ||
381 | +config EGLIBC_CRYPT_UFC | ||
382 | bool "Ultra fast `crypt' implementation" | ||
383 | - depends OPTION_EGLIBC_CRYPT | ||
384 | + depends on EGLIBC_CRYPT | ||
385 | help | ||
386 | This option group provides ultra fast DES-based implementation of | ||
387 | the `crypt' function. When this option group is disabled, | ||
388 | @@ -216,7 +214,7 @@ | ||
389 | errno to ENOSYS if /salt/ passed does not correspond to either MD5, | ||
390 | SHA-256 or SHA-512 algorithm. | ||
391 | |||
392 | -config OPTION_EGLIBC_DB_ALIASES | ||
393 | +config EGLIBC_DB_ALIASES | ||
394 | bool "Functions for accessing the mail aliases database" | ||
395 | help | ||
396 | This option group includues functions for looking up mail | ||
397 | @@ -233,7 +231,7 @@ | ||
398 | When this option group is disabled, the NSS service libraries | ||
399 | also lack support for querying their mail alias tables. | ||
400 | |||
401 | -config OPTION_EGLIBC_ENVZ | ||
402 | +config EGLIBC_ENVZ | ||
403 | bool "Functions for handling envz-style environment vectors." | ||
404 | help | ||
405 | This option group contains functions for creating and operating | ||
406 | @@ -248,7 +246,7 @@ | ||
407 | envz_entry envz_remove | ||
408 | envz_get envz_strip | ||
409 | |||
410 | -config OPTION_EGLIBC_FCVT | ||
411 | +config EGLIBC_FCVT | ||
412 | bool "Functions for converting floating-point numbers to strings" | ||
413 | help | ||
414 | This option group includes functions for converting | ||
415 | @@ -262,14 +260,14 @@ | ||
416 | fcvt_r qfcvt_r | ||
417 | gcvt qgcvt | ||
418 | |||
419 | -config OPTION_EGLIBC_FMTMSG | ||
420 | +config EGLIBC_FMTMSG | ||
421 | bool "Functions for formatting messages" | ||
422 | help | ||
423 | This option group includes the following functions: | ||
424 | |||
425 | addseverity fmtmsg | ||
426 | |||
427 | -config OPTION_EGLIBC_FSTAB | ||
428 | +config EGLIBC_FSTAB | ||
429 | bool "Access functions for 'fstab'" | ||
430 | help | ||
431 | This option group includes functions for reading the mount | ||
432 | @@ -283,7 +281,7 @@ | ||
433 | getfsent setfsent | ||
434 | getfsfile | ||
435 | |||
436 | -config OPTION_EGLIBC_FTRAVERSE | ||
437 | +config EGLIBC_FTRAVERSE | ||
438 | bool "Functions for traversing file hierarchies" | ||
439 | help | ||
440 | This option group includes functions for traversing file | ||
441 | @@ -297,9 +295,9 @@ | ||
442 | fts_set nftw64 | ||
443 | fts_close | ||
444 | |||
445 | -config OPTION_EGLIBC_GETLOGIN | ||
446 | +config EGLIBC_GETLOGIN | ||
447 | bool "The getlogin function" | ||
448 | - depends OPTION_EGLIBC_UTMP | ||
449 | + depends on EGLIBC_UTMP | ||
450 | help | ||
451 | This function group includes the 'getlogin' and 'getlogin_r' | ||
452 | functions, which return the user name associated by the login | ||
453 | @@ -309,17 +307,17 @@ | ||
454 | fall back on 'getlogin' to find the user's login name for tilde | ||
455 | expansion when the 'HOME' environment variable is not set. | ||
456 | |||
457 | -config OPTION_EGLIBC_IDN | ||
458 | +config EGLIBC_IDN | ||
459 | bool "International domain names support" | ||
460 | help | ||
461 | This option group includes the `libcidn' library which | ||
462 | provides support for international domain names. | ||
463 | |||
464 | -config OPTION_EGLIBC_INET | ||
465 | +config EGLIBC_INET | ||
466 | bool "Networking support" | ||
467 | help | ||
468 | This option group includes networking-specific functions and | ||
469 | - data. With OPTION_EGLIBC_INET disabled, the EGLIBC | ||
470 | + data. With EGLIBC_INET disabled, the EGLIBC | ||
471 | installation and API changes as follows: | ||
472 | |||
473 | - The following libraries are not installed: | ||
474 | @@ -439,14 +437,14 @@ | ||
475 | use Unix-domain sockets to communicate with the syslog daemon; | ||
476 | syslog is valuable in non-networked contexts. | ||
477 | |||
478 | -config OPTION_EGLIBC_INET_ANL | ||
479 | +config EGLIBC_INET_ANL | ||
480 | bool "Asynchronous name lookup" | ||
481 | - depends OPTION_EGLIBC_INET | ||
482 | + depends on EGLIBC_INET | ||
483 | help | ||
484 | This option group includes the `libanl' library which | ||
485 | provides support for asynchronous name lookup. | ||
486 | |||
487 | -config OPTION_EGLIBC_LIBM | ||
488 | +config EGLIBC_LIBM | ||
489 | bool "libm (math library)" | ||
490 | help | ||
491 | This option group includes the 'libm' library, containing | ||
492 | @@ -464,7 +462,7 @@ | ||
493 | group, you will not be able to build 'libstdc++' against the | ||
494 | resulting EGLIBC installation. | ||
495 | |||
496 | -config OPTION_EGLIBC_LOCALES | ||
497 | +config EGLIBC_LOCALES | ||
498 | bool "Locale definitions" | ||
499 | help | ||
500 | This option group includes all locale definitions other than | ||
501 | @@ -472,17 +470,17 @@ | ||
502 | only the "C" locale is supported. | ||
503 | |||
504 | |||
505 | -config OPTION_EGLIBC_LOCALE_CODE | ||
506 | +config EGLIBC_LOCALE_CODE | ||
507 | bool "Locale functions" | ||
508 | - depends OPTION_POSIX_C_LANG_WIDE_CHAR | ||
509 | + depends on POSIX_C_LANG_WIDE_CHAR | ||
510 | help | ||
511 | This option group includes locale support functions, programs, | ||
512 | - and libraries. With OPTION_EGLIBC_LOCALE_FUNCTIONS disabled, | ||
513 | + and libraries. With EGLIBC_LOCALE_CODE disabled, | ||
514 | EGLIBC supports only the 'C' locale (also known as 'POSIX'), | ||
515 | and ignores the settings of the 'LANG' and 'LC_*' environment | ||
516 | variables. | ||
517 | |||
518 | - With OPTION_EGLIBC_LOCALE_CODE disabled, the following | ||
519 | + With EGLIBC_LOCALE_CODE disabled, the following | ||
520 | functions are omitted from libc: | ||
521 | |||
522 | duplocale localeconv nl_langinfo rpmatch strfmon_l | ||
523 | @@ -491,46 +489,43 @@ | ||
524 | Furthermore, only the LC_CTYPE and LC_TIME categories of the | ||
525 | standard "C" locale are available. | ||
526 | |||
527 | - The OPTION_EGLIBC_CATGETS option group depends on this option | ||
528 | - group; if you disable OPTION_EGLIBC_LOCALE_CODE, you must also | ||
529 | - disable OPTION_EGLIBC_CATGETS. | ||
530 | + The EGLIBC_CATGETS option group depends on this option group. | ||
531 | + | ||
532 | |||
533 | -config OPTION_EGLIBC_MEMUSAGE | ||
534 | +config EGLIBC_MEMUSAGE | ||
535 | bool "Memory profiling library" | ||
536 | help | ||
537 | This option group includes the `libmemusage' library and | ||
538 | the `memusage' and `memusagestat' utilities. | ||
539 | These components provide memory profiling functions. | ||
540 | |||
541 | - OPTION_EGLIBC_MEMUSAGE_DEFAULT_BUFFER_SIZE | ||
542 | + EGLIBC_MEMUSAGE_DEFAULT_BUFFER_SIZE | ||
543 | |||
544 | Libmemusage library buffers the profiling data in memory | ||
545 | before writing it out to disk. By default, the library | ||
546 | allocates 1.5M buffer, which can be substantial for some | ||
547 | - systems. OPTION_EGLIBC_MEMUSAGE_DEFAULT_BUFFER_SIZE option | ||
548 | + systems. EGLIBC_MEMUSAGE_DEFAULT_BUFFER_SIZE option | ||
549 | allows to change the default buffer size. It specifies | ||
550 | the number of entries the buffer should have. | ||
551 | On most architectures one buffer entry amounts to 48 bytes, | ||
552 | so setting this option to the value of 512 will reduce the size of | ||
553 | the memory buffer to 24K. | ||
554 | |||
555 | -config OPTION_EGLIBC_NIS | ||
556 | +config EGLIBC_NIS | ||
557 | bool "Support for NIS, NIS+, and the special 'compat' services." | ||
558 | - depends OPTION_EGLIBC_INET | ||
559 | - depends OPTION_EGLIBC_SUNRPC | ||
560 | + depends on EGLIBC_INET && EGLIBC_SUNRPC | ||
561 | help | ||
562 | This option group includes the NIS, NIS+, and 'compat' Name | ||
563 | Service Switch service libraries. When it is disabled, those | ||
564 | services libraries are not installed; you should remove any | ||
565 | references to them from your 'nsswitch.conf' file. | ||
566 | |||
567 | - This option group depends on the OPTION_EGLIBC_INET option | ||
568 | + This option group depends on the EGLIBC_INET option | ||
569 | group; you must enable that to enable this option group. | ||
570 | |||
571 | -config OPTION_EGLIBC_NSSWITCH | ||
572 | +config EGLIBC_NSSWITCH | ||
573 | bool "Name service switch (nsswitch) support" | ||
574 | help | ||
575 | - | ||
576 | This option group includes support for the 'nsswitch' facility. | ||
577 | With this option group enabled, all EGLIBC functions for | ||
578 | accessing various system databases (passwords and groups; | ||
579 | @@ -544,12 +539,12 @@ | ||
580 | 'option-groups.config' file must set the following two | ||
581 | variables: | ||
582 | |||
583 | - OPTION_EGLIBC_NSSWITCH_FIXED_CONFIG | ||
584 | + EGLIBC_NSSWITCH_FIXED_CONFIG | ||
585 | |||
586 | Set this to the name of a file whose contents observe the | ||
587 | same syntax as an ordinary '/etc/nsswitch.conf' file. The | ||
588 | EGLIBC build process parses this file just as EGLIBC would | ||
589 | - at run time if OPTION_EGLIBC_NSSWITCH were enabled, and | ||
590 | + at run time if EGLIBC_NSSWITCH were enabled, and | ||
591 | produces a C library that uses the nsswitch service | ||
592 | libraries to search for database entries as this file | ||
593 | specifies, instead of consulting '/etc/nsswitch.conf' at run | ||
594 | @@ -567,7 +562,7 @@ | ||
595 | you will probably want to delete references to databases not | ||
596 | needed on your system. | ||
597 | |||
598 | - OPTION_EGLIBC_NSSWITCH_FIXED_FUNCTIONS | ||
599 | + EGLIBC_NSSWITCH_FIXED_FUNCTIONS | ||
600 | |||
601 | The EGLIBC build process uses this file to decide which | ||
602 | functions to make available from which service libraries. | ||
603 | @@ -585,28 +580,28 @@ | ||
604 | Be sure to mention each function in each service you wish to | ||
605 | use. If you do not mention a service's function here, the | ||
606 | EGLIBC database access functions will not find it, even if | ||
607 | - it is listed in the OPTION_EGLIBC_NSSWITCH_FIXED_CONFIG | ||
608 | + it is listed in the EGLIBC_NSSWITCH_FIXED_CONFIG | ||
609 | file. | ||
610 | |||
611 | - In this arrangement, EGLIBC will not use the 'dlopen' and | ||
612 | - 'dlsym' functions to find database access functions. Instead, | ||
613 | - libc hard-codes references to the service libraries' database | ||
614 | - access functions. You must explicitly link your program | ||
615 | - against the name service libraries (those whose names start | ||
616 | - with 'libnss_', in the sysroot's '/lib' directory) whose | ||
617 | - functions you intend to use. This arrangement helps | ||
618 | - system-wide static analysis tools decide which functions a | ||
619 | - system actually uses. | ||
620 | - | ||
621 | - Note that some nsswitch service libraries require other option | ||
622 | - groups to be enabled; for example, the OPTION_EGLIBC_INET | ||
623 | - option group must be enabled to use the 'libnss_dns.so.2' | ||
624 | - service library, which uses the Domain Name System network | ||
625 | - protocol to answer queries. | ||
626 | + In this arrangement, EGLIBC will not use the 'dlopen' and | ||
627 | + 'dlsym' functions to find database access functions. Instead, | ||
628 | + libc hard-codes references to the service libraries' database | ||
629 | + access functions. You must explicitly link your program | ||
630 | + against the name service libraries (those whose names start | ||
631 | + with 'libnss_', in the sysroot's '/lib' directory) whose | ||
632 | + functions you intend to use. This arrangement helps | ||
633 | + system-wide static analysis tools decide which functions a | ||
634 | + system actually uses. | ||
635 | + | ||
636 | + Note that some nsswitch service libraries require other option | ||
637 | + groups to be enabled; for example, the EGLIBC_INET | ||
638 | + option group must be enabled to use the 'libnss_dns.so.2' | ||
639 | + service library, which uses the Domain Name System network | ||
640 | + protocol to answer queries. | ||
641 | |||
642 | -config OPTION_EGLIBC_RCMD | ||
643 | +config EGLIBC_RCMD | ||
644 | bool "Support for 'rcmd' and related library functions" | ||
645 | - depends OPTION_EGLIBC_INET | ||
646 | + depends on EGLIBC_INET | ||
647 | help | ||
648 | This option group includes functions for running commands on | ||
649 | remote machines via the 'rsh' protocol, and doing authentication | ||
650 | @@ -622,7 +617,7 @@ | ||
651 | rresvport ruserpass | ||
652 | rresvport_af | ||
653 | |||
654 | -config OPTION_EGLIBC_RTLD_DEBUG | ||
655 | +config EGLIBC_RTLD_DEBUG | ||
656 | bool "Runtime linker debug print outs" | ||
657 | help | ||
658 | This option group enables debug output of the runtime linker | ||
659 | @@ -633,7 +628,7 @@ | ||
660 | the `ldd' utility which may also be used by the prelinker. | ||
661 | In particular, the `--unused' ldd option will not work correctly. | ||
662 | |||
663 | -config OPTION_EGLIBC_SPAWN | ||
664 | +config EGLIBC_SPAWN | ||
665 | bool "Support for POSIX posix_spawn functions" | ||
666 | help | ||
667 | This option group includes the POSIX functions for executing | ||
668 | @@ -669,7 +664,7 @@ | ||
669 | disabled, those programs will only operate on uncompressed | ||
670 | charmap files. | ||
671 | |||
672 | -config OPTION_EGLIBC_STREAMS | ||
673 | +config EGLIBC_STREAMS | ||
674 | bool "Support for accessing STREAMS." | ||
675 | help | ||
676 | This option group includes functions for reading and writing | ||
677 | @@ -685,14 +680,14 @@ | ||
678 | isastream fdetach | ||
679 | putmsg | ||
680 | |||
681 | -config OPTION_EGLIBC_SUNRPC | ||
682 | +config EGLIBC_SUNRPC | ||
683 | bool "Support for the Sun 'RPC' protocol." | ||
684 | - depends OPTION_EGLIBC_INET | ||
685 | + depends on EGLIBC_INET | ||
686 | help | ||
687 | This option group includes support for the Sun RPC protocols, | ||
688 | including the 'rpcgen' and 'rpcinfo' programs. | ||
689 | |||
690 | -config OPTION_EGLIBC_UTMP | ||
691 | +config EGLIBC_UTMP | ||
692 | bool "Older access functions for 'utmp' login records" | ||
693 | help | ||
694 | This option group includes the older 'utent' family of | ||
695 | @@ -719,9 +714,9 @@ | ||
696 | |||
697 | libutil.so (and libutil.a) | ||
698 | |||
699 | -config OPTION_EGLIBC_UTMPX | ||
700 | +config EGLIBC_UTMPX | ||
701 | bool "POSIX access functions for 'utmp' login records" | ||
702 | - depends OPTION_EGLIBC_UTMP | ||
703 | + depends on EGLIBC_UTMP | ||
704 | help | ||
705 | This option group includes the POSIX functions for reading and | ||
706 | writing user login records in the 'utmp' file (usually | ||
707 | @@ -742,21 +737,21 @@ | ||
708 | updwtmpx | ||
709 | utmpxname | ||
710 | |||
711 | -config OPTION_EGLIBC_WORDEXP | ||
712 | +config EGLIBC_WORDEXP | ||
713 | bool "Shell-style word expansion" | ||
714 | help | ||
715 | This option group includes the 'wordexp' function for | ||
716 | performing word expansion in the manner of the shell, and the | ||
717 | accompanying 'wordfree' function. | ||
718 | |||
719 | -config OPTION_POSIX_C_LANG_WIDE_CHAR | ||
720 | +config POSIX_C_LANG_WIDE_CHAR | ||
721 | bool "ISO C library wide character functions, excluding I/O" | ||
722 | help | ||
723 | This option group includes the functions defined by the ISO C | ||
724 | standard for working with wide and multibyte characters in | ||
725 | memory. Functions for reading and writing wide and multibyte | ||
726 | characters from and to files call in the | ||
727 | - OPTION_POSIX_WIDE_CHAR_DEVICE_IO option group. | ||
728 | + POSIX_WIDE_CHAR_DEVICE_IO option group. | ||
729 | |||
730 | This option group includes the following functions: | ||
731 | |||
732 | @@ -778,14 +773,14 @@ | ||
733 | mbrlen wcscoll wcstol | ||
734 | mbrtowc wcscpy wcstold | ||
735 | |||
736 | -config OPTION_POSIX_REGEXP | ||
737 | +config POSIX_REGEXP | ||
738 | bool "Regular expressions" | ||
739 | help | ||
740 | This option group includes the POSIX regular expression | ||
741 | functions, and the associated non-POSIX extensions and | ||
742 | compatibility functions. | ||
743 | |||
744 | - With OPTION_POSIX_REGEXP disabled, the following functions are | ||
745 | + With POSIX_REGEXP disabled, the following functions are | ||
746 | omitted from libc: | ||
747 | |||
748 | re_comp re_max_failures regcomp | ||
749 | @@ -799,9 +794,9 @@ | ||
750 | <regexp.h> header file, 'compile', 'step', and 'advance', is | ||
751 | omitted. | ||
752 | |||
753 | -config OPTION_POSIX_REGEXP_GLIBC | ||
754 | +config POSIX_REGEXP_GLIBC | ||
755 | bool "Regular expressions from GLIBC" | ||
756 | - depends OPTION_POSIX_REGEXP | ||
757 | + depends on POSIX_REGEXP | ||
758 | help | ||
759 | This option group specifies which regular expression | ||
760 | library to use. The choice is between regex | ||
761 | @@ -810,9 +805,9 @@ | ||
762 | optimized for speed; regex from libiberty is more than twice | ||
763 | as small while still is enough for most practical purposes. | ||
764 | |||
765 | -config OPTION_POSIX_WIDE_CHAR_DEVICE_IO | ||
766 | +config POSIX_WIDE_CHAR_DEVICE_IO | ||
767 | bool "Input and output functions for wide characters" | ||
768 | - depends OPTION_POSIX_C_LANG_WIDE_CHAR | ||
769 | + depends on POSIX_C_LANG_WIDE_CHAR | ||
770 | help | ||
771 | This option group includes functions for reading and writing | ||
772 | wide characters to and from <stdio.h> streams. | ||
773 | Index: libc/Makefile | ||
774 | =================================================================== | ||
775 | --- libc.orig/Makefile 2013-06-04 08:48:26.000000000 -0700 | ||
776 | +++ libc/Makefile 2013-06-26 00:45:15.796885570 -0700 | ||
777 | @@ -24,6 +24,7 @@ | ||
778 | |||
779 | include Makeconfig | ||
780 | |||
781 | +include options-config/Makefile | ||
782 | |||
783 | # This is the default target; it makes everything except the tests. | ||
784 | .PHONY: all | ||
785 | Index: libc/configure | ||
786 | =================================================================== | ||
787 | --- libc.orig/configure 2013-06-24 15:42:26.000000000 -0700 | ||
788 | +++ libc/configure 2013-06-26 00:45:15.800885570 -0700 | ||
789 | @@ -622,6 +622,7 @@ | ||
790 | libc_cv_have_bash2 | ||
791 | BASH_SHELL | ||
792 | libc_cv_gcc_static_libgcc | ||
793 | +KCONFIG_TOOLS | ||
794 | CXX_SYSINCLUDES | ||
795 | SYSINCLUDES | ||
796 | AUTOCONF | ||
797 | @@ -734,6 +735,7 @@ | ||
798 | with_binutils | ||
799 | with_selinux | ||
800 | with_headers | ||
801 | +with_kconfig | ||
802 | with_default_link | ||
803 | enable_sanity_checks | ||
804 | enable_shared | ||
805 | @@ -1432,6 +1434,9 @@ | ||
806 | --with-selinux if building with SELinux support | ||
807 | --with-headers=PATH location of system headers to use (for example | ||
808 | /usr/src/linux/include) [default=compiler default] | ||
809 | + --with-kconfig=PATH location of kconfig tools to use (from Linux kernel | ||
810 | + builds) to re-use for configuring EGLIBC option | ||
811 | + groups | ||
812 | --with-default-link do not use explicit linker scripts | ||
813 | --with-cpu=CPU select code for CPU variant | ||
814 | |||
815 | @@ -3395,6 +3400,14 @@ | ||
816 | |||
817 | |||
818 | |||
819 | +# Check whether --with-kconfig was given. | ||
820 | +if test "${with_kconfig+set}" = set; then | ||
821 | + withval=$with_kconfig; KCONFIG_TOOLS=$withval | ||
822 | +else | ||
823 | + KCONFIG_TOOLS='' | ||
824 | +fi | ||
825 | + | ||
826 | + | ||
827 | |||
828 | # Check whether --with-default-link was given. | ||
829 | if test "${with_default_link+set}" = set; then : | ||
830 | Index: libc/EGLIBC.option-groups | ||
831 | =================================================================== | ||
832 | --- libc.orig/EGLIBC.option-groups 2007-04-13 17:50:17.000000000 -0700 | ||
833 | +++ libc/EGLIBC.option-groups 2013-06-26 00:45:15.800885570 -0700 | ||
834 | @@ -56,33 +56,9 @@ | ||
835 | |||
836 | The Option Groups | ||
837 | |||
838 | -EGLIBC currently implements the following option groups, also | ||
839 | -documented in the file 'option-groups.def': | ||
840 | - | ||
841 | -OPTION_EGLIBC_CATGETS | ||
842 | - This option group includes functions for accessing message | ||
843 | - catalogs: catopen, catclose, and catgets. | ||
844 | - | ||
845 | -OPTION_EGLIBC_LOCALES | ||
846 | - This option group includes all locale definitions other than | ||
847 | - those for the "C" locale. If this option group is omitted, then | ||
848 | - only the "C" locale is supported. | ||
849 | - | ||
850 | -OPTION_EGLIBC_LIBM | ||
851 | - This option group includes the 'libm' library, containing | ||
852 | - mathematical functions. If this option group is omitted, then | ||
853 | - an EGLIBC installation does not include shared or unshared versions | ||
854 | - of the math library. | ||
855 | - | ||
856 | - Note that this does not remove all floating-point related | ||
857 | - functionality from EGLIBC; for example, 'printf' and 'scanf' | ||
858 | - can still print and read floating-point values with this option | ||
859 | - group disabled. | ||
860 | - | ||
861 | - Note that the ISO Standard C++ library 'libstdc++' depends on | ||
862 | - EGLIBC's math library 'libm'. If you disable this option | ||
863 | - group, you will not be able to build 'libstdc++' against the | ||
864 | - resulting EGLIBC installation. | ||
865 | +To see the current full list of implemented option groups, refer to the | ||
866 | +file 'option-groups.def' at the top of the source tree, or run | ||
867 | +'make menuconfig' from the top-level build directory. | ||
868 | |||
869 | The POSIX.1-2001 specification includes a suggested partition of all | ||
870 | the functions in the POSIX C API into option groups: math functions | ||
871 | @@ -110,6 +86,18 @@ | ||
872 | OPTION_EGLIBC_LOCALES = n | ||
873 | OPTION_EGLIBC_LIBM = y | ||
874 | |||
875 | +Like the Linux kernel, EGLIBC supports a similar set of '*config' make | ||
876 | +targets to make it easier to create 'option-groups.config', with all | ||
877 | +dependencies between option groups automatically satisfied. Run | ||
878 | +'make help' to see the list of supported make config targets. For | ||
879 | +example, 'make menuconfig' will update the current config utilising a | ||
880 | +menu based program. | ||
881 | + | ||
882 | +The option group names and their type (boolean, int, hex, string), help | ||
883 | +description, and dependencies with other option groups, are described by | ||
884 | +'option-groups.def' at the top of the source tree, analogous to the | ||
885 | +'Kconfig' files in the Linux kernel. | ||
886 | + | ||
887 | In general, each option group variable controls whether a given set of | ||
888 | object files in EGLIBC is compiled and included in the final | ||
889 | libraries, or omitted from the build. | ||
890 | @@ -132,22 +120,3 @@ | ||
891 | |||
892 | We have used the system to subset some portions of EGLIBC's | ||
893 | functionality. It needs to be extended to cover more of the library. | ||
894 | - | ||
895 | -At the moment, EGLIBC performs no sanity checks on the contents of | ||
896 | -'option-groups.config'; if an option group's name is mistyped, the | ||
897 | -option group is silently included in the build. EGLIBC should check | ||
898 | -that all variables set in 'option-groups.config' are proper option | ||
899 | -group names, and that their values are appropriate. | ||
900 | - | ||
901 | -Some portions of EGLIBC depend on others; for example, the Sun Remote | ||
902 | -Procedure Call functions in 'sunrpc' depend on the networking | ||
903 | -functions in 'inet'. The sanity checking described above should check | ||
904 | -that the selection configuration satisfies dependencies within EGLIBC, | ||
905 | -and produce a legible error message if it does not. At the moment, | ||
906 | -inconsistent configurations produce link errors late in the build | ||
907 | -process. | ||
908 | - | ||
909 | -The Linux kernel's configuration system provides interactive | ||
910 | -interfaces for creating and modifying configuration files (which also | ||
911 | -perform the sanity checking and dependency tracking described above). | ||
912 | -EGLIBC should provide similar interfaces. | ||
diff --git a/meta/recipes-core/eglibc/eglibc-2.18/0001-eglibc-run-libm-err-tab.pl-with-specific-dirs-in-S.patch b/meta/recipes-core/eglibc/eglibc-2.18/0001-eglibc-run-libm-err-tab.pl-with-specific-dirs-in-S.patch new file mode 100644 index 0000000000..a8463ea915 --- /dev/null +++ b/meta/recipes-core/eglibc/eglibc-2.18/0001-eglibc-run-libm-err-tab.pl-with-specific-dirs-in-S.patch | |||
@@ -0,0 +1,36 @@ | |||
1 | From 713d822908d1b2ae8403af7f9375c7054ed3dd49 Mon Sep 17 00:00:00 2001 | ||
2 | From: Ting Liu <b28495@freescale.com> | ||
3 | Date: Wed, 19 Dec 2012 04:39:57 -0600 | ||
4 | Subject: [PATCH] eglibc: run libm-err-tab.pl with specific dirs in ${S} | ||
5 | |||
6 | libm-err-tab.pl will parse all the files named "libm-test-ulps" | ||
7 | in 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/ | ||
10 | aarch64/libm-test-ulps), run libm-err-tab.pl with specific dirs | ||
11 | in ${S}. | ||
12 | |||
13 | Upstream-Status: inappropriate [OE specific] | ||
14 | |||
15 | Signed-off-by: Ting Liu <b28495@freescale.com> | ||
16 | --- | ||
17 | manual/Makefile | 3 ++- | ||
18 | 1 file changed, 2 insertions(+), 1 deletion(-) | ||
19 | |||
20 | diff --git a/manual/Makefile b/manual/Makefile | ||
21 | index 6fddff0..7af242e 100644 | ||
22 | --- a/manual/Makefile | ||
23 | +++ b/manual/Makefile | ||
24 | @@ -109,7 +109,8 @@ $(objpfx)libm-err.texi: $(objpfx)stamp-libm-err | ||
25 | $(objpfx)stamp-libm-err: libm-err-tab.pl $(wildcard $(foreach dir,$(sysdirs),\ | ||
26 | $(dir)/libm-test-ulps)) | ||
27 | pwd=`pwd`; \ | ||
28 | - $(PERL) $< $$pwd/.. > $(objpfx)libm-err-tmp | ||
29 | + $(PERL) $< $$pwd/../ports > $(objpfx)libm-err-tmp | ||
30 | + $(PERL) $< $$pwd/../sysdeps >> $(objpfx)libm-err-tmp | ||
31 | $(move-if-change) $(objpfx)libm-err-tmp $(objpfx)libm-err.texi | ||
32 | touch $@ | ||
33 | |||
34 | -- | ||
35 | 1.7.9.7 | ||
36 | |||
diff --git a/meta/recipes-core/eglibc/eglibc-2.18/0002-eglibc-menuconfig-hex-string-options.patch b/meta/recipes-core/eglibc/eglibc-2.18/0002-eglibc-menuconfig-hex-string-options.patch new file mode 100644 index 0000000000..7caba48112 --- /dev/null +++ b/meta/recipes-core/eglibc/eglibc-2.18/0002-eglibc-menuconfig-hex-string-options.patch | |||
@@ -0,0 +1,169 @@ | |||
1 | pulled from | ||
2 | |||
3 | http://www.eglibc.org/archives/patches/msg01043.html | ||
4 | |||
5 | |||
6 | Upstream-Status: Pending | ||
7 | Signed-off-by: Khem | ||
8 | |||
9 | |||
10 | This patch builds on the menuconfig patch for EGLIBC. | ||
11 | |||
12 | |||
13 | There are a few options that have non-boolean types, that would benefit from the new 'make *config' support: | ||
14 | |||
15 | EGLIBC_MEMUSAGE_DEFAULT_BUFFER_SIZE (int) | ||
16 | EGLIBC_NSSWITCH_FIXED_CONFIG (string) | ||
17 | EGLIBC_NSSWITCH_FIXED_FUNCTIONS (string) | ||
18 | |||
19 | |||
20 | The patch converts these to real options in libc/option-groups.def. Also, libc/scripts/option-groups.awk is modified to output a '#define' line for int, hex, or string options encountered in the config file. | ||
21 | |||
22 | In the post-processing script config-postproc.pl, a small change is needed: for any boolean option FOO that is implicitly disabled in the kconfig output, make sure that option is indeed a boolean before printing the explicit OPTION_FOO=n. | ||
23 | |||
24 | Finally, libc/malloc/Makefile passes __OPTION_EGLIBC_MEMUSAGE_DEFAULT_BUFFER_SIZE as a CPPFLAGS, which is not necessary anymore because this macro will now be present in the generated header. | ||
25 | |||
26 | attached is the updated patch to address above issues. | ||
27 | |||
28 | Steve | ||
29 | |||
30 | -- | ||
31 | Steve Longerbeam | Senior Embedded Engineer, ESD Services | ||
32 | Mentor Embedded(tm) | 46871 Bayside Parkway, Fremont, CA 94538 | ||
33 | P 510.354.5838 | M 408.410.2735 | ||
34 | Nucleus(r) | Linux(r) | Android(tm) | Services | UI | Multi-OS | ||
35 | |||
36 | |||
37 | Index: libc/malloc/Makefile | ||
38 | =================================================================== | ||
39 | --- libc.orig/malloc/Makefile 2012-01-04 22:06:18.000000000 -0800 | ||
40 | +++ libc/malloc/Makefile 2012-05-09 19:35:28.598682105 -0700 | ||
41 | @@ -48,10 +48,6 @@ | ||
42 | ifeq ($(OPTION_EGLIBC_MEMUSAGE),y) | ||
43 | extra-libs = libmemusage | ||
44 | extra-libs-others = $(extra-libs) | ||
45 | - | ||
46 | -ifdef OPTION_EGLIBC_MEMUSAGE_DEFAULT_BUFFER_SIZE | ||
47 | -CPPFLAGS-memusage += -D__OPTION_EGLIBC_MEMUSAGE_DEFAULT_BUFFER_SIZE=$(OPTION_EGLIBC_MEMUSAGE_DEFAULT_BUFFER_SIZE) | ||
48 | -endif | ||
49 | endif | ||
50 | |||
51 | libmemusage-routines = memusage | ||
52 | Index: libc/option-groups.def | ||
53 | =================================================================== | ||
54 | --- libc.orig/option-groups.def 2012-05-09 19:33:48.398677256 -0700 | ||
55 | +++ libc/option-groups.def 2012-05-09 19:35:28.610682107 -0700 | ||
56 | @@ -513,8 +513,11 @@ | ||
57 | the `memusage' and `memusagestat' utilities. | ||
58 | These components provide memory profiling functions. | ||
59 | |||
60 | - EGLIBC_MEMUSAGE_DEFAULT_BUFFER_SIZE | ||
61 | - | ||
62 | +config EGLIBC_MEMUSAGE_DEFAULT_BUFFER_SIZE | ||
63 | + int "Memory profiling library buffer size" | ||
64 | + depends on EGLIBC_MEMUSAGE | ||
65 | + default "32768" | ||
66 | + help | ||
67 | Libmemusage library buffers the profiling data in memory | ||
68 | before writing it out to disk. By default, the library | ||
69 | allocates 1.5M buffer, which can be substantial for some | ||
70 | @@ -553,8 +556,11 @@ | ||
71 | 'option-groups.config' file must set the following two | ||
72 | variables: | ||
73 | |||
74 | - EGLIBC_NSSWITCH_FIXED_CONFIG | ||
75 | - | ||
76 | +config EGLIBC_NSSWITCH_FIXED_CONFIG | ||
77 | + string "Nsswitch fixed config filename" | ||
78 | + depends on !EGLIBC_NSSWITCH | ||
79 | + default "" | ||
80 | + help | ||
81 | Set this to the name of a file whose contents observe the | ||
82 | same syntax as an ordinary '/etc/nsswitch.conf' file. The | ||
83 | EGLIBC build process parses this file just as EGLIBC would | ||
84 | @@ -576,8 +582,11 @@ | ||
85 | you will probably want to delete references to databases not | ||
86 | needed on your system. | ||
87 | |||
88 | - EGLIBC_NSSWITCH_FIXED_FUNCTIONS | ||
89 | - | ||
90 | +config EGLIBC_NSSWITCH_FIXED_FUNCTIONS | ||
91 | + string "Nsswitch fixed functions filename" | ||
92 | + depends on !EGLIBC_NSSWITCH | ||
93 | + default "" | ||
94 | + help | ||
95 | The EGLIBC build process uses this file to decide which | ||
96 | functions to make available from which service libraries. | ||
97 | The file 'nss/fixed-nsswitch.functions' serves as a sample | ||
98 | Index: libc/options-config/config-postproc.pl | ||
99 | =================================================================== | ||
100 | --- libc.orig/options-config/config-postproc.pl 2012-05-09 19:33:36.530676681 -0700 | ||
101 | +++ libc/options-config/config-postproc.pl 2012-05-09 19:35:28.610682107 -0700 | ||
102 | @@ -8,7 +8,7 @@ | ||
103 | die "Could not open $ARGV[0]" unless -T $ARGV[0]; | ||
104 | |||
105 | sub yank { | ||
106 | - @option = grep($_ ne $_[0], @option); | ||
107 | + @option = grep(!($_ =~ /$_[0]\s*=/), @option); | ||
108 | } | ||
109 | |||
110 | open(DEFAULTS, $defaults) || die "Could not open $defaults\n"; | ||
111 | @@ -16,7 +16,7 @@ | ||
112 | # get the full list of available options using the default config file | ||
113 | $i = 0; | ||
114 | while (<DEFAULTS>) { | ||
115 | - if (/^\s*OPTION_(\w+)\s*=/) { | ||
116 | + if (/^\s*OPTION_(\w+\s*=.*$)/) { | ||
117 | $option[$i++] = $1; | ||
118 | } | ||
119 | } | ||
120 | @@ -35,8 +35,9 @@ | ||
121 | s/CONFIG_/OPTION_/g; | ||
122 | print; | ||
123 | } elsif (/^\s*#\s+CONFIG_(\w+) is not set/) { | ||
124 | - # this is a comment line, change CONFIG_ to OPTION_, remove this | ||
125 | - # option from option list, and convert to explicit OPTION_FOO=n | ||
126 | + # this is a comment line for an unset boolean option, change CONFIG_ | ||
127 | + # to OPTION_, remove this option from option list, and convert to | ||
128 | + # explicit OPTION_FOO=n | ||
129 | $opt = $1; | ||
130 | yank($opt); | ||
131 | s/CONFIG_/OPTION_/g; | ||
132 | @@ -46,9 +47,12 @@ | ||
133 | } | ||
134 | } | ||
135 | |||
136 | -# any options left in @options, are options that were not mentioned in | ||
137 | +# any boolean options left in @options, are options that were not mentioned in | ||
138 | # the config file, and implicitly that means the option must be set =n, | ||
139 | # so do that here. | ||
140 | foreach $opt (@option) { | ||
141 | - print "OPTION_$opt=n\n"; | ||
142 | + if ($opt =~ /=\s*[yn]/) { | ||
143 | + $opt =~ s/=\s*[yn]/=n/; | ||
144 | + print "OPTION_$opt\n"; | ||
145 | + } | ||
146 | } | ||
147 | Index: libc/scripts/option-groups.awk | ||
148 | =================================================================== | ||
149 | --- libc.orig/scripts/option-groups.awk 2012-01-04 22:06:00.000000000 -0800 | ||
150 | +++ libc/scripts/option-groups.awk 2012-05-09 19:35:28.610682107 -0700 | ||
151 | @@ -46,9 +46,15 @@ | ||
152 | print "#define __" var " 1" | ||
153 | else if (vars[var] == "n") | ||
154 | print "/* #undef __" var " */" | ||
155 | - # Ignore variables that don't have boolean values. | ||
156 | - # Ideally, this would be driven by the types given in | ||
157 | - # option-groups.def. | ||
158 | + else if (vars[var] ~ /^[0-9]+/ || | ||
159 | + vars[var] ~ /^0x[0-9aAbBcCdDeEfF]+/ || | ||
160 | + vars[var] ~ /^\"/) | ||
161 | + print "#define __" var " " vars[var] | ||
162 | + else | ||
163 | + print "/* #undef __" var " */" | ||
164 | + # Ignore variables that don't have boolean, int, hex, or | ||
165 | + # string values. Ideally, this would be driven by the types | ||
166 | + # given in option-groups.def. | ||
167 | } | ||
168 | } | ||
169 | |||
diff --git a/meta/recipes-core/eglibc/eglibc-2.18/0003-eglibc-menuconfig-build-instructions.patch b/meta/recipes-core/eglibc/eglibc-2.18/0003-eglibc-menuconfig-build-instructions.patch new file mode 100644 index 0000000000..d137f5b318 --- /dev/null +++ b/meta/recipes-core/eglibc/eglibc-2.18/0003-eglibc-menuconfig-build-instructions.patch | |||
@@ -0,0 +1,176 @@ | |||
1 | Pulled from | ||
2 | |||
3 | http://www.eglibc.org/archives/patches/msg01035.html | ||
4 | |||
5 | Upstream-Status: Pending | ||
6 | Signed-off-by: Khem | ||
7 | |||
8 | As part of the menuconfig development, I encountered some outdated information in the cross-build instructions, libc/EGLIBC.cross-building. This patch updates the file with new (and tested) instructions. It is unrelated to the menuconfig support, but applies after. | ||
9 | |||
10 | My testing was done with an ARM target, and an x86_64 Linux host, so I converted the instructions to use those host/target types from the original i686/powerpc. Hope that's ok. | ||
11 | |||
12 | |||
13 | Thanks, | ||
14 | |||
15 | -- | ||
16 | Steve Longerbeam | Senior Embedded Engineer, ESD Services | ||
17 | Mentor Embedded(tm) | 46871 Bayside Parkway, Fremont, CA 94538 | ||
18 | P 510.354.5838 | M 408.410.2735 | ||
19 | Nucleus(r) | Linux(r) | Android(tm) | Services | UI | Multi-OS | ||
20 | |||
21 | |||
22 | EGLIBC.cross-building | 59 +++++++++++++++++++++++++++++--------------------- | ||
23 | 1 file changed, 35 insertions(+), 24 deletions(-) | ||
24 | |||
25 | Index: libc/EGLIBC.cross-building | ||
26 | =================================================================== | ||
27 | --- libc.orig/EGLIBC.cross-building 2012-05-09 19:33:36.522676681 -0700 | ||
28 | +++ libc/EGLIBC.cross-building 2012-05-09 19:36:13.918684298 -0700 | ||
29 | @@ -47,31 +47,34 @@ | ||
30 | EGLIBC requires recent versions of the GNU binutils, GCC, and the | ||
31 | Linux kernel. The web page <http://www.eglibc.org/prerequisites> | ||
32 | documents the current requirements, and lists patches needed for | ||
33 | -certain target architectures. As of this writing, EGLIBC required | ||
34 | -binutils 2.17, GCC 4.1, and Linux 2.6.19.1. | ||
35 | +certain target architectures. As of this writing, these build | ||
36 | +instructions have been tested with binutils 2.22.51, GCC 4.6.2, | ||
37 | +and Linux 3.1. | ||
38 | |||
39 | First, let's set some variables, to simplify later commands. We'll | ||
40 | -build EGLIBC and GCC for a PowerPC target, known to the Linux kernel | ||
41 | -as 'powerpc', and we'll do the build on an Intel Linux box: | ||
42 | +build EGLIBC and GCC for an ARM target, known to the Linux kernel | ||
43 | +as 'arm', and we'll do the build on an Intel x86_64 Linux box: | ||
44 | |||
45 | - $ build=i686-pc-linux-gnu | ||
46 | + $ build=x86_64-pc-linux-gnu | ||
47 | $ host=$build | ||
48 | - $ target=powerpc-none-linux-gnu | ||
49 | - $ linux_arch=powerpc | ||
50 | + $ target=arm-none-linux-gnueabi | ||
51 | + $ linux_arch=arm | ||
52 | |||
53 | We're using the aforementioned versions of Binutils, GCC, and Linux: | ||
54 | |||
55 | - $ binutilsv=binutils-2.17 | ||
56 | - $ gccv=gcc-4.1.1 | ||
57 | - $ linuxv=linux-2.6.20 | ||
58 | + $ binutilsv=binutils-2.22.51 | ||
59 | + $ gccv=gcc-4.6.2 | ||
60 | + $ linuxv=linux-3.1 | ||
61 | |||
62 | We're carrying out the entire process under '~/cross-build', which | ||
63 | -contains unpacked source trees: | ||
64 | +contains unpacked source trees for binutils, gcc, and linux kernel, | ||
65 | +along with EGLIBC svn trunk (which can be checked-out with | ||
66 | +'svn co http://www.eglibc.org/svn/trunk eglibc'): | ||
67 | |||
68 | - $ top=$HOME/cross-build/ppc | ||
69 | + $ top=$HOME/cross-build/$target | ||
70 | $ src=$HOME/cross-build/src | ||
71 | $ ls $src | ||
72 | - binutils-2.17 gcc-4.1.1 libc linux-2.6.20 | ||
73 | + binutils-2.22.51 eglibc gcc-4.6.2 linux-3.1 | ||
74 | |||
75 | We're going to place our build directories in a subdirectory 'obj', | ||
76 | we'll install the cross-development toolchain in 'tools', and we'll | ||
77 | @@ -99,7 +102,7 @@ | ||
78 | |||
79 | The First GCC | ||
80 | |||
81 | -For our work, we need a cross-compiler targeting a PowerPC Linux | ||
82 | +For our work, we need a cross-compiler targeting an ARM Linux | ||
83 | system. However, that configuration includes the shared library | ||
84 | 'libgcc_s.so', which is compiled against the EGLIBC headers (which we | ||
85 | haven't installed yet) and linked against 'libc.so' (which we haven't | ||
86 | @@ -125,7 +128,8 @@ | ||
87 | > --prefix=$tools \ | ||
88 | > --without-headers --with-newlib \ | ||
89 | > --disable-shared --disable-threads --disable-libssp \ | ||
90 | - > --disable-libgomp --disable-libmudflap \ | ||
91 | + > --disable-libgomp --disable-libmudflap --disable-libquadmath \ | ||
92 | + > --disable-decimal-float --disable-libffi \ | ||
93 | > --enable-languages=c | ||
94 | $ PATH=$tools/bin:$PATH make | ||
95 | $ PATH=$tools/bin:$PATH make install | ||
96 | @@ -162,12 +166,13 @@ | ||
97 | > CXX=$tools/bin/$target-g++ \ | ||
98 | > AR=$tools/bin/$target-ar \ | ||
99 | > RANLIB=$tools/bin/$target-ranlib \ | ||
100 | - > $src/libc/configure \ | ||
101 | + > $src/eglibc/libc/configure \ | ||
102 | > --prefix=/usr \ | ||
103 | > --with-headers=$sysroot/usr/include \ | ||
104 | > --build=$build \ | ||
105 | > --host=$target \ | ||
106 | - > --disable-profile --without-gd --without-cvs --enable-add-ons | ||
107 | + > --disable-profile --without-gd --without-cvs \ | ||
108 | + > --enable-add-ons=nptl,libidn,../ports | ||
109 | |||
110 | The option '--prefix=/usr' may look strange, but you should never | ||
111 | configure EGLIBC with a prefix other than '/usr': in various places, | ||
112 | @@ -181,6 +186,11 @@ | ||
113 | The '--with-headers' option tells EGLIBC where the Linux headers have | ||
114 | been installed. | ||
115 | |||
116 | +The '--enable-add-ons=nptl,libidn,../ports' option tells EGLIBC to look | ||
117 | +for the listed glibc add-ons. Most notably the ports add-on (located | ||
118 | +just above the libc sources in the EGLIBC svn tree) is required to | ||
119 | +support ARM targets. | ||
120 | + | ||
121 | We can now use the 'install-headers' makefile target to install the | ||
122 | headers: | ||
123 | |||
124 | @@ -223,6 +233,7 @@ | ||
125 | > --prefix=$tools \ | ||
126 | > --with-sysroot=$sysroot \ | ||
127 | > --disable-libssp --disable-libgomp --disable-libmudflap \ | ||
128 | + > --disable-libffi --disable-libquadmath \ | ||
129 | > --enable-languages=c | ||
130 | $ PATH=$tools/bin:$PATH make | ||
131 | $ PATH=$tools/bin:$PATH make install | ||
132 | @@ -240,13 +251,14 @@ | ||
133 | > CXX=$tools/bin/$target-g++ \ | ||
134 | > AR=$tools/bin/$target-ar \ | ||
135 | > RANLIB=$tools/bin/$target-ranlib \ | ||
136 | - > $src/libc/configure \ | ||
137 | + > $src/eglibc/libc/configure \ | ||
138 | > --prefix=/usr \ | ||
139 | > --with-headers=$sysroot/usr/include \ | ||
140 | > --with-kconfig=$obj/linux/scripts/kconfig \ | ||
141 | > --build=$build \ | ||
142 | > --host=$target \ | ||
143 | - > --disable-profile --without-gd --without-cvs --enable-add-ons | ||
144 | + > --disable-profile --without-gd --without-cvs \ | ||
145 | + > --enable-add-ons=nptl,libidn,../ports | ||
146 | |||
147 | Note the additional '--with-kconfig' option. This tells EGLIBC where to | ||
148 | find the host config tools used by the kernel 'make config' and 'make | ||
149 | @@ -337,15 +349,15 @@ | ||
150 | ELF Header: | ||
151 | ... | ||
152 | Type: EXEC (Executable file) | ||
153 | - Machine: PowerPC | ||
154 | + Machine: ARM | ||
155 | |||
156 | ... | ||
157 | Program Headers: | ||
158 | Type Offset VirtAddr PhysAddr FileSiz MemSiz Flg Align | ||
159 | PHDR 0x000034 0x10000034 0x10000034 0x00100 0x00100 R E 0x4 | ||
160 | - INTERP 0x000134 0x10000134 0x10000134 0x0000d 0x0000d R 0x1 | ||
161 | - [Requesting program interpreter: /lib/ld.so.1] | ||
162 | - LOAD 0x000000 0x10000000 0x10000000 0x008f0 0x008f0 R E 0x10000 | ||
163 | + INTERP 0x000134 0x00008134 0x00008134 0x00013 0x00013 R 0x1 | ||
164 | + [Requesting program interpreter: /lib/ld-linux.so.3] | ||
165 | + LOAD 0x000000 0x00008000 0x00008000 0x0042c 0x0042c R E 0x8000 | ||
166 | ... | ||
167 | |||
168 | Looking at the dynamic section of the installed 'libgcc_s.so', we see | ||
169 | @@ -357,7 +369,6 @@ | ||
170 | Dynamic section at offset 0x1083c contains 24 entries: | ||
171 | Tag Type Name/Value | ||
172 | 0x00000001 (NEEDED) Shared library: [libc.so.6] | ||
173 | - 0x00000001 (NEEDED) Shared library: [ld.so.1] | ||
174 | 0x0000000e (SONAME) Library soname: [libgcc_s.so.1] | ||
175 | ... | ||
176 | |||
diff --git a/meta/recipes-core/eglibc/eglibc-2.18/GLRO_dl_debug_mask.patch b/meta/recipes-core/eglibc/eglibc-2.18/GLRO_dl_debug_mask.patch new file mode 100644 index 0000000000..7258c82418 --- /dev/null +++ b/meta/recipes-core/eglibc/eglibc-2.18/GLRO_dl_debug_mask.patch | |||
@@ -0,0 +1,143 @@ | |||
1 | Its controlled by __OPTION_EGLIBC_RTLD_DEBUG | ||
2 | so we should use GLRO_dl_debug_mask | ||
3 | |||
4 | Singed-off-by: Khem Raj <raj.khem@gmail.com> | ||
5 | |||
6 | Upstream-Status: Pending | ||
7 | Index: libc/elf/dl-open.c | ||
8 | =================================================================== | ||
9 | --- libc.orig/elf/dl-open.c 2012-10-25 10:18:12.000000000 -0700 | ||
10 | +++ libc/elf/dl-open.c 2013-01-09 11:49:02.635577870 -0800 | ||
11 | @@ -155,7 +155,7 @@ | ||
12 | ns->_ns_main_searchlist->r_list[new_nlist++] = map; | ||
13 | |||
14 | /* We modify the global scope. Report this. */ | ||
15 | - if (__builtin_expect (GLRO(dl_debug_mask) & DL_DEBUG_SCOPES, 0)) | ||
16 | + if (__builtin_expect (GLRO_dl_debug_mask & DL_DEBUG_SCOPES, 0)) | ||
17 | _dl_debug_printf ("\nadd %s [%lu] to global scope\n", | ||
18 | map->l_name, map->l_ns); | ||
19 | } | ||
20 | @@ -298,7 +298,7 @@ | ||
21 | LIBC_PROBE (map_complete, 3, args->nsid, r, new); | ||
22 | |||
23 | /* Print scope information. */ | ||
24 | - if (__builtin_expect (GLRO(dl_debug_mask) & DL_DEBUG_SCOPES, 0)) | ||
25 | + if (__builtin_expect (GLRO_dl_debug_mask & DL_DEBUG_SCOPES, 0)) | ||
26 | _dl_show_scope (new, 0); | ||
27 | |||
28 | /* Only do lazy relocation if `LD_BIND_NOW' is not set. */ | ||
29 | @@ -515,7 +515,7 @@ | ||
30 | } | ||
31 | |||
32 | /* Print scope information. */ | ||
33 | - if (__builtin_expect (GLRO(dl_debug_mask) & DL_DEBUG_SCOPES, 0)) | ||
34 | + if (__builtin_expect (GLRO_dl_debug_mask & DL_DEBUG_SCOPES, 0)) | ||
35 | _dl_show_scope (imap, from_scope); | ||
36 | } | ||
37 | |||
38 | Index: libc/ports/sysdeps/mips/dl-lookup.c | ||
39 | =================================================================== | ||
40 | --- libc.orig/ports/sysdeps/mips/dl-lookup.c 2012-08-17 12:39:53.000000000 -0700 | ||
41 | +++ libc/ports/sysdeps/mips/dl-lookup.c 2013-01-09 11:49:02.635577870 -0800 | ||
42 | @@ -111,7 +111,7 @@ | ||
43 | continue; | ||
44 | |||
45 | /* Print some debugging info if wanted. */ | ||
46 | - if (__builtin_expect (GLRO(dl_debug_mask) & DL_DEBUG_SYMBOLS, 0)) | ||
47 | + if (__builtin_expect (GLRO_dl_debug_mask & DL_DEBUG_SYMBOLS, 0)) | ||
48 | _dl_debug_printf ("symbol=%s; lookup in file=%s [%lu]\n", | ||
49 | undef_name, | ||
50 | map->l_name[0] ? map->l_name : rtld_progname, | ||
51 | @@ -432,7 +432,7 @@ | ||
52 | hash table. */ | ||
53 | if (__builtin_expect (tab->size, 0)) | ||
54 | { | ||
55 | - assert (GLRO(dl_debug_mask) & DL_DEBUG_PRELINK); | ||
56 | + assert (GLRO_dl_debug_mask & DL_DEBUG_PRELINK); | ||
57 | __rtld_lock_unlock_recursive (tab->lock); | ||
58 | goto success; | ||
59 | } | ||
60 | @@ -681,7 +681,7 @@ | ||
61 | } | ||
62 | |||
63 | /* Display information if we are debugging. */ | ||
64 | - if (__builtin_expect (GLRO(dl_debug_mask) & DL_DEBUG_FILES, 0)) | ||
65 | + if (__builtin_expect (GLRO_dl_debug_mask & DL_DEBUG_FILES, 0)) | ||
66 | _dl_debug_printf ("\ | ||
67 | \nfile=%s [%lu]; needed by %s [%lu] (relocation dependency)\n\n", | ||
68 | map->l_name[0] ? map->l_name : rtld_progname, | ||
69 | @@ -788,7 +788,7 @@ | ||
70 | { | ||
71 | if ((*ref == NULL || ELFW(ST_BIND) ((*ref)->st_info) != STB_WEAK) | ||
72 | && skip_map == NULL | ||
73 | - && !(GLRO(dl_debug_mask) & DL_DEBUG_UNUSED)) | ||
74 | + && !(GLRO_dl_debug_mask & DL_DEBUG_UNUSED)) | ||
75 | { | ||
76 | /* We could find no value for a strong reference. */ | ||
77 | const char *reference_name = undef_map ? undef_map->l_name : ""; | ||
78 | @@ -861,7 +861,7 @@ | ||
79 | if (__builtin_expect (current_value.m->l_used == 0, 0)) | ||
80 | current_value.m->l_used = 1; | ||
81 | |||
82 | - if (__builtin_expect (GLRO(dl_debug_mask) | ||
83 | + if (__builtin_expect (GLRO_dl_debug_mask | ||
84 | & (DL_DEBUG_BINDINGS|DL_DEBUG_PRELINK), 0)) | ||
85 | _dl_debug_bindings (undef_name, undef_map, ref, | ||
86 | ¤t_value, version, type_class, protected); | ||
87 | @@ -926,7 +926,7 @@ | ||
88 | { | ||
89 | const char *reference_name = undef_map->l_name; | ||
90 | |||
91 | - if (GLRO(dl_debug_mask) & DL_DEBUG_BINDINGS) | ||
92 | + if (GLRO_dl_debug_mask & DL_DEBUG_BINDINGS) | ||
93 | { | ||
94 | _dl_debug_printf ("binding file %s [%lu] to %s [%lu]: %s symbol `%s'", | ||
95 | (reference_name[0] | ||
96 | @@ -942,7 +942,7 @@ | ||
97 | _dl_debug_printf_c ("\n"); | ||
98 | } | ||
99 | #ifdef SHARED | ||
100 | - if (GLRO(dl_debug_mask) & DL_DEBUG_PRELINK) | ||
101 | + if (GLRO_dl_debug_mask & DL_DEBUG_PRELINK) | ||
102 | { | ||
103 | int conflict = 0; | ||
104 | struct sym_val val = { NULL, NULL }; | ||
105 | Index: libc/elf/rtld.c | ||
106 | =================================================================== | ||
107 | --- libc.orig/elf/rtld.c 2012-10-10 08:35:46.000000000 -0700 | ||
108 | +++ libc/elf/rtld.c 2013-01-09 11:49:02.635577870 -0800 | ||
109 | @@ -2118,7 +2118,7 @@ | ||
110 | GLRO(dl_init_all_dirs) = GL(dl_all_dirs); | ||
111 | |||
112 | /* Print scope information. */ | ||
113 | - if (__builtin_expect (GLRO(dl_debug_mask) & DL_DEBUG_SCOPES, 0)) | ||
114 | + if (__builtin_expect (GLRO_dl_debug_mask & DL_DEBUG_SCOPES, 0)) | ||
115 | { | ||
116 | _dl_debug_printf ("\nInitial object scopes\n"); | ||
117 | |||
118 | Index: libc/elf/dl-lookup.c | ||
119 | =================================================================== | ||
120 | --- libc.orig/elf/dl-lookup.c 2012-08-17 12:39:53.000000000 -0700 | ||
121 | +++ libc/elf/dl-lookup.c 2013-01-09 11:49:02.635577870 -0800 | ||
122 | @@ -771,7 +771,7 @@ | ||
123 | { | ||
124 | if ((*ref == NULL || ELFW(ST_BIND) ((*ref)->st_info) != STB_WEAK) | ||
125 | && skip_map == NULL | ||
126 | - && !(GLRO(dl_debug_mask) & DL_DEBUG_UNUSED)) | ||
127 | + && !(GLRO_dl_debug_mask & DL_DEBUG_UNUSED)) | ||
128 | { | ||
129 | /* We could find no value for a strong reference. */ | ||
130 | const char *reference_name = undef_map ? undef_map->l_name : ""; | ||
131 | Index: libc/elf/get-dynamic-info.h | ||
132 | =================================================================== | ||
133 | --- libc.orig/elf/get-dynamic-info.h 2012-12-02 13:11:45.000000000 -0800 | ||
134 | +++ libc/elf/get-dynamic-info.h 2013-01-09 12:53:51.015657653 -0800 | ||
135 | @@ -157,7 +157,7 @@ | ||
136 | them. Therefore to avoid breaking existing applications the | ||
137 | best we can do is add a warning during debugging with the | ||
138 | intent of notifying the user of the problem. */ | ||
139 | - if (__builtin_expect (GLRO(dl_debug_mask) & DL_DEBUG_FILES, 0) | ||
140 | + if (__builtin_expect (GLRO_dl_debug_mask & DL_DEBUG_FILES, 0) | ||
141 | && l->l_flags_1 & ~DT_1_SUPPORTED_MASK) | ||
142 | _dl_debug_printf ("\nWARNING: Unsupported flag value(s) of 0x%x in DT_FLAGS_1.\n", | ||
143 | l->l_flags_1 & ~DT_1_SUPPORTED_MASK); | ||
diff --git a/meta/recipes-core/eglibc/eglibc-2.18/IO-acquire-lock-fix.patch b/meta/recipes-core/eglibc/eglibc-2.18/IO-acquire-lock-fix.patch new file mode 100644 index 0000000000..cf5803585c --- /dev/null +++ b/meta/recipes-core/eglibc/eglibc-2.18/IO-acquire-lock-fix.patch | |||
@@ -0,0 +1,17 @@ | |||
1 | import http://sourceware.org/ml/libc-ports/2007-12/msg00000.html | ||
2 | |||
3 | Upstream-Status: Pending | ||
4 | |||
5 | Index: libc/bits/stdio-lock.h | ||
6 | =================================================================== | ||
7 | --- libc.orig/bits/stdio-lock.h 2009-10-28 14:34:19.000000000 -0700 | ||
8 | +++ libc/bits/stdio-lock.h 2009-10-28 14:34:54.000000000 -0700 | ||
9 | @@ -50,6 +50,8 @@ __libc_lock_define_recursive (typedef, _ | ||
10 | _IO_cleanup_region_start ((void (*) (void *)) _IO_funlockfile, (_fp)); \ | ||
11 | _IO_flockfile (_fp) | ||
12 | |||
13 | +# define _IO_acquire_lock_clear_flags2(_fp) _IO_acquire_lock (_fp) | ||
14 | + | ||
15 | # define _IO_release_lock(_fp) \ | ||
16 | _IO_funlockfile (_fp); \ | ||
17 | _IO_cleanup_region_end (0) | ||
diff --git a/meta/recipes-core/eglibc/eglibc-2.18/add_resource_h_to_wait_h.patch b/meta/recipes-core/eglibc/eglibc-2.18/add_resource_h_to_wait_h.patch new file mode 100644 index 0000000000..f5023c08d4 --- /dev/null +++ b/meta/recipes-core/eglibc/eglibc-2.18/add_resource_h_to_wait_h.patch | |||
@@ -0,0 +1,20 @@ | |||
1 | The older versions of perf still require sys/resource.h to be | ||
2 | present in this header, the newer version of perf in 3.2 and | ||
3 | beyond directly include sys/resource.h | ||
4 | |||
5 | Upstream-Status: Inapproriate [older kernel/perf specific] | ||
6 | |||
7 | Signed-off-by: Saul Wold <sgw@linux.intel.com> | ||
8 | |||
9 | Index: libc/posix/sys/wait.h | ||
10 | =================================================================== | ||
11 | --- libc.orig/posix/sys/wait.h | ||
12 | +++ libc/posix/sys/wait.h | ||
13 | @@ -28,6 +28,7 @@ | ||
14 | __BEGIN_DECLS | ||
15 | |||
16 | #include <signal.h> | ||
17 | +#include <sys/resource.h> | ||
18 | |||
19 | /* These macros could also be defined in <stdlib.h>. */ | ||
20 | #if !defined _STDLIB_H || (!defined __USE_XOPEN && !defined __USE_XOPEN2K8) | ||
diff --git a/meta/recipes-core/eglibc/eglibc-2.18/eglibc-svn-arm-lowlevellock-include-tls.patch b/meta/recipes-core/eglibc/eglibc-2.18/eglibc-svn-arm-lowlevellock-include-tls.patch new file mode 100644 index 0000000000..4313aa5197 --- /dev/null +++ b/meta/recipes-core/eglibc/eglibc-2.18/eglibc-svn-arm-lowlevellock-include-tls.patch | |||
@@ -0,0 +1,21 @@ | |||
1 | In file included from ../nptl/sysdeps/unix/sysv/linux/libc-lowlevellock.c:21: | ||
2 | ../nptl/sysdeps/unix/sysv/linux/lowlevellock.c: In function '__lll_lock_wait_private': | ||
3 | ../nptl/sysdeps/unix/sysv/linux/lowlevellock.c:34: warning: implicit declaration of function 'THREAD_GETMEM' | ||
4 | ../nptl/sysdeps/unix/sysv/linux/lowlevellock.c:34: error: 'THREAD_SELF' undeclared (first use in this function) | ||
5 | ../nptl/sysdeps/unix/sysv/linux/lowlevellock.c:34: error: (Each undeclared identifier is reported only once | ||
6 | ../nptl/sysdeps/unix/sysv/linux/lowlevellock.c:34: error: for each function it appears in.) | ||
7 | ../nptl/sysdeps/unix/sysv/linux/lowlevellock.c:34: error: 'header' undeclared (first use in this function) | ||
8 | make[4]: *** [/var/tmp/portage/sys-libs/glibc-2.7-r1/work/build-default-armv4l-unknown-linux-gnu-nptl/nptl/rtld-libc-lowlevellock.os] Error 1 | ||
9 | |||
10 | Upstream-Status: Pending | ||
11 | |||
12 | --- libc/ports/sysdeps/unix/sysv/linux/arm/nptl/lowlevellock.h.orig | ||
13 | +++ libc/ports/sysdeps/unix/sysv/linux/arm/nptl/lowlevellock.h | ||
14 | @@ -25,6 +25,7 @@ | ||
15 | #include <atomic.h> | ||
16 | #include <sysdep.h> | ||
17 | #include <kernel-features.h> | ||
18 | +#include <tls.h> | ||
19 | |||
20 | #define FUTEX_WAIT 0 | ||
21 | #define FUTEX_WAKE 1 | ||
diff --git a/meta/recipes-core/eglibc/eglibc-2.18/eglibc_fix_findidx_parameters.patch b/meta/recipes-core/eglibc/eglibc-2.18/eglibc_fix_findidx_parameters.patch new file mode 100644 index 0000000000..bbf4605505 --- /dev/null +++ b/meta/recipes-core/eglibc/eglibc-2.18/eglibc_fix_findidx_parameters.patch | |||
@@ -0,0 +1,38 @@ | |||
1 | Upstream-Status: backport | ||
2 | |||
3 | Imported patch from: http://www.eglibc.org/archives/patches/msg01124.html | ||
4 | |||
5 | Signed-Off-By: Nitin A Kamble <nitin.a.kamble@intel.com> | ||
6 | 2012/05/09 | ||
7 | |||
8 | Index: libc/posix/xregex.c | ||
9 | =================================================================== | ||
10 | --- libc.orig/posix/xregex.c | ||
11 | +++ libc/posix/xregex.c | ||
12 | @@ -2943,7 +2943,7 @@ PREFIX(regex_compile) (const char *ARG_P | ||
13 | _NL_CURRENT (LC_COLLATE, | ||
14 | _NL_COLLATE_INDIRECTWC); | ||
15 | |||
16 | - idx = findidx ((const wint_t**)&cp); | ||
17 | + idx = findidx ((const wint_t**)&cp, -1); | ||
18 | if (idx == 0 || cp < (wint_t*) str + c1) | ||
19 | /* This is no valid character. */ | ||
20 | FREE_STACK_RETURN (REG_ECOLLATE); | ||
21 | @@ -3392,7 +3392,7 @@ PREFIX(regex_compile) (const char *ARG_P | ||
22 | indirect = (const int32_t *) | ||
23 | _NL_CURRENT (LC_COLLATE, _NL_COLLATE_INDIRECTMB); | ||
24 | |||
25 | - idx = findidx (&cp); | ||
26 | + idx = findidx (&cp, -1); | ||
27 | if (idx == 0 || cp < str + c1) | ||
28 | /* This is no valid character. */ | ||
29 | FREE_STACK_RETURN (REG_ECOLLATE); | ||
30 | @@ -6363,7 +6363,7 @@ byte_re_match_2_internal (struct re_patt | ||
31 | } | ||
32 | str_buf[i] = TRANSLATE(*(d+i)); | ||
33 | str_buf[i+1] = '\0'; /* sentinel */ | ||
34 | - idx2 = findidx ((const wint_t**)&cp); | ||
35 | + idx2 = findidx ((const wint_t**)&cp, -1); | ||
36 | } | ||
37 | |||
38 | /* Update d, however d will be incremented at | ||
diff --git a/meta/recipes-core/eglibc/eglibc-2.18/etc/ld.so.conf b/meta/recipes-core/eglibc/eglibc-2.18/etc/ld.so.conf new file mode 100644 index 0000000000..e69de29bb2 --- /dev/null +++ b/meta/recipes-core/eglibc/eglibc-2.18/etc/ld.so.conf | |||
diff --git a/meta/recipes-core/eglibc/eglibc-2.18/fileops-without-wchar-io.patch b/meta/recipes-core/eglibc/eglibc-2.18/fileops-without-wchar-io.patch new file mode 100644 index 0000000000..2ca0bca248 --- /dev/null +++ b/meta/recipes-core/eglibc/eglibc-2.18/fileops-without-wchar-io.patch | |||
@@ -0,0 +1,22 @@ | |||
1 | Fix error like | ||
2 | |||
3 | /home/kraj/work/angstrom/sources/openembedded-core/build/tmp-eglibc/work/mips64-oe-linux/eglibc-2.16-r2+svnr19383/build-mips64-oe-linux/libc_pic.os: In function `_IO_new_file_fopen': | ||
4 | /home/kraj/work/angstrom/sources/openembedded-core/build/tmp-eglibc/work/mips64-oe-linux/eglibc-2.16-r2+svnr19383/eglibc-2_16/libc/libio/fileops.c:431: undefined reference to `_IO_file_close_it_internal' | ||
5 | collect2: error: ld returned 1 exit status | ||
6 | |||
7 | |||
8 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
9 | Upstream-Status: Pending | ||
10 | Index: libc/libio/fileops.c | ||
11 | =================================================================== | ||
12 | --- libc.orig/libio/fileops.c 2012-07-04 18:25:47.000000000 -0700 | ||
13 | +++ libc/libio/fileops.c 2012-07-24 00:21:17.220322557 -0700 | ||
14 | @@ -428,7 +428,7 @@ | ||
15 | result->_mode = 1; | ||
16 | #else | ||
17 | /* Treat this as if we couldn't find the given character set. */ | ||
18 | - (void) INTUSE(_IO_file_close_it) (fp); | ||
19 | + (void) _IO_file_close_it (fp); | ||
20 | __set_errno (EINVAL); | ||
21 | return NULL; | ||
22 | #endif | ||
diff --git a/meta/recipes-core/eglibc/eglibc-2.18/fix-tibetian-locales.patch b/meta/recipes-core/eglibc/eglibc-2.18/fix-tibetian-locales.patch new file mode 100644 index 0000000000..25c43a9fe6 --- /dev/null +++ b/meta/recipes-core/eglibc/eglibc-2.18/fix-tibetian-locales.patch | |||
@@ -0,0 +1,38 @@ | |||
1 | cross localedef fails to compile these locales because name_fmt field is empty | ||
2 | It is not acceptable for cross localedef and it errors out | ||
3 | |||
4 | LC_NAME: field `name_fmt' not defined | ||
5 | |||
6 | We therefore give a dummy string to the format, the real fix needs some native | ||
7 | tibetian person to define proper name_fmt | ||
8 | |||
9 | Upstream-Status: Pending | ||
10 | |||
11 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
12 | |||
13 | Index: libc/localedata/locales/bo_CN | ||
14 | =================================================================== | ||
15 | --- libc.orig/localedata/locales/bo_CN 2012-11-17 09:50:14.000000000 -0800 | ||
16 | +++ libc/localedata/locales/bo_CN 2013-01-04 08:55:15.593612288 -0800 | ||
17 | @@ -145,7 +145,7 @@ | ||
18 | LC_NAME | ||
19 | % FIXME | ||
20 | |||
21 | -name_fmt "" | ||
22 | +name_fmt "FIXME" | ||
23 | % name_gen "FIXME" | ||
24 | % name_miss "FIXME" | ||
25 | % name_mr "FIXME" | ||
26 | Index: libc/localedata/locales/bo_IN | ||
27 | =================================================================== | ||
28 | --- libc.orig/localedata/locales/bo_IN 2012-11-17 09:50:14.000000000 -0800 | ||
29 | +++ libc/localedata/locales/bo_IN 2013-01-04 08:54:12.345609028 -0800 | ||
30 | @@ -70,7 +70,7 @@ | ||
31 | |||
32 | LC_NAME | ||
33 | % FIXME | ||
34 | -name_fmt "" | ||
35 | +name_fmt "FIXME" | ||
36 | % name_gen "FIXME" | ||
37 | % name_miss "FIXME" | ||
38 | % name_mr "FIXME" | ||
diff --git a/meta/recipes-core/eglibc/eglibc-2.18/fix_for_centos_5.8.patch b/meta/recipes-core/eglibc/eglibc-2.18/fix_for_centos_5.8.patch new file mode 100644 index 0000000000..7618c99534 --- /dev/null +++ b/meta/recipes-core/eglibc/eglibc-2.18/fix_for_centos_5.8.patch | |||
@@ -0,0 +1,18 @@ | |||
1 | Upstream-Status: Inappropriate [other] | ||
2 | |||
3 | This is a hack to fix building the locale bits on an older | ||
4 | CentOs 5.X machine | ||
5 | |||
6 | Index: eglibc-2_16/libc/locale/programs/config.h | ||
7 | =================================================================== | ||
8 | --- eglibc-2_16.orig/libc/locale/programs/config.h | ||
9 | +++ eglibc-2_16/libc/locale/programs/config.h | ||
10 | @@ -19,6 +19,8 @@ | ||
11 | #ifndef _LD_CONFIG_H | ||
12 | #define _LD_CONFIG_H 1 | ||
13 | |||
14 | +#define DUMMY_LOCALE_T | ||
15 | + | ||
16 | /* Use the internal textdomain used for libc messages. */ | ||
17 | #define PACKAGE _libc_intl_domainname | ||
18 | #ifndef VERSION | ||
diff --git a/meta/recipes-core/eglibc/eglibc-2.18/fsl-ppc-no-fsqrt.patch b/meta/recipes-core/eglibc/eglibc-2.18/fsl-ppc-no-fsqrt.patch new file mode 100644 index 0000000000..511ee9d19e --- /dev/null +++ b/meta/recipes-core/eglibc/eglibc-2.18/fsl-ppc-no-fsqrt.patch | |||
@@ -0,0 +1,100 @@ | |||
1 | Create e5500 specific math_private.h and let it include when compiling for e5500/64bit core | ||
2 | We prefefine __CPU_HAS_FSQRT to 0 and then in general ppc64 math_private.h we check if its | ||
3 | already defined before redefining it. This way we can ensure that on e5500 builds it wont | ||
4 | emit fsqrt intructions | ||
5 | |||
6 | -Khem | ||
7 | |||
8 | Upstream-Status: Pending | ||
9 | |||
10 | Index: libc/sysdeps/powerpc/fpu/math_private.h | ||
11 | =================================================================== | ||
12 | --- libc.orig/sysdeps/powerpc/fpu/math_private.h | ||
13 | +++ libc/sysdeps/powerpc/fpu/math_private.h | ||
14 | @@ -25,10 +25,12 @@ | ||
15 | #include <dl-procinfo.h> | ||
16 | #include_next <math_private.h> | ||
17 | |||
18 | -# if __WORDSIZE == 64 || defined _ARCH_PWR4 | ||
19 | -# define __CPU_HAS_FSQRT 1 | ||
20 | -# else | ||
21 | -# define __CPU_HAS_FSQRT ((GLRO(dl_hwcap) & PPC_FEATURE_64) != 0) | ||
22 | +# ifndef __CPU_HAS_FSQRT | ||
23 | +# if __WORDSIZE == 64 || defined _ARCH_PWR4 | ||
24 | +# define __CPU_HAS_FSQRT 1 | ||
25 | +# else | ||
26 | +# define __CPU_HAS_FSQRT ((GLRO(dl_hwcap) & PPC_FEATURE_64) != 0) | ||
27 | +# endif | ||
28 | # endif | ||
29 | |||
30 | extern double __slow_ieee754_sqrt (double); | ||
31 | Index: libc/ports/sysdeps/powerpc/powerpc64/e5500/fpu/math_private.h | ||
32 | =================================================================== | ||
33 | --- /dev/null | ||
34 | +++ libc/ports/sysdeps/powerpc/powerpc64/e5500/fpu/math_private.h | ||
35 | @@ -0,0 +1,9 @@ | ||
36 | +#ifndef _E5500_MATH_PRIVATE_H_ | ||
37 | +#define _E5500_MATH_PRIVATE_H_ 1 | ||
38 | +/* E5500 core FPU does not implement | ||
39 | + fsqrt */ | ||
40 | + | ||
41 | +#define __CPU_HAS_FSQRT 0 | ||
42 | +#include_next <math_private.h> | ||
43 | + | ||
44 | +#endif /* _E5500_MATH_PRIVATE_H_ */ | ||
45 | Index: libc/ports/sysdeps/powerpc/powerpc64/e6500/fpu/math_private.h | ||
46 | =================================================================== | ||
47 | --- /dev/null | ||
48 | +++ libc/ports/sysdeps/powerpc/powerpc64/e6500/fpu/math_private.h | ||
49 | @@ -0,0 +1,9 @@ | ||
50 | +#ifndef _E6500_MATH_PRIVATE_H_ | ||
51 | +#define _E6500_MATH_PRIVATE_H_ 1 | ||
52 | +/* E6500 core FPU does not implement | ||
53 | + fsqrt */ | ||
54 | + | ||
55 | +#define __CPU_HAS_FSQRT 0 | ||
56 | +#include_next <math_private.h> | ||
57 | + | ||
58 | +#endif /* _E6500_MATH_PRIVATE_H_ */ | ||
59 | Index: libc/ports/sysdeps/powerpc/powerpc32/e500mc/fpu/math_private.h | ||
60 | =================================================================== | ||
61 | --- /dev/null | ||
62 | +++ libc/ports/sysdeps/powerpc/powerpc32/e500mc/fpu/math_private.h | ||
63 | @@ -0,0 +1,9 @@ | ||
64 | +#ifndef _E500MC_MATH_PRIVATE_H_ | ||
65 | +#define _E500MC_MATH_PRIVATE_H_ 1 | ||
66 | +/* E500MC core FPU does not implement | ||
67 | + fsqrt */ | ||
68 | + | ||
69 | +#define __CPU_HAS_FSQRT 0 | ||
70 | +#include_next <math_private.h> | ||
71 | + | ||
72 | +#endif /* _E500MC_MATH_PRIVATE_H_ */ | ||
73 | Index: libc/ports/sysdeps/powerpc/powerpc32/e5500/fpu/math_private.h | ||
74 | =================================================================== | ||
75 | --- /dev/null | ||
76 | +++ libc/ports/sysdeps/powerpc/powerpc32/e5500/fpu/math_private.h | ||
77 | @@ -0,0 +1,9 @@ | ||
78 | +#ifndef _E5500_MATH_PRIVATE_H_ | ||
79 | +#define _E5500_MATH_PRIVATE_H_ 1 | ||
80 | +/* E5500 core FPU does not implement | ||
81 | + fsqrt */ | ||
82 | + | ||
83 | +#define __CPU_HAS_FSQRT 0 | ||
84 | +#include_next <math_private.h> | ||
85 | + | ||
86 | +#endif /* _E5500_MATH_PRIVATE_H_ */ | ||
87 | Index: libc/ports/sysdeps/powerpc/powerpc32/e6500/fpu/math_private.h | ||
88 | =================================================================== | ||
89 | --- /dev/null | ||
90 | +++ libc/ports/sysdeps/powerpc/powerpc32/e6500/fpu/math_private.h | ||
91 | @@ -0,0 +1,9 @@ | ||
92 | +#ifndef _E6500_MATH_PRIVATE_H_ | ||
93 | +#define _E6500_MATH_PRIVATE_H_ 1 | ||
94 | +/* E6500 core FPU does not implement | ||
95 | + fsqrt */ | ||
96 | + | ||
97 | +#define __CPU_HAS_FSQRT 0 | ||
98 | +#include_next <math_private.h> | ||
99 | + | ||
100 | +#endif /* _E6500_MATH_PRIVATE_H_ */ | ||
diff --git a/meta/recipes-core/eglibc/eglibc-2.18/generate-supported.mk b/meta/recipes-core/eglibc/eglibc-2.18/generate-supported.mk new file mode 100644 index 0000000000..d2a28c2dc6 --- /dev/null +++ b/meta/recipes-core/eglibc/eglibc-2.18/generate-supported.mk | |||
@@ -0,0 +1,11 @@ | |||
1 | #!/usr/bin/make | ||
2 | |||
3 | include $(IN) | ||
4 | |||
5 | all: | ||
6 | rm -f $(OUT) | ||
7 | touch $(OUT) | ||
8 | for locale in $(SUPPORTED-LOCALES); do \ | ||
9 | [ $$locale = true ] && continue; \ | ||
10 | echo $$locale | sed 's,/, ,' >> $(OUT); \ | ||
11 | done | ||
diff --git a/meta/recipes-core/eglibc/eglibc-2.18/glibc.fix_sqrt2.patch b/meta/recipes-core/eglibc/eglibc-2.18/glibc.fix_sqrt2.patch new file mode 100644 index 0000000000..a66972998c --- /dev/null +++ b/meta/recipes-core/eglibc/eglibc-2.18/glibc.fix_sqrt2.patch | |||
@@ -0,0 +1,1491 @@ | |||
1 | Signed-of-by: Edmar Wienskoski <edmar@freescale.com> | ||
2 | Upstream-Status: Pending | ||
3 | |||
4 | diff -ruN libc-orig/sysdeps/powerpc/powerpc32/603e/fpu/e_sqrt.c libc/sysdeps/powerpc/powerpc32/603e/fpu/e_sqrt.c | ||
5 | --- libc-orig/sysdeps/powerpc/powerpc32/603e/fpu/e_sqrt.c 1969-12-31 18:00:00.000000000 -0600 | ||
6 | +++ libc/sysdeps/powerpc/powerpc32/603e/fpu/e_sqrt.c 2012-06-14 14:51:50.452001745 -0500 | ||
7 | @@ -0,0 +1,134 @@ | ||
8 | +/* Double-precision floating point square root. | ||
9 | + Copyright (C) 2010 Free Software Foundation, Inc. | ||
10 | + This file is part of the GNU C Library. | ||
11 | + | ||
12 | + The GNU C Library is free software; you can redistribute it and/or | ||
13 | + modify it under the terms of the GNU Lesser General Public | ||
14 | + License as published by the Free Software Foundation; either | ||
15 | + version 2.1 of the License, or (at your option) any later version. | ||
16 | + | ||
17 | + The GNU C Library is distributed in the hope that it will be useful, | ||
18 | + but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
19 | + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
20 | + Lesser General Public License for more details. | ||
21 | + | ||
22 | + You should have received a copy of the GNU Lesser General Public | ||
23 | + License along with the GNU C Library; if not, write to the Free | ||
24 | + Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA | ||
25 | + 02111-1307 USA. */ | ||
26 | + | ||
27 | +#include <math.h> | ||
28 | +#include <math_private.h> | ||
29 | +#include <fenv_libc.h> | ||
30 | +#include <inttypes.h> | ||
31 | + | ||
32 | +#include <sysdep.h> | ||
33 | +#include <ldsodefs.h> | ||
34 | + | ||
35 | +static const ieee_float_shape_type a_nan = {.word = 0x7fc00000 }; | ||
36 | +static const ieee_float_shape_type a_inf = {.word = 0x7f800000 }; | ||
37 | +static const float two108 = 3.245185536584267269e+32; | ||
38 | +static const float twom54 = 5.551115123125782702e-17; | ||
39 | +static const float half = 0.5; | ||
40 | + | ||
41 | +/* The method is based on the descriptions in: | ||
42 | + | ||
43 | + _The Handbook of Floating-Pointer Arithmetic_ by Muller et al., chapter 5; | ||
44 | + _IA-64 and Elementary Functions: Speed and Precision_ by Markstein, chapter 9 | ||
45 | + | ||
46 | + We find the actual square root and half of its reciprocal | ||
47 | + simultaneously. */ | ||
48 | + | ||
49 | +#ifdef __STDC__ | ||
50 | +double | ||
51 | +__ieee754_sqrt (double b) | ||
52 | +#else | ||
53 | +double | ||
54 | +__ieee754_sqrt (b) | ||
55 | + double b; | ||
56 | +#endif | ||
57 | +{ | ||
58 | + if (__builtin_expect (b > 0, 1)) | ||
59 | + { | ||
60 | + double y, g, h, d, r; | ||
61 | + ieee_double_shape_type u; | ||
62 | + | ||
63 | + if (__builtin_expect (b != a_inf.value, 1)) | ||
64 | + { | ||
65 | + fenv_t fe; | ||
66 | + | ||
67 | + fe = fegetenv_register (); | ||
68 | + | ||
69 | + u.value = b; | ||
70 | + | ||
71 | + relax_fenv_state (); | ||
72 | + | ||
73 | + __asm__ ("frsqrte %[estimate], %[x]\n" | ||
74 | + : [estimate] "=f" (y) : [x] "f" (b)); | ||
75 | + | ||
76 | + /* Following Muller et al, page 168, equation 5.20. | ||
77 | + | ||
78 | + h goes to 1/(2*sqrt(b)) | ||
79 | + g goes to sqrt(b). | ||
80 | + | ||
81 | + We need three iterations to get within 1ulp. */ | ||
82 | + | ||
83 | + /* Indicate that these can be performed prior to the branch. GCC | ||
84 | + insists on sinking them below the branch, however; it seems like | ||
85 | + they'd be better before the branch so that we can cover any latency | ||
86 | + from storing the argument and loading its high word. Oh well. */ | ||
87 | + | ||
88 | + g = b * y; | ||
89 | + h = 0.5 * y; | ||
90 | + | ||
91 | + /* Handle small numbers by scaling. */ | ||
92 | + if (__builtin_expect ((u.parts.msw & 0x7ff00000) <= 0x02000000, 0)) | ||
93 | + return __ieee754_sqrt (b * two108) * twom54; | ||
94 | + | ||
95 | +#define FMADD(a_, c_, b_) \ | ||
96 | + ({ double __r; \ | ||
97 | + __asm__ ("fmadd %[r], %[a], %[c], %[b]\n" \ | ||
98 | + : [r] "=f" (__r) : [a] "f" (a_), [c] "f" (c_), [b] "f" (b_)); \ | ||
99 | + __r;}) | ||
100 | +#define FNMSUB(a_, c_, b_) \ | ||
101 | + ({ double __r; \ | ||
102 | + __asm__ ("fnmsub %[r], %[a], %[c], %[b]\n" \ | ||
103 | + : [r] "=f" (__r) : [a] "f" (a_), [c] "f" (c_), [b] "f" (b_)); \ | ||
104 | + __r;}) | ||
105 | + | ||
106 | + r = FNMSUB (g, h, half); | ||
107 | + g = FMADD (g, r, g); | ||
108 | + h = FMADD (h, r, h); | ||
109 | + | ||
110 | + r = FNMSUB (g, h, half); | ||
111 | + g = FMADD (g, r, g); | ||
112 | + h = FMADD (h, r, h); | ||
113 | + | ||
114 | + r = FNMSUB (g, h, half); | ||
115 | + g = FMADD (g, r, g); | ||
116 | + h = FMADD (h, r, h); | ||
117 | + | ||
118 | + /* g is now +/- 1ulp, or exactly equal to, the square root of b. */ | ||
119 | + | ||
120 | + /* Final refinement. */ | ||
121 | + d = FNMSUB (g, g, b); | ||
122 | + | ||
123 | + fesetenv_register (fe); | ||
124 | + return FMADD (d, h, g); | ||
125 | + } | ||
126 | + } | ||
127 | + else if (b < 0) | ||
128 | + { | ||
129 | + /* For some reason, some PowerPC32 processors don't implement | ||
130 | + FE_INVALID_SQRT. */ | ||
131 | +#ifdef FE_INVALID_SQRT | ||
132 | + feraiseexcept (FE_INVALID_SQRT); | ||
133 | + | ||
134 | + fenv_union_t u = { .fenv = fegetenv_register () }; | ||
135 | + if ((u.l[1] & FE_INVALID) == 0) | ||
136 | +#endif | ||
137 | + feraiseexcept (FE_INVALID); | ||
138 | + b = a_nan.value; | ||
139 | + } | ||
140 | + return f_wash (b); | ||
141 | +} | ||
142 | diff -ruN libc-orig/sysdeps/powerpc/powerpc32/603e/fpu/e_sqrtf.c libc/sysdeps/powerpc/powerpc32/603e/fpu/e_sqrtf.c | ||
143 | --- libc-orig/sysdeps/powerpc/powerpc32/603e/fpu/e_sqrtf.c 1969-12-31 18:00:00.000000000 -0600 | ||
144 | +++ libc/sysdeps/powerpc/powerpc32/603e/fpu/e_sqrtf.c 2012-06-14 14:51:50.452001745 -0500 | ||
145 | @@ -0,0 +1,101 @@ | ||
146 | +/* Single-precision floating point square root. | ||
147 | + Copyright (C) 2010 Free Software Foundation, Inc. | ||
148 | + This file is part of the GNU C Library. | ||
149 | + | ||
150 | + The GNU C Library is free software; you can redistribute it and/or | ||
151 | + modify it under the terms of the GNU Lesser General Public | ||
152 | + License as published by the Free Software Foundation; either | ||
153 | + version 2.1 of the License, or (at your option) any later version. | ||
154 | + | ||
155 | + The GNU C Library is distributed in the hope that it will be useful, | ||
156 | + but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
157 | + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
158 | + Lesser General Public License for more details. | ||
159 | + | ||
160 | + You should have received a copy of the GNU Lesser General Public | ||
161 | + License along with the GNU C Library; if not, write to the Free | ||
162 | + Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA | ||
163 | + 02111-1307 USA. */ | ||
164 | + | ||
165 | +#include <math.h> | ||
166 | +#include <math_private.h> | ||
167 | +#include <fenv_libc.h> | ||
168 | +#include <inttypes.h> | ||
169 | + | ||
170 | +#include <sysdep.h> | ||
171 | +#include <ldsodefs.h> | ||
172 | + | ||
173 | +static const ieee_float_shape_type a_nan = {.word = 0x7fc00000 }; | ||
174 | +static const ieee_float_shape_type a_inf = {.word = 0x7f800000 }; | ||
175 | +static const float threehalf = 1.5; | ||
176 | + | ||
177 | +/* The method is based on the descriptions in: | ||
178 | + | ||
179 | + _The Handbook of Floating-Pointer Arithmetic_ by Muller et al., chapter 5; | ||
180 | + _IA-64 and Elementary Functions: Speed and Precision_ by Markstein, chapter 9 | ||
181 | + | ||
182 | + We find the reciprocal square root and use that to compute the actual | ||
183 | + square root. */ | ||
184 | + | ||
185 | +#ifdef __STDC__ | ||
186 | +float | ||
187 | +__ieee754_sqrtf (float b) | ||
188 | +#else | ||
189 | +float | ||
190 | +__ieee754_sqrtf (b) | ||
191 | + float b; | ||
192 | +#endif | ||
193 | +{ | ||
194 | + if (__builtin_expect (b > 0, 1)) | ||
195 | + { | ||
196 | +#define FMSUB(a_, c_, b_) \ | ||
197 | + ({ double __r; \ | ||
198 | + __asm__ ("fmsub %[r], %[a], %[c], %[b]\n" \ | ||
199 | + : [r] "=f" (__r) : [a] "f" (a_), [c] "f" (c_), [b] "f" (b_)); \ | ||
200 | + __r;}) | ||
201 | +#define FNMSUB(a_, c_, b_) \ | ||
202 | + ({ double __r; \ | ||
203 | + __asm__ ("fnmsub %[r], %[a], %[c], %[b]\n" \ | ||
204 | + : [r] "=f" (__r) : [a] "f" (a_), [c] "f" (c_), [b] "f" (b_)); \ | ||
205 | + __r;}) | ||
206 | + | ||
207 | + if (__builtin_expect (b != a_inf.value, 1)) | ||
208 | + { | ||
209 | + double y, x; | ||
210 | + fenv_t fe; | ||
211 | + | ||
212 | + fe = fegetenv_register (); | ||
213 | + | ||
214 | + relax_fenv_state (); | ||
215 | + | ||
216 | + /* Compute y = 1.5 * b - b. Uses fewer constants than y = 0.5 * b. */ | ||
217 | + y = FMSUB (threehalf, b, b); | ||
218 | + | ||
219 | + /* Initial estimate. */ | ||
220 | + __asm__ ("frsqrte %[x], %[b]\n" : [x] "=f" (x) : [b] "f" (b)); | ||
221 | + | ||
222 | + /* Iterate. x_{n+1} = x_n * (1.5 - y * (x_n * x_n)). */ | ||
223 | + x = x * FNMSUB (y, x * x, threehalf); | ||
224 | + x = x * FNMSUB (y, x * x, threehalf); | ||
225 | + x = x * FNMSUB (y, x * x, threehalf); | ||
226 | + | ||
227 | + /* All done. */ | ||
228 | + fesetenv_register (fe); | ||
229 | + return x * b; | ||
230 | + } | ||
231 | + } | ||
232 | + else if (b < 0) | ||
233 | + { | ||
234 | + /* For some reason, some PowerPC32 processors don't implement | ||
235 | + FE_INVALID_SQRT. */ | ||
236 | +#ifdef FE_INVALID_SQRT | ||
237 | + feraiseexcept (FE_INVALID_SQRT); | ||
238 | + | ||
239 | + fenv_union_t u = { .fenv = fegetenv_register () }; | ||
240 | + if ((u.l[1] & FE_INVALID) == 0) | ||
241 | +#endif | ||
242 | + feraiseexcept (FE_INVALID); | ||
243 | + b = a_nan.value; | ||
244 | + } | ||
245 | + return f_washf (b); | ||
246 | +} | ||
247 | diff -ruN libc-orig/sysdeps/powerpc/powerpc32/e500mc/fpu/e_sqrt.c libc/sysdeps/powerpc/powerpc32/e500mc/fpu/e_sqrt.c | ||
248 | --- libc-orig/sysdeps/powerpc/powerpc32/e500mc/fpu/e_sqrt.c 1969-12-31 18:00:00.000000000 -0600 | ||
249 | +++ libc/sysdeps/powerpc/powerpc32/e500mc/fpu/e_sqrt.c 2012-06-14 14:55:14.749001061 -0500 | ||
250 | @@ -0,0 +1,134 @@ | ||
251 | +/* Double-precision floating point square root. | ||
252 | + Copyright (C) 2010 Free Software Foundation, Inc. | ||
253 | + This file is part of the GNU C Library. | ||
254 | + | ||
255 | + The GNU C Library is free software; you can redistribute it and/or | ||
256 | + modify it under the terms of the GNU Lesser General Public | ||
257 | + License as published by the Free Software Foundation; either | ||
258 | + version 2.1 of the License, or (at your option) any later version. | ||
259 | + | ||
260 | + The GNU C Library is distributed in the hope that it will be useful, | ||
261 | + but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
262 | + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
263 | + Lesser General Public License for more details. | ||
264 | + | ||
265 | + You should have received a copy of the GNU Lesser General Public | ||
266 | + License along with the GNU C Library; if not, write to the Free | ||
267 | + Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA | ||
268 | + 02111-1307 USA. */ | ||
269 | + | ||
270 | +#include <math.h> | ||
271 | +#include <math_private.h> | ||
272 | +#include <fenv_libc.h> | ||
273 | +#include <inttypes.h> | ||
274 | + | ||
275 | +#include <sysdep.h> | ||
276 | +#include <ldsodefs.h> | ||
277 | + | ||
278 | +static const ieee_float_shape_type a_nan = {.word = 0x7fc00000 }; | ||
279 | +static const ieee_float_shape_type a_inf = {.word = 0x7f800000 }; | ||
280 | +static const float two108 = 3.245185536584267269e+32; | ||
281 | +static const float twom54 = 5.551115123125782702e-17; | ||
282 | +static const float half = 0.5; | ||
283 | + | ||
284 | +/* The method is based on the descriptions in: | ||
285 | + | ||
286 | + _The Handbook of Floating-Pointer Arithmetic_ by Muller et al., chapter 5; | ||
287 | + _IA-64 and Elementary Functions: Speed and Precision_ by Markstein, chapter 9 | ||
288 | + | ||
289 | + We find the actual square root and half of its reciprocal | ||
290 | + simultaneously. */ | ||
291 | + | ||
292 | +#ifdef __STDC__ | ||
293 | +double | ||
294 | +__ieee754_sqrt (double b) | ||
295 | +#else | ||
296 | +double | ||
297 | +__ieee754_sqrt (b) | ||
298 | + double b; | ||
299 | +#endif | ||
300 | +{ | ||
301 | + if (__builtin_expect (b > 0, 1)) | ||
302 | + { | ||
303 | + double y, g, h, d, r; | ||
304 | + ieee_double_shape_type u; | ||
305 | + | ||
306 | + if (__builtin_expect (b != a_inf.value, 1)) | ||
307 | + { | ||
308 | + fenv_t fe; | ||
309 | + | ||
310 | + fe = fegetenv_register (); | ||
311 | + | ||
312 | + u.value = b; | ||
313 | + | ||
314 | + relax_fenv_state (); | ||
315 | + | ||
316 | + __asm__ ("frsqrte %[estimate], %[x]\n" | ||
317 | + : [estimate] "=f" (y) : [x] "f" (b)); | ||
318 | + | ||
319 | + /* Following Muller et al, page 168, equation 5.20. | ||
320 | + | ||
321 | + h goes to 1/(2*sqrt(b)) | ||
322 | + g goes to sqrt(b). | ||
323 | + | ||
324 | + We need three iterations to get within 1ulp. */ | ||
325 | + | ||
326 | + /* Indicate that these can be performed prior to the branch. GCC | ||
327 | + insists on sinking them below the branch, however; it seems like | ||
328 | + they'd be better before the branch so that we can cover any latency | ||
329 | + from storing the argument and loading its high word. Oh well. */ | ||
330 | + | ||
331 | + g = b * y; | ||
332 | + h = 0.5 * y; | ||
333 | + | ||
334 | + /* Handle small numbers by scaling. */ | ||
335 | + if (__builtin_expect ((u.parts.msw & 0x7ff00000) <= 0x02000000, 0)) | ||
336 | + return __ieee754_sqrt (b * two108) * twom54; | ||
337 | + | ||
338 | +#define FMADD(a_, c_, b_) \ | ||
339 | + ({ double __r; \ | ||
340 | + __asm__ ("fmadd %[r], %[a], %[c], %[b]\n" \ | ||
341 | + : [r] "=f" (__r) : [a] "f" (a_), [c] "f" (c_), [b] "f" (b_)); \ | ||
342 | + __r;}) | ||
343 | +#define FNMSUB(a_, c_, b_) \ | ||
344 | + ({ double __r; \ | ||
345 | + __asm__ ("fnmsub %[r], %[a], %[c], %[b]\n" \ | ||
346 | + : [r] "=f" (__r) : [a] "f" (a_), [c] "f" (c_), [b] "f" (b_)); \ | ||
347 | + __r;}) | ||
348 | + | ||
349 | + r = FNMSUB (g, h, half); | ||
350 | + g = FMADD (g, r, g); | ||
351 | + h = FMADD (h, r, h); | ||
352 | + | ||
353 | + r = FNMSUB (g, h, half); | ||
354 | + g = FMADD (g, r, g); | ||
355 | + h = FMADD (h, r, h); | ||
356 | + | ||
357 | + r = FNMSUB (g, h, half); | ||
358 | + g = FMADD (g, r, g); | ||
359 | + h = FMADD (h, r, h); | ||
360 | + | ||
361 | + /* g is now +/- 1ulp, or exactly equal to, the square root of b. */ | ||
362 | + | ||
363 | + /* Final refinement. */ | ||
364 | + d = FNMSUB (g, g, b); | ||
365 | + | ||
366 | + fesetenv_register (fe); | ||
367 | + return FMADD (d, h, g); | ||
368 | + } | ||
369 | + } | ||
370 | + else if (b < 0) | ||
371 | + { | ||
372 | + /* For some reason, some PowerPC32 processors don't implement | ||
373 | + FE_INVALID_SQRT. */ | ||
374 | +#ifdef FE_INVALID_SQRT | ||
375 | + feraiseexcept (FE_INVALID_SQRT); | ||
376 | + | ||
377 | + fenv_union_t u = { .fenv = fegetenv_register () }; | ||
378 | + if ((u.l[1] & FE_INVALID) == 0) | ||
379 | +#endif | ||
380 | + feraiseexcept (FE_INVALID); | ||
381 | + b = a_nan.value; | ||
382 | + } | ||
383 | + return f_wash (b); | ||
384 | +} | ||
385 | diff -ruN libc-orig/sysdeps/powerpc/powerpc32/e500mc/fpu/e_sqrtf.c libc/sysdeps/powerpc/powerpc32/e500mc/fpu/e_sqrtf.c | ||
386 | --- libc-orig/sysdeps/powerpc/powerpc32/e500mc/fpu/e_sqrtf.c 1969-12-31 18:00:00.000000000 -0600 | ||
387 | +++ libc/sysdeps/powerpc/powerpc32/e500mc/fpu/e_sqrtf.c 2012-06-14 14:55:14.749001061 -0500 | ||
388 | @@ -0,0 +1,101 @@ | ||
389 | +/* Single-precision floating point square root. | ||
390 | + Copyright (C) 2010 Free Software Foundation, Inc. | ||
391 | + This file is part of the GNU C Library. | ||
392 | + | ||
393 | + The GNU C Library is free software; you can redistribute it and/or | ||
394 | + modify it under the terms of the GNU Lesser General Public | ||
395 | + License as published by the Free Software Foundation; either | ||
396 | + version 2.1 of the License, or (at your option) any later version. | ||
397 | + | ||
398 | + The GNU C Library is distributed in the hope that it will be useful, | ||
399 | + but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
400 | + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
401 | + Lesser General Public License for more details. | ||
402 | + | ||
403 | + You should have received a copy of the GNU Lesser General Public | ||
404 | + License along with the GNU C Library; if not, write to the Free | ||
405 | + Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA | ||
406 | + 02111-1307 USA. */ | ||
407 | + | ||
408 | +#include <math.h> | ||
409 | +#include <math_private.h> | ||
410 | +#include <fenv_libc.h> | ||
411 | +#include <inttypes.h> | ||
412 | + | ||
413 | +#include <sysdep.h> | ||
414 | +#include <ldsodefs.h> | ||
415 | + | ||
416 | +static const ieee_float_shape_type a_nan = {.word = 0x7fc00000 }; | ||
417 | +static const ieee_float_shape_type a_inf = {.word = 0x7f800000 }; | ||
418 | +static const float threehalf = 1.5; | ||
419 | + | ||
420 | +/* The method is based on the descriptions in: | ||
421 | + | ||
422 | + _The Handbook of Floating-Pointer Arithmetic_ by Muller et al., chapter 5; | ||
423 | + _IA-64 and Elementary Functions: Speed and Precision_ by Markstein, chapter 9 | ||
424 | + | ||
425 | + We find the reciprocal square root and use that to compute the actual | ||
426 | + square root. */ | ||
427 | + | ||
428 | +#ifdef __STDC__ | ||
429 | +float | ||
430 | +__ieee754_sqrtf (float b) | ||
431 | +#else | ||
432 | +float | ||
433 | +__ieee754_sqrtf (b) | ||
434 | + float b; | ||
435 | +#endif | ||
436 | +{ | ||
437 | + if (__builtin_expect (b > 0, 1)) | ||
438 | + { | ||
439 | +#define FMSUB(a_, c_, b_) \ | ||
440 | + ({ double __r; \ | ||
441 | + __asm__ ("fmsub %[r], %[a], %[c], %[b]\n" \ | ||
442 | + : [r] "=f" (__r) : [a] "f" (a_), [c] "f" (c_), [b] "f" (b_)); \ | ||
443 | + __r;}) | ||
444 | +#define FNMSUB(a_, c_, b_) \ | ||
445 | + ({ double __r; \ | ||
446 | + __asm__ ("fnmsub %[r], %[a], %[c], %[b]\n" \ | ||
447 | + : [r] "=f" (__r) : [a] "f" (a_), [c] "f" (c_), [b] "f" (b_)); \ | ||
448 | + __r;}) | ||
449 | + | ||
450 | + if (__builtin_expect (b != a_inf.value, 1)) | ||
451 | + { | ||
452 | + double y, x; | ||
453 | + fenv_t fe; | ||
454 | + | ||
455 | + fe = fegetenv_register (); | ||
456 | + | ||
457 | + relax_fenv_state (); | ||
458 | + | ||
459 | + /* Compute y = 1.5 * b - b. Uses fewer constants than y = 0.5 * b. */ | ||
460 | + y = FMSUB (threehalf, b, b); | ||
461 | + | ||
462 | + /* Initial estimate. */ | ||
463 | + __asm__ ("frsqrte %[x], %[b]\n" : [x] "=f" (x) : [b] "f" (b)); | ||
464 | + | ||
465 | + /* Iterate. x_{n+1} = x_n * (1.5 - y * (x_n * x_n)). */ | ||
466 | + x = x * FNMSUB (y, x * x, threehalf); | ||
467 | + x = x * FNMSUB (y, x * x, threehalf); | ||
468 | + x = x * FNMSUB (y, x * x, threehalf); | ||
469 | + | ||
470 | + /* All done. */ | ||
471 | + fesetenv_register (fe); | ||
472 | + return x * b; | ||
473 | + } | ||
474 | + } | ||
475 | + else if (b < 0) | ||
476 | + { | ||
477 | + /* For some reason, some PowerPC32 processors don't implement | ||
478 | + FE_INVALID_SQRT. */ | ||
479 | +#ifdef FE_INVALID_SQRT | ||
480 | + feraiseexcept (FE_INVALID_SQRT); | ||
481 | + | ||
482 | + fenv_union_t u = { .fenv = fegetenv_register () }; | ||
483 | + if ((u.l[1] & FE_INVALID) == 0) | ||
484 | +#endif | ||
485 | + feraiseexcept (FE_INVALID); | ||
486 | + b = a_nan.value; | ||
487 | + } | ||
488 | + return f_washf (b); | ||
489 | +} | ||
490 | diff -ruN libc-orig/sysdeps/powerpc/powerpc32/e5500/fpu/e_sqrt.c libc/sysdeps/powerpc/powerpc32/e5500/fpu/e_sqrt.c | ||
491 | --- libc-orig/sysdeps/powerpc/powerpc32/e5500/fpu/e_sqrt.c 1969-12-31 18:00:00.000000000 -0600 | ||
492 | +++ libc/sysdeps/powerpc/powerpc32/e5500/fpu/e_sqrt.c 2012-06-14 14:55:21.812002270 -0500 | ||
493 | @@ -0,0 +1,134 @@ | ||
494 | +/* Double-precision floating point square root. | ||
495 | + Copyright (C) 2010 Free Software Foundation, Inc. | ||
496 | + This file is part of the GNU C Library. | ||
497 | + | ||
498 | + The GNU C Library is free software; you can redistribute it and/or | ||
499 | + modify it under the terms of the GNU Lesser General Public | ||
500 | + License as published by the Free Software Foundation; either | ||
501 | + version 2.1 of the License, or (at your option) any later version. | ||
502 | + | ||
503 | + The GNU C Library is distributed in the hope that it will be useful, | ||
504 | + but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
505 | + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
506 | + Lesser General Public License for more details. | ||
507 | + | ||
508 | + You should have received a copy of the GNU Lesser General Public | ||
509 | + License along with the GNU C Library; if not, write to the Free | ||
510 | + Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA | ||
511 | + 02111-1307 USA. */ | ||
512 | + | ||
513 | +#include <math.h> | ||
514 | +#include <math_private.h> | ||
515 | +#include <fenv_libc.h> | ||
516 | +#include <inttypes.h> | ||
517 | + | ||
518 | +#include <sysdep.h> | ||
519 | +#include <ldsodefs.h> | ||
520 | + | ||
521 | +static const ieee_float_shape_type a_nan = {.word = 0x7fc00000 }; | ||
522 | +static const ieee_float_shape_type a_inf = {.word = 0x7f800000 }; | ||
523 | +static const float two108 = 3.245185536584267269e+32; | ||
524 | +static const float twom54 = 5.551115123125782702e-17; | ||
525 | +static const float half = 0.5; | ||
526 | + | ||
527 | +/* The method is based on the descriptions in: | ||
528 | + | ||
529 | + _The Handbook of Floating-Pointer Arithmetic_ by Muller et al., chapter 5; | ||
530 | + _IA-64 and Elementary Functions: Speed and Precision_ by Markstein, chapter 9 | ||
531 | + | ||
532 | + We find the actual square root and half of its reciprocal | ||
533 | + simultaneously. */ | ||
534 | + | ||
535 | +#ifdef __STDC__ | ||
536 | +double | ||
537 | +__ieee754_sqrt (double b) | ||
538 | +#else | ||
539 | +double | ||
540 | +__ieee754_sqrt (b) | ||
541 | + double b; | ||
542 | +#endif | ||
543 | +{ | ||
544 | + if (__builtin_expect (b > 0, 1)) | ||
545 | + { | ||
546 | + double y, g, h, d, r; | ||
547 | + ieee_double_shape_type u; | ||
548 | + | ||
549 | + if (__builtin_expect (b != a_inf.value, 1)) | ||
550 | + { | ||
551 | + fenv_t fe; | ||
552 | + | ||
553 | + fe = fegetenv_register (); | ||
554 | + | ||
555 | + u.value = b; | ||
556 | + | ||
557 | + relax_fenv_state (); | ||
558 | + | ||
559 | + __asm__ ("frsqrte %[estimate], %[x]\n" | ||
560 | + : [estimate] "=f" (y) : [x] "f" (b)); | ||
561 | + | ||
562 | + /* Following Muller et al, page 168, equation 5.20. | ||
563 | + | ||
564 | + h goes to 1/(2*sqrt(b)) | ||
565 | + g goes to sqrt(b). | ||
566 | + | ||
567 | + We need three iterations to get within 1ulp. */ | ||
568 | + | ||
569 | + /* Indicate that these can be performed prior to the branch. GCC | ||
570 | + insists on sinking them below the branch, however; it seems like | ||
571 | + they'd be better before the branch so that we can cover any latency | ||
572 | + from storing the argument and loading its high word. Oh well. */ | ||
573 | + | ||
574 | + g = b * y; | ||
575 | + h = 0.5 * y; | ||
576 | + | ||
577 | + /* Handle small numbers by scaling. */ | ||
578 | + if (__builtin_expect ((u.parts.msw & 0x7ff00000) <= 0x02000000, 0)) | ||
579 | + return __ieee754_sqrt (b * two108) * twom54; | ||
580 | + | ||
581 | +#define FMADD(a_, c_, b_) \ | ||
582 | + ({ double __r; \ | ||
583 | + __asm__ ("fmadd %[r], %[a], %[c], %[b]\n" \ | ||
584 | + : [r] "=f" (__r) : [a] "f" (a_), [c] "f" (c_), [b] "f" (b_)); \ | ||
585 | + __r;}) | ||
586 | +#define FNMSUB(a_, c_, b_) \ | ||
587 | + ({ double __r; \ | ||
588 | + __asm__ ("fnmsub %[r], %[a], %[c], %[b]\n" \ | ||
589 | + : [r] "=f" (__r) : [a] "f" (a_), [c] "f" (c_), [b] "f" (b_)); \ | ||
590 | + __r;}) | ||
591 | + | ||
592 | + r = FNMSUB (g, h, half); | ||
593 | + g = FMADD (g, r, g); | ||
594 | + h = FMADD (h, r, h); | ||
595 | + | ||
596 | + r = FNMSUB (g, h, half); | ||
597 | + g = FMADD (g, r, g); | ||
598 | + h = FMADD (h, r, h); | ||
599 | + | ||
600 | + r = FNMSUB (g, h, half); | ||
601 | + g = FMADD (g, r, g); | ||
602 | + h = FMADD (h, r, h); | ||
603 | + | ||
604 | + /* g is now +/- 1ulp, or exactly equal to, the square root of b. */ | ||
605 | + | ||
606 | + /* Final refinement. */ | ||
607 | + d = FNMSUB (g, g, b); | ||
608 | + | ||
609 | + fesetenv_register (fe); | ||
610 | + return FMADD (d, h, g); | ||
611 | + } | ||
612 | + } | ||
613 | + else if (b < 0) | ||
614 | + { | ||
615 | + /* For some reason, some PowerPC32 processors don't implement | ||
616 | + FE_INVALID_SQRT. */ | ||
617 | +#ifdef FE_INVALID_SQRT | ||
618 | + feraiseexcept (FE_INVALID_SQRT); | ||
619 | + | ||
620 | + fenv_union_t u = { .fenv = fegetenv_register () }; | ||
621 | + if ((u.l[1] & FE_INVALID) == 0) | ||
622 | +#endif | ||
623 | + feraiseexcept (FE_INVALID); | ||
624 | + b = a_nan.value; | ||
625 | + } | ||
626 | + return f_wash (b); | ||
627 | +} | ||
628 | diff -ruN libc-orig/sysdeps/powerpc/powerpc32/e5500/fpu/e_sqrtf.c libc/sysdeps/powerpc/powerpc32/e5500/fpu/e_sqrtf.c | ||
629 | --- libc-orig/sysdeps/powerpc/powerpc32/e5500/fpu/e_sqrtf.c 1969-12-31 18:00:00.000000000 -0600 | ||
630 | +++ libc/sysdeps/powerpc/powerpc32/e5500/fpu/e_sqrtf.c 2012-06-14 14:55:21.812002270 -0500 | ||
631 | @@ -0,0 +1,101 @@ | ||
632 | +/* Single-precision floating point square root. | ||
633 | + Copyright (C) 2010 Free Software Foundation, Inc. | ||
634 | + This file is part of the GNU C Library. | ||
635 | + | ||
636 | + The GNU C Library is free software; you can redistribute it and/or | ||
637 | + modify it under the terms of the GNU Lesser General Public | ||
638 | + License as published by the Free Software Foundation; either | ||
639 | + version 2.1 of the License, or (at your option) any later version. | ||
640 | + | ||
641 | + The GNU C Library is distributed in the hope that it will be useful, | ||
642 | + but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
643 | + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
644 | + Lesser General Public License for more details. | ||
645 | + | ||
646 | + You should have received a copy of the GNU Lesser General Public | ||
647 | + License along with the GNU C Library; if not, write to the Free | ||
648 | + Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA | ||
649 | + 02111-1307 USA. */ | ||
650 | + | ||
651 | +#include <math.h> | ||
652 | +#include <math_private.h> | ||
653 | +#include <fenv_libc.h> | ||
654 | +#include <inttypes.h> | ||
655 | + | ||
656 | +#include <sysdep.h> | ||
657 | +#include <ldsodefs.h> | ||
658 | + | ||
659 | +static const ieee_float_shape_type a_nan = {.word = 0x7fc00000 }; | ||
660 | +static const ieee_float_shape_type a_inf = {.word = 0x7f800000 }; | ||
661 | +static const float threehalf = 1.5; | ||
662 | + | ||
663 | +/* The method is based on the descriptions in: | ||
664 | + | ||
665 | + _The Handbook of Floating-Pointer Arithmetic_ by Muller et al., chapter 5; | ||
666 | + _IA-64 and Elementary Functions: Speed and Precision_ by Markstein, chapter 9 | ||
667 | + | ||
668 | + We find the reciprocal square root and use that to compute the actual | ||
669 | + square root. */ | ||
670 | + | ||
671 | +#ifdef __STDC__ | ||
672 | +float | ||
673 | +__ieee754_sqrtf (float b) | ||
674 | +#else | ||
675 | +float | ||
676 | +__ieee754_sqrtf (b) | ||
677 | + float b; | ||
678 | +#endif | ||
679 | +{ | ||
680 | + if (__builtin_expect (b > 0, 1)) | ||
681 | + { | ||
682 | +#define FMSUB(a_, c_, b_) \ | ||
683 | + ({ double __r; \ | ||
684 | + __asm__ ("fmsub %[r], %[a], %[c], %[b]\n" \ | ||
685 | + : [r] "=f" (__r) : [a] "f" (a_), [c] "f" (c_), [b] "f" (b_)); \ | ||
686 | + __r;}) | ||
687 | +#define FNMSUB(a_, c_, b_) \ | ||
688 | + ({ double __r; \ | ||
689 | + __asm__ ("fnmsub %[r], %[a], %[c], %[b]\n" \ | ||
690 | + : [r] "=f" (__r) : [a] "f" (a_), [c] "f" (c_), [b] "f" (b_)); \ | ||
691 | + __r;}) | ||
692 | + | ||
693 | + if (__builtin_expect (b != a_inf.value, 1)) | ||
694 | + { | ||
695 | + double y, x; | ||
696 | + fenv_t fe; | ||
697 | + | ||
698 | + fe = fegetenv_register (); | ||
699 | + | ||
700 | + relax_fenv_state (); | ||
701 | + | ||
702 | + /* Compute y = 1.5 * b - b. Uses fewer constants than y = 0.5 * b. */ | ||
703 | + y = FMSUB (threehalf, b, b); | ||
704 | + | ||
705 | + /* Initial estimate. */ | ||
706 | + __asm__ ("frsqrte %[x], %[b]\n" : [x] "=f" (x) : [b] "f" (b)); | ||
707 | + | ||
708 | + /* Iterate. x_{n+1} = x_n * (1.5 - y * (x_n * x_n)). */ | ||
709 | + x = x * FNMSUB (y, x * x, threehalf); | ||
710 | + x = x * FNMSUB (y, x * x, threehalf); | ||
711 | + x = x * FNMSUB (y, x * x, threehalf); | ||
712 | + | ||
713 | + /* All done. */ | ||
714 | + fesetenv_register (fe); | ||
715 | + return x * b; | ||
716 | + } | ||
717 | + } | ||
718 | + else if (b < 0) | ||
719 | + { | ||
720 | + /* For some reason, some PowerPC32 processors don't implement | ||
721 | + FE_INVALID_SQRT. */ | ||
722 | +#ifdef FE_INVALID_SQRT | ||
723 | + feraiseexcept (FE_INVALID_SQRT); | ||
724 | + | ||
725 | + fenv_union_t u = { .fenv = fegetenv_register () }; | ||
726 | + if ((u.l[1] & FE_INVALID) == 0) | ||
727 | +#endif | ||
728 | + feraiseexcept (FE_INVALID); | ||
729 | + b = a_nan.value; | ||
730 | + } | ||
731 | + return f_washf (b); | ||
732 | +} | ||
733 | diff -ruN libc-orig/sysdeps/powerpc/powerpc32/e6500/fpu/e_sqrt.c libc/sysdeps/powerpc/powerpc32/e6500/fpu/e_sqrt.c | ||
734 | --- libc-orig/sysdeps/powerpc/powerpc32/e6500/fpu/e_sqrt.c 1969-12-31 18:00:00.000000000 -0600 | ||
735 | +++ libc/sysdeps/powerpc/powerpc32/e6500/fpu/e_sqrt.c 2012-06-14 14:55:24.620001266 -0500 | ||
736 | @@ -0,0 +1,134 @@ | ||
737 | +/* Double-precision floating point square root. | ||
738 | + Copyright (C) 2010 Free Software Foundation, Inc. | ||
739 | + This file is part of the GNU C Library. | ||
740 | + | ||
741 | + The GNU C Library is free software; you can redistribute it and/or | ||
742 | + modify it under the terms of the GNU Lesser General Public | ||
743 | + License as published by the Free Software Foundation; either | ||
744 | + version 2.1 of the License, or (at your option) any later version. | ||
745 | + | ||
746 | + The GNU C Library is distributed in the hope that it will be useful, | ||
747 | + but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
748 | + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
749 | + Lesser General Public License for more details. | ||
750 | + | ||
751 | + You should have received a copy of the GNU Lesser General Public | ||
752 | + License along with the GNU C Library; if not, write to the Free | ||
753 | + Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA | ||
754 | + 02111-1307 USA. */ | ||
755 | + | ||
756 | +#include <math.h> | ||
757 | +#include <math_private.h> | ||
758 | +#include <fenv_libc.h> | ||
759 | +#include <inttypes.h> | ||
760 | + | ||
761 | +#include <sysdep.h> | ||
762 | +#include <ldsodefs.h> | ||
763 | + | ||
764 | +static const ieee_float_shape_type a_nan = {.word = 0x7fc00000 }; | ||
765 | +static const ieee_float_shape_type a_inf = {.word = 0x7f800000 }; | ||
766 | +static const float two108 = 3.245185536584267269e+32; | ||
767 | +static const float twom54 = 5.551115123125782702e-17; | ||
768 | +static const float half = 0.5; | ||
769 | + | ||
770 | +/* The method is based on the descriptions in: | ||
771 | + | ||
772 | + _The Handbook of Floating-Pointer Arithmetic_ by Muller et al., chapter 5; | ||
773 | + _IA-64 and Elementary Functions: Speed and Precision_ by Markstein, chapter 9 | ||
774 | + | ||
775 | + We find the actual square root and half of its reciprocal | ||
776 | + simultaneously. */ | ||
777 | + | ||
778 | +#ifdef __STDC__ | ||
779 | +double | ||
780 | +__ieee754_sqrt (double b) | ||
781 | +#else | ||
782 | +double | ||
783 | +__ieee754_sqrt (b) | ||
784 | + double b; | ||
785 | +#endif | ||
786 | +{ | ||
787 | + if (__builtin_expect (b > 0, 1)) | ||
788 | + { | ||
789 | + double y, g, h, d, r; | ||
790 | + ieee_double_shape_type u; | ||
791 | + | ||
792 | + if (__builtin_expect (b != a_inf.value, 1)) | ||
793 | + { | ||
794 | + fenv_t fe; | ||
795 | + | ||
796 | + fe = fegetenv_register (); | ||
797 | + | ||
798 | + u.value = b; | ||
799 | + | ||
800 | + relax_fenv_state (); | ||
801 | + | ||
802 | + __asm__ ("frsqrte %[estimate], %[x]\n" | ||
803 | + : [estimate] "=f" (y) : [x] "f" (b)); | ||
804 | + | ||
805 | + /* Following Muller et al, page 168, equation 5.20. | ||
806 | + | ||
807 | + h goes to 1/(2*sqrt(b)) | ||
808 | + g goes to sqrt(b). | ||
809 | + | ||
810 | + We need three iterations to get within 1ulp. */ | ||
811 | + | ||
812 | + /* Indicate that these can be performed prior to the branch. GCC | ||
813 | + insists on sinking them below the branch, however; it seems like | ||
814 | + they'd be better before the branch so that we can cover any latency | ||
815 | + from storing the argument and loading its high word. Oh well. */ | ||
816 | + | ||
817 | + g = b * y; | ||
818 | + h = 0.5 * y; | ||
819 | + | ||
820 | + /* Handle small numbers by scaling. */ | ||
821 | + if (__builtin_expect ((u.parts.msw & 0x7ff00000) <= 0x02000000, 0)) | ||
822 | + return __ieee754_sqrt (b * two108) * twom54; | ||
823 | + | ||
824 | +#define FMADD(a_, c_, b_) \ | ||
825 | + ({ double __r; \ | ||
826 | + __asm__ ("fmadd %[r], %[a], %[c], %[b]\n" \ | ||
827 | + : [r] "=f" (__r) : [a] "f" (a_), [c] "f" (c_), [b] "f" (b_)); \ | ||
828 | + __r;}) | ||
829 | +#define FNMSUB(a_, c_, b_) \ | ||
830 | + ({ double __r; \ | ||
831 | + __asm__ ("fnmsub %[r], %[a], %[c], %[b]\n" \ | ||
832 | + : [r] "=f" (__r) : [a] "f" (a_), [c] "f" (c_), [b] "f" (b_)); \ | ||
833 | + __r;}) | ||
834 | + | ||
835 | + r = FNMSUB (g, h, half); | ||
836 | + g = FMADD (g, r, g); | ||
837 | + h = FMADD (h, r, h); | ||
838 | + | ||
839 | + r = FNMSUB (g, h, half); | ||
840 | + g = FMADD (g, r, g); | ||
841 | + h = FMADD (h, r, h); | ||
842 | + | ||
843 | + r = FNMSUB (g, h, half); | ||
844 | + g = FMADD (g, r, g); | ||
845 | + h = FMADD (h, r, h); | ||
846 | + | ||
847 | + /* g is now +/- 1ulp, or exactly equal to, the square root of b. */ | ||
848 | + | ||
849 | + /* Final refinement. */ | ||
850 | + d = FNMSUB (g, g, b); | ||
851 | + | ||
852 | + fesetenv_register (fe); | ||
853 | + return FMADD (d, h, g); | ||
854 | + } | ||
855 | + } | ||
856 | + else if (b < 0) | ||
857 | + { | ||
858 | + /* For some reason, some PowerPC32 processors don't implement | ||
859 | + FE_INVALID_SQRT. */ | ||
860 | +#ifdef FE_INVALID_SQRT | ||
861 | + feraiseexcept (FE_INVALID_SQRT); | ||
862 | + | ||
863 | + fenv_union_t u = { .fenv = fegetenv_register () }; | ||
864 | + if ((u.l[1] & FE_INVALID) == 0) | ||
865 | +#endif | ||
866 | + feraiseexcept (FE_INVALID); | ||
867 | + b = a_nan.value; | ||
868 | + } | ||
869 | + return f_wash (b); | ||
870 | +} | ||
871 | diff -ruN libc-orig/sysdeps/powerpc/powerpc32/e6500/fpu/e_sqrtf.c libc/sysdeps/powerpc/powerpc32/e6500/fpu/e_sqrtf.c | ||
872 | --- libc-orig/sysdeps/powerpc/powerpc32/e6500/fpu/e_sqrtf.c 1969-12-31 18:00:00.000000000 -0600 | ||
873 | +++ libc/sysdeps/powerpc/powerpc32/e6500/fpu/e_sqrtf.c 2012-06-14 14:55:24.620001266 -0500 | ||
874 | @@ -0,0 +1,101 @@ | ||
875 | +/* Single-precision floating point square root. | ||
876 | + Copyright (C) 2010 Free Software Foundation, Inc. | ||
877 | + This file is part of the GNU C Library. | ||
878 | + | ||
879 | + The GNU C Library is free software; you can redistribute it and/or | ||
880 | + modify it under the terms of the GNU Lesser General Public | ||
881 | + License as published by the Free Software Foundation; either | ||
882 | + version 2.1 of the License, or (at your option) any later version. | ||
883 | + | ||
884 | + The GNU C Library is distributed in the hope that it will be useful, | ||
885 | + but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
886 | + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
887 | + Lesser General Public License for more details. | ||
888 | + | ||
889 | + You should have received a copy of the GNU Lesser General Public | ||
890 | + License along with the GNU C Library; if not, write to the Free | ||
891 | + Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA | ||
892 | + 02111-1307 USA. */ | ||
893 | + | ||
894 | +#include <math.h> | ||
895 | +#include <math_private.h> | ||
896 | +#include <fenv_libc.h> | ||
897 | +#include <inttypes.h> | ||
898 | + | ||
899 | +#include <sysdep.h> | ||
900 | +#include <ldsodefs.h> | ||
901 | + | ||
902 | +static const ieee_float_shape_type a_nan = {.word = 0x7fc00000 }; | ||
903 | +static const ieee_float_shape_type a_inf = {.word = 0x7f800000 }; | ||
904 | +static const float threehalf = 1.5; | ||
905 | + | ||
906 | +/* The method is based on the descriptions in: | ||
907 | + | ||
908 | + _The Handbook of Floating-Pointer Arithmetic_ by Muller et al., chapter 5; | ||
909 | + _IA-64 and Elementary Functions: Speed and Precision_ by Markstein, chapter 9 | ||
910 | + | ||
911 | + We find the reciprocal square root and use that to compute the actual | ||
912 | + square root. */ | ||
913 | + | ||
914 | +#ifdef __STDC__ | ||
915 | +float | ||
916 | +__ieee754_sqrtf (float b) | ||
917 | +#else | ||
918 | +float | ||
919 | +__ieee754_sqrtf (b) | ||
920 | + float b; | ||
921 | +#endif | ||
922 | +{ | ||
923 | + if (__builtin_expect (b > 0, 1)) | ||
924 | + { | ||
925 | +#define FMSUB(a_, c_, b_) \ | ||
926 | + ({ double __r; \ | ||
927 | + __asm__ ("fmsub %[r], %[a], %[c], %[b]\n" \ | ||
928 | + : [r] "=f" (__r) : [a] "f" (a_), [c] "f" (c_), [b] "f" (b_)); \ | ||
929 | + __r;}) | ||
930 | +#define FNMSUB(a_, c_, b_) \ | ||
931 | + ({ double __r; \ | ||
932 | + __asm__ ("fnmsub %[r], %[a], %[c], %[b]\n" \ | ||
933 | + : [r] "=f" (__r) : [a] "f" (a_), [c] "f" (c_), [b] "f" (b_)); \ | ||
934 | + __r;}) | ||
935 | + | ||
936 | + if (__builtin_expect (b != a_inf.value, 1)) | ||
937 | + { | ||
938 | + double y, x; | ||
939 | + fenv_t fe; | ||
940 | + | ||
941 | + fe = fegetenv_register (); | ||
942 | + | ||
943 | + relax_fenv_state (); | ||
944 | + | ||
945 | + /* Compute y = 1.5 * b - b. Uses fewer constants than y = 0.5 * b. */ | ||
946 | + y = FMSUB (threehalf, b, b); | ||
947 | + | ||
948 | + /* Initial estimate. */ | ||
949 | + __asm__ ("frsqrte %[x], %[b]\n" : [x] "=f" (x) : [b] "f" (b)); | ||
950 | + | ||
951 | + /* Iterate. x_{n+1} = x_n * (1.5 - y * (x_n * x_n)). */ | ||
952 | + x = x * FNMSUB (y, x * x, threehalf); | ||
953 | + x = x * FNMSUB (y, x * x, threehalf); | ||
954 | + x = x * FNMSUB (y, x * x, threehalf); | ||
955 | + | ||
956 | + /* All done. */ | ||
957 | + fesetenv_register (fe); | ||
958 | + return x * b; | ||
959 | + } | ||
960 | + } | ||
961 | + else if (b < 0) | ||
962 | + { | ||
963 | + /* For some reason, some PowerPC32 processors don't implement | ||
964 | + FE_INVALID_SQRT. */ | ||
965 | +#ifdef FE_INVALID_SQRT | ||
966 | + feraiseexcept (FE_INVALID_SQRT); | ||
967 | + | ||
968 | + fenv_union_t u = { .fenv = fegetenv_register () }; | ||
969 | + if ((u.l[1] & FE_INVALID) == 0) | ||
970 | +#endif | ||
971 | + feraiseexcept (FE_INVALID); | ||
972 | + b = a_nan.value; | ||
973 | + } | ||
974 | + return f_washf (b); | ||
975 | +} | ||
976 | diff -ruN libc-orig/sysdeps/powerpc/powerpc64/e5500/fpu/e_sqrt.c libc/sysdeps/powerpc/powerpc64/e5500/fpu/e_sqrt.c | ||
977 | --- libc-orig/sysdeps/powerpc/powerpc64/e5500/fpu/e_sqrt.c 1969-12-31 18:00:00.000000000 -0600 | ||
978 | +++ libc/sysdeps/powerpc/powerpc64/e5500/fpu/e_sqrt.c 2012-06-14 14:51:50.452001745 -0500 | ||
979 | @@ -0,0 +1,134 @@ | ||
980 | +/* Double-precision floating point square root. | ||
981 | + Copyright (C) 2010 Free Software Foundation, Inc. | ||
982 | + This file is part of the GNU C Library. | ||
983 | + | ||
984 | + The GNU C Library is free software; you can redistribute it and/or | ||
985 | + modify it under the terms of the GNU Lesser General Public | ||
986 | + License as published by the Free Software Foundation; either | ||
987 | + version 2.1 of the License, or (at your option) any later version. | ||
988 | + | ||
989 | + The GNU C Library is distributed in the hope that it will be useful, | ||
990 | + but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
991 | + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
992 | + Lesser General Public License for more details. | ||
993 | + | ||
994 | + You should have received a copy of the GNU Lesser General Public | ||
995 | + License along with the GNU C Library; if not, write to the Free | ||
996 | + Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA | ||
997 | + 02111-1307 USA. */ | ||
998 | + | ||
999 | +#include <math.h> | ||
1000 | +#include <math_private.h> | ||
1001 | +#include <fenv_libc.h> | ||
1002 | +#include <inttypes.h> | ||
1003 | + | ||
1004 | +#include <sysdep.h> | ||
1005 | +#include <ldsodefs.h> | ||
1006 | + | ||
1007 | +static const ieee_float_shape_type a_nan = {.word = 0x7fc00000 }; | ||
1008 | +static const ieee_float_shape_type a_inf = {.word = 0x7f800000 }; | ||
1009 | +static const float two108 = 3.245185536584267269e+32; | ||
1010 | +static const float twom54 = 5.551115123125782702e-17; | ||
1011 | +static const float half = 0.5; | ||
1012 | + | ||
1013 | +/* The method is based on the descriptions in: | ||
1014 | + | ||
1015 | + _The Handbook of Floating-Pointer Arithmetic_ by Muller et al., chapter 5; | ||
1016 | + _IA-64 and Elementary Functions: Speed and Precision_ by Markstein, chapter 9 | ||
1017 | + | ||
1018 | + We find the actual square root and half of its reciprocal | ||
1019 | + simultaneously. */ | ||
1020 | + | ||
1021 | +#ifdef __STDC__ | ||
1022 | +double | ||
1023 | +__ieee754_sqrt (double b) | ||
1024 | +#else | ||
1025 | +double | ||
1026 | +__ieee754_sqrt (b) | ||
1027 | + double b; | ||
1028 | +#endif | ||
1029 | +{ | ||
1030 | + if (__builtin_expect (b > 0, 1)) | ||
1031 | + { | ||
1032 | + double y, g, h, d, r; | ||
1033 | + ieee_double_shape_type u; | ||
1034 | + | ||
1035 | + if (__builtin_expect (b != a_inf.value, 1)) | ||
1036 | + { | ||
1037 | + fenv_t fe; | ||
1038 | + | ||
1039 | + fe = fegetenv_register (); | ||
1040 | + | ||
1041 | + u.value = b; | ||
1042 | + | ||
1043 | + relax_fenv_state (); | ||
1044 | + | ||
1045 | + __asm__ ("frsqrte %[estimate], %[x]\n" | ||
1046 | + : [estimate] "=f" (y) : [x] "f" (b)); | ||
1047 | + | ||
1048 | + /* Following Muller et al, page 168, equation 5.20. | ||
1049 | + | ||
1050 | + h goes to 1/(2*sqrt(b)) | ||
1051 | + g goes to sqrt(b). | ||
1052 | + | ||
1053 | + We need three iterations to get within 1ulp. */ | ||
1054 | + | ||
1055 | + /* Indicate that these can be performed prior to the branch. GCC | ||
1056 | + insists on sinking them below the branch, however; it seems like | ||
1057 | + they'd be better before the branch so that we can cover any latency | ||
1058 | + from storing the argument and loading its high word. Oh well. */ | ||
1059 | + | ||
1060 | + g = b * y; | ||
1061 | + h = 0.5 * y; | ||
1062 | + | ||
1063 | + /* Handle small numbers by scaling. */ | ||
1064 | + if (__builtin_expect ((u.parts.msw & 0x7ff00000) <= 0x02000000, 0)) | ||
1065 | + return __ieee754_sqrt (b * two108) * twom54; | ||
1066 | + | ||
1067 | +#define FMADD(a_, c_, b_) \ | ||
1068 | + ({ double __r; \ | ||
1069 | + __asm__ ("fmadd %[r], %[a], %[c], %[b]\n" \ | ||
1070 | + : [r] "=f" (__r) : [a] "f" (a_), [c] "f" (c_), [b] "f" (b_)); \ | ||
1071 | + __r;}) | ||
1072 | +#define FNMSUB(a_, c_, b_) \ | ||
1073 | + ({ double __r; \ | ||
1074 | + __asm__ ("fnmsub %[r], %[a], %[c], %[b]\n" \ | ||
1075 | + : [r] "=f" (__r) : [a] "f" (a_), [c] "f" (c_), [b] "f" (b_)); \ | ||
1076 | + __r;}) | ||
1077 | + | ||
1078 | + r = FNMSUB (g, h, half); | ||
1079 | + g = FMADD (g, r, g); | ||
1080 | + h = FMADD (h, r, h); | ||
1081 | + | ||
1082 | + r = FNMSUB (g, h, half); | ||
1083 | + g = FMADD (g, r, g); | ||
1084 | + h = FMADD (h, r, h); | ||
1085 | + | ||
1086 | + r = FNMSUB (g, h, half); | ||
1087 | + g = FMADD (g, r, g); | ||
1088 | + h = FMADD (h, r, h); | ||
1089 | + | ||
1090 | + /* g is now +/- 1ulp, or exactly equal to, the square root of b. */ | ||
1091 | + | ||
1092 | + /* Final refinement. */ | ||
1093 | + d = FNMSUB (g, g, b); | ||
1094 | + | ||
1095 | + fesetenv_register (fe); | ||
1096 | + return FMADD (d, h, g); | ||
1097 | + } | ||
1098 | + } | ||
1099 | + else if (b < 0) | ||
1100 | + { | ||
1101 | + /* For some reason, some PowerPC32 processors don't implement | ||
1102 | + FE_INVALID_SQRT. */ | ||
1103 | +#ifdef FE_INVALID_SQRT | ||
1104 | + feraiseexcept (FE_INVALID_SQRT); | ||
1105 | + | ||
1106 | + fenv_union_t u = { .fenv = fegetenv_register () }; | ||
1107 | + if ((u.l[1] & FE_INVALID) == 0) | ||
1108 | +#endif | ||
1109 | + feraiseexcept (FE_INVALID); | ||
1110 | + b = a_nan.value; | ||
1111 | + } | ||
1112 | + return f_wash (b); | ||
1113 | +} | ||
1114 | diff -ruN libc-orig/sysdeps/powerpc/powerpc64/e5500/fpu/e_sqrtf.c libc/sysdeps/powerpc/powerpc64/e5500/fpu/e_sqrtf.c | ||
1115 | --- libc-orig/sysdeps/powerpc/powerpc64/e5500/fpu/e_sqrtf.c 1969-12-31 18:00:00.000000000 -0600 | ||
1116 | +++ libc/sysdeps/powerpc/powerpc64/e5500/fpu/e_sqrtf.c 2012-06-14 14:51:50.452001745 -0500 | ||
1117 | @@ -0,0 +1,101 @@ | ||
1118 | +/* Single-precision floating point square root. | ||
1119 | + Copyright (C) 2010 Free Software Foundation, Inc. | ||
1120 | + This file is part of the GNU C Library. | ||
1121 | + | ||
1122 | + The GNU C Library is free software; you can redistribute it and/or | ||
1123 | + modify it under the terms of the GNU Lesser General Public | ||
1124 | + License as published by the Free Software Foundation; either | ||
1125 | + version 2.1 of the License, or (at your option) any later version. | ||
1126 | + | ||
1127 | + The GNU C Library is distributed in the hope that it will be useful, | ||
1128 | + but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
1129 | + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
1130 | + Lesser General Public License for more details. | ||
1131 | + | ||
1132 | + You should have received a copy of the GNU Lesser General Public | ||
1133 | + License along with the GNU C Library; if not, write to the Free | ||
1134 | + Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA | ||
1135 | + 02111-1307 USA. */ | ||
1136 | + | ||
1137 | +#include <math.h> | ||
1138 | +#include <math_private.h> | ||
1139 | +#include <fenv_libc.h> | ||
1140 | +#include <inttypes.h> | ||
1141 | + | ||
1142 | +#include <sysdep.h> | ||
1143 | +#include <ldsodefs.h> | ||
1144 | + | ||
1145 | +static const ieee_float_shape_type a_nan = {.word = 0x7fc00000 }; | ||
1146 | +static const ieee_float_shape_type a_inf = {.word = 0x7f800000 }; | ||
1147 | +static const float threehalf = 1.5; | ||
1148 | + | ||
1149 | +/* The method is based on the descriptions in: | ||
1150 | + | ||
1151 | + _The Handbook of Floating-Pointer Arithmetic_ by Muller et al., chapter 5; | ||
1152 | + _IA-64 and Elementary Functions: Speed and Precision_ by Markstein, chapter 9 | ||
1153 | + | ||
1154 | + We find the reciprocal square root and use that to compute the actual | ||
1155 | + square root. */ | ||
1156 | + | ||
1157 | +#ifdef __STDC__ | ||
1158 | +float | ||
1159 | +__ieee754_sqrtf (float b) | ||
1160 | +#else | ||
1161 | +float | ||
1162 | +__ieee754_sqrtf (b) | ||
1163 | + float b; | ||
1164 | +#endif | ||
1165 | +{ | ||
1166 | + if (__builtin_expect (b > 0, 1)) | ||
1167 | + { | ||
1168 | +#define FMSUB(a_, c_, b_) \ | ||
1169 | + ({ double __r; \ | ||
1170 | + __asm__ ("fmsub %[r], %[a], %[c], %[b]\n" \ | ||
1171 | + : [r] "=f" (__r) : [a] "f" (a_), [c] "f" (c_), [b] "f" (b_)); \ | ||
1172 | + __r;}) | ||
1173 | +#define FNMSUB(a_, c_, b_) \ | ||
1174 | + ({ double __r; \ | ||
1175 | + __asm__ ("fnmsub %[r], %[a], %[c], %[b]\n" \ | ||
1176 | + : [r] "=f" (__r) : [a] "f" (a_), [c] "f" (c_), [b] "f" (b_)); \ | ||
1177 | + __r;}) | ||
1178 | + | ||
1179 | + if (__builtin_expect (b != a_inf.value, 1)) | ||
1180 | + { | ||
1181 | + double y, x; | ||
1182 | + fenv_t fe; | ||
1183 | + | ||
1184 | + fe = fegetenv_register (); | ||
1185 | + | ||
1186 | + relax_fenv_state (); | ||
1187 | + | ||
1188 | + /* Compute y = 1.5 * b - b. Uses fewer constants than y = 0.5 * b. */ | ||
1189 | + y = FMSUB (threehalf, b, b); | ||
1190 | + | ||
1191 | + /* Initial estimate. */ | ||
1192 | + __asm__ ("frsqrte %[x], %[b]\n" : [x] "=f" (x) : [b] "f" (b)); | ||
1193 | + | ||
1194 | + /* Iterate. x_{n+1} = x_n * (1.5 - y * (x_n * x_n)). */ | ||
1195 | + x = x * FNMSUB (y, x * x, threehalf); | ||
1196 | + x = x * FNMSUB (y, x * x, threehalf); | ||
1197 | + x = x * FNMSUB (y, x * x, threehalf); | ||
1198 | + | ||
1199 | + /* All done. */ | ||
1200 | + fesetenv_register (fe); | ||
1201 | + return x * b; | ||
1202 | + } | ||
1203 | + } | ||
1204 | + else if (b < 0) | ||
1205 | + { | ||
1206 | + /* For some reason, some PowerPC32 processors don't implement | ||
1207 | + FE_INVALID_SQRT. */ | ||
1208 | +#ifdef FE_INVALID_SQRT | ||
1209 | + feraiseexcept (FE_INVALID_SQRT); | ||
1210 | + | ||
1211 | + fenv_union_t u = { .fenv = fegetenv_register () }; | ||
1212 | + if ((u.l[1] & FE_INVALID) == 0) | ||
1213 | +#endif | ||
1214 | + feraiseexcept (FE_INVALID); | ||
1215 | + b = a_nan.value; | ||
1216 | + } | ||
1217 | + return f_washf (b); | ||
1218 | +} | ||
1219 | diff -ruN libc-orig/sysdeps/powerpc/powerpc64/e6500/fpu/e_sqrt.c libc/sysdeps/powerpc/powerpc64/e6500/fpu/e_sqrt.c | ||
1220 | --- libc-orig/sysdeps/powerpc/powerpc64/e6500/fpu/e_sqrt.c 1969-12-31 18:00:00.000000000 -0600 | ||
1221 | +++ libc/sysdeps/powerpc/powerpc64/e6500/fpu/e_sqrt.c 2012-06-14 14:56:02.080000985 -0500 | ||
1222 | @@ -0,0 +1,134 @@ | ||
1223 | +/* Double-precision floating point square root. | ||
1224 | + Copyright (C) 2010 Free Software Foundation, Inc. | ||
1225 | + This file is part of the GNU C Library. | ||
1226 | + | ||
1227 | + The GNU C Library is free software; you can redistribute it and/or | ||
1228 | + modify it under the terms of the GNU Lesser General Public | ||
1229 | + License as published by the Free Software Foundation; either | ||
1230 | + version 2.1 of the License, or (at your option) any later version. | ||
1231 | + | ||
1232 | + The GNU C Library is distributed in the hope that it will be useful, | ||
1233 | + but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
1234 | + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
1235 | + Lesser General Public License for more details. | ||
1236 | + | ||
1237 | + You should have received a copy of the GNU Lesser General Public | ||
1238 | + License along with the GNU C Library; if not, write to the Free | ||
1239 | + Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA | ||
1240 | + 02111-1307 USA. */ | ||
1241 | + | ||
1242 | +#include <math.h> | ||
1243 | +#include <math_private.h> | ||
1244 | +#include <fenv_libc.h> | ||
1245 | +#include <inttypes.h> | ||
1246 | + | ||
1247 | +#include <sysdep.h> | ||
1248 | +#include <ldsodefs.h> | ||
1249 | + | ||
1250 | +static const ieee_float_shape_type a_nan = {.word = 0x7fc00000 }; | ||
1251 | +static const ieee_float_shape_type a_inf = {.word = 0x7f800000 }; | ||
1252 | +static const float two108 = 3.245185536584267269e+32; | ||
1253 | +static const float twom54 = 5.551115123125782702e-17; | ||
1254 | +static const float half = 0.5; | ||
1255 | + | ||
1256 | +/* The method is based on the descriptions in: | ||
1257 | + | ||
1258 | + _The Handbook of Floating-Pointer Arithmetic_ by Muller et al., chapter 5; | ||
1259 | + _IA-64 and Elementary Functions: Speed and Precision_ by Markstein, chapter 9 | ||
1260 | + | ||
1261 | + We find the actual square root and half of its reciprocal | ||
1262 | + simultaneously. */ | ||
1263 | + | ||
1264 | +#ifdef __STDC__ | ||
1265 | +double | ||
1266 | +__ieee754_sqrt (double b) | ||
1267 | +#else | ||
1268 | +double | ||
1269 | +__ieee754_sqrt (b) | ||
1270 | + double b; | ||
1271 | +#endif | ||
1272 | +{ | ||
1273 | + if (__builtin_expect (b > 0, 1)) | ||
1274 | + { | ||
1275 | + double y, g, h, d, r; | ||
1276 | + ieee_double_shape_type u; | ||
1277 | + | ||
1278 | + if (__builtin_expect (b != a_inf.value, 1)) | ||
1279 | + { | ||
1280 | + fenv_t fe; | ||
1281 | + | ||
1282 | + fe = fegetenv_register (); | ||
1283 | + | ||
1284 | + u.value = b; | ||
1285 | + | ||
1286 | + relax_fenv_state (); | ||
1287 | + | ||
1288 | + __asm__ ("frsqrte %[estimate], %[x]\n" | ||
1289 | + : [estimate] "=f" (y) : [x] "f" (b)); | ||
1290 | + | ||
1291 | + /* Following Muller et al, page 168, equation 5.20. | ||
1292 | + | ||
1293 | + h goes to 1/(2*sqrt(b)) | ||
1294 | + g goes to sqrt(b). | ||
1295 | + | ||
1296 | + We need three iterations to get within 1ulp. */ | ||
1297 | + | ||
1298 | + /* Indicate that these can be performed prior to the branch. GCC | ||
1299 | + insists on sinking them below the branch, however; it seems like | ||
1300 | + they'd be better before the branch so that we can cover any latency | ||
1301 | + from storing the argument and loading its high word. Oh well. */ | ||
1302 | + | ||
1303 | + g = b * y; | ||
1304 | + h = 0.5 * y; | ||
1305 | + | ||
1306 | + /* Handle small numbers by scaling. */ | ||
1307 | + if (__builtin_expect ((u.parts.msw & 0x7ff00000) <= 0x02000000, 0)) | ||
1308 | + return __ieee754_sqrt (b * two108) * twom54; | ||
1309 | + | ||
1310 | +#define FMADD(a_, c_, b_) \ | ||
1311 | + ({ double __r; \ | ||
1312 | + __asm__ ("fmadd %[r], %[a], %[c], %[b]\n" \ | ||
1313 | + : [r] "=f" (__r) : [a] "f" (a_), [c] "f" (c_), [b] "f" (b_)); \ | ||
1314 | + __r;}) | ||
1315 | +#define FNMSUB(a_, c_, b_) \ | ||
1316 | + ({ double __r; \ | ||
1317 | + __asm__ ("fnmsub %[r], %[a], %[c], %[b]\n" \ | ||
1318 | + : [r] "=f" (__r) : [a] "f" (a_), [c] "f" (c_), [b] "f" (b_)); \ | ||
1319 | + __r;}) | ||
1320 | + | ||
1321 | + r = FNMSUB (g, h, half); | ||
1322 | + g = FMADD (g, r, g); | ||
1323 | + h = FMADD (h, r, h); | ||
1324 | + | ||
1325 | + r = FNMSUB (g, h, half); | ||
1326 | + g = FMADD (g, r, g); | ||
1327 | + h = FMADD (h, r, h); | ||
1328 | + | ||
1329 | + r = FNMSUB (g, h, half); | ||
1330 | + g = FMADD (g, r, g); | ||
1331 | + h = FMADD (h, r, h); | ||
1332 | + | ||
1333 | + /* g is now +/- 1ulp, or exactly equal to, the square root of b. */ | ||
1334 | + | ||
1335 | + /* Final refinement. */ | ||
1336 | + d = FNMSUB (g, g, b); | ||
1337 | + | ||
1338 | + fesetenv_register (fe); | ||
1339 | + return FMADD (d, h, g); | ||
1340 | + } | ||
1341 | + } | ||
1342 | + else if (b < 0) | ||
1343 | + { | ||
1344 | + /* For some reason, some PowerPC32 processors don't implement | ||
1345 | + FE_INVALID_SQRT. */ | ||
1346 | +#ifdef FE_INVALID_SQRT | ||
1347 | + feraiseexcept (FE_INVALID_SQRT); | ||
1348 | + | ||
1349 | + fenv_union_t u = { .fenv = fegetenv_register () }; | ||
1350 | + if ((u.l[1] & FE_INVALID) == 0) | ||
1351 | +#endif | ||
1352 | + feraiseexcept (FE_INVALID); | ||
1353 | + b = a_nan.value; | ||
1354 | + } | ||
1355 | + return f_wash (b); | ||
1356 | +} | ||
1357 | diff -ruN libc-orig/sysdeps/powerpc/powerpc64/e6500/fpu/e_sqrtf.c libc/sysdeps/powerpc/powerpc64/e6500/fpu/e_sqrtf.c | ||
1358 | --- libc-orig/sysdeps/powerpc/powerpc64/e6500/fpu/e_sqrtf.c 1969-12-31 18:00:00.000000000 -0600 | ||
1359 | +++ libc/sysdeps/powerpc/powerpc64/e6500/fpu/e_sqrtf.c 2012-06-14 14:56:02.080000985 -0500 | ||
1360 | @@ -0,0 +1,101 @@ | ||
1361 | +/* Single-precision floating point square root. | ||
1362 | + Copyright (C) 2010 Free Software Foundation, Inc. | ||
1363 | + This file is part of the GNU C Library. | ||
1364 | + | ||
1365 | + The GNU C Library is free software; you can redistribute it and/or | ||
1366 | + modify it under the terms of the GNU Lesser General Public | ||
1367 | + License as published by the Free Software Foundation; either | ||
1368 | + version 2.1 of the License, or (at your option) any later version. | ||
1369 | + | ||
1370 | + The GNU C Library is distributed in the hope that it will be useful, | ||
1371 | + but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
1372 | + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
1373 | + Lesser General Public License for more details. | ||
1374 | + | ||
1375 | + You should have received a copy of the GNU Lesser General Public | ||
1376 | + License along with the GNU C Library; if not, write to the Free | ||
1377 | + Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA | ||
1378 | + 02111-1307 USA. */ | ||
1379 | + | ||
1380 | +#include <math.h> | ||
1381 | +#include <math_private.h> | ||
1382 | +#include <fenv_libc.h> | ||
1383 | +#include <inttypes.h> | ||
1384 | + | ||
1385 | +#include <sysdep.h> | ||
1386 | +#include <ldsodefs.h> | ||
1387 | + | ||
1388 | +static const ieee_float_shape_type a_nan = {.word = 0x7fc00000 }; | ||
1389 | +static const ieee_float_shape_type a_inf = {.word = 0x7f800000 }; | ||
1390 | +static const float threehalf = 1.5; | ||
1391 | + | ||
1392 | +/* The method is based on the descriptions in: | ||
1393 | + | ||
1394 | + _The Handbook of Floating-Pointer Arithmetic_ by Muller et al., chapter 5; | ||
1395 | + _IA-64 and Elementary Functions: Speed and Precision_ by Markstein, chapter 9 | ||
1396 | + | ||
1397 | + We find the reciprocal square root and use that to compute the actual | ||
1398 | + square root. */ | ||
1399 | + | ||
1400 | +#ifdef __STDC__ | ||
1401 | +float | ||
1402 | +__ieee754_sqrtf (float b) | ||
1403 | +#else | ||
1404 | +float | ||
1405 | +__ieee754_sqrtf (b) | ||
1406 | + float b; | ||
1407 | +#endif | ||
1408 | +{ | ||
1409 | + if (__builtin_expect (b > 0, 1)) | ||
1410 | + { | ||
1411 | +#define FMSUB(a_, c_, b_) \ | ||
1412 | + ({ double __r; \ | ||
1413 | + __asm__ ("fmsub %[r], %[a], %[c], %[b]\n" \ | ||
1414 | + : [r] "=f" (__r) : [a] "f" (a_), [c] "f" (c_), [b] "f" (b_)); \ | ||
1415 | + __r;}) | ||
1416 | +#define FNMSUB(a_, c_, b_) \ | ||
1417 | + ({ double __r; \ | ||
1418 | + __asm__ ("fnmsub %[r], %[a], %[c], %[b]\n" \ | ||
1419 | + : [r] "=f" (__r) : [a] "f" (a_), [c] "f" (c_), [b] "f" (b_)); \ | ||
1420 | + __r;}) | ||
1421 | + | ||
1422 | + if (__builtin_expect (b != a_inf.value, 1)) | ||
1423 | + { | ||
1424 | + double y, x; | ||
1425 | + fenv_t fe; | ||
1426 | + | ||
1427 | + fe = fegetenv_register (); | ||
1428 | + | ||
1429 | + relax_fenv_state (); | ||
1430 | + | ||
1431 | + /* Compute y = 1.5 * b - b. Uses fewer constants than y = 0.5 * b. */ | ||
1432 | + y = FMSUB (threehalf, b, b); | ||
1433 | + | ||
1434 | + /* Initial estimate. */ | ||
1435 | + __asm__ ("frsqrte %[x], %[b]\n" : [x] "=f" (x) : [b] "f" (b)); | ||
1436 | + | ||
1437 | + /* Iterate. x_{n+1} = x_n * (1.5 - y * (x_n * x_n)). */ | ||
1438 | + x = x * FNMSUB (y, x * x, threehalf); | ||
1439 | + x = x * FNMSUB (y, x * x, threehalf); | ||
1440 | + x = x * FNMSUB (y, x * x, threehalf); | ||
1441 | + | ||
1442 | + /* All done. */ | ||
1443 | + fesetenv_register (fe); | ||
1444 | + return x * b; | ||
1445 | + } | ||
1446 | + } | ||
1447 | + else if (b < 0) | ||
1448 | + { | ||
1449 | + /* For some reason, some PowerPC32 processors don't implement | ||
1450 | + FE_INVALID_SQRT. */ | ||
1451 | +#ifdef FE_INVALID_SQRT | ||
1452 | + feraiseexcept (FE_INVALID_SQRT); | ||
1453 | + | ||
1454 | + fenv_union_t u = { .fenv = fegetenv_register () }; | ||
1455 | + if ((u.l[1] & FE_INVALID) == 0) | ||
1456 | +#endif | ||
1457 | + feraiseexcept (FE_INVALID); | ||
1458 | + b = a_nan.value; | ||
1459 | + } | ||
1460 | + return f_washf (b); | ||
1461 | +} | ||
1462 | diff -ruN libc-orig/sysdeps/unix/sysv/linux/powerpc/powerpc32/603e/fpu/Implies libc/sysdeps/unix/sysv/linux/powerpc/powerpc32/603e/fpu/Implies | ||
1463 | --- libc-orig/sysdeps/unix/sysv/linux/powerpc/powerpc32/603e/fpu/Implies 1969-12-31 18:00:00.000000000 -0600 | ||
1464 | +++ libc/sysdeps/unix/sysv/linux/powerpc/powerpc32/603e/fpu/Implies 2012-06-14 14:51:50.452001745 -0500 | ||
1465 | @@ -0,0 +1 @@ | ||
1466 | +powerpc/powerpc32/603e/fpu | ||
1467 | diff -ruN libc-orig/sysdeps/unix/sysv/linux/powerpc/powerpc32/e500mc/fpu/Implies libc/sysdeps/unix/sysv/linux/powerpc/powerpc32/e500mc/fpu/Implies | ||
1468 | --- libc-orig/sysdeps/unix/sysv/linux/powerpc/powerpc32/e500mc/fpu/Implies 1969-12-31 18:00:00.000000000 -0600 | ||
1469 | +++ libc/sysdeps/unix/sysv/linux/powerpc/powerpc32/e500mc/fpu/Implies 2012-06-14 14:54:00.481000876 -0500 | ||
1470 | @@ -0,0 +1 @@ | ||
1471 | +powerpc/powerpc32/e500mc/fpu | ||
1472 | diff -ruN libc-orig/sysdeps/unix/sysv/linux/powerpc/powerpc32/e5500/fpu/Implies libc/sysdeps/unix/sysv/linux/powerpc/powerpc32/e5500/fpu/Implies | ||
1473 | --- libc-orig/sysdeps/unix/sysv/linux/powerpc/powerpc32/e5500/fpu/Implies 1969-12-31 18:00:00.000000000 -0600 | ||
1474 | +++ libc/sysdeps/unix/sysv/linux/powerpc/powerpc32/e5500/fpu/Implies 2012-06-14 14:54:17.000001007 -0500 | ||
1475 | @@ -0,0 +1 @@ | ||
1476 | +powerpc/powerpc32/e5500/fpu | ||
1477 | diff -ruN libc-orig/sysdeps/unix/sysv/linux/powerpc/powerpc32/e6500/fpu/Implies libc/sysdeps/unix/sysv/linux/powerpc/powerpc32/e6500/fpu/Implies | ||
1478 | --- libc-orig/sysdeps/unix/sysv/linux/powerpc/powerpc32/e6500/fpu/Implies 1969-12-31 18:00:00.000000000 -0600 | ||
1479 | +++ libc/sysdeps/unix/sysv/linux/powerpc/powerpc32/e6500/fpu/Implies 2012-06-14 14:54:31.054001299 -0500 | ||
1480 | @@ -0,0 +1 @@ | ||
1481 | +powerpc/powerpc32/e6500/fpu | ||
1482 | diff -ruN libc-orig/sysdeps/unix/sysv/linux/powerpc/powerpc64/e5500/fpu/Implies libc/sysdeps/unix/sysv/linux/powerpc/powerpc64/e5500/fpu/Implies | ||
1483 | --- libc-orig/sysdeps/unix/sysv/linux/powerpc/powerpc64/e5500/fpu/Implies 1969-12-31 18:00:00.000000000 -0600 | ||
1484 | +++ libc/sysdeps/unix/sysv/linux/powerpc/powerpc64/e5500/fpu/Implies 2012-06-14 14:51:50.453001709 -0500 | ||
1485 | @@ -0,0 +1 @@ | ||
1486 | +powerpc/powerpc64/e5500/fpu | ||
1487 | diff -ruN libc-orig/sysdeps/unix/sysv/linux/powerpc/powerpc64/e6500/fpu/Implies libc/sysdeps/unix/sysv/linux/powerpc/powerpc64/e6500/fpu/Implies | ||
1488 | --- libc-orig/sysdeps/unix/sysv/linux/powerpc/powerpc64/e6500/fpu/Implies 1969-12-31 18:00:00.000000000 -0600 | ||
1489 | +++ libc/sysdeps/unix/sysv/linux/powerpc/powerpc64/e6500/fpu/Implies 2012-06-14 14:58:14.298001288 -0500 | ||
1490 | @@ -0,0 +1 @@ | ||
1491 | +powerpc/powerpc64/e6500/fpu | ||
diff --git a/meta/recipes-core/eglibc/eglibc-2.18/initgroups_keys.patch b/meta/recipes-core/eglibc/eglibc-2.18/initgroups_keys.patch new file mode 100644 index 0000000000..be29856b03 --- /dev/null +++ b/meta/recipes-core/eglibc/eglibc-2.18/initgroups_keys.patch | |||
@@ -0,0 +1,20 @@ | |||
1 | This is needed since initgroups belongs to NET group | ||
2 | so when NET is disabled in eglibc build then it reports | ||
3 | as undefined symbol | ||
4 | |||
5 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
6 | Upstream-Status: Pending | ||
7 | |||
8 | Index: libc/nss/getent.c | ||
9 | =================================================================== | ||
10 | --- libc.orig/nss/getent.c 2012-03-09 09:41:57.099581559 -0800 | ||
11 | +++ libc/nss/getent.c 2012-03-09 09:42:13.095582334 -0800 | ||
12 | @@ -898,7 +898,7 @@ | ||
13 | D(group) | ||
14 | D(gshadow) | ||
15 | DN(hosts) | ||
16 | -D(initgroups) | ||
17 | +DN(initgroups) | ||
18 | DN(netgroup) | ||
19 | DN(networks) | ||
20 | D(passwd) | ||
diff --git a/meta/recipes-core/eglibc/eglibc-2.18/ld-search-order.patch b/meta/recipes-core/eglibc/eglibc-2.18/ld-search-order.patch new file mode 100644 index 0000000000..e83a0ad6d2 --- /dev/null +++ b/meta/recipes-core/eglibc/eglibc-2.18/ld-search-order.patch | |||
@@ -0,0 +1,56 @@ | |||
1 | Upstream-Status: Inappropriate [embedded specific] | ||
2 | |||
3 | The default lib search path order is: | ||
4 | |||
5 | 1) LD_LIBRARY_PATH | ||
6 | 2) RPATH from the binary | ||
7 | 3) ld.so.cache | ||
8 | 4) default search paths embedded in the linker | ||
9 | |||
10 | For nativesdk binaries which are being used alongside binaries on a host system, we | ||
11 | need the search paths to firstly search the shipped nativesdk libs but then also | ||
12 | cover the host system. For example we want the host system's libGL and this may be | ||
13 | in a non-standard location like /usr/lib/mesa. The only place the location is know | ||
14 | about is in the ld.so.cache of the host system. | ||
15 | |||
16 | Since nativesdk has a simple structure and doesn't need to use a cache itself, we | ||
17 | repurpose the cache for use as a last resort in finding host system binaries. This | ||
18 | means we need to switch the order of 3 and 4 above to make this work effectively. | ||
19 | |||
20 | RP 14/10/2010 | ||
21 | |||
22 | Index: libc/elf/dl-load.c | ||
23 | =================================================================== | ||
24 | --- libc.orig/elf/dl-load.c 2012-12-02 13:11:45.000000000 -0800 | ||
25 | +++ libc/elf/dl-load.c 2013-01-09 07:00:59.135223084 -0800 | ||
26 | @@ -2215,7 +2215,14 @@ | ||
27 | fd = open_path (name, namelen, mode & __RTLD_SECURE, | ||
28 | &loader->l_runpath_dirs, &realname, &fb, loader, | ||
29 | LA_SER_RUNPATH, &found_other_class); | ||
30 | - | ||
31 | + /* try the default path. */ | ||
32 | + if (fd == -1 | ||
33 | + && ((l = loader ?: GL(dl_ns)[nsid]._ns_loaded) == NULL | ||
34 | + || __builtin_expect (!(l->l_flags_1 & DF_1_NODEFLIB), 1)) | ||
35 | + && rtld_search_dirs.dirs != (void *) -1) | ||
36 | + fd = open_path (name, namelen, mode & __RTLD_SECURE, &rtld_search_dirs, | ||
37 | + &realname, &fb, l, LA_SER_DEFAULT, &found_other_class); | ||
38 | + /* Finally try ld.so.cache */ | ||
39 | #ifdef USE_LDCONFIG | ||
40 | if (fd == -1 | ||
41 | && (__builtin_expect (! (mode & __RTLD_SECURE), 1) | ||
42 | @@ -2283,14 +2290,6 @@ | ||
43 | } | ||
44 | #endif | ||
45 | |||
46 | - /* Finally, try the default path. */ | ||
47 | - if (fd == -1 | ||
48 | - && ((l = loader ?: GL(dl_ns)[nsid]._ns_loaded) == NULL | ||
49 | - || __builtin_expect (!(l->l_flags_1 & DF_1_NODEFLIB), 1)) | ||
50 | - && rtld_search_dirs.dirs != (void *) -1) | ||
51 | - fd = open_path (name, namelen, mode & __RTLD_SECURE, &rtld_search_dirs, | ||
52 | - &realname, &fb, l, LA_SER_DEFAULT, &found_other_class); | ||
53 | - | ||
54 | /* Add another newline when we are tracing the library loading. */ | ||
55 | if (__builtin_expect (GLRO_dl_debug_mask & DL_DEBUG_LIBS, 0)) | ||
56 | _dl_debug_printf ("\n"); | ||
diff --git a/meta/recipes-core/eglibc/eglibc-2.18/mips-rld-map-check.patch b/meta/recipes-core/eglibc/eglibc-2.18/mips-rld-map-check.patch new file mode 100644 index 0000000000..9b646fea95 --- /dev/null +++ b/meta/recipes-core/eglibc/eglibc-2.18/mips-rld-map-check.patch | |||
@@ -0,0 +1,26 @@ | |||
1 | |||
2 | On mips target, binutils currently sets DT_MIPS_RLD_MAP to 0 in dynamic | ||
3 | section if a --version-script sets _RLD_MAP to local. This is apparently | ||
4 | a binutils bug, but libc shouldn't segfault in this case. | ||
5 | |||
6 | see also: http://sourceware.org/bugilla/show_bug.cgi?id=11615 | ||
7 | |||
8 | Upstream-Status: Pending | ||
9 | |||
10 | 9/19/2010 - added by Qing He <qing.he@intel.com> | ||
11 | |||
12 | |||
13 | --- | ||
14 | diff -ru glibc-2.10.1.orig/ports/sysdeps/mips/dl-machine.h glibc-2.10.1/ports/sysdeps/mips/dl-machine.h | ||
15 | --- glibc-2.10.1.orig/ports/sysdeps/mips/dl-machine.h 2009-05-16 16:36:20.000000000 +0800 | ||
16 | +++ glibc-2.10.1/ports/sysdeps/mips/dl-machine.h 2010-09-19 09:11:53.000000000 +0800 | ||
17 | @@ -70,7 +70,8 @@ | ||
18 | /* If there is a DT_MIPS_RLD_MAP entry in the dynamic section, fill it in | ||
19 | with the run-time address of the r_debug structure */ | ||
20 | #define ELF_MACHINE_DEBUG_SETUP(l,r) \ | ||
21 | -do { if ((l)->l_info[DT_MIPS (RLD_MAP)]) \ | ||
22 | +do { if ((l)->l_info[DT_MIPS (RLD_MAP)] && \ | ||
23 | + (l)->l_info[DT_MIPS (RLD_MAP)]->d_un.d_ptr) \ | ||
24 | *(ElfW(Addr) *)((l)->l_info[DT_MIPS (RLD_MAP)]->d_un.d_ptr) = \ | ||
25 | (ElfW(Addr)) (r); \ | ||
26 | } while (0) | ||
diff --git a/meta/recipes-core/eglibc/eglibc-2.18/multilib_readlib.patch b/meta/recipes-core/eglibc/eglibc-2.18/multilib_readlib.patch new file mode 100644 index 0000000000..1542b1b519 --- /dev/null +++ b/meta/recipes-core/eglibc/eglibc-2.18/multilib_readlib.patch | |||
@@ -0,0 +1,17 @@ | |||
1 | Upstream-Status: Inappropriate [embedded specific] | ||
2 | |||
3 | Replace the OECORE_KNOWN_INTERPRETER_NAMES with the value of | ||
4 | variable EGLIBC_KNOWN_INTERPRETER_NAMES. | ||
5 | |||
6 | Lianhao Lu, 08/01/2011 | ||
7 | |||
8 | --- libc/elf/readlib.c.orig 2011-08-12 17:05:51.864470837 +0800 | ||
9 | +++ libc/elf/readlib.c 2011-08-12 17:06:39.346942074 +0800 | ||
10 | @@ -52,6 +52,7 @@ | ||
11 | #ifdef SYSDEP_KNOWN_INTERPRETER_NAMES | ||
12 | SYSDEP_KNOWN_INTERPRETER_NAMES | ||
13 | #endif | ||
14 | + OECORE_KNOWN_INTERPRETER_NAMES | ||
15 | }; | ||
16 | |||
17 | static struct known_names known_libs[] = | ||
diff --git a/meta/recipes-core/eglibc/eglibc-2.18/ppc-sqrt_finite.patch b/meta/recipes-core/eglibc/eglibc-2.18/ppc-sqrt_finite.patch new file mode 100644 index 0000000000..6ea666b1d6 --- /dev/null +++ b/meta/recipes-core/eglibc/eglibc-2.18/ppc-sqrt_finite.patch | |||
@@ -0,0 +1,184 @@ | |||
1 | on ppc fixes the errors like below | ||
2 | | ./.libs/libpulsecore-1.1.so: undefined reference to `__sqrt_finite' | ||
3 | | collect2: ld returned 1 exit status | ||
4 | |||
5 | Upstream-Status: Pending | ||
6 | |||
7 | ChangeLog | ||
8 | |||
9 | 2012-01-06 Khem Raj <raj.khem@gmail.com> | ||
10 | |||
11 | * sysdeps/powerpc/powerpc64/e5500/fpu/e_sqrtf.c: Add __*_finite alias. | ||
12 | Remove cruft. | ||
13 | * sysdeps/powerpc/powerpc64/e5500/fpu/e_sqrt.c: Ditto. | ||
14 | * sysdeps/powerpc/powerpc32/603e/fpu/e_sqrt.c: Ditto. | ||
15 | * sysdeps/powerpc/powerpc32/603e/fpu/e_sqrtf.c: Ditto. | ||
16 | |||
17 | Index: libc/sysdeps/powerpc/powerpc32/603e/fpu/e_sqrt.c | ||
18 | =================================================================== | ||
19 | --- libc.orig/sysdeps/powerpc/powerpc32/603e/fpu/e_sqrt.c | ||
20 | +++ libc/sysdeps/powerpc/powerpc32/603e/fpu/e_sqrt.c | ||
21 | @@ -39,14 +39,8 @@ static const float half = 0.5; | ||
22 | We find the actual square root and half of its reciprocal | ||
23 | simultaneously. */ | ||
24 | |||
25 | -#ifdef __STDC__ | ||
26 | double | ||
27 | __ieee754_sqrt (double b) | ||
28 | -#else | ||
29 | -double | ||
30 | -__ieee754_sqrt (b) | ||
31 | - double b; | ||
32 | -#endif | ||
33 | { | ||
34 | if (__builtin_expect (b > 0, 1)) | ||
35 | { | ||
36 | @@ -132,3 +126,4 @@ __ieee754_sqrt (b) | ||
37 | } | ||
38 | return f_wash (b); | ||
39 | } | ||
40 | +strong_alias (__ieee754_sqrt, __sqrt_finite) | ||
41 | Index: libc/sysdeps/powerpc/powerpc32/603e/fpu/e_sqrtf.c | ||
42 | =================================================================== | ||
43 | --- libc.orig/sysdeps/powerpc/powerpc32/603e/fpu/e_sqrtf.c | ||
44 | +++ libc/sysdeps/powerpc/powerpc32/603e/fpu/e_sqrtf.c | ||
45 | @@ -37,14 +37,8 @@ static const float threehalf = 1.5; | ||
46 | We find the reciprocal square root and use that to compute the actual | ||
47 | square root. */ | ||
48 | |||
49 | -#ifdef __STDC__ | ||
50 | float | ||
51 | __ieee754_sqrtf (float b) | ||
52 | -#else | ||
53 | -float | ||
54 | -__ieee754_sqrtf (b) | ||
55 | - float b; | ||
56 | -#endif | ||
57 | { | ||
58 | if (__builtin_expect (b > 0, 1)) | ||
59 | { | ||
60 | @@ -99,3 +93,4 @@ __ieee754_sqrtf (b) | ||
61 | } | ||
62 | return f_washf (b); | ||
63 | } | ||
64 | +strong_alias (__ieee754_sqrtf, __sqrtf_finite) | ||
65 | Index: libc/sysdeps/powerpc/powerpc64/e5500/fpu/e_sqrt.c | ||
66 | =================================================================== | ||
67 | --- libc.orig/sysdeps/powerpc/powerpc64/e5500/fpu/e_sqrt.c | ||
68 | +++ libc/sysdeps/powerpc/powerpc64/e5500/fpu/e_sqrt.c | ||
69 | @@ -39,14 +39,8 @@ static const float half = 0.5; | ||
70 | We find the actual square root and half of its reciprocal | ||
71 | simultaneously. */ | ||
72 | |||
73 | -#ifdef __STDC__ | ||
74 | double | ||
75 | __ieee754_sqrt (double b) | ||
76 | -#else | ||
77 | -double | ||
78 | -__ieee754_sqrt (b) | ||
79 | - double b; | ||
80 | -#endif | ||
81 | { | ||
82 | if (__builtin_expect (b > 0, 1)) | ||
83 | { | ||
84 | @@ -132,3 +126,4 @@ __ieee754_sqrt (b) | ||
85 | } | ||
86 | return f_wash (b); | ||
87 | } | ||
88 | +strong_alias (__ieee754_sqrt, __sqrt_finite) | ||
89 | Index: libc/sysdeps/powerpc/powerpc64/e5500/fpu/e_sqrtf.c | ||
90 | =================================================================== | ||
91 | --- libc.orig/sysdeps/powerpc/powerpc64/e5500/fpu/e_sqrtf.c | ||
92 | +++ libc/sysdeps/powerpc/powerpc64/e5500/fpu/e_sqrtf.c | ||
93 | @@ -37,14 +37,8 @@ static const float threehalf = 1.5; | ||
94 | We find the reciprocal square root and use that to compute the actual | ||
95 | square root. */ | ||
96 | |||
97 | -#ifdef __STDC__ | ||
98 | float | ||
99 | __ieee754_sqrtf (float b) | ||
100 | -#else | ||
101 | -float | ||
102 | -__ieee754_sqrtf (b) | ||
103 | - float b; | ||
104 | -#endif | ||
105 | { | ||
106 | if (__builtin_expect (b > 0, 1)) | ||
107 | { | ||
108 | @@ -99,3 +93,4 @@ __ieee754_sqrtf (b) | ||
109 | } | ||
110 | return f_washf (b); | ||
111 | } | ||
112 | +strong_alias (__ieee754_sqrtf, __sqrtf_finite) | ||
113 | Index: libc/sysdeps/powerpc/powerpc32/e500mc/fpu/e_sqrt.c | ||
114 | =================================================================== | ||
115 | --- libc.orig/sysdeps/powerpc/powerpc32/e500mc/fpu/e_sqrt.c | ||
116 | +++ libc/sysdeps/powerpc/powerpc32/e500mc/fpu/e_sqrt.c | ||
117 | @@ -132,3 +132,4 @@ __ieee754_sqrt (b) | ||
118 | } | ||
119 | return f_wash (b); | ||
120 | } | ||
121 | +strong_alias (__ieee754_sqrt, __sqrt_finite) | ||
122 | Index: libc/sysdeps/powerpc/powerpc32/e500mc/fpu/e_sqrtf.c | ||
123 | =================================================================== | ||
124 | --- libc.orig/sysdeps/powerpc/powerpc32/e500mc/fpu/e_sqrtf.c | ||
125 | +++ libc/sysdeps/powerpc/powerpc32/e500mc/fpu/e_sqrtf.c | ||
126 | @@ -99,3 +99,4 @@ __ieee754_sqrtf (b) | ||
127 | } | ||
128 | return f_washf (b); | ||
129 | } | ||
130 | +strong_alias (__ieee754_sqrtf, __sqrtf_finite) | ||
131 | Index: libc/sysdeps/powerpc/powerpc32/e5500/fpu/e_sqrt.c | ||
132 | =================================================================== | ||
133 | --- libc.orig/sysdeps/powerpc/powerpc32/e5500/fpu/e_sqrt.c | ||
134 | +++ libc/sysdeps/powerpc/powerpc32/e5500/fpu/e_sqrt.c | ||
135 | @@ -132,3 +132,4 @@ __ieee754_sqrt (b) | ||
136 | } | ||
137 | return f_wash (b); | ||
138 | } | ||
139 | +strong_alias (__ieee754_sqrt, __sqrt_finite) | ||
140 | Index: libc/sysdeps/powerpc/powerpc32/e5500/fpu/e_sqrtf.c | ||
141 | =================================================================== | ||
142 | --- libc.orig/sysdeps/powerpc/powerpc32/e5500/fpu/e_sqrtf.c | ||
143 | +++ libc/sysdeps/powerpc/powerpc32/e5500/fpu/e_sqrtf.c | ||
144 | @@ -99,3 +99,4 @@ __ieee754_sqrtf (b) | ||
145 | } | ||
146 | return f_washf (b); | ||
147 | } | ||
148 | +strong_alias (__ieee754_sqrtf, __sqrtf_finite) | ||
149 | Index: libc/sysdeps/powerpc/powerpc64/e6500/fpu/e_sqrt.c | ||
150 | =================================================================== | ||
151 | --- libc.orig/sysdeps/powerpc/powerpc64/e6500/fpu/e_sqrt.c | ||
152 | +++ libc/sysdeps/powerpc/powerpc64/e6500/fpu/e_sqrt.c | ||
153 | @@ -132,3 +132,4 @@ __ieee754_sqrt (b) | ||
154 | } | ||
155 | return f_wash (b); | ||
156 | } | ||
157 | +strong_alias (__ieee754_sqrt, __sqrt_finite) | ||
158 | Index: libc/sysdeps/powerpc/powerpc64/e6500/fpu/e_sqrtf.c | ||
159 | =================================================================== | ||
160 | --- libc.orig/sysdeps/powerpc/powerpc64/e6500/fpu/e_sqrtf.c | ||
161 | +++ libc/sysdeps/powerpc/powerpc64/e6500/fpu/e_sqrtf.c | ||
162 | @@ -99,3 +99,4 @@ __ieee754_sqrtf (b) | ||
163 | } | ||
164 | return f_washf (b); | ||
165 | } | ||
166 | +strong_alias (__ieee754_sqrtf, __sqrtf_finite) | ||
167 | Index: libc/sysdeps/powerpc/powerpc32/e6500/fpu/e_sqrt.c | ||
168 | =================================================================== | ||
169 | --- libc.orig/sysdeps/powerpc/powerpc32/e6500/fpu/e_sqrt.c | ||
170 | +++ libc/sysdeps/powerpc/powerpc32/e6500/fpu/e_sqrt.c | ||
171 | @@ -132,3 +132,4 @@ __ieee754_sqrt (b) | ||
172 | } | ||
173 | return f_wash (b); | ||
174 | } | ||
175 | +strong_alias (__ieee754_sqrt, __sqrt_finite) | ||
176 | Index: libc/sysdeps/powerpc/powerpc32/e6500/fpu/e_sqrtf.c | ||
177 | =================================================================== | ||
178 | --- libc.orig/sysdeps/powerpc/powerpc32/e6500/fpu/e_sqrtf.c | ||
179 | +++ libc/sysdeps/powerpc/powerpc32/e6500/fpu/e_sqrtf.c | ||
180 | @@ -99,3 +99,4 @@ __ieee754_sqrtf (b) | ||
181 | } | ||
182 | return f_washf (b); | ||
183 | } | ||
184 | +strong_alias (__ieee754_sqrtf, __sqrtf_finite) | ||
diff --git a/meta/recipes-core/eglibc/eglibc-2.18/ppc_slow_ieee754_sqrt.patch b/meta/recipes-core/eglibc/eglibc-2.18/ppc_slow_ieee754_sqrt.patch new file mode 100644 index 0000000000..60532cbd03 --- /dev/null +++ b/meta/recipes-core/eglibc/eglibc-2.18/ppc_slow_ieee754_sqrt.patch | |||
@@ -0,0 +1,365 @@ | |||
1 | __ieee754_sqrt{,f} are now inline functions and call out __slow versions | ||
2 | |||
3 | |||
4 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
5 | Upstream-Status: Pending | ||
6 | Index: libc/sysdeps/powerpc/powerpc32/603e/fpu/e_sqrt.c | ||
7 | =================================================================== | ||
8 | --- libc.orig/sysdeps/powerpc/powerpc32/603e/fpu/e_sqrt.c | ||
9 | +++ libc/sysdeps/powerpc/powerpc32/603e/fpu/e_sqrt.c | ||
10 | @@ -40,7 +40,7 @@ static const float half = 0.5; | ||
11 | simultaneously. */ | ||
12 | |||
13 | double | ||
14 | -__ieee754_sqrt (double b) | ||
15 | +__slow_ieee754_sqrt (double b) | ||
16 | { | ||
17 | if (__builtin_expect (b > 0, 1)) | ||
18 | { | ||
19 | @@ -77,7 +77,7 @@ __ieee754_sqrt (double b) | ||
20 | |||
21 | /* Handle small numbers by scaling. */ | ||
22 | if (__builtin_expect ((u.parts.msw & 0x7ff00000) <= 0x02000000, 0)) | ||
23 | - return __ieee754_sqrt (b * two108) * twom54; | ||
24 | + return __slow_ieee754_sqrt (b * two108) * twom54; | ||
25 | |||
26 | #define FMADD(a_, c_, b_) \ | ||
27 | ({ double __r; \ | ||
28 | @@ -126,4 +126,12 @@ __ieee754_sqrt (double b) | ||
29 | } | ||
30 | return f_wash (b); | ||
31 | } | ||
32 | + | ||
33 | +#undef __ieee754_sqrt | ||
34 | +double | ||
35 | +__ieee754_sqrt (double x) | ||
36 | +{ | ||
37 | + return __slow_ieee754_sqrt (x); | ||
38 | +} | ||
39 | + | ||
40 | strong_alias (__ieee754_sqrt, __sqrt_finite) | ||
41 | Index: libc/sysdeps/powerpc/powerpc32/603e/fpu/e_sqrtf.c | ||
42 | =================================================================== | ||
43 | --- libc.orig/sysdeps/powerpc/powerpc32/603e/fpu/e_sqrtf.c | ||
44 | +++ libc/sysdeps/powerpc/powerpc32/603e/fpu/e_sqrtf.c | ||
45 | @@ -38,7 +38,7 @@ static const float threehalf = 1.5; | ||
46 | square root. */ | ||
47 | |||
48 | float | ||
49 | -__ieee754_sqrtf (float b) | ||
50 | +__slow_ieee754_sqrtf (float b) | ||
51 | { | ||
52 | if (__builtin_expect (b > 0, 1)) | ||
53 | { | ||
54 | @@ -93,4 +93,10 @@ __ieee754_sqrtf (float b) | ||
55 | } | ||
56 | return f_washf (b); | ||
57 | } | ||
58 | +#undef __ieee754_sqrtf | ||
59 | +float | ||
60 | +__ieee754_sqrtf (float x) | ||
61 | +{ | ||
62 | + return __slow_ieee754_sqrtf (x); | ||
63 | +} | ||
64 | strong_alias (__ieee754_sqrtf, __sqrtf_finite) | ||
65 | Index: libc/sysdeps/powerpc/powerpc64/e5500/fpu/e_sqrt.c | ||
66 | =================================================================== | ||
67 | --- libc.orig/sysdeps/powerpc/powerpc64/e5500/fpu/e_sqrt.c | ||
68 | +++ libc/sysdeps/powerpc/powerpc64/e5500/fpu/e_sqrt.c | ||
69 | @@ -40,7 +40,7 @@ static const float half = 0.5; | ||
70 | simultaneously. */ | ||
71 | |||
72 | double | ||
73 | -__ieee754_sqrt (double b) | ||
74 | +__slow_ieee754_sqrt (double b) | ||
75 | { | ||
76 | if (__builtin_expect (b > 0, 1)) | ||
77 | { | ||
78 | @@ -77,7 +77,7 @@ __ieee754_sqrt (double b) | ||
79 | |||
80 | /* Handle small numbers by scaling. */ | ||
81 | if (__builtin_expect ((u.parts.msw & 0x7ff00000) <= 0x02000000, 0)) | ||
82 | - return __ieee754_sqrt (b * two108) * twom54; | ||
83 | + return __slow_ieee754_sqrt (b * two108) * twom54; | ||
84 | |||
85 | #define FMADD(a_, c_, b_) \ | ||
86 | ({ double __r; \ | ||
87 | @@ -126,4 +126,12 @@ __ieee754_sqrt (double b) | ||
88 | } | ||
89 | return f_wash (b); | ||
90 | } | ||
91 | + | ||
92 | +#undef __ieee754_sqrt | ||
93 | +double | ||
94 | +__ieee754_sqrt (double x) | ||
95 | +{ | ||
96 | + return __slow_ieee754_sqrt (x); | ||
97 | +} | ||
98 | + | ||
99 | strong_alias (__ieee754_sqrt, __sqrt_finite) | ||
100 | Index: libc/sysdeps/powerpc/powerpc64/e5500/fpu/e_sqrtf.c | ||
101 | =================================================================== | ||
102 | --- libc.orig/sysdeps/powerpc/powerpc64/e5500/fpu/e_sqrtf.c | ||
103 | +++ libc/sysdeps/powerpc/powerpc64/e5500/fpu/e_sqrtf.c | ||
104 | @@ -38,7 +38,7 @@ static const float threehalf = 1.5; | ||
105 | square root. */ | ||
106 | |||
107 | float | ||
108 | -__ieee754_sqrtf (float b) | ||
109 | +__slow_ieee754_sqrtf (float b) | ||
110 | { | ||
111 | if (__builtin_expect (b > 0, 1)) | ||
112 | { | ||
113 | @@ -93,4 +93,11 @@ __ieee754_sqrtf (float b) | ||
114 | } | ||
115 | return f_washf (b); | ||
116 | } | ||
117 | +#undef __ieee754_sqrtf | ||
118 | +float | ||
119 | +__ieee754_sqrtf (float x) | ||
120 | +{ | ||
121 | + return __slow_ieee754_sqrtf (x); | ||
122 | +} | ||
123 | + | ||
124 | strong_alias (__ieee754_sqrtf, __sqrtf_finite) | ||
125 | Index: libc/sysdeps/powerpc/powerpc64/e6500/fpu/e_sqrt.c | ||
126 | =================================================================== | ||
127 | --- libc.orig/sysdeps/powerpc/powerpc64/e6500/fpu/e_sqrt.c | ||
128 | +++ libc/sysdeps/powerpc/powerpc64/e6500/fpu/e_sqrt.c | ||
129 | @@ -41,10 +41,10 @@ static const float half = 0.5; | ||
130 | |||
131 | #ifdef __STDC__ | ||
132 | double | ||
133 | -__ieee754_sqrt (double b) | ||
134 | +__slow_ieee754_sqrt (double b) | ||
135 | #else | ||
136 | double | ||
137 | -__ieee754_sqrt (b) | ||
138 | +__slow_ieee754_sqrt (b) | ||
139 | double b; | ||
140 | #endif | ||
141 | { | ||
142 | @@ -83,7 +83,7 @@ __ieee754_sqrt (b) | ||
143 | |||
144 | /* Handle small numbers by scaling. */ | ||
145 | if (__builtin_expect ((u.parts.msw & 0x7ff00000) <= 0x02000000, 0)) | ||
146 | - return __ieee754_sqrt (b * two108) * twom54; | ||
147 | + return __slow_ieee754_sqrt (b * two108) * twom54; | ||
148 | |||
149 | #define FMADD(a_, c_, b_) \ | ||
150 | ({ double __r; \ | ||
151 | @@ -132,4 +132,12 @@ __ieee754_sqrt (b) | ||
152 | } | ||
153 | return f_wash (b); | ||
154 | } | ||
155 | + | ||
156 | +#undef __ieee754_sqrt | ||
157 | +double | ||
158 | +__ieee754_sqrt (double x) | ||
159 | +{ | ||
160 | + return __slow_ieee754_sqrt (x); | ||
161 | +} | ||
162 | + | ||
163 | strong_alias (__ieee754_sqrt, __sqrt_finite) | ||
164 | Index: libc/sysdeps/powerpc/powerpc64/e6500/fpu/e_sqrtf.c | ||
165 | =================================================================== | ||
166 | --- libc.orig/sysdeps/powerpc/powerpc64/e6500/fpu/e_sqrtf.c | ||
167 | +++ libc/sysdeps/powerpc/powerpc64/e6500/fpu/e_sqrtf.c | ||
168 | @@ -39,10 +39,10 @@ static const float threehalf = 1.5; | ||
169 | |||
170 | #ifdef __STDC__ | ||
171 | float | ||
172 | -__ieee754_sqrtf (float b) | ||
173 | +__slow_ieee754_sqrtf (float b) | ||
174 | #else | ||
175 | float | ||
176 | -__ieee754_sqrtf (b) | ||
177 | +__slow_ieee754_sqrtf (b) | ||
178 | float b; | ||
179 | #endif | ||
180 | { | ||
181 | @@ -99,4 +99,12 @@ __ieee754_sqrtf (b) | ||
182 | } | ||
183 | return f_washf (b); | ||
184 | } | ||
185 | + | ||
186 | +#undef __ieee754_sqrtf | ||
187 | +float | ||
188 | +__ieee754_sqrtf (float x) | ||
189 | +{ | ||
190 | + return __slow_ieee754_sqrtf (x); | ||
191 | +} | ||
192 | + | ||
193 | strong_alias (__ieee754_sqrtf, __sqrtf_finite) | ||
194 | Index: libc/sysdeps/powerpc/powerpc32/e500mc/fpu/e_sqrt.c | ||
195 | =================================================================== | ||
196 | --- libc.orig/sysdeps/powerpc/powerpc32/e500mc/fpu/e_sqrt.c | ||
197 | +++ libc/sysdeps/powerpc/powerpc32/e500mc/fpu/e_sqrt.c | ||
198 | @@ -41,10 +41,10 @@ static const float half = 0.5; | ||
199 | |||
200 | #ifdef __STDC__ | ||
201 | double | ||
202 | -__ieee754_sqrt (double b) | ||
203 | +__slow_ieee754_sqrt (double b) | ||
204 | #else | ||
205 | double | ||
206 | -__ieee754_sqrt (b) | ||
207 | +__slow_ieee754_sqrt (b) | ||
208 | double b; | ||
209 | #endif | ||
210 | { | ||
211 | @@ -83,7 +83,7 @@ __ieee754_sqrt (b) | ||
212 | |||
213 | /* Handle small numbers by scaling. */ | ||
214 | if (__builtin_expect ((u.parts.msw & 0x7ff00000) <= 0x02000000, 0)) | ||
215 | - return __ieee754_sqrt (b * two108) * twom54; | ||
216 | + return __slow_ieee754_sqrt (b * two108) * twom54; | ||
217 | |||
218 | #define FMADD(a_, c_, b_) \ | ||
219 | ({ double __r; \ | ||
220 | @@ -132,4 +132,12 @@ __ieee754_sqrt (b) | ||
221 | } | ||
222 | return f_wash (b); | ||
223 | } | ||
224 | + | ||
225 | +#undef __ieee754_sqrt | ||
226 | +double | ||
227 | +__ieee754_sqrt (double x) | ||
228 | +{ | ||
229 | + return __slow_ieee754_sqrt (x); | ||
230 | +} | ||
231 | + | ||
232 | strong_alias (__ieee754_sqrt, __sqrt_finite) | ||
233 | Index: libc/sysdeps/powerpc/powerpc32/e500mc/fpu/e_sqrtf.c | ||
234 | =================================================================== | ||
235 | --- libc.orig/sysdeps/powerpc/powerpc32/e500mc/fpu/e_sqrtf.c | ||
236 | +++ libc/sysdeps/powerpc/powerpc32/e500mc/fpu/e_sqrtf.c | ||
237 | @@ -39,10 +39,10 @@ static const float threehalf = 1.5; | ||
238 | |||
239 | #ifdef __STDC__ | ||
240 | float | ||
241 | -__ieee754_sqrtf (float b) | ||
242 | +__slow_ieee754_sqrtf (float b) | ||
243 | #else | ||
244 | float | ||
245 | -__ieee754_sqrtf (b) | ||
246 | +__slow_ieee754_sqrtf (b) | ||
247 | float b; | ||
248 | #endif | ||
249 | { | ||
250 | @@ -99,4 +99,12 @@ __ieee754_sqrtf (b) | ||
251 | } | ||
252 | return f_washf (b); | ||
253 | } | ||
254 | + | ||
255 | +#undef __ieee754_sqrtf | ||
256 | +float | ||
257 | +__ieee754_sqrtf (float x) | ||
258 | +{ | ||
259 | + return __slow_ieee754_sqrtf (x); | ||
260 | +} | ||
261 | + | ||
262 | strong_alias (__ieee754_sqrtf, __sqrtf_finite) | ||
263 | Index: libc/sysdeps/powerpc/powerpc32/e5500/fpu/e_sqrt.c | ||
264 | =================================================================== | ||
265 | --- libc.orig/sysdeps/powerpc/powerpc32/e5500/fpu/e_sqrt.c | ||
266 | +++ libc/sysdeps/powerpc/powerpc32/e5500/fpu/e_sqrt.c | ||
267 | @@ -41,10 +41,10 @@ static const float half = 0.5; | ||
268 | |||
269 | #ifdef __STDC__ | ||
270 | double | ||
271 | -__ieee754_sqrt (double b) | ||
272 | +__slow_ieee754_sqrt (double b) | ||
273 | #else | ||
274 | double | ||
275 | -__ieee754_sqrt (b) | ||
276 | +__slow_ieee754_sqrt (b) | ||
277 | double b; | ||
278 | #endif | ||
279 | { | ||
280 | @@ -83,7 +83,7 @@ __ieee754_sqrt (b) | ||
281 | |||
282 | /* Handle small numbers by scaling. */ | ||
283 | if (__builtin_expect ((u.parts.msw & 0x7ff00000) <= 0x02000000, 0)) | ||
284 | - return __ieee754_sqrt (b * two108) * twom54; | ||
285 | + return __slow_ieee754_sqrt (b * two108) * twom54; | ||
286 | |||
287 | #define FMADD(a_, c_, b_) \ | ||
288 | ({ double __r; \ | ||
289 | @@ -132,4 +132,12 @@ __ieee754_sqrt (b) | ||
290 | } | ||
291 | return f_wash (b); | ||
292 | } | ||
293 | + | ||
294 | +#undef __ieee754_sqrt | ||
295 | +double | ||
296 | +__ieee754_sqrt (double x) | ||
297 | +{ | ||
298 | + return __slow_ieee754_sqrt (x); | ||
299 | +} | ||
300 | + | ||
301 | strong_alias (__ieee754_sqrt, __sqrt_finite) | ||
302 | Index: libc/sysdeps/powerpc/powerpc32/e5500/fpu/e_sqrtf.c | ||
303 | =================================================================== | ||
304 | --- libc.orig/sysdeps/powerpc/powerpc32/e5500/fpu/e_sqrtf.c | ||
305 | +++ libc/sysdeps/powerpc/powerpc32/e5500/fpu/e_sqrtf.c | ||
306 | @@ -39,10 +39,10 @@ static const float threehalf = 1.5; | ||
307 | |||
308 | #ifdef __STDC__ | ||
309 | float | ||
310 | -__ieee754_sqrtf (float b) | ||
311 | +__slow_ieee754_sqrtf (float b) | ||
312 | #else | ||
313 | float | ||
314 | -__ieee754_sqrtf (b) | ||
315 | +__slow_ieee754_sqrtf (b) | ||
316 | float b; | ||
317 | #endif | ||
318 | { | ||
319 | @@ -99,4 +99,12 @@ __ieee754_sqrtf (b) | ||
320 | } | ||
321 | return f_washf (b); | ||
322 | } | ||
323 | + | ||
324 | +#undef __ieee754_sqrtf | ||
325 | +float | ||
326 | +__ieee754_sqrtf (float x) | ||
327 | +{ | ||
328 | + return __slow_ieee754_sqrtf (x); | ||
329 | +} | ||
330 | + | ||
331 | strong_alias (__ieee754_sqrtf, __sqrtf_finite) | ||
332 | Index: libc/sysdeps/powerpc/powerpc32/e6500/fpu/e_sqrt.c | ||
333 | =================================================================== | ||
334 | --- libc.orig/sysdeps/powerpc/powerpc32/e6500/fpu/e_sqrt.c | ||
335 | +++ libc/sysdeps/powerpc/powerpc32/e6500/fpu/e_sqrt.c | ||
336 | @@ -132,4 +132,12 @@ __ieee754_sqrt (b) | ||
337 | } | ||
338 | return f_wash (b); | ||
339 | } | ||
340 | + | ||
341 | +#undef __ieee754_sqrt | ||
342 | +double | ||
343 | +__ieee754_sqrt (double x) | ||
344 | +{ | ||
345 | + return __slow_ieee754_sqrt (x); | ||
346 | +} | ||
347 | + | ||
348 | strong_alias (__ieee754_sqrt, __sqrt_finite) | ||
349 | Index: libc/sysdeps/powerpc/powerpc32/e6500/fpu/e_sqrtf.c | ||
350 | =================================================================== | ||
351 | --- libc.orig/sysdeps/powerpc/powerpc32/e6500/fpu/e_sqrtf.c | ||
352 | +++ libc/sysdeps/powerpc/powerpc32/e6500/fpu/e_sqrtf.c | ||
353 | @@ -99,4 +99,12 @@ __ieee754_sqrtf (b) | ||
354 | } | ||
355 | return f_washf (b); | ||
356 | } | ||
357 | + | ||
358 | +#undef __ieee754_sqrtf | ||
359 | +float | ||
360 | +__ieee754_sqrtf (float x) | ||
361 | +{ | ||
362 | + return __slow_ieee754_sqrtf (x); | ||
363 | +} | ||
364 | + | ||
365 | strong_alias (__ieee754_sqrtf, __sqrtf_finite) | ||
diff --git a/meta/recipes-core/eglibc/eglibc-2.18/relocatable_sdk.patch b/meta/recipes-core/eglibc/eglibc-2.18/relocatable_sdk.patch new file mode 100644 index 0000000000..ca5f17ba58 --- /dev/null +++ b/meta/recipes-core/eglibc/eglibc-2.18/relocatable_sdk.patch | |||
@@ -0,0 +1,108 @@ | |||
1 | Upstream-Status: Inappropriate [SDK specific] | ||
2 | |||
3 | This patch puts the dynamic loader path in the binaries, SYSTEM_DIRS strings | ||
4 | and lengths as well as ld.so.cache path in the dynamic loader to specific | ||
5 | sections in memory. The sections that contain paths have been allocated a 4096 | ||
6 | byte section, which is the maximum path length in linux. This will allow the | ||
7 | relocating script to parse the ELF binary, detect the section and easily replace | ||
8 | the strings in a certain path. | ||
9 | |||
10 | Signed-off-by: Laurentiu Palcu <laurentiu.palcu@intel.com> | ||
11 | |||
12 | Index: libc/elf/interp.c | ||
13 | =================================================================== | ||
14 | --- libc.orig/elf/interp.c | ||
15 | +++ libc/elf/interp.c | ||
16 | @@ -16,5 +16,5 @@ | ||
17 | License along with the GNU C Library; if not, see | ||
18 | <http://www.gnu.org/licenses/>. */ | ||
19 | |||
20 | -const char __invoke_dynamic_linker__[] __attribute__ ((section (".interp"))) | ||
21 | +const char __invoke_dynamic_linker__[4096] __attribute__ ((section (".interp"))) | ||
22 | = RUNTIME_LINKER; | ||
23 | Index: libc/elf/dl-load.c | ||
24 | =================================================================== | ||
25 | --- libc.orig/elf/dl-load.c | ||
26 | +++ libc/elf/dl-load.c | ||
27 | @@ -144,8 +144,8 @@ static size_t max_capstrlen attribute_re | ||
28 | /* Get the generated information about the trusted directories. */ | ||
29 | #include "trusted-dirs.h" | ||
30 | |||
31 | -static const char system_dirs[] = SYSTEM_DIRS; | ||
32 | -static const size_t system_dirs_len[] = | ||
33 | +static const char system_dirs[4096] __attribute__ ((section (".sysdirs"))) = SYSTEM_DIRS; | ||
34 | +volatile static const size_t system_dirs_len[] __attribute__ ((section (".sysdirslen"))) = | ||
35 | { | ||
36 | SYSTEM_DIRS_LEN | ||
37 | }; | ||
38 | Index: libc/elf/dl-cache.c | ||
39 | =================================================================== | ||
40 | --- libc.orig/elf/dl-cache.c | ||
41 | +++ libc/elf/dl-cache.c | ||
42 | @@ -133,6 +133,10 @@ do \ | ||
43 | while (0) | ||
44 | |||
45 | |||
46 | +const char LD_SO_CACHE[4096] __attribute__ ((section (".ldsocache"))) = | ||
47 | + SYSCONFDIR "/ld.so.cache"; | ||
48 | + | ||
49 | + | ||
50 | int | ||
51 | internal_function | ||
52 | _dl_cache_libcmp (const char *p1, const char *p2) | ||
53 | Index: libc/elf/ldconfig.c | ||
54 | =================================================================== | ||
55 | --- libc.orig/elf/ldconfig.c | ||
56 | +++ libc/elf/ldconfig.c | ||
57 | @@ -166,6 +166,9 @@ static struct argp argp = | ||
58 | options, parse_opt, NULL, doc, NULL, more_help, NULL | ||
59 | }; | ||
60 | |||
61 | + | ||
62 | +extern const char LD_SO_CACHE[4096] __attribute__ ((section (".ldsocache"))); | ||
63 | + | ||
64 | /* Check if string corresponds to an important hardware capability or | ||
65 | a platform. */ | ||
66 | static int | ||
67 | Index: libc/sysdeps/generic/dl-cache.h | ||
68 | =================================================================== | ||
69 | --- libc.orig/sysdeps/generic/dl-cache.h | ||
70 | +++ libc/sysdeps/generic/dl-cache.h | ||
71 | @@ -27,10 +27,6 @@ | ||
72 | ((flags) == 1 || (flags) == _DL_CACHE_DEFAULT_ID) | ||
73 | #endif | ||
74 | |||
75 | -#ifndef LD_SO_CACHE | ||
76 | -# define LD_SO_CACHE SYSCONFDIR "/ld.so.cache" | ||
77 | -#endif | ||
78 | - | ||
79 | #ifndef add_system_dir | ||
80 | # define add_system_dir(dir) add_dir (dir) | ||
81 | #endif | ||
82 | Index: libc/elf/rtld.c | ||
83 | =================================================================== | ||
84 | --- libc.orig/elf/rtld.c | ||
85 | +++ libc/elf/rtld.c | ||
86 | @@ -99,6 +99,7 @@ uintptr_t __pointer_chk_guard_local | ||
87 | strong_alias (__pointer_chk_guard_local, __pointer_chk_guard) | ||
88 | #endif | ||
89 | |||
90 | +extern const char LD_SO_CACHE[4096] __attribute__ ((section (".ldsocache"))); | ||
91 | |||
92 | /* List of auditing DSOs. */ | ||
93 | static struct audit_list | ||
94 | @@ -1031,12 +1032,12 @@ of this helper program; chances are you | ||
95 | --list list all dependencies and how they are resolved\n\ | ||
96 | --verify verify that given object really is a dynamically linked\n\ | ||
97 | object we can handle\n\ | ||
98 | - --inhibit-cache Do not use " LD_SO_CACHE "\n\ | ||
99 | + --inhibit-cache Do not use %s\n\ | ||
100 | --library-path PATH use given PATH instead of content of the environment\n\ | ||
101 | variable LD_LIBRARY_PATH\n\ | ||
102 | --inhibit-rpath LIST ignore RUNPATH and RPATH information in object names\n\ | ||
103 | in LIST\n\ | ||
104 | - --audit LIST use objects named in LIST as auditors\n"); | ||
105 | + --audit LIST use objects named in LIST as auditors\n", LD_SO_CACHE); | ||
106 | |||
107 | ++_dl_skip_args; | ||
108 | --_dl_argc; | ||
diff --git a/meta/recipes-core/eglibc/eglibc-2.18/relocatable_sdk_fix_openpath.patch b/meta/recipes-core/eglibc/eglibc-2.18/relocatable_sdk_fix_openpath.patch new file mode 100644 index 0000000000..f164f8f9ae --- /dev/null +++ b/meta/recipes-core/eglibc/eglibc-2.18/relocatable_sdk_fix_openpath.patch | |||
@@ -0,0 +1,41 @@ | |||
1 | Upstream-Status: Inappropriate [SDK specific] | ||
2 | |||
3 | eglibc-nativesdk: Fix buffer overrun with a relocated SDK | ||
4 | |||
5 | When ld-linux-*.so.2 is relocated to a path that is longer than the | ||
6 | original fixed location, the dynamic loader will crash in open_path | ||
7 | because it implicitly assumes that max_dirnamelen is a fixed size that | ||
8 | never changes. | ||
9 | |||
10 | The allocated buffer will not be large enough to contain the directory | ||
11 | path string which is larger than the fixed location provided at build | ||
12 | time. | ||
13 | |||
14 | Signed-off-by: Jason Wessel <jason.wessel@windriver.com> | ||
15 | |||
16 | --- | ||
17 | elf/dl-load.c | 12 ++++++++++++ | ||
18 | 1 file changed, 12 insertions(+) | ||
19 | |||
20 | --- a/elf/dl-load.c | ||
21 | +++ b/elf/dl-load.c | ||
22 | @@ -1919,7 +1919,19 @@ open_path (const char *name, size_t name | ||
23 | given on the command line when rtld is run directly. */ | ||
24 | return -1; | ||
25 | |||
26 | + do | ||
27 | + { | ||
28 | + struct r_search_path_elem *this_dir = *dirs; | ||
29 | + if (this_dir->dirnamelen > max_dirnamelen) | ||
30 | + { | ||
31 | + max_dirnamelen = this_dir->dirnamelen; | ||
32 | + } | ||
33 | + } | ||
34 | + while (*++dirs != NULL); | ||
35 | + | ||
36 | buf = alloca (max_dirnamelen + max_capstrlen + namelen); | ||
37 | + | ||
38 | + dirs = sps->dirs; | ||
39 | do | ||
40 | { | ||
41 | struct r_search_path_elem *this_dir = *dirs; | ||
diff --git a/meta/recipes-core/eglibc/eglibc-2.18/tzselect-awk.patch b/meta/recipes-core/eglibc/eglibc-2.18/tzselect-awk.patch new file mode 100644 index 0000000000..dc9949bec9 --- /dev/null +++ b/meta/recipes-core/eglibc/eglibc-2.18/tzselect-awk.patch | |||
@@ -0,0 +1,42 @@ | |||
1 | tzselect: workaround bug in busybox awk | ||
2 | |||
3 | busybox's version of awk in version 1.20.2 and lower doesn't support | ||
4 | escape sequences in conjunction with the -F option. Use -v FS= instead | ||
5 | as a workaround until the bug is fixed. | ||
6 | |||
7 | Reference: | ||
8 | https://bugs.busybox.net/show_bug.cgi?id=5126 | ||
9 | |||
10 | Upstream-Status: Inappropriate [other] | ||
11 | |||
12 | Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> | ||
13 | |||
14 | --- libc/timezone/tzselect.ksh | ||
15 | +++ libc/timezone/tzselect.ksh | ||
16 | @@ -208,7 +208,7 @@ while | ||
17 | TZ_for_date=$TZ;; | ||
18 | *) | ||
19 | # Get list of names of countries in the continent or ocean. | ||
20 | - countries=$($AWK -F'\t' \ | ||
21 | + countries=$($AWK -v FS="\t" \ | ||
22 | -v continent="$continent" \ | ||
23 | -v TZ_COUNTRY_TABLE="$TZ_COUNTRY_TABLE" \ | ||
24 | ' | ||
25 | @@ -252,7 +252,7 @@ while | ||
26 | |||
27 | |||
28 | # Get list of names of time zone rule regions in the country. | ||
29 | - regions=$($AWK -F'\t' \ | ||
30 | + regions=$($AWK -v FS="\t" \ | ||
31 | -v country="$country" \ | ||
32 | -v TZ_COUNTRY_TABLE="$TZ_COUNTRY_TABLE" \ | ||
33 | ' | ||
34 | @@ -289,7 +289,7 @@ while | ||
35 | esac | ||
36 | |||
37 | # Determine TZ from country and region. | ||
38 | - TZ=$($AWK -F'\t' \ | ||
39 | + TZ=$($AWK -v FS="\t" \ | ||
40 | -v country="$country" \ | ||
41 | -v region="$region" \ | ||
42 | -v TZ_COUNTRY_TABLE="$TZ_COUNTRY_TABLE" \ | ||
diff --git a/meta/recipes-core/eglibc/eglibc-2.18/tzselect-sh.patch b/meta/recipes-core/eglibc/eglibc-2.18/tzselect-sh.patch new file mode 100644 index 0000000000..e9a3691bbb --- /dev/null +++ b/meta/recipes-core/eglibc/eglibc-2.18/tzselect-sh.patch | |||
@@ -0,0 +1,156 @@ | |||
1 | tzselect: eliminate ksh-dependency | ||
2 | |||
3 | This is an adapted version of a patch originally | ||
4 | by Peter Seebach <peter.seebach@windriver.com> found here: | ||
5 | http://www.eglibc.org/archives/patches/msg00671.html | ||
6 | |||
7 | Upstream-Status: Pending | ||
8 | |||
9 | Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> | ||
10 | |||
11 | Index: libc/timezone/tzselect.ksh | ||
12 | =================================================================== | ||
13 | --- libc.orig/timezone/tzselect.ksh 2012-11-17 09:50:14.000000000 -0800 | ||
14 | +++ libc/timezone/tzselect.ksh 2013-01-03 22:46:26.423844259 -0800 | ||
15 | @@ -1,4 +1,4 @@ | ||
16 | -#!/bin/bash | ||
17 | +#!/bin/sh | ||
18 | |||
19 | PKGVERSION='(tzcode) ' | ||
20 | TZVERSION=see_Makefile | ||
21 | @@ -11,23 +11,80 @@ | ||
22 | |||
23 | # Porting notes: | ||
24 | # | ||
25 | -# This script requires a Posix-like shell with the extension of a | ||
26 | -# 'select' statement. The 'select' statement was introduced in the | ||
27 | -# Korn shell and is available in Bash and other shell implementations. | ||
28 | -# If your host lacks both Bash and the Korn shell, you can get their | ||
29 | -# source from one of these locations: | ||
30 | +# func_select allows this script to run on shells (such as busybox ash) | ||
31 | +# which lack the ksh "select" builtin. | ||
32 | # | ||
33 | -# Bash <http://www.gnu.org/software/bash/bash.html> | ||
34 | -# Korn Shell <http://www.kornshell.com/> | ||
35 | -# Public Domain Korn Shell <http://www.cs.mun.ca/~michael/pdksh/> | ||
36 | -# | ||
37 | -# This script also uses several features of modern awk programs. | ||
38 | +# This script uses several features of modern awk programs. | ||
39 | # If your host lacks awk, or has an old awk that does not conform to Posix, | ||
40 | # you can use either of the following free programs instead: | ||
41 | # | ||
42 | # Gawk (GNU awk) <http://www.gnu.org/software/gawk/> | ||
43 | # mawk <http://invisible-island.net/mawk/> | ||
44 | |||
45 | +# Implement ksh-style select in POSIX shell | ||
46 | + | ||
47 | +# We need a mostly-portable echo-n. | ||
48 | +case `echo -n "foo\c"` in | ||
49 | +*n*c*) func_echo_n() { echo "$*"; } ;; | ||
50 | +*n*) func_echo_n() { echo "$*\c"; } ;; | ||
51 | +*) func_echo_n() { echo -n "$*"; } ;; | ||
52 | +esac | ||
53 | + | ||
54 | +# Synopsis: Replace "select foo in list" with "while func_select foo in list" | ||
55 | +# and this works just like ksh, so far as I know. | ||
56 | +func_select () { | ||
57 | + func_select_args=0 | ||
58 | + if expr "$1" : "[_a-zA-Z][_a-zA-Z0-9]*$" > /dev/null; then | ||
59 | + func_select_var=$1 | ||
60 | + else | ||
61 | + echo >&2 "func_select: '$1' is not a valid variable name." | ||
62 | + return 1 | ||
63 | + fi | ||
64 | + shift 1 | ||
65 | + case $1 in | ||
66 | + in) shift 1;; | ||
67 | + *) echo >&2 "func_select: usage: func_select var in ... (you must provide | ||
68 | +arguments)"; return 1;; | ||
69 | + esac | ||
70 | + case $# in | ||
71 | + 0) echo >&2 "func_select: usage: func_select var in ..."; return 1;; | ||
72 | + esac | ||
73 | + for func_select_arg | ||
74 | + do | ||
75 | + func_select_args=`expr $func_select_args + 1` | ||
76 | + eval func_select_a_$func_select_args=\$func_select_arg | ||
77 | + done | ||
78 | + REPLY="" | ||
79 | + while : | ||
80 | + do | ||
81 | + if test -z "$REPLY"; then | ||
82 | + func_select_i=1 | ||
83 | + while test $func_select_i -le $func_select_args | ||
84 | + do | ||
85 | + eval echo "\"\$func_select_i) \$func_select_a_$func_select_i\"" | ||
86 | + func_select_i=`expr $func_select_i + 1` | ||
87 | + done | ||
88 | + fi | ||
89 | + func_echo_n "${PS3-#? }" >&2 | ||
90 | + if read REPLY; then | ||
91 | + if test -n "${REPLY}"; then | ||
92 | + if expr "$REPLY" : '[1-9][0-9]*$' > /dev/null; then | ||
93 | + if test "$REPLY" -ge 1 && test "$REPLY" -le $func_select_args; then | ||
94 | + eval $func_select_var=\$func_select_a_$REPLY | ||
95 | + else | ||
96 | + eval $func_select_var= | ||
97 | + fi | ||
98 | + else | ||
99 | + eval $func_select_var= | ||
100 | + fi | ||
101 | + return 0 | ||
102 | + fi | ||
103 | + else | ||
104 | + eval $func_select_var= | ||
105 | + return 1 | ||
106 | + fi | ||
107 | + done | ||
108 | +} | ||
109 | |||
110 | # Specify default values for environment variables if they are unset. | ||
111 | : ${AWK=awk} | ||
112 | @@ -72,7 +129,7 @@ | ||
113 | |||
114 | |||
115 | # Work around a bug in bash 1.14.7 and earlier, where $PS3 is sent to stdout. | ||
116 | -case $(echo 1 | (select x in x; do break; done) 2>/dev/null) in | ||
117 | +case $(echo 1 | (while func_select x in x; do break; done) 2>/dev/null) in | ||
118 | ?*) PS3= | ||
119 | esac | ||
120 | |||
121 | @@ -92,7 +149,7 @@ | ||
122 | |||
123 | echo >&2 'Please select a continent or ocean.' | ||
124 | |||
125 | - select continent in \ | ||
126 | + while func_select continent in \ | ||
127 | Africa \ | ||
128 | Americas \ | ||
129 | Antarctica \ | ||
130 | @@ -172,7 +229,7 @@ | ||
131 | case $countries in | ||
132 | *"$newline"*) | ||
133 | echo >&2 'Please select a country.' | ||
134 | - select country in $countries | ||
135 | + while func_select country in $countries | ||
136 | do | ||
137 | case $country in | ||
138 | '') echo >&2 'Please enter a number in range.';; | ||
139 | @@ -211,7 +268,7 @@ | ||
140 | *"$newline"*) | ||
141 | echo >&2 'Please select one of the following' \ | ||
142 | 'time zone regions.' | ||
143 | - select region in $regions | ||
144 | + while func_select region in $regions | ||
145 | do | ||
146 | case $region in | ||
147 | '') echo >&2 'Please enter a number in range.';; | ||
148 | @@ -288,7 +345,7 @@ | ||
149 | echo >&2 "Is the above information OK?" | ||
150 | |||
151 | ok= | ||
152 | - select ok in Yes No | ||
153 | + while func_select ok in Yes No | ||
154 | do | ||
155 | case $ok in | ||
156 | '') echo >&2 'Please enter 1 for Yes, or 2 for No.';; | ||