summaryrefslogtreecommitdiffstats
path: root/meta/recipes-core/eglibc/eglibc-2.19
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-core/eglibc/eglibc-2.19')
-rw-r--r--meta/recipes-core/eglibc/eglibc-2.19/0001-R_ARM_TLS_DTPOFF32.patch56
-rw-r--r--meta/recipes-core/eglibc/eglibc-2.19/0001-eglibc-menuconfig-support.patch912
-rw-r--r--meta/recipes-core/eglibc/eglibc-2.19/0001-eglibc-run-libm-err-tab.pl-with-specific-dirs-in-S.patch36
-rw-r--r--meta/recipes-core/eglibc/eglibc-2.19/0002-eglibc-menuconfig-hex-string-options.patch169
-rw-r--r--meta/recipes-core/eglibc/eglibc-2.19/0003-eglibc-menuconfig-build-instructions.patch176
-rw-r--r--meta/recipes-core/eglibc/eglibc-2.19/GLRO_dl_debug_mask.patch143
-rw-r--r--meta/recipes-core/eglibc/eglibc-2.19/IO-acquire-lock-fix.patch17
-rw-r--r--meta/recipes-core/eglibc/eglibc-2.19/add_resource_h_to_wait_h.patch20
-rw-r--r--meta/recipes-core/eglibc/eglibc-2.19/eglibc-svn-arm-lowlevellock-include-tls.patch21
-rw-r--r--meta/recipes-core/eglibc/eglibc-2.19/eglibc_fix_findidx_parameters.patch38
-rw-r--r--meta/recipes-core/eglibc/eglibc-2.19/etc/ld.so.conf0
-rw-r--r--meta/recipes-core/eglibc/eglibc-2.19/fileops-without-wchar-io.patch22
-rw-r--r--meta/recipes-core/eglibc/eglibc-2.19/fix-tibetian-locales.patch38
-rw-r--r--meta/recipes-core/eglibc/eglibc-2.19/fix_for_centos_5.8.patch18
-rw-r--r--meta/recipes-core/eglibc/eglibc-2.19/fsl-ppc-no-fsqrt.patch100
-rw-r--r--meta/recipes-core/eglibc/eglibc-2.19/generate-supported.mk11
-rw-r--r--meta/recipes-core/eglibc/eglibc-2.19/glibc.fix_sqrt2.patch1516
-rw-r--r--meta/recipes-core/eglibc/eglibc-2.19/initgroups_keys.patch20
-rw-r--r--meta/recipes-core/eglibc/eglibc-2.19/ld-search-order.patch56
-rw-r--r--meta/recipes-core/eglibc/eglibc-2.19/mips-rld-map-check.patch26
-rw-r--r--meta/recipes-core/eglibc/eglibc-2.19/multilib_readlib.patch17
-rw-r--r--meta/recipes-core/eglibc/eglibc-2.19/ppc-sqrt_finite.patch184
-rw-r--r--meta/recipes-core/eglibc/eglibc-2.19/ppc_slow_ieee754_sqrt.patch365
-rw-r--r--meta/recipes-core/eglibc/eglibc-2.19/ppce6500-32b_slow_ieee754_sqrt.patch47
-rw-r--r--meta/recipes-core/eglibc/eglibc-2.19/relocatable_sdk.patch108
-rw-r--r--meta/recipes-core/eglibc/eglibc-2.19/relocatable_sdk_fix_openpath.patch41
26 files changed, 4157 insertions, 0 deletions
diff --git a/meta/recipes-core/eglibc/eglibc-2.19/0001-R_ARM_TLS_DTPOFF32.patch b/meta/recipes-core/eglibc/eglibc-2.19/0001-R_ARM_TLS_DTPOFF32.patch
new file mode 100644
index 0000000000..b4489e9ae9
--- /dev/null
+++ b/meta/recipes-core/eglibc/eglibc-2.19/0001-R_ARM_TLS_DTPOFF32.patch
@@ -0,0 +1,56 @@
1
2Quote 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
36Upstream-Status: Pending
37
38Signed-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
43ndex 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.19/0001-eglibc-menuconfig-support.patch b/meta/recipes-core/eglibc/eglibc-2.19/0001-eglibc-menuconfig-support.patch
new file mode 100644
index 0000000000..4559a110fb
--- /dev/null
+++ b/meta/recipes-core/eglibc/eglibc-2.19/0001-eglibc-menuconfig-support.patch
@@ -0,0 +1,912 @@
1Pulled from
2http://www.eglibc.org/archives/patches/msg01042.html
3
4Upstream-Status: Pending
5Signed-off-by: Khem
6
7Hi,
8
9This patch adds 'make menuconfig' support to EGLIBC.
10
11
12EGLIBC 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
14There 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
23Pre-Processing:
24
25
26The 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
28Post-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
39A new configure option, '--with-kconfig=<PATH>', tells EGLIBC where to find the pre-built 'conf' and 'mconf' host tools from Linux kernel builds.
40
41libc/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
43libc/EGLIBC.option-groups is updated to include new information on the menuconfig support.
44
45Thanks,
46
47attached is the updated patch to address above issues.
48
49Steve
50
51--
52Steve Longerbeam | Senior Embedded Engineer, ESD Services
53Mentor Embedded(tm) | 46871 Bayside Parkway, Fremont, CA 94538
54P 510.354.5838 | M 408.410.2735
55Nucleus(r) | Linux(r) | Android(tm) | Services | UI | Multi-OS
56
57
58Index: libc/EGLIBC.cross-building
59===================================================================
60--- libc.orig/EGLIBC.cross-building
61+++ libc/EGLIBC.cross-building
62@@ -243,9 +243,29 @@ full EGLIBC build:
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
92Index: libc/configure.ac
93===================================================================
94--- libc.orig/configure.ac
95+++ libc/configure.ac
96@@ -127,6 +127,16 @@ AC_ARG_WITH([headers],
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],
113Index: libc/config.make.in
114===================================================================
115--- libc.orig/config.make.in
116+++ libc/config.make.in
117@@ -45,6 +45,8 @@ sysincludes = @SYSINCLUDES@
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@
126Index: libc/options-config/config-postproc.pl
127===================================================================
128--- /dev/null
129+++ libc/options-config/config-postproc.pl
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+}
185Index: libc/options-config/config-preproc.pl
186===================================================================
187--- /dev/null
188+++ libc/options-config/config-preproc.pl
189@@ -0,0 +1,8 @@
190+#!/usr/bin/perl
191+
192+if (@ARGV) {
193+ while (<>) {
194+ s/OPTION_/CONFIG_/g;
195+ print;
196+ }
197+}
198Index: libc/options-config/Makefile
199===================================================================
200--- /dev/null
201+++ libc/options-config/Makefile
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
258Index: libc/option-groups.def
259===================================================================
260--- libc.orig/option-groups.def
261+++ libc/option-groups.def
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 @@ config OPTION_EGLIBC_ADVANCED_INET6
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 @@ config OPTION_EGLIBC_BACKTRACE
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 @@ config OPTION_EGLIBC_BIG_MACROS
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 @@ config OPTION_EGLIBC_BSD
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 @@ config OPTION_EGLIBC_CXX_TESTS
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 @@ config OPTION_EGLIBC_CHARSETS
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 @@ config OPTION_EGLIBC_CRYPT_UFC
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 @@ config OPTION_EGLIBC_DB_ALIASES
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 @@ config OPTION_EGLIBC_ENVZ
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 @@ config OPTION_EGLIBC_FCVT
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 @@ config OPTION_EGLIBC_FSTAB
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 @@ config OPTION_EGLIBC_FTRAVERSE
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 @@ config OPTION_EGLIBC_GETLOGIN
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 @@ config OPTION_EGLIBC_INET
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 @@ config OPTION_EGLIBC_LIBM
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 @@ config OPTION_EGLIBC_LOCALES
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 @@ config OPTION_EGLIBC_LOCALE_CODE
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 @@ config OPTION_EGLIBC_NSSWITCH
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 @@ config OPTION_EGLIBC_NSSWITCH
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 @@ config OPTION_EGLIBC_NSSWITCH
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 @@ config OPTION_EGLIBC_RCMD
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 @@ config OPTION_EGLIBC_RTLD_DEBUG
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 @@ config OPTION_EGLIBC_SPAWN
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 @@ config OPTION_EGLIBC_STREAMS
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 @@ config OPTION_EGLIBC_UTMP
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 @@ config OPTION_EGLIBC_UTMPX
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 @@ config OPTION_POSIX_C_LANG_WIDE_CHAR
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 @@ config OPTION_POSIX_REGEXP
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 @@ config OPTION_POSIX_REGEXP_GLIBC
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.
773Index: libc/Makefile
774===================================================================
775--- libc.orig/Makefile
776+++ libc/Makefile
777@@ -24,6 +24,7 @@ endif
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
785Index: libc/configure
786===================================================================
787--- libc.orig/configure
788+++ libc/configure
789@@ -621,6 +621,7 @@ KSH
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 @@ with_fp
798 with_binutils
799 with_selinux
800 with_headers
801+with_kconfig
802 with_default_link
803 enable_sanity_checks
804 enable_shared
805@@ -1438,6 +1440,9 @@ Optional Packages:
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@@ -3401,6 +3406,14 @@ fi
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 :
830Index: libc/EGLIBC.option-groups
831===================================================================
832--- libc.orig/EGLIBC.option-groups
833+++ libc/EGLIBC.option-groups
834@@ -56,33 +56,9 @@ disable option groups one by one, until
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 @@ data, but include mathematical functions
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 @@ under development.
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.19/0001-eglibc-run-libm-err-tab.pl-with-specific-dirs-in-S.patch b/meta/recipes-core/eglibc/eglibc-2.19/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.19/0001-eglibc-run-libm-err-tab.pl-with-specific-dirs-in-S.patch
@@ -0,0 +1,36 @@
1From 713d822908d1b2ae8403af7f9375c7054ed3dd49 Mon Sep 17 00:00:00 2001
2From: Ting Liu <b28495@freescale.com>
3Date: Wed, 19 Dec 2012 04:39:57 -0600
4Subject: [PATCH] eglibc: run libm-err-tab.pl with specific dirs in ${S}
5
6libm-err-tab.pl will parse all the files named "libm-test-ulps"
7in the given dir recursively. To avoid parsing the one in
8${S}/.pc/ (it does exist after eglibc adds aarch64 support,
9${S}/.pc/aarch64-0001-glibc-fsf-v1-eaf6f205.patch/ports/sysdeps/
10aarch64/libm-test-ulps), run libm-err-tab.pl with specific dirs
11in ${S}.
12
13Upstream-Status: inappropriate [OE specific]
14
15Signed-off-by: Ting Liu <b28495@freescale.com>
16---
17 manual/Makefile | 3 ++-
18 1 file changed, 2 insertions(+), 1 deletion(-)
19
20diff --git a/manual/Makefile b/manual/Makefile
21index 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--
351.7.9.7
36
diff --git a/meta/recipes-core/eglibc/eglibc-2.19/0002-eglibc-menuconfig-hex-string-options.patch b/meta/recipes-core/eglibc/eglibc-2.19/0002-eglibc-menuconfig-hex-string-options.patch
new file mode 100644
index 0000000000..7caba48112
--- /dev/null
+++ b/meta/recipes-core/eglibc/eglibc-2.19/0002-eglibc-menuconfig-hex-string-options.patch
@@ -0,0 +1,169 @@
1pulled from
2
3http://www.eglibc.org/archives/patches/msg01043.html
4
5
6Upstream-Status: Pending
7Signed-off-by: Khem
8
9
10This patch builds on the menuconfig patch for EGLIBC.
11
12
13There are a few options that have non-boolean types, that would benefit from the new 'make *config' support:
14
15EGLIBC_MEMUSAGE_DEFAULT_BUFFER_SIZE (int)
16EGLIBC_NSSWITCH_FIXED_CONFIG (string)
17EGLIBC_NSSWITCH_FIXED_FUNCTIONS (string)
18
19
20The 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
22In 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
24Finally, 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
26attached is the updated patch to address above issues.
27
28Steve
29
30--
31Steve Longerbeam | Senior Embedded Engineer, ESD Services
32Mentor Embedded(tm) | 46871 Bayside Parkway, Fremont, CA 94538
33P 510.354.5838 | M 408.410.2735
34Nucleus(r) | Linux(r) | Android(tm) | Services | UI | Multi-OS
35
36
37Index: 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
52Index: 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
98Index: 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 }
147Index: 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.19/0003-eglibc-menuconfig-build-instructions.patch b/meta/recipes-core/eglibc/eglibc-2.19/0003-eglibc-menuconfig-build-instructions.patch
new file mode 100644
index 0000000000..d137f5b318
--- /dev/null
+++ b/meta/recipes-core/eglibc/eglibc-2.19/0003-eglibc-menuconfig-build-instructions.patch
@@ -0,0 +1,176 @@
1Pulled from
2
3http://www.eglibc.org/archives/patches/msg01035.html
4
5Upstream-Status: Pending
6Signed-off-by: Khem
7
8As 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
10My 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
13Thanks,
14
15--
16Steve Longerbeam | Senior Embedded Engineer, ESD Services
17Mentor Embedded(tm) | 46871 Bayside Parkway, Fremont, CA 94538
18P 510.354.5838 | M 408.410.2735
19Nucleus(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
25Index: 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.19/GLRO_dl_debug_mask.patch b/meta/recipes-core/eglibc/eglibc-2.19/GLRO_dl_debug_mask.patch
new file mode 100644
index 0000000000..7258c82418
--- /dev/null
+++ b/meta/recipes-core/eglibc/eglibc-2.19/GLRO_dl_debug_mask.patch
@@ -0,0 +1,143 @@
1Its controlled by __OPTION_EGLIBC_RTLD_DEBUG
2so we should use GLRO_dl_debug_mask
3
4Singed-off-by: Khem Raj <raj.khem@gmail.com>
5
6Upstream-Status: Pending
7Index: libc/elf/dl-open.c
8===================================================================
9--- libc.orig/elf/dl-open.c 2012-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
38Index: 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 &current_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 };
105Index: 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
118Index: 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 : "";
131Index: 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.19/IO-acquire-lock-fix.patch b/meta/recipes-core/eglibc/eglibc-2.19/IO-acquire-lock-fix.patch
new file mode 100644
index 0000000000..cf5803585c
--- /dev/null
+++ b/meta/recipes-core/eglibc/eglibc-2.19/IO-acquire-lock-fix.patch
@@ -0,0 +1,17 @@
1import http://sourceware.org/ml/libc-ports/2007-12/msg00000.html
2
3Upstream-Status: Pending
4
5Index: libc/bits/stdio-lock.h
6===================================================================
7--- libc.orig/bits/stdio-lock.h 2009-10-28 14:34:19.000000000 -0700
8+++ libc/bits/stdio-lock.h 2009-10-28 14:34:54.000000000 -0700
9@@ -50,6 +50,8 @@ __libc_lock_define_recursive (typedef, _
10 _IO_cleanup_region_start ((void (*) (void *)) _IO_funlockfile, (_fp)); \
11 _IO_flockfile (_fp)
12
13+# define _IO_acquire_lock_clear_flags2(_fp) _IO_acquire_lock (_fp)
14+
15 # define _IO_release_lock(_fp) \
16 _IO_funlockfile (_fp); \
17 _IO_cleanup_region_end (0)
diff --git a/meta/recipes-core/eglibc/eglibc-2.19/add_resource_h_to_wait_h.patch b/meta/recipes-core/eglibc/eglibc-2.19/add_resource_h_to_wait_h.patch
new file mode 100644
index 0000000000..f5023c08d4
--- /dev/null
+++ b/meta/recipes-core/eglibc/eglibc-2.19/add_resource_h_to_wait_h.patch
@@ -0,0 +1,20 @@
1The older versions of perf still require sys/resource.h to be
2present in this header, the newer version of perf in 3.2 and
3beyond directly include sys/resource.h
4
5Upstream-Status: Inapproriate [older kernel/perf specific]
6
7Signed-off-by: Saul Wold <sgw@linux.intel.com>
8
9Index: 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.19/eglibc-svn-arm-lowlevellock-include-tls.patch b/meta/recipes-core/eglibc/eglibc-2.19/eglibc-svn-arm-lowlevellock-include-tls.patch
new file mode 100644
index 0000000000..4313aa5197
--- /dev/null
+++ b/meta/recipes-core/eglibc/eglibc-2.19/eglibc-svn-arm-lowlevellock-include-tls.patch
@@ -0,0 +1,21 @@
1In file included from ../nptl/sysdeps/unix/sysv/linux/libc-lowlevellock.c:21:
2../nptl/sysdeps/unix/sysv/linux/lowlevellock.c: In function '__lll_lock_wait_private':
3../nptl/sysdeps/unix/sysv/linux/lowlevellock.c:34: warning: implicit declaration of function 'THREAD_GETMEM'
4../nptl/sysdeps/unix/sysv/linux/lowlevellock.c:34: error: 'THREAD_SELF' undeclared (first use in this function)
5../nptl/sysdeps/unix/sysv/linux/lowlevellock.c:34: error: (Each undeclared identifier is reported only once
6../nptl/sysdeps/unix/sysv/linux/lowlevellock.c:34: error: for each function it appears in.)
7../nptl/sysdeps/unix/sysv/linux/lowlevellock.c:34: error: 'header' undeclared (first use in this function)
8make[4]: *** [/var/tmp/portage/sys-libs/glibc-2.7-r1/work/build-default-armv4l-unknown-linux-gnu-nptl/nptl/rtld-libc-lowlevellock.os] Error 1
9
10Upstream-Status: Pending
11
12--- libc/ports/sysdeps/unix/sysv/linux/arm/nptl/lowlevellock.h.orig
13+++ libc/ports/sysdeps/unix/sysv/linux/arm/nptl/lowlevellock.h
14@@ -25,6 +25,7 @@
15 #include <atomic.h>
16 #include <sysdep.h>
17 #include <kernel-features.h>
18+#include <tls.h>
19
20 #define FUTEX_WAIT 0
21 #define FUTEX_WAKE 1
diff --git a/meta/recipes-core/eglibc/eglibc-2.19/eglibc_fix_findidx_parameters.patch b/meta/recipes-core/eglibc/eglibc-2.19/eglibc_fix_findidx_parameters.patch
new file mode 100644
index 0000000000..bbf4605505
--- /dev/null
+++ b/meta/recipes-core/eglibc/eglibc-2.19/eglibc_fix_findidx_parameters.patch
@@ -0,0 +1,38 @@
1Upstream-Status: backport
2
3Imported patch from: http://www.eglibc.org/archives/patches/msg01124.html
4
5Signed-Off-By: Nitin A Kamble <nitin.a.kamble@intel.com>
62012/05/09
7
8Index: libc/posix/xregex.c
9===================================================================
10--- libc.orig/posix/xregex.c
11+++ libc/posix/xregex.c
12@@ -2943,7 +2943,7 @@ PREFIX(regex_compile) (const char *ARG_P
13 _NL_CURRENT (LC_COLLATE,
14 _NL_COLLATE_INDIRECTWC);
15
16- idx = findidx ((const wint_t**)&cp);
17+ idx = findidx ((const wint_t**)&cp, -1);
18 if (idx == 0 || cp < (wint_t*) str + c1)
19 /* This is no valid character. */
20 FREE_STACK_RETURN (REG_ECOLLATE);
21@@ -3392,7 +3392,7 @@ PREFIX(regex_compile) (const char *ARG_P
22 indirect = (const int32_t *)
23 _NL_CURRENT (LC_COLLATE, _NL_COLLATE_INDIRECTMB);
24
25- idx = findidx (&cp);
26+ idx = findidx (&cp, -1);
27 if (idx == 0 || cp < str + c1)
28 /* This is no valid character. */
29 FREE_STACK_RETURN (REG_ECOLLATE);
30@@ -6363,7 +6363,7 @@ byte_re_match_2_internal (struct re_patt
31 }
32 str_buf[i] = TRANSLATE(*(d+i));
33 str_buf[i+1] = '\0'; /* sentinel */
34- idx2 = findidx ((const wint_t**)&cp);
35+ idx2 = findidx ((const wint_t**)&cp, -1);
36 }
37
38 /* Update d, however d will be incremented at
diff --git a/meta/recipes-core/eglibc/eglibc-2.19/etc/ld.so.conf b/meta/recipes-core/eglibc/eglibc-2.19/etc/ld.so.conf
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/meta/recipes-core/eglibc/eglibc-2.19/etc/ld.so.conf
diff --git a/meta/recipes-core/eglibc/eglibc-2.19/fileops-without-wchar-io.patch b/meta/recipes-core/eglibc/eglibc-2.19/fileops-without-wchar-io.patch
new file mode 100644
index 0000000000..2ca0bca248
--- /dev/null
+++ b/meta/recipes-core/eglibc/eglibc-2.19/fileops-without-wchar-io.patch
@@ -0,0 +1,22 @@
1Fix 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'
5collect2: error: ld returned 1 exit status
6
7
8Signed-off-by: Khem Raj <raj.khem@gmail.com>
9Upstream-Status: Pending
10Index: 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.19/fix-tibetian-locales.patch b/meta/recipes-core/eglibc/eglibc-2.19/fix-tibetian-locales.patch
new file mode 100644
index 0000000000..25c43a9fe6
--- /dev/null
+++ b/meta/recipes-core/eglibc/eglibc-2.19/fix-tibetian-locales.patch
@@ -0,0 +1,38 @@
1cross localedef fails to compile these locales because name_fmt field is empty
2It is not acceptable for cross localedef and it errors out
3
4LC_NAME: field `name_fmt' not defined
5
6We therefore give a dummy string to the format, the real fix needs some native
7tibetian person to define proper name_fmt
8
9Upstream-Status: Pending
10
11Signed-off-by: Khem Raj <raj.khem@gmail.com>
12
13Index: 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"
26Index: 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.19/fix_for_centos_5.8.patch b/meta/recipes-core/eglibc/eglibc-2.19/fix_for_centos_5.8.patch
new file mode 100644
index 0000000000..7618c99534
--- /dev/null
+++ b/meta/recipes-core/eglibc/eglibc-2.19/fix_for_centos_5.8.patch
@@ -0,0 +1,18 @@
1Upstream-Status: Inappropriate [other]
2
3This is a hack to fix building the locale bits on an older
4CentOs 5.X machine
5
6Index: 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.19/fsl-ppc-no-fsqrt.patch b/meta/recipes-core/eglibc/eglibc-2.19/fsl-ppc-no-fsqrt.patch
new file mode 100644
index 0000000000..511ee9d19e
--- /dev/null
+++ b/meta/recipes-core/eglibc/eglibc-2.19/fsl-ppc-no-fsqrt.patch
@@ -0,0 +1,100 @@
1Create e5500 specific math_private.h and let it include when compiling for e5500/64bit core
2We prefefine __CPU_HAS_FSQRT to 0 and then in general ppc64 math_private.h we check if its
3already defined before redefining it. This way we can ensure that on e5500 builds it wont
4emit fsqrt intructions
5
6-Khem
7
8Upstream-Status: Pending
9
10Index: 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);
31Index: 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_ */
45Index: 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_ */
59Index: 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_ */
73Index: 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_ */
87Index: 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.19/generate-supported.mk b/meta/recipes-core/eglibc/eglibc-2.19/generate-supported.mk
new file mode 100644
index 0000000000..d2a28c2dc6
--- /dev/null
+++ b/meta/recipes-core/eglibc/eglibc-2.19/generate-supported.mk
@@ -0,0 +1,11 @@
1#!/usr/bin/make
2
3include $(IN)
4
5all:
6 rm -f $(OUT)
7 touch $(OUT)
8 for locale in $(SUPPORTED-LOCALES); do \
9 [ $$locale = true ] && continue; \
10 echo $$locale | sed 's,/, ,' >> $(OUT); \
11 done
diff --git a/meta/recipes-core/eglibc/eglibc-2.19/glibc.fix_sqrt2.patch b/meta/recipes-core/eglibc/eglibc-2.19/glibc.fix_sqrt2.patch
new file mode 100644
index 0000000000..689b79c61c
--- /dev/null
+++ b/meta/recipes-core/eglibc/eglibc-2.19/glibc.fix_sqrt2.patch
@@ -0,0 +1,1516 @@
1Signed-of-by: Edmar Wienskoski <edmar@freescale.com>
2Upstream-Status: Pending
3
4Index: libc/sysdeps/powerpc/powerpc32/603e/fpu/e_sqrt.c
5===================================================================
6--- /dev/null
7+++ libc/sysdeps/powerpc/powerpc32/603e/fpu/e_sqrt.c
8@@ -0,0 +1,134 @@
9+/* Double-precision floating point square root.
10+ Copyright (C) 2010 Free Software Foundation, Inc.
11+ This file is part of the GNU C Library.
12+
13+ The GNU C Library is free software; you can redistribute it and/or
14+ modify it under the terms of the GNU Lesser General Public
15+ License as published by the Free Software Foundation; either
16+ version 2.1 of the License, or (at your option) any later version.
17+
18+ The GNU C Library is distributed in the hope that it will be useful,
19+ but WITHOUT ANY WARRANTY; without even the implied warranty of
20+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
21+ Lesser General Public License for more details.
22+
23+ You should have received a copy of the GNU Lesser General Public
24+ License along with the GNU C Library; if not, write to the Free
25+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
26+ 02111-1307 USA. */
27+
28+#include <math.h>
29+#include <math_private.h>
30+#include <fenv_libc.h>
31+#include <inttypes.h>
32+
33+#include <sysdep.h>
34+#include <ldsodefs.h>
35+
36+static const ieee_float_shape_type a_nan = {.word = 0x7fc00000 };
37+static const ieee_float_shape_type a_inf = {.word = 0x7f800000 };
38+static const float two108 = 3.245185536584267269e+32;
39+static const float twom54 = 5.551115123125782702e-17;
40+static const float half = 0.5;
41+
42+/* The method is based on the descriptions in:
43+
44+ _The Handbook of Floating-Pointer Arithmetic_ by Muller et al., chapter 5;
45+ _IA-64 and Elementary Functions: Speed and Precision_ by Markstein, chapter 9
46+
47+ We find the actual square root and half of its reciprocal
48+ simultaneously. */
49+
50+#ifdef __STDC__
51+double
52+__ieee754_sqrt (double b)
53+#else
54+double
55+__ieee754_sqrt (b)
56+ double b;
57+#endif
58+{
59+ if (__builtin_expect (b > 0, 1))
60+ {
61+ double y, g, h, d, r;
62+ ieee_double_shape_type u;
63+
64+ if (__builtin_expect (b != a_inf.value, 1))
65+ {
66+ fenv_t fe;
67+
68+ fe = fegetenv_register ();
69+
70+ u.value = b;
71+
72+ relax_fenv_state ();
73+
74+ __asm__ ("frsqrte %[estimate], %[x]\n"
75+ : [estimate] "=f" (y) : [x] "f" (b));
76+
77+ /* Following Muller et al, page 168, equation 5.20.
78+
79+ h goes to 1/(2*sqrt(b))
80+ g goes to sqrt(b).
81+
82+ We need three iterations to get within 1ulp. */
83+
84+ /* Indicate that these can be performed prior to the branch. GCC
85+ insists on sinking them below the branch, however; it seems like
86+ they'd be better before the branch so that we can cover any latency
87+ from storing the argument and loading its high word. Oh well. */
88+
89+ g = b * y;
90+ h = 0.5 * y;
91+
92+ /* Handle small numbers by scaling. */
93+ if (__builtin_expect ((u.parts.msw & 0x7ff00000) <= 0x02000000, 0))
94+ return __ieee754_sqrt (b * two108) * twom54;
95+
96+#define FMADD(a_, c_, b_) \
97+ ({ double __r; \
98+ __asm__ ("fmadd %[r], %[a], %[c], %[b]\n" \
99+ : [r] "=f" (__r) : [a] "f" (a_), [c] "f" (c_), [b] "f" (b_)); \
100+ __r;})
101+#define FNMSUB(a_, c_, b_) \
102+ ({ double __r; \
103+ __asm__ ("fnmsub %[r], %[a], %[c], %[b]\n" \
104+ : [r] "=f" (__r) : [a] "f" (a_), [c] "f" (c_), [b] "f" (b_)); \
105+ __r;})
106+
107+ r = FNMSUB (g, h, half);
108+ g = FMADD (g, r, g);
109+ h = FMADD (h, r, h);
110+
111+ r = FNMSUB (g, h, half);
112+ g = FMADD (g, r, g);
113+ h = FMADD (h, r, h);
114+
115+ r = FNMSUB (g, h, half);
116+ g = FMADD (g, r, g);
117+ h = FMADD (h, r, h);
118+
119+ /* g is now +/- 1ulp, or exactly equal to, the square root of b. */
120+
121+ /* Final refinement. */
122+ d = FNMSUB (g, g, b);
123+
124+ fesetenv_register (fe);
125+ return FMADD (d, h, g);
126+ }
127+ }
128+ else if (b < 0)
129+ {
130+ /* For some reason, some PowerPC32 processors don't implement
131+ FE_INVALID_SQRT. */
132+#ifdef FE_INVALID_SQRT
133+ feraiseexcept (FE_INVALID_SQRT);
134+
135+ fenv_union_t u = { .fenv = fegetenv_register () };
136+ if ((u.l & FE_INVALID) == 0)
137+#endif
138+ feraiseexcept (FE_INVALID);
139+ b = a_nan.value;
140+ }
141+ return f_wash (b);
142+}
143Index: libc/sysdeps/powerpc/powerpc32/603e/fpu/e_sqrtf.c
144===================================================================
145--- /dev/null
146+++ libc/sysdeps/powerpc/powerpc32/603e/fpu/e_sqrtf.c
147@@ -0,0 +1,101 @@
148+/* Single-precision floating point square root.
149+ Copyright (C) 2010 Free Software Foundation, Inc.
150+ This file is part of the GNU C Library.
151+
152+ The GNU C Library is free software; you can redistribute it and/or
153+ modify it under the terms of the GNU Lesser General Public
154+ License as published by the Free Software Foundation; either
155+ version 2.1 of the License, or (at your option) any later version.
156+
157+ The GNU C Library is distributed in the hope that it will be useful,
158+ but WITHOUT ANY WARRANTY; without even the implied warranty of
159+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
160+ Lesser General Public License for more details.
161+
162+ You should have received a copy of the GNU Lesser General Public
163+ License along with the GNU C Library; if not, write to the Free
164+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
165+ 02111-1307 USA. */
166+
167+#include <math.h>
168+#include <math_private.h>
169+#include <fenv_libc.h>
170+#include <inttypes.h>
171+
172+#include <sysdep.h>
173+#include <ldsodefs.h>
174+
175+static const ieee_float_shape_type a_nan = {.word = 0x7fc00000 };
176+static const ieee_float_shape_type a_inf = {.word = 0x7f800000 };
177+static const float threehalf = 1.5;
178+
179+/* The method is based on the descriptions in:
180+
181+ _The Handbook of Floating-Pointer Arithmetic_ by Muller et al., chapter 5;
182+ _IA-64 and Elementary Functions: Speed and Precision_ by Markstein, chapter 9
183+
184+ We find the reciprocal square root and use that to compute the actual
185+ square root. */
186+
187+#ifdef __STDC__
188+float
189+__ieee754_sqrtf (float b)
190+#else
191+float
192+__ieee754_sqrtf (b)
193+ float b;
194+#endif
195+{
196+ if (__builtin_expect (b > 0, 1))
197+ {
198+#define FMSUB(a_, c_, b_) \
199+ ({ double __r; \
200+ __asm__ ("fmsub %[r], %[a], %[c], %[b]\n" \
201+ : [r] "=f" (__r) : [a] "f" (a_), [c] "f" (c_), [b] "f" (b_)); \
202+ __r;})
203+#define FNMSUB(a_, c_, b_) \
204+ ({ double __r; \
205+ __asm__ ("fnmsub %[r], %[a], %[c], %[b]\n" \
206+ : [r] "=f" (__r) : [a] "f" (a_), [c] "f" (c_), [b] "f" (b_)); \
207+ __r;})
208+
209+ if (__builtin_expect (b != a_inf.value, 1))
210+ {
211+ double y, x;
212+ fenv_t fe;
213+
214+ fe = fegetenv_register ();
215+
216+ relax_fenv_state ();
217+
218+ /* Compute y = 1.5 * b - b. Uses fewer constants than y = 0.5 * b. */
219+ y = FMSUB (threehalf, b, b);
220+
221+ /* Initial estimate. */
222+ __asm__ ("frsqrte %[x], %[b]\n" : [x] "=f" (x) : [b] "f" (b));
223+
224+ /* Iterate. x_{n+1} = x_n * (1.5 - y * (x_n * x_n)). */
225+ x = x * FNMSUB (y, x * x, threehalf);
226+ x = x * FNMSUB (y, x * x, threehalf);
227+ x = x * FNMSUB (y, x * x, threehalf);
228+
229+ /* All done. */
230+ fesetenv_register (fe);
231+ return x * b;
232+ }
233+ }
234+ else if (b < 0)
235+ {
236+ /* For some reason, some PowerPC32 processors don't implement
237+ FE_INVALID_SQRT. */
238+#ifdef FE_INVALID_SQRT
239+ feraiseexcept (FE_INVALID_SQRT);
240+
241+ fenv_union_t u = { .fenv = fegetenv_register () };
242+ if ((u.l & FE_INVALID) == 0)
243+#endif
244+ feraiseexcept (FE_INVALID);
245+ b = a_nan.value;
246+ }
247+ return f_washf (b);
248+}
249Index: libc/sysdeps/powerpc/powerpc32/e500mc/fpu/e_sqrt.c
250===================================================================
251--- /dev/null
252+++ libc/sysdeps/powerpc/powerpc32/e500mc/fpu/e_sqrt.c
253@@ -0,0 +1,134 @@
254+/* Double-precision floating point square root.
255+ Copyright (C) 2010 Free Software Foundation, Inc.
256+ This file is part of the GNU C Library.
257+
258+ The GNU C Library is free software; you can redistribute it and/or
259+ modify it under the terms of the GNU Lesser General Public
260+ License as published by the Free Software Foundation; either
261+ version 2.1 of the License, or (at your option) any later version.
262+
263+ The GNU C Library is distributed in the hope that it will be useful,
264+ but WITHOUT ANY WARRANTY; without even the implied warranty of
265+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
266+ Lesser General Public License for more details.
267+
268+ You should have received a copy of the GNU Lesser General Public
269+ License along with the GNU C Library; if not, write to the Free
270+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
271+ 02111-1307 USA. */
272+
273+#include <math.h>
274+#include <math_private.h>
275+#include <fenv_libc.h>
276+#include <inttypes.h>
277+
278+#include <sysdep.h>
279+#include <ldsodefs.h>
280+
281+static const ieee_float_shape_type a_nan = {.word = 0x7fc00000 };
282+static const ieee_float_shape_type a_inf = {.word = 0x7f800000 };
283+static const float two108 = 3.245185536584267269e+32;
284+static const float twom54 = 5.551115123125782702e-17;
285+static const float half = 0.5;
286+
287+/* The method is based on the descriptions in:
288+
289+ _The Handbook of Floating-Pointer Arithmetic_ by Muller et al., chapter 5;
290+ _IA-64 and Elementary Functions: Speed and Precision_ by Markstein, chapter 9
291+
292+ We find the actual square root and half of its reciprocal
293+ simultaneously. */
294+
295+#ifdef __STDC__
296+double
297+__ieee754_sqrt (double b)
298+#else
299+double
300+__ieee754_sqrt (b)
301+ double b;
302+#endif
303+{
304+ if (__builtin_expect (b > 0, 1))
305+ {
306+ double y, g, h, d, r;
307+ ieee_double_shape_type u;
308+
309+ if (__builtin_expect (b != a_inf.value, 1))
310+ {
311+ fenv_t fe;
312+
313+ fe = fegetenv_register ();
314+
315+ u.value = b;
316+
317+ relax_fenv_state ();
318+
319+ __asm__ ("frsqrte %[estimate], %[x]\n"
320+ : [estimate] "=f" (y) : [x] "f" (b));
321+
322+ /* Following Muller et al, page 168, equation 5.20.
323+
324+ h goes to 1/(2*sqrt(b))
325+ g goes to sqrt(b).
326+
327+ We need three iterations to get within 1ulp. */
328+
329+ /* Indicate that these can be performed prior to the branch. GCC
330+ insists on sinking them below the branch, however; it seems like
331+ they'd be better before the branch so that we can cover any latency
332+ from storing the argument and loading its high word. Oh well. */
333+
334+ g = b * y;
335+ h = 0.5 * y;
336+
337+ /* Handle small numbers by scaling. */
338+ if (__builtin_expect ((u.parts.msw & 0x7ff00000) <= 0x02000000, 0))
339+ return __ieee754_sqrt (b * two108) * twom54;
340+
341+#define FMADD(a_, c_, b_) \
342+ ({ double __r; \
343+ __asm__ ("fmadd %[r], %[a], %[c], %[b]\n" \
344+ : [r] "=f" (__r) : [a] "f" (a_), [c] "f" (c_), [b] "f" (b_)); \
345+ __r;})
346+#define FNMSUB(a_, c_, b_) \
347+ ({ double __r; \
348+ __asm__ ("fnmsub %[r], %[a], %[c], %[b]\n" \
349+ : [r] "=f" (__r) : [a] "f" (a_), [c] "f" (c_), [b] "f" (b_)); \
350+ __r;})
351+
352+ r = FNMSUB (g, h, half);
353+ g = FMADD (g, r, g);
354+ h = FMADD (h, r, h);
355+
356+ r = FNMSUB (g, h, half);
357+ g = FMADD (g, r, g);
358+ h = FMADD (h, r, h);
359+
360+ r = FNMSUB (g, h, half);
361+ g = FMADD (g, r, g);
362+ h = FMADD (h, r, h);
363+
364+ /* g is now +/- 1ulp, or exactly equal to, the square root of b. */
365+
366+ /* Final refinement. */
367+ d = FNMSUB (g, g, b);
368+
369+ fesetenv_register (fe);
370+ return FMADD (d, h, g);
371+ }
372+ }
373+ else if (b < 0)
374+ {
375+ /* For some reason, some PowerPC32 processors don't implement
376+ FE_INVALID_SQRT. */
377+#ifdef FE_INVALID_SQRT
378+ feraiseexcept (FE_INVALID_SQRT);
379+
380+ fenv_union_t u = { .fenv = fegetenv_register () };
381+ if ((u.l & FE_INVALID) == 0)
382+#endif
383+ feraiseexcept (FE_INVALID);
384+ b = a_nan.value;
385+ }
386+ return f_wash (b);
387+}
388Index: libc/sysdeps/powerpc/powerpc32/e500mc/fpu/e_sqrtf.c
389===================================================================
390--- /dev/null
391+++ libc/sysdeps/powerpc/powerpc32/e500mc/fpu/e_sqrtf.c
392@@ -0,0 +1,101 @@
393+/* Single-precision floating point square root.
394+ Copyright (C) 2010 Free Software Foundation, Inc.
395+ This file is part of the GNU C Library.
396+
397+ The GNU C Library is free software; you can redistribute it and/or
398+ modify it under the terms of the GNU Lesser General Public
399+ License as published by the Free Software Foundation; either
400+ version 2.1 of the License, or (at your option) any later version.
401+
402+ The GNU C Library is distributed in the hope that it will be useful,
403+ but WITHOUT ANY WARRANTY; without even the implied warranty of
404+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
405+ Lesser General Public License for more details.
406+
407+ You should have received a copy of the GNU Lesser General Public
408+ License along with the GNU C Library; if not, write to the Free
409+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
410+ 02111-1307 USA. */
411+
412+#include <math.h>
413+#include <math_private.h>
414+#include <fenv_libc.h>
415+#include <inttypes.h>
416+
417+#include <sysdep.h>
418+#include <ldsodefs.h>
419+
420+static const ieee_float_shape_type a_nan = {.word = 0x7fc00000 };
421+static const ieee_float_shape_type a_inf = {.word = 0x7f800000 };
422+static const float threehalf = 1.5;
423+
424+/* The method is based on the descriptions in:
425+
426+ _The Handbook of Floating-Pointer Arithmetic_ by Muller et al., chapter 5;
427+ _IA-64 and Elementary Functions: Speed and Precision_ by Markstein, chapter 9
428+
429+ We find the reciprocal square root and use that to compute the actual
430+ square root. */
431+
432+#ifdef __STDC__
433+float
434+__ieee754_sqrtf (float b)
435+#else
436+float
437+__ieee754_sqrtf (b)
438+ float b;
439+#endif
440+{
441+ if (__builtin_expect (b > 0, 1))
442+ {
443+#define FMSUB(a_, c_, b_) \
444+ ({ double __r; \
445+ __asm__ ("fmsub %[r], %[a], %[c], %[b]\n" \
446+ : [r] "=f" (__r) : [a] "f" (a_), [c] "f" (c_), [b] "f" (b_)); \
447+ __r;})
448+#define FNMSUB(a_, c_, b_) \
449+ ({ double __r; \
450+ __asm__ ("fnmsub %[r], %[a], %[c], %[b]\n" \
451+ : [r] "=f" (__r) : [a] "f" (a_), [c] "f" (c_), [b] "f" (b_)); \
452+ __r;})
453+
454+ if (__builtin_expect (b != a_inf.value, 1))
455+ {
456+ double y, x;
457+ fenv_t fe;
458+
459+ fe = fegetenv_register ();
460+
461+ relax_fenv_state ();
462+
463+ /* Compute y = 1.5 * b - b. Uses fewer constants than y = 0.5 * b. */
464+ y = FMSUB (threehalf, b, b);
465+
466+ /* Initial estimate. */
467+ __asm__ ("frsqrte %[x], %[b]\n" : [x] "=f" (x) : [b] "f" (b));
468+
469+ /* Iterate. x_{n+1} = x_n * (1.5 - y * (x_n * x_n)). */
470+ x = x * FNMSUB (y, x * x, threehalf);
471+ x = x * FNMSUB (y, x * x, threehalf);
472+ x = x * FNMSUB (y, x * x, threehalf);
473+
474+ /* All done. */
475+ fesetenv_register (fe);
476+ return x * b;
477+ }
478+ }
479+ else if (b < 0)
480+ {
481+ /* For some reason, some PowerPC32 processors don't implement
482+ FE_INVALID_SQRT. */
483+#ifdef FE_INVALID_SQRT
484+ feraiseexcept (FE_INVALID_SQRT);
485+
486+ fenv_union_t u = { .fenv = fegetenv_register () };
487+ if ((u.l & FE_INVALID) == 0)
488+#endif
489+ feraiseexcept (FE_INVALID);
490+ b = a_nan.value;
491+ }
492+ return f_washf (b);
493+}
494Index: libc/sysdeps/powerpc/powerpc32/e5500/fpu/e_sqrt.c
495===================================================================
496--- /dev/null
497+++ libc/sysdeps/powerpc/powerpc32/e5500/fpu/e_sqrt.c
498@@ -0,0 +1,134 @@
499+/* Double-precision floating point square root.
500+ Copyright (C) 2010 Free Software Foundation, Inc.
501+ This file is part of the GNU C Library.
502+
503+ The GNU C Library is free software; you can redistribute it and/or
504+ modify it under the terms of the GNU Lesser General Public
505+ License as published by the Free Software Foundation; either
506+ version 2.1 of the License, or (at your option) any later version.
507+
508+ The GNU C Library is distributed in the hope that it will be useful,
509+ but WITHOUT ANY WARRANTY; without even the implied warranty of
510+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
511+ Lesser General Public License for more details.
512+
513+ You should have received a copy of the GNU Lesser General Public
514+ License along with the GNU C Library; if not, write to the Free
515+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
516+ 02111-1307 USA. */
517+
518+#include <math.h>
519+#include <math_private.h>
520+#include <fenv_libc.h>
521+#include <inttypes.h>
522+
523+#include <sysdep.h>
524+#include <ldsodefs.h>
525+
526+static const ieee_float_shape_type a_nan = {.word = 0x7fc00000 };
527+static const ieee_float_shape_type a_inf = {.word = 0x7f800000 };
528+static const float two108 = 3.245185536584267269e+32;
529+static const float twom54 = 5.551115123125782702e-17;
530+static const float half = 0.5;
531+
532+/* The method is based on the descriptions in:
533+
534+ _The Handbook of Floating-Pointer Arithmetic_ by Muller et al., chapter 5;
535+ _IA-64 and Elementary Functions: Speed and Precision_ by Markstein, chapter 9
536+
537+ We find the actual square root and half of its reciprocal
538+ simultaneously. */
539+
540+#ifdef __STDC__
541+double
542+__ieee754_sqrt (double b)
543+#else
544+double
545+__ieee754_sqrt (b)
546+ double b;
547+#endif
548+{
549+ if (__builtin_expect (b > 0, 1))
550+ {
551+ double y, g, h, d, r;
552+ ieee_double_shape_type u;
553+
554+ if (__builtin_expect (b != a_inf.value, 1))
555+ {
556+ fenv_t fe;
557+
558+ fe = fegetenv_register ();
559+
560+ u.value = b;
561+
562+ relax_fenv_state ();
563+
564+ __asm__ ("frsqrte %[estimate], %[x]\n"
565+ : [estimate] "=f" (y) : [x] "f" (b));
566+
567+ /* Following Muller et al, page 168, equation 5.20.
568+
569+ h goes to 1/(2*sqrt(b))
570+ g goes to sqrt(b).
571+
572+ We need three iterations to get within 1ulp. */
573+
574+ /* Indicate that these can be performed prior to the branch. GCC
575+ insists on sinking them below the branch, however; it seems like
576+ they'd be better before the branch so that we can cover any latency
577+ from storing the argument and loading its high word. Oh well. */
578+
579+ g = b * y;
580+ h = 0.5 * y;
581+
582+ /* Handle small numbers by scaling. */
583+ if (__builtin_expect ((u.parts.msw & 0x7ff00000) <= 0x02000000, 0))
584+ return __ieee754_sqrt (b * two108) * twom54;
585+
586+#define FMADD(a_, c_, b_) \
587+ ({ double __r; \
588+ __asm__ ("fmadd %[r], %[a], %[c], %[b]\n" \
589+ : [r] "=f" (__r) : [a] "f" (a_), [c] "f" (c_), [b] "f" (b_)); \
590+ __r;})
591+#define FNMSUB(a_, c_, b_) \
592+ ({ double __r; \
593+ __asm__ ("fnmsub %[r], %[a], %[c], %[b]\n" \
594+ : [r] "=f" (__r) : [a] "f" (a_), [c] "f" (c_), [b] "f" (b_)); \
595+ __r;})
596+
597+ r = FNMSUB (g, h, half);
598+ g = FMADD (g, r, g);
599+ h = FMADD (h, r, h);
600+
601+ r = FNMSUB (g, h, half);
602+ g = FMADD (g, r, g);
603+ h = FMADD (h, r, h);
604+
605+ r = FNMSUB (g, h, half);
606+ g = FMADD (g, r, g);
607+ h = FMADD (h, r, h);
608+
609+ /* g is now +/- 1ulp, or exactly equal to, the square root of b. */
610+
611+ /* Final refinement. */
612+ d = FNMSUB (g, g, b);
613+
614+ fesetenv_register (fe);
615+ return FMADD (d, h, g);
616+ }
617+ }
618+ else if (b < 0)
619+ {
620+ /* For some reason, some PowerPC32 processors don't implement
621+ FE_INVALID_SQRT. */
622+#ifdef FE_INVALID_SQRT
623+ feraiseexcept (FE_INVALID_SQRT);
624+
625+ fenv_union_t u = { .fenv = fegetenv_register () };
626+ if ((u.l & FE_INVALID) == 0)
627+#endif
628+ feraiseexcept (FE_INVALID);
629+ b = a_nan.value;
630+ }
631+ return f_wash (b);
632+}
633Index: libc/sysdeps/powerpc/powerpc32/e5500/fpu/e_sqrtf.c
634===================================================================
635--- /dev/null
636+++ libc/sysdeps/powerpc/powerpc32/e5500/fpu/e_sqrtf.c
637@@ -0,0 +1,101 @@
638+/* Single-precision floating point square root.
639+ Copyright (C) 2010 Free Software Foundation, Inc.
640+ This file is part of the GNU C Library.
641+
642+ The GNU C Library is free software; you can redistribute it and/or
643+ modify it under the terms of the GNU Lesser General Public
644+ License as published by the Free Software Foundation; either
645+ version 2.1 of the License, or (at your option) any later version.
646+
647+ The GNU C Library is distributed in the hope that it will be useful,
648+ but WITHOUT ANY WARRANTY; without even the implied warranty of
649+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
650+ Lesser General Public License for more details.
651+
652+ You should have received a copy of the GNU Lesser General Public
653+ License along with the GNU C Library; if not, write to the Free
654+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
655+ 02111-1307 USA. */
656+
657+#include <math.h>
658+#include <math_private.h>
659+#include <fenv_libc.h>
660+#include <inttypes.h>
661+
662+#include <sysdep.h>
663+#include <ldsodefs.h>
664+
665+static const ieee_float_shape_type a_nan = {.word = 0x7fc00000 };
666+static const ieee_float_shape_type a_inf = {.word = 0x7f800000 };
667+static const float threehalf = 1.5;
668+
669+/* The method is based on the descriptions in:
670+
671+ _The Handbook of Floating-Pointer Arithmetic_ by Muller et al., chapter 5;
672+ _IA-64 and Elementary Functions: Speed and Precision_ by Markstein, chapter 9
673+
674+ We find the reciprocal square root and use that to compute the actual
675+ square root. */
676+
677+#ifdef __STDC__
678+float
679+__ieee754_sqrtf (float b)
680+#else
681+float
682+__ieee754_sqrtf (b)
683+ float b;
684+#endif
685+{
686+ if (__builtin_expect (b > 0, 1))
687+ {
688+#define FMSUB(a_, c_, b_) \
689+ ({ double __r; \
690+ __asm__ ("fmsub %[r], %[a], %[c], %[b]\n" \
691+ : [r] "=f" (__r) : [a] "f" (a_), [c] "f" (c_), [b] "f" (b_)); \
692+ __r;})
693+#define FNMSUB(a_, c_, b_) \
694+ ({ double __r; \
695+ __asm__ ("fnmsub %[r], %[a], %[c], %[b]\n" \
696+ : [r] "=f" (__r) : [a] "f" (a_), [c] "f" (c_), [b] "f" (b_)); \
697+ __r;})
698+
699+ if (__builtin_expect (b != a_inf.value, 1))
700+ {
701+ double y, x;
702+ fenv_t fe;
703+
704+ fe = fegetenv_register ();
705+
706+ relax_fenv_state ();
707+
708+ /* Compute y = 1.5 * b - b. Uses fewer constants than y = 0.5 * b. */
709+ y = FMSUB (threehalf, b, b);
710+
711+ /* Initial estimate. */
712+ __asm__ ("frsqrte %[x], %[b]\n" : [x] "=f" (x) : [b] "f" (b));
713+
714+ /* Iterate. x_{n+1} = x_n * (1.5 - y * (x_n * x_n)). */
715+ x = x * FNMSUB (y, x * x, threehalf);
716+ x = x * FNMSUB (y, x * x, threehalf);
717+ x = x * FNMSUB (y, x * x, threehalf);
718+
719+ /* All done. */
720+ fesetenv_register (fe);
721+ return x * b;
722+ }
723+ }
724+ else if (b < 0)
725+ {
726+ /* For some reason, some PowerPC32 processors don't implement
727+ FE_INVALID_SQRT. */
728+#ifdef FE_INVALID_SQRT
729+ feraiseexcept (FE_INVALID_SQRT);
730+
731+ fenv_union_t u = { .fenv = fegetenv_register () };
732+ if ((u.l & FE_INVALID) == 0)
733+#endif
734+ feraiseexcept (FE_INVALID);
735+ b = a_nan.value;
736+ }
737+ return f_washf (b);
738+}
739Index: libc/sysdeps/powerpc/powerpc32/e6500/fpu/e_sqrt.c
740===================================================================
741--- /dev/null
742+++ libc/sysdeps/powerpc/powerpc32/e6500/fpu/e_sqrt.c
743@@ -0,0 +1,134 @@
744+/* Double-precision floating point square root.
745+ Copyright (C) 2010 Free Software Foundation, Inc.
746+ This file is part of the GNU C Library.
747+
748+ The GNU C Library is free software; you can redistribute it and/or
749+ modify it under the terms of the GNU Lesser General Public
750+ License as published by the Free Software Foundation; either
751+ version 2.1 of the License, or (at your option) any later version.
752+
753+ The GNU C Library is distributed in the hope that it will be useful,
754+ but WITHOUT ANY WARRANTY; without even the implied warranty of
755+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
756+ Lesser General Public License for more details.
757+
758+ You should have received a copy of the GNU Lesser General Public
759+ License along with the GNU C Library; if not, write to the Free
760+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
761+ 02111-1307 USA. */
762+
763+#include <math.h>
764+#include <math_private.h>
765+#include <fenv_libc.h>
766+#include <inttypes.h>
767+
768+#include <sysdep.h>
769+#include <ldsodefs.h>
770+
771+static const ieee_float_shape_type a_nan = {.word = 0x7fc00000 };
772+static const ieee_float_shape_type a_inf = {.word = 0x7f800000 };
773+static const float two108 = 3.245185536584267269e+32;
774+static const float twom54 = 5.551115123125782702e-17;
775+static const float half = 0.5;
776+
777+/* The method is based on the descriptions in:
778+
779+ _The Handbook of Floating-Pointer Arithmetic_ by Muller et al., chapter 5;
780+ _IA-64 and Elementary Functions: Speed and Precision_ by Markstein, chapter 9
781+
782+ We find the actual square root and half of its reciprocal
783+ simultaneously. */
784+
785+#ifdef __STDC__
786+double
787+__ieee754_sqrt (double b)
788+#else
789+double
790+__ieee754_sqrt (b)
791+ double b;
792+#endif
793+{
794+ if (__builtin_expect (b > 0, 1))
795+ {
796+ double y, g, h, d, r;
797+ ieee_double_shape_type u;
798+
799+ if (__builtin_expect (b != a_inf.value, 1))
800+ {
801+ fenv_t fe;
802+
803+ fe = fegetenv_register ();
804+
805+ u.value = b;
806+
807+ relax_fenv_state ();
808+
809+ __asm__ ("frsqrte %[estimate], %[x]\n"
810+ : [estimate] "=f" (y) : [x] "f" (b));
811+
812+ /* Following Muller et al, page 168, equation 5.20.
813+
814+ h goes to 1/(2*sqrt(b))
815+ g goes to sqrt(b).
816+
817+ We need three iterations to get within 1ulp. */
818+
819+ /* Indicate that these can be performed prior to the branch. GCC
820+ insists on sinking them below the branch, however; it seems like
821+ they'd be better before the branch so that we can cover any latency
822+ from storing the argument and loading its high word. Oh well. */
823+
824+ g = b * y;
825+ h = 0.5 * y;
826+
827+ /* Handle small numbers by scaling. */
828+ if (__builtin_expect ((u.parts.msw & 0x7ff00000) <= 0x02000000, 0))
829+ return __ieee754_sqrt (b * two108) * twom54;
830+
831+#define FMADD(a_, c_, b_) \
832+ ({ double __r; \
833+ __asm__ ("fmadd %[r], %[a], %[c], %[b]\n" \
834+ : [r] "=f" (__r) : [a] "f" (a_), [c] "f" (c_), [b] "f" (b_)); \
835+ __r;})
836+#define FNMSUB(a_, c_, b_) \
837+ ({ double __r; \
838+ __asm__ ("fnmsub %[r], %[a], %[c], %[b]\n" \
839+ : [r] "=f" (__r) : [a] "f" (a_), [c] "f" (c_), [b] "f" (b_)); \
840+ __r;})
841+
842+ r = FNMSUB (g, h, half);
843+ g = FMADD (g, r, g);
844+ h = FMADD (h, r, h);
845+
846+ r = FNMSUB (g, h, half);
847+ g = FMADD (g, r, g);
848+ h = FMADD (h, r, h);
849+
850+ r = FNMSUB (g, h, half);
851+ g = FMADD (g, r, g);
852+ h = FMADD (h, r, h);
853+
854+ /* g is now +/- 1ulp, or exactly equal to, the square root of b. */
855+
856+ /* Final refinement. */
857+ d = FNMSUB (g, g, b);
858+
859+ fesetenv_register (fe);
860+ return FMADD (d, h, g);
861+ }
862+ }
863+ else if (b < 0)
864+ {
865+ /* For some reason, some PowerPC32 processors don't implement
866+ FE_INVALID_SQRT. */
867+#ifdef FE_INVALID_SQRT
868+ feraiseexcept (FE_INVALID_SQRT);
869+
870+ fenv_union_t u = { .fenv = fegetenv_register () };
871+ if ((u.l & FE_INVALID) == 0)
872+#endif
873+ feraiseexcept (FE_INVALID);
874+ b = a_nan.value;
875+ }
876+ return f_wash (b);
877+}
878Index: libc/sysdeps/powerpc/powerpc32/e6500/fpu/e_sqrtf.c
879===================================================================
880--- /dev/null
881+++ libc/sysdeps/powerpc/powerpc32/e6500/fpu/e_sqrtf.c
882@@ -0,0 +1,101 @@
883+/* Single-precision floating point square root.
884+ Copyright (C) 2010 Free Software Foundation, Inc.
885+ This file is part of the GNU C Library.
886+
887+ The GNU C Library is free software; you can redistribute it and/or
888+ modify it under the terms of the GNU Lesser General Public
889+ License as published by the Free Software Foundation; either
890+ version 2.1 of the License, or (at your option) any later version.
891+
892+ The GNU C Library is distributed in the hope that it will be useful,
893+ but WITHOUT ANY WARRANTY; without even the implied warranty of
894+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
895+ Lesser General Public License for more details.
896+
897+ You should have received a copy of the GNU Lesser General Public
898+ License along with the GNU C Library; if not, write to the Free
899+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
900+ 02111-1307 USA. */
901+
902+#include <math.h>
903+#include <math_private.h>
904+#include <fenv_libc.h>
905+#include <inttypes.h>
906+
907+#include <sysdep.h>
908+#include <ldsodefs.h>
909+
910+static const ieee_float_shape_type a_nan = {.word = 0x7fc00000 };
911+static const ieee_float_shape_type a_inf = {.word = 0x7f800000 };
912+static const float threehalf = 1.5;
913+
914+/* The method is based on the descriptions in:
915+
916+ _The Handbook of Floating-Pointer Arithmetic_ by Muller et al., chapter 5;
917+ _IA-64 and Elementary Functions: Speed and Precision_ by Markstein, chapter 9
918+
919+ We find the reciprocal square root and use that to compute the actual
920+ square root. */
921+
922+#ifdef __STDC__
923+float
924+__ieee754_sqrtf (float b)
925+#else
926+float
927+__ieee754_sqrtf (b)
928+ float b;
929+#endif
930+{
931+ if (__builtin_expect (b > 0, 1))
932+ {
933+#define FMSUB(a_, c_, b_) \
934+ ({ double __r; \
935+ __asm__ ("fmsub %[r], %[a], %[c], %[b]\n" \
936+ : [r] "=f" (__r) : [a] "f" (a_), [c] "f" (c_), [b] "f" (b_)); \
937+ __r;})
938+#define FNMSUB(a_, c_, b_) \
939+ ({ double __r; \
940+ __asm__ ("fnmsub %[r], %[a], %[c], %[b]\n" \
941+ : [r] "=f" (__r) : [a] "f" (a_), [c] "f" (c_), [b] "f" (b_)); \
942+ __r;})
943+
944+ if (__builtin_expect (b != a_inf.value, 1))
945+ {
946+ double y, x;
947+ fenv_t fe;
948+
949+ fe = fegetenv_register ();
950+
951+ relax_fenv_state ();
952+
953+ /* Compute y = 1.5 * b - b. Uses fewer constants than y = 0.5 * b. */
954+ y = FMSUB (threehalf, b, b);
955+
956+ /* Initial estimate. */
957+ __asm__ ("frsqrte %[x], %[b]\n" : [x] "=f" (x) : [b] "f" (b));
958+
959+ /* Iterate. x_{n+1} = x_n * (1.5 - y * (x_n * x_n)). */
960+ x = x * FNMSUB (y, x * x, threehalf);
961+ x = x * FNMSUB (y, x * x, threehalf);
962+ x = x * FNMSUB (y, x * x, threehalf);
963+
964+ /* All done. */
965+ fesetenv_register (fe);
966+ return x * b;
967+ }
968+ }
969+ else if (b < 0)
970+ {
971+ /* For some reason, some PowerPC32 processors don't implement
972+ FE_INVALID_SQRT. */
973+#ifdef FE_INVALID_SQRT
974+ feraiseexcept (FE_INVALID_SQRT);
975+
976+ fenv_union_t u = { .fenv = fegetenv_register () };
977+ if ((u.l & FE_INVALID) == 0)
978+#endif
979+ feraiseexcept (FE_INVALID);
980+ b = a_nan.value;
981+ }
982+ return f_washf (b);
983+}
984Index: libc/sysdeps/powerpc/powerpc64/e5500/fpu/e_sqrt.c
985===================================================================
986--- /dev/null
987+++ libc/sysdeps/powerpc/powerpc64/e5500/fpu/e_sqrt.c
988@@ -0,0 +1,134 @@
989+/* Double-precision floating point square root.
990+ Copyright (C) 2010 Free Software Foundation, Inc.
991+ This file is part of the GNU C Library.
992+
993+ The GNU C Library is free software; you can redistribute it and/or
994+ modify it under the terms of the GNU Lesser General Public
995+ License as published by the Free Software Foundation; either
996+ version 2.1 of the License, or (at your option) any later version.
997+
998+ The GNU C Library is distributed in the hope that it will be useful,
999+ but WITHOUT ANY WARRANTY; without even the implied warranty of
1000+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
1001+ Lesser General Public License for more details.
1002+
1003+ You should have received a copy of the GNU Lesser General Public
1004+ License along with the GNU C Library; if not, write to the Free
1005+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
1006+ 02111-1307 USA. */
1007+
1008+#include <math.h>
1009+#include <math_private.h>
1010+#include <fenv_libc.h>
1011+#include <inttypes.h>
1012+
1013+#include <sysdep.h>
1014+#include <ldsodefs.h>
1015+
1016+static const ieee_float_shape_type a_nan = {.word = 0x7fc00000 };
1017+static const ieee_float_shape_type a_inf = {.word = 0x7f800000 };
1018+static const float two108 = 3.245185536584267269e+32;
1019+static const float twom54 = 5.551115123125782702e-17;
1020+static const float half = 0.5;
1021+
1022+/* The method is based on the descriptions in:
1023+
1024+ _The Handbook of Floating-Pointer Arithmetic_ by Muller et al., chapter 5;
1025+ _IA-64 and Elementary Functions: Speed and Precision_ by Markstein, chapter 9
1026+
1027+ We find the actual square root and half of its reciprocal
1028+ simultaneously. */
1029+
1030+#ifdef __STDC__
1031+double
1032+__ieee754_sqrt (double b)
1033+#else
1034+double
1035+__ieee754_sqrt (b)
1036+ double b;
1037+#endif
1038+{
1039+ if (__builtin_expect (b > 0, 1))
1040+ {
1041+ double y, g, h, d, r;
1042+ ieee_double_shape_type u;
1043+
1044+ if (__builtin_expect (b != a_inf.value, 1))
1045+ {
1046+ fenv_t fe;
1047+
1048+ fe = fegetenv_register ();
1049+
1050+ u.value = b;
1051+
1052+ relax_fenv_state ();
1053+
1054+ __asm__ ("frsqrte %[estimate], %[x]\n"
1055+ : [estimate] "=f" (y) : [x] "f" (b));
1056+
1057+ /* Following Muller et al, page 168, equation 5.20.
1058+
1059+ h goes to 1/(2*sqrt(b))
1060+ g goes to sqrt(b).
1061+
1062+ We need three iterations to get within 1ulp. */
1063+
1064+ /* Indicate that these can be performed prior to the branch. GCC
1065+ insists on sinking them below the branch, however; it seems like
1066+ they'd be better before the branch so that we can cover any latency
1067+ from storing the argument and loading its high word. Oh well. */
1068+
1069+ g = b * y;
1070+ h = 0.5 * y;
1071+
1072+ /* Handle small numbers by scaling. */
1073+ if (__builtin_expect ((u.parts.msw & 0x7ff00000) <= 0x02000000, 0))
1074+ return __ieee754_sqrt (b * two108) * twom54;
1075+
1076+#define FMADD(a_, c_, b_) \
1077+ ({ double __r; \
1078+ __asm__ ("fmadd %[r], %[a], %[c], %[b]\n" \
1079+ : [r] "=f" (__r) : [a] "f" (a_), [c] "f" (c_), [b] "f" (b_)); \
1080+ __r;})
1081+#define FNMSUB(a_, c_, b_) \
1082+ ({ double __r; \
1083+ __asm__ ("fnmsub %[r], %[a], %[c], %[b]\n" \
1084+ : [r] "=f" (__r) : [a] "f" (a_), [c] "f" (c_), [b] "f" (b_)); \
1085+ __r;})
1086+
1087+ r = FNMSUB (g, h, half);
1088+ g = FMADD (g, r, g);
1089+ h = FMADD (h, r, h);
1090+
1091+ r = FNMSUB (g, h, half);
1092+ g = FMADD (g, r, g);
1093+ h = FMADD (h, r, h);
1094+
1095+ r = FNMSUB (g, h, half);
1096+ g = FMADD (g, r, g);
1097+ h = FMADD (h, r, h);
1098+
1099+ /* g is now +/- 1ulp, or exactly equal to, the square root of b. */
1100+
1101+ /* Final refinement. */
1102+ d = FNMSUB (g, g, b);
1103+
1104+ fesetenv_register (fe);
1105+ return FMADD (d, h, g);
1106+ }
1107+ }
1108+ else if (b < 0)
1109+ {
1110+ /* For some reason, some PowerPC32 processors don't implement
1111+ FE_INVALID_SQRT. */
1112+#ifdef FE_INVALID_SQRT
1113+ feraiseexcept (FE_INVALID_SQRT);
1114+
1115+ fenv_union_t u = { .fenv = fegetenv_register () };
1116+ if ((u.l & FE_INVALID) == 0)
1117+#endif
1118+ feraiseexcept (FE_INVALID);
1119+ b = a_nan.value;
1120+ }
1121+ return f_wash (b);
1122+}
1123Index: libc/sysdeps/powerpc/powerpc64/e5500/fpu/e_sqrtf.c
1124===================================================================
1125--- /dev/null
1126+++ libc/sysdeps/powerpc/powerpc64/e5500/fpu/e_sqrtf.c
1127@@ -0,0 +1,101 @@
1128+/* Single-precision floating point square root.
1129+ Copyright (C) 2010 Free Software Foundation, Inc.
1130+ This file is part of the GNU C Library.
1131+
1132+ The GNU C Library is free software; you can redistribute it and/or
1133+ modify it under the terms of the GNU Lesser General Public
1134+ License as published by the Free Software Foundation; either
1135+ version 2.1 of the License, or (at your option) any later version.
1136+
1137+ The GNU C Library is distributed in the hope that it will be useful,
1138+ but WITHOUT ANY WARRANTY; without even the implied warranty of
1139+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
1140+ Lesser General Public License for more details.
1141+
1142+ You should have received a copy of the GNU Lesser General Public
1143+ License along with the GNU C Library; if not, write to the Free
1144+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
1145+ 02111-1307 USA. */
1146+
1147+#include <math.h>
1148+#include <math_private.h>
1149+#include <fenv_libc.h>
1150+#include <inttypes.h>
1151+
1152+#include <sysdep.h>
1153+#include <ldsodefs.h>
1154+
1155+static const ieee_float_shape_type a_nan = {.word = 0x7fc00000 };
1156+static const ieee_float_shape_type a_inf = {.word = 0x7f800000 };
1157+static const float threehalf = 1.5;
1158+
1159+/* The method is based on the descriptions in:
1160+
1161+ _The Handbook of Floating-Pointer Arithmetic_ by Muller et al., chapter 5;
1162+ _IA-64 and Elementary Functions: Speed and Precision_ by Markstein, chapter 9
1163+
1164+ We find the reciprocal square root and use that to compute the actual
1165+ square root. */
1166+
1167+#ifdef __STDC__
1168+float
1169+__ieee754_sqrtf (float b)
1170+#else
1171+float
1172+__ieee754_sqrtf (b)
1173+ float b;
1174+#endif
1175+{
1176+ if (__builtin_expect (b > 0, 1))
1177+ {
1178+#define FMSUB(a_, c_, b_) \
1179+ ({ double __r; \
1180+ __asm__ ("fmsub %[r], %[a], %[c], %[b]\n" \
1181+ : [r] "=f" (__r) : [a] "f" (a_), [c] "f" (c_), [b] "f" (b_)); \
1182+ __r;})
1183+#define FNMSUB(a_, c_, b_) \
1184+ ({ double __r; \
1185+ __asm__ ("fnmsub %[r], %[a], %[c], %[b]\n" \
1186+ : [r] "=f" (__r) : [a] "f" (a_), [c] "f" (c_), [b] "f" (b_)); \
1187+ __r;})
1188+
1189+ if (__builtin_expect (b != a_inf.value, 1))
1190+ {
1191+ double y, x;
1192+ fenv_t fe;
1193+
1194+ fe = fegetenv_register ();
1195+
1196+ relax_fenv_state ();
1197+
1198+ /* Compute y = 1.5 * b - b. Uses fewer constants than y = 0.5 * b. */
1199+ y = FMSUB (threehalf, b, b);
1200+
1201+ /* Initial estimate. */
1202+ __asm__ ("frsqrte %[x], %[b]\n" : [x] "=f" (x) : [b] "f" (b));
1203+
1204+ /* Iterate. x_{n+1} = x_n * (1.5 - y * (x_n * x_n)). */
1205+ x = x * FNMSUB (y, x * x, threehalf);
1206+ x = x * FNMSUB (y, x * x, threehalf);
1207+ x = x * FNMSUB (y, x * x, threehalf);
1208+
1209+ /* All done. */
1210+ fesetenv_register (fe);
1211+ return x * b;
1212+ }
1213+ }
1214+ else if (b < 0)
1215+ {
1216+ /* For some reason, some PowerPC32 processors don't implement
1217+ FE_INVALID_SQRT. */
1218+#ifdef FE_INVALID_SQRT
1219+ feraiseexcept (FE_INVALID_SQRT);
1220+
1221+ fenv_union_t u = { .fenv = fegetenv_register () };
1222+ if ((u.l & FE_INVALID) == 0)
1223+#endif
1224+ feraiseexcept (FE_INVALID);
1225+ b = a_nan.value;
1226+ }
1227+ return f_washf (b);
1228+}
1229Index: libc/sysdeps/powerpc/powerpc64/e6500/fpu/e_sqrt.c
1230===================================================================
1231--- /dev/null
1232+++ libc/sysdeps/powerpc/powerpc64/e6500/fpu/e_sqrt.c
1233@@ -0,0 +1,134 @@
1234+/* Double-precision floating point square root.
1235+ Copyright (C) 2010 Free Software Foundation, Inc.
1236+ This file is part of the GNU C Library.
1237+
1238+ The GNU C Library is free software; you can redistribute it and/or
1239+ modify it under the terms of the GNU Lesser General Public
1240+ License as published by the Free Software Foundation; either
1241+ version 2.1 of the License, or (at your option) any later version.
1242+
1243+ The GNU C Library is distributed in the hope that it will be useful,
1244+ but WITHOUT ANY WARRANTY; without even the implied warranty of
1245+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
1246+ Lesser General Public License for more details.
1247+
1248+ You should have received a copy of the GNU Lesser General Public
1249+ License along with the GNU C Library; if not, write to the Free
1250+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
1251+ 02111-1307 USA. */
1252+
1253+#include <math.h>
1254+#include <math_private.h>
1255+#include <fenv_libc.h>
1256+#include <inttypes.h>
1257+
1258+#include <sysdep.h>
1259+#include <ldsodefs.h>
1260+
1261+static const ieee_float_shape_type a_nan = {.word = 0x7fc00000 };
1262+static const ieee_float_shape_type a_inf = {.word = 0x7f800000 };
1263+static const float two108 = 3.245185536584267269e+32;
1264+static const float twom54 = 5.551115123125782702e-17;
1265+static const float half = 0.5;
1266+
1267+/* The method is based on the descriptions in:
1268+
1269+ _The Handbook of Floating-Pointer Arithmetic_ by Muller et al., chapter 5;
1270+ _IA-64 and Elementary Functions: Speed and Precision_ by Markstein, chapter 9
1271+
1272+ We find the actual square root and half of its reciprocal
1273+ simultaneously. */
1274+
1275+#ifdef __STDC__
1276+double
1277+__ieee754_sqrt (double b)
1278+#else
1279+double
1280+__ieee754_sqrt (b)
1281+ double b;
1282+#endif
1283+{
1284+ if (__builtin_expect (b > 0, 1))
1285+ {
1286+ double y, g, h, d, r;
1287+ ieee_double_shape_type u;
1288+
1289+ if (__builtin_expect (b != a_inf.value, 1))
1290+ {
1291+ fenv_t fe;
1292+
1293+ fe = fegetenv_register ();
1294+
1295+ u.value = b;
1296+
1297+ relax_fenv_state ();
1298+
1299+ __asm__ ("frsqrte %[estimate], %[x]\n"
1300+ : [estimate] "=f" (y) : [x] "f" (b));
1301+
1302+ /* Following Muller et al, page 168, equation 5.20.
1303+
1304+ h goes to 1/(2*sqrt(b))
1305+ g goes to sqrt(b).
1306+
1307+ We need three iterations to get within 1ulp. */
1308+
1309+ /* Indicate that these can be performed prior to the branch. GCC
1310+ insists on sinking them below the branch, however; it seems like
1311+ they'd be better before the branch so that we can cover any latency
1312+ from storing the argument and loading its high word. Oh well. */
1313+
1314+ g = b * y;
1315+ h = 0.5 * y;
1316+
1317+ /* Handle small numbers by scaling. */
1318+ if (__builtin_expect ((u.parts.msw & 0x7ff00000) <= 0x02000000, 0))
1319+ return __ieee754_sqrt (b * two108) * twom54;
1320+
1321+#define FMADD(a_, c_, b_) \
1322+ ({ double __r; \
1323+ __asm__ ("fmadd %[r], %[a], %[c], %[b]\n" \
1324+ : [r] "=f" (__r) : [a] "f" (a_), [c] "f" (c_), [b] "f" (b_)); \
1325+ __r;})
1326+#define FNMSUB(a_, c_, b_) \
1327+ ({ double __r; \
1328+ __asm__ ("fnmsub %[r], %[a], %[c], %[b]\n" \
1329+ : [r] "=f" (__r) : [a] "f" (a_), [c] "f" (c_), [b] "f" (b_)); \
1330+ __r;})
1331+
1332+ r = FNMSUB (g, h, half);
1333+ g = FMADD (g, r, g);
1334+ h = FMADD (h, r, h);
1335+
1336+ r = FNMSUB (g, h, half);
1337+ g = FMADD (g, r, g);
1338+ h = FMADD (h, r, h);
1339+
1340+ r = FNMSUB (g, h, half);
1341+ g = FMADD (g, r, g);
1342+ h = FMADD (h, r, h);
1343+
1344+ /* g is now +/- 1ulp, or exactly equal to, the square root of b. */
1345+
1346+ /* Final refinement. */
1347+ d = FNMSUB (g, g, b);
1348+
1349+ fesetenv_register (fe);
1350+ return FMADD (d, h, g);
1351+ }
1352+ }
1353+ else if (b < 0)
1354+ {
1355+ /* For some reason, some PowerPC32 processors don't implement
1356+ FE_INVALID_SQRT. */
1357+#ifdef FE_INVALID_SQRT
1358+ feraiseexcept (FE_INVALID_SQRT);
1359+
1360+ fenv_union_t u = { .fenv = fegetenv_register () };
1361+ if ((u.l & FE_INVALID) == 0)
1362+#endif
1363+ feraiseexcept (FE_INVALID);
1364+ b = a_nan.value;
1365+ }
1366+ return f_wash (b);
1367+}
1368Index: libc/sysdeps/powerpc/powerpc64/e6500/fpu/e_sqrtf.c
1369===================================================================
1370--- /dev/null
1371+++ libc/sysdeps/powerpc/powerpc64/e6500/fpu/e_sqrtf.c
1372@@ -0,0 +1,101 @@
1373+/* Single-precision floating point square root.
1374+ Copyright (C) 2010 Free Software Foundation, Inc.
1375+ This file is part of the GNU C Library.
1376+
1377+ The GNU C Library is free software; you can redistribute it and/or
1378+ modify it under the terms of the GNU Lesser General Public
1379+ License as published by the Free Software Foundation; either
1380+ version 2.1 of the License, or (at your option) any later version.
1381+
1382+ The GNU C Library is distributed in the hope that it will be useful,
1383+ but WITHOUT ANY WARRANTY; without even the implied warranty of
1384+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
1385+ Lesser General Public License for more details.
1386+
1387+ You should have received a copy of the GNU Lesser General Public
1388+ License along with the GNU C Library; if not, write to the Free
1389+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
1390+ 02111-1307 USA. */
1391+
1392+#include <math.h>
1393+#include <math_private.h>
1394+#include <fenv_libc.h>
1395+#include <inttypes.h>
1396+
1397+#include <sysdep.h>
1398+#include <ldsodefs.h>
1399+
1400+static const ieee_float_shape_type a_nan = {.word = 0x7fc00000 };
1401+static const ieee_float_shape_type a_inf = {.word = 0x7f800000 };
1402+static const float threehalf = 1.5;
1403+
1404+/* The method is based on the descriptions in:
1405+
1406+ _The Handbook of Floating-Pointer Arithmetic_ by Muller et al., chapter 5;
1407+ _IA-64 and Elementary Functions: Speed and Precision_ by Markstein, chapter 9
1408+
1409+ We find the reciprocal square root and use that to compute the actual
1410+ square root. */
1411+
1412+#ifdef __STDC__
1413+float
1414+__ieee754_sqrtf (float b)
1415+#else
1416+float
1417+__ieee754_sqrtf (b)
1418+ float b;
1419+#endif
1420+{
1421+ if (__builtin_expect (b > 0, 1))
1422+ {
1423+#define FMSUB(a_, c_, b_) \
1424+ ({ double __r; \
1425+ __asm__ ("fmsub %[r], %[a], %[c], %[b]\n" \
1426+ : [r] "=f" (__r) : [a] "f" (a_), [c] "f" (c_), [b] "f" (b_)); \
1427+ __r;})
1428+#define FNMSUB(a_, c_, b_) \
1429+ ({ double __r; \
1430+ __asm__ ("fnmsub %[r], %[a], %[c], %[b]\n" \
1431+ : [r] "=f" (__r) : [a] "f" (a_), [c] "f" (c_), [b] "f" (b_)); \
1432+ __r;})
1433+
1434+ if (__builtin_expect (b != a_inf.value, 1))
1435+ {
1436+ double y, x;
1437+ fenv_t fe;
1438+
1439+ fe = fegetenv_register ();
1440+
1441+ relax_fenv_state ();
1442+
1443+ /* Compute y = 1.5 * b - b. Uses fewer constants than y = 0.5 * b. */
1444+ y = FMSUB (threehalf, b, b);
1445+
1446+ /* Initial estimate. */
1447+ __asm__ ("frsqrte %[x], %[b]\n" : [x] "=f" (x) : [b] "f" (b));
1448+
1449+ /* Iterate. x_{n+1} = x_n * (1.5 - y * (x_n * x_n)). */
1450+ x = x * FNMSUB (y, x * x, threehalf);
1451+ x = x * FNMSUB (y, x * x, threehalf);
1452+ x = x * FNMSUB (y, x * x, threehalf);
1453+
1454+ /* All done. */
1455+ fesetenv_register (fe);
1456+ return x * b;
1457+ }
1458+ }
1459+ else if (b < 0)
1460+ {
1461+ /* For some reason, some PowerPC32 processors don't implement
1462+ FE_INVALID_SQRT. */
1463+#ifdef FE_INVALID_SQRT
1464+ feraiseexcept (FE_INVALID_SQRT);
1465+
1466+ fenv_union_t u = { .fenv = fegetenv_register () };
1467+ if ((u.l & FE_INVALID) == 0)
1468+#endif
1469+ feraiseexcept (FE_INVALID);
1470+ b = a_nan.value;
1471+ }
1472+ return f_washf (b);
1473+}
1474Index: libc/sysdeps/unix/sysv/linux/powerpc/powerpc32/603e/fpu/Implies
1475===================================================================
1476--- /dev/null
1477+++ libc/sysdeps/unix/sysv/linux/powerpc/powerpc32/603e/fpu/Implies
1478@@ -0,0 +1 @@
1479+powerpc/powerpc32/603e/fpu
1480Index: libc/sysdeps/unix/sysv/linux/powerpc/powerpc32/e300c3/fpu/Implies
1481===================================================================
1482--- /dev/null
1483+++ libc/sysdeps/unix/sysv/linux/powerpc/powerpc32/e300c3/fpu/Implies
1484@@ -0,0 +1,2 @@
1485+# e300c3 is a variant of 603e so use the same optimizations for sqrt
1486+powerpc/powerpc32/603e/fpu
1487Index: libc/sysdeps/unix/sysv/linux/powerpc/powerpc32/e500mc/fpu/Implies
1488===================================================================
1489--- /dev/null
1490+++ libc/sysdeps/unix/sysv/linux/powerpc/powerpc32/e500mc/fpu/Implies
1491@@ -0,0 +1 @@
1492+powerpc/powerpc32/e500mc/fpu
1493Index: libc/sysdeps/unix/sysv/linux/powerpc/powerpc32/e5500/fpu/Implies
1494===================================================================
1495--- /dev/null
1496+++ libc/sysdeps/unix/sysv/linux/powerpc/powerpc32/e5500/fpu/Implies
1497@@ -0,0 +1 @@
1498+powerpc/powerpc32/e5500/fpu
1499Index: libc/sysdeps/unix/sysv/linux/powerpc/powerpc32/e6500/fpu/Implies
1500===================================================================
1501--- /dev/null
1502+++ libc/sysdeps/unix/sysv/linux/powerpc/powerpc32/e6500/fpu/Implies
1503@@ -0,0 +1 @@
1504+powerpc/powerpc32/e6500/fpu
1505Index: libc/sysdeps/unix/sysv/linux/powerpc/powerpc64/e5500/fpu/Implies
1506===================================================================
1507--- /dev/null
1508+++ libc/sysdeps/unix/sysv/linux/powerpc/powerpc64/e5500/fpu/Implies
1509@@ -0,0 +1 @@
1510+powerpc/powerpc64/e5500/fpu
1511Index: libc/sysdeps/unix/sysv/linux/powerpc/powerpc64/e6500/fpu/Implies
1512===================================================================
1513--- /dev/null
1514+++ libc/sysdeps/unix/sysv/linux/powerpc/powerpc64/e6500/fpu/Implies
1515@@ -0,0 +1 @@
1516+powerpc/powerpc64/e6500/fpu
diff --git a/meta/recipes-core/eglibc/eglibc-2.19/initgroups_keys.patch b/meta/recipes-core/eglibc/eglibc-2.19/initgroups_keys.patch
new file mode 100644
index 0000000000..be29856b03
--- /dev/null
+++ b/meta/recipes-core/eglibc/eglibc-2.19/initgroups_keys.patch
@@ -0,0 +1,20 @@
1This is needed since initgroups belongs to NET group
2so when NET is disabled in eglibc build then it reports
3as undefined symbol
4
5Signed-off-by: Khem Raj <raj.khem@gmail.com>
6Upstream-Status: Pending
7
8Index: libc/nss/getent.c
9===================================================================
10--- libc.orig/nss/getent.c 2012-03-09 09:41:57.099581559 -0800
11+++ libc/nss/getent.c 2012-03-09 09:42:13.095582334 -0800
12@@ -898,7 +898,7 @@
13 D(group)
14 D(gshadow)
15 DN(hosts)
16-D(initgroups)
17+DN(initgroups)
18 DN(netgroup)
19 DN(networks)
20 D(passwd)
diff --git a/meta/recipes-core/eglibc/eglibc-2.19/ld-search-order.patch b/meta/recipes-core/eglibc/eglibc-2.19/ld-search-order.patch
new file mode 100644
index 0000000000..e83a0ad6d2
--- /dev/null
+++ b/meta/recipes-core/eglibc/eglibc-2.19/ld-search-order.patch
@@ -0,0 +1,56 @@
1Upstream-Status: Inappropriate [embedded specific]
2
3The default lib search path order is:
4
5 1) LD_LIBRARY_PATH
6 2) RPATH from the binary
7 3) ld.so.cache
8 4) default search paths embedded in the linker
9
10For nativesdk binaries which are being used alongside binaries on a host system, we
11need the search paths to firstly search the shipped nativesdk libs but then also
12cover the host system. For example we want the host system's libGL and this may be
13in a non-standard location like /usr/lib/mesa. The only place the location is know
14about is in the ld.so.cache of the host system.
15
16Since nativesdk has a simple structure and doesn't need to use a cache itself, we
17repurpose the cache for use as a last resort in finding host system binaries. This
18means we need to switch the order of 3 and 4 above to make this work effectively.
19
20RP 14/10/2010
21
22Index: libc/elf/dl-load.c
23===================================================================
24--- libc.orig/elf/dl-load.c 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.19/mips-rld-map-check.patch b/meta/recipes-core/eglibc/eglibc-2.19/mips-rld-map-check.patch
new file mode 100644
index 0000000000..9b646fea95
--- /dev/null
+++ b/meta/recipes-core/eglibc/eglibc-2.19/mips-rld-map-check.patch
@@ -0,0 +1,26 @@
1
2On mips target, binutils currently sets DT_MIPS_RLD_MAP to 0 in dynamic
3section if a --version-script sets _RLD_MAP to local. This is apparently
4a binutils bug, but libc shouldn't segfault in this case.
5
6see also: http://sourceware.org/bugilla/show_bug.cgi?id=11615
7
8Upstream-Status: Pending
9
109/19/2010 - added by Qing He <qing.he@intel.com>
11
12
13---
14diff -ru glibc-2.10.1.orig/ports/sysdeps/mips/dl-machine.h glibc-2.10.1/ports/sysdeps/mips/dl-machine.h
15--- glibc-2.10.1.orig/ports/sysdeps/mips/dl-machine.h 2009-05-16 16:36:20.000000000 +0800
16+++ glibc-2.10.1/ports/sysdeps/mips/dl-machine.h 2010-09-19 09:11:53.000000000 +0800
17@@ -70,7 +70,8 @@
18 /* If there is a DT_MIPS_RLD_MAP entry in the dynamic section, fill it in
19 with the run-time address of the r_debug structure */
20 #define ELF_MACHINE_DEBUG_SETUP(l,r) \
21-do { if ((l)->l_info[DT_MIPS (RLD_MAP)]) \
22+do { if ((l)->l_info[DT_MIPS (RLD_MAP)] && \
23+ (l)->l_info[DT_MIPS (RLD_MAP)]->d_un.d_ptr) \
24 *(ElfW(Addr) *)((l)->l_info[DT_MIPS (RLD_MAP)]->d_un.d_ptr) = \
25 (ElfW(Addr)) (r); \
26 } while (0)
diff --git a/meta/recipes-core/eglibc/eglibc-2.19/multilib_readlib.patch b/meta/recipes-core/eglibc/eglibc-2.19/multilib_readlib.patch
new file mode 100644
index 0000000000..1542b1b519
--- /dev/null
+++ b/meta/recipes-core/eglibc/eglibc-2.19/multilib_readlib.patch
@@ -0,0 +1,17 @@
1Upstream-Status: Inappropriate [embedded specific]
2
3Replace the OECORE_KNOWN_INTERPRETER_NAMES with the value of
4variable EGLIBC_KNOWN_INTERPRETER_NAMES.
5
6Lianhao Lu, 08/01/2011
7
8--- libc/elf/readlib.c.orig 2011-08-12 17:05:51.864470837 +0800
9+++ libc/elf/readlib.c 2011-08-12 17:06:39.346942074 +0800
10@@ -52,6 +52,7 @@
11 #ifdef SYSDEP_KNOWN_INTERPRETER_NAMES
12 SYSDEP_KNOWN_INTERPRETER_NAMES
13 #endif
14+ OECORE_KNOWN_INTERPRETER_NAMES
15 };
16
17 static struct known_names known_libs[] =
diff --git a/meta/recipes-core/eglibc/eglibc-2.19/ppc-sqrt_finite.patch b/meta/recipes-core/eglibc/eglibc-2.19/ppc-sqrt_finite.patch
new file mode 100644
index 0000000000..6ea666b1d6
--- /dev/null
+++ b/meta/recipes-core/eglibc/eglibc-2.19/ppc-sqrt_finite.patch
@@ -0,0 +1,184 @@
1on ppc fixes the errors like below
2| ./.libs/libpulsecore-1.1.so: undefined reference to `__sqrt_finite'
3| collect2: ld returned 1 exit status
4
5Upstream-Status: Pending
6
7ChangeLog
8
92012-01-06 Khem Raj <raj.khem@gmail.com>
10
11 * sysdeps/powerpc/powerpc64/e5500/fpu/e_sqrtf.c: Add __*_finite alias.
12 Remove cruft.
13 * sysdeps/powerpc/powerpc64/e5500/fpu/e_sqrt.c: Ditto.
14 * sysdeps/powerpc/powerpc32/603e/fpu/e_sqrt.c: Ditto.
15 * sysdeps/powerpc/powerpc32/603e/fpu/e_sqrtf.c: Ditto.
16
17Index: libc/sysdeps/powerpc/powerpc32/603e/fpu/e_sqrt.c
18===================================================================
19--- libc.orig/sysdeps/powerpc/powerpc32/603e/fpu/e_sqrt.c
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)
41Index: 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)
65Index: 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)
89Index: 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)
113Index: 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)
122Index: 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)
131Index: 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)
140Index: 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)
149Index: 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)
158Index: 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)
167Index: 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)
176Index: 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.19/ppc_slow_ieee754_sqrt.patch b/meta/recipes-core/eglibc/eglibc-2.19/ppc_slow_ieee754_sqrt.patch
new file mode 100644
index 0000000000..60532cbd03
--- /dev/null
+++ b/meta/recipes-core/eglibc/eglibc-2.19/ppc_slow_ieee754_sqrt.patch
@@ -0,0 +1,365 @@
1 __ieee754_sqrt{,f} are now inline functions and call out __slow versions
2
3
4Signed-off-by: Khem Raj <raj.khem@gmail.com>
5Upstream-Status: Pending
6Index: libc/sysdeps/powerpc/powerpc32/603e/fpu/e_sqrt.c
7===================================================================
8--- libc.orig/sysdeps/powerpc/powerpc32/603e/fpu/e_sqrt.c
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)
41Index: 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)
65Index: 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)
100Index: 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)
125Index: 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)
164Index: 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)
194Index: 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)
233Index: 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)
263Index: 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)
302Index: 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)
332Index: 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)
349Index: 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.19/ppce6500-32b_slow_ieee754_sqrt.patch b/meta/recipes-core/eglibc/eglibc-2.19/ppce6500-32b_slow_ieee754_sqrt.patch
new file mode 100644
index 0000000000..4c6c1070c3
--- /dev/null
+++ b/meta/recipes-core/eglibc/eglibc-2.19/ppce6500-32b_slow_ieee754_sqrt.patch
@@ -0,0 +1,47 @@
1 __ieee754_sqrt{,f} are now inline functions and call out __slow versions
2
3
4Signed-off-by: chunrong guo <B40290@freescale.com>
5Upstream-Status: Pending
6
7diff -rNu libc-orig/sysdeps/powerpc/powerpc32/e6500/fpu/e_sqrt.c libc/sysdeps/powerpc/powerpc32/e6500/fpu/e_sqrt.c
8--- libc-orig/sysdeps/powerpc/powerpc32/e6500/fpu/e_sqrt.c 2014-04-08 04:39:58.487229887 -0500
9+++ libc/sysdeps/powerpc/powerpc32/e6500/fpu/e_sqrt.c 2014-04-08 04:40:52.643069198 -0500
10@@ -41,10 +41,10 @@
11
12 #ifdef __STDC__
13 double
14-__ieee754_sqrt (double b)
15+__slow_ieee754_sqrt (double b)
16 #else
17 double
18-__ieee754_sqrt (b)
19+__slow_ieee754_sqrt (b)
20 double b;
21 #endif
22 {
23@@ -83,7 +83,7 @@
24
25 /* Handle small numbers by scaling. */
26 if (__builtin_expect ((u.parts.msw & 0x7ff00000) <= 0x02000000, 0))
27- return __ieee754_sqrt (b * two108) * twom54;
28+ return __slow_ieee754_sqrt (b * two108) * twom54;
29
30 #define FMADD(a_, c_, b_) \
31 ({ double __r; \
32diff -rNu libc-orig/sysdeps/powerpc/powerpc32/e6500/fpu/e_sqrtf.c libc/sysdeps/powerpc/powerpc32/e6500/fpu/e_sqrtf.c
33--- libc-orig/sysdeps/powerpc/powerpc32/e6500/fpu/e_sqrtf.c 2014-04-08 04:39:58.487229887 -0500
34+++ libc/sysdeps/powerpc/powerpc32/e6500/fpu/e_sqrtf.c 2014-04-08 04:41:26.017067682 -0500
35@@ -39,10 +39,10 @@
36
37 #ifdef __STDC__
38 float
39-__ieee754_sqrtf (float b)
40+__slow_ieee754_sqrtf (float b)
41 #else
42 float
43-__ieee754_sqrtf (b)
44+__slow_ieee754_sqrtf (b)
45 float b;
46 #endif
47 {
diff --git a/meta/recipes-core/eglibc/eglibc-2.19/relocatable_sdk.patch b/meta/recipes-core/eglibc/eglibc-2.19/relocatable_sdk.patch
new file mode 100644
index 0000000000..ca5f17ba58
--- /dev/null
+++ b/meta/recipes-core/eglibc/eglibc-2.19/relocatable_sdk.patch
@@ -0,0 +1,108 @@
1Upstream-Status: Inappropriate [SDK specific]
2
3This patch puts the dynamic loader path in the binaries, SYSTEM_DIRS strings
4and lengths as well as ld.so.cache path in the dynamic loader to specific
5sections in memory. The sections that contain paths have been allocated a 4096
6byte section, which is the maximum path length in linux. This will allow the
7relocating script to parse the ELF binary, detect the section and easily replace
8the strings in a certain path.
9
10Signed-off-by: Laurentiu Palcu <laurentiu.palcu@intel.com>
11
12Index: 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;
23Index: 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 };
38Index: 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)
53Index: 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
67Index: 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
82Index: 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.19/relocatable_sdk_fix_openpath.patch b/meta/recipes-core/eglibc/eglibc-2.19/relocatable_sdk_fix_openpath.patch
new file mode 100644
index 0000000000..f164f8f9ae
--- /dev/null
+++ b/meta/recipes-core/eglibc/eglibc-2.19/relocatable_sdk_fix_openpath.patch
@@ -0,0 +1,41 @@
1Upstream-Status: Inappropriate [SDK specific]
2
3eglibc-nativesdk: Fix buffer overrun with a relocated SDK
4
5When ld-linux-*.so.2 is relocated to a path that is longer than the
6original fixed location, the dynamic loader will crash in open_path
7because it implicitly assumes that max_dirnamelen is a fixed size that
8never changes.
9
10The allocated buffer will not be large enough to contain the directory
11path string which is larger than the fixed location provided at build
12time.
13
14Signed-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;