summaryrefslogtreecommitdiffstats
path: root/meta/recipes-core/eglibc
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-core/eglibc')
-rw-r--r--meta/recipes-core/eglibc/cross-localedef-native_2.19.bb49
-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
-rw-r--r--meta/recipes-core/eglibc/eglibc-collateral.inc12
-rw-r--r--meta/recipes-core/eglibc/eglibc-common.inc9
-rw-r--r--meta/recipes-core/eglibc/eglibc-initial.inc78
-rw-r--r--meta/recipes-core/eglibc/eglibc-initial_2.19.bb11
-rw-r--r--meta/recipes-core/eglibc/eglibc-ld.inc56
-rw-r--r--meta/recipes-core/eglibc/eglibc-locale.inc96
-rw-r--r--meta/recipes-core/eglibc/eglibc-locale_2.19.bb1
-rw-r--r--meta/recipes-core/eglibc/eglibc-mtrace.inc13
-rw-r--r--meta/recipes-core/eglibc/eglibc-mtrace_2.19.bb1
-rw-r--r--meta/recipes-core/eglibc/eglibc-options.inc162
-rw-r--r--meta/recipes-core/eglibc/eglibc-package.inc155
-rw-r--r--meta/recipes-core/eglibc/eglibc-scripts.inc16
-rw-r--r--meta/recipes-core/eglibc/eglibc-scripts_2.19.bb1
-rw-r--r--meta/recipes-core/eglibc/eglibc-testing.inc79
-rw-r--r--meta/recipes-core/eglibc/eglibc.inc84
-rw-r--r--meta/recipes-core/eglibc/eglibc_2.19.bb146
-rw-r--r--meta/recipes-core/eglibc/ldconfig-native-2.12.1/32and64bit.patch331
-rw-r--r--meta/recipes-core/eglibc/ldconfig-native-2.12.1/README8
-rw-r--r--meta/recipes-core/eglibc/ldconfig-native-2.12.1/endian-ness_handling.patch454
-rw-r--r--meta/recipes-core/eglibc/ldconfig-native-2.12.1/endianess-header.patch113
-rw-r--r--meta/recipes-core/eglibc/ldconfig-native-2.12.1/flag_fix.patch24
-rw-r--r--meta/recipes-core/eglibc/ldconfig-native-2.12.1/ldconfig-native-2.12.1.tar.bz2bin0 -> 21491 bytes
-rw-r--r--meta/recipes-core/eglibc/ldconfig-native-2.12.1/ldconfig.patch471
-rw-r--r--meta/recipes-core/eglibc/ldconfig-native-2.12.1/ldconfig_aux-cache_path_fix.patch36
-rw-r--r--meta/recipes-core/eglibc/ldconfig-native_2.12.1.bb30
-rw-r--r--meta/recipes-core/eglibc/site_config/funcs474
-rw-r--r--meta/recipes-core/eglibc/site_config/headers156
-rw-r--r--meta/recipes-core/eglibc/site_config/types21
55 files changed, 7244 insertions, 0 deletions
diff --git a/meta/recipes-core/eglibc/cross-localedef-native_2.19.bb b/meta/recipes-core/eglibc/cross-localedef-native_2.19.bb
new file mode 100644
index 0000000000..3ce0e1d394
--- /dev/null
+++ b/meta/recipes-core/eglibc/cross-localedef-native_2.19.bb
@@ -0,0 +1,49 @@
1SUMMARY = "Cross locale generation tool for eglibc"
2HOMEPAGE = "http://www.eglibc.org/home"
3SECTION = "libs"
4LICENSE = "LGPL-2.1"
5
6LIC_DIR = "${WORKDIR}/eglibc-${PV}/libc"
7LIC_FILES_CHKSUM = "file://${LIC_DIR}/LICENSES;md5=e9a558e243b36d3209f380deb394b213 \
8 file://${LIC_DIR}/COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263 \
9 file://${LIC_DIR}/posix/rxspencer/COPYRIGHT;md5=dc5485bb394a13b2332ec1c785f5d83a \
10 file://${LIC_DIR}/COPYING.LIB;md5=4fbd65380cdd255951079008b364516c"
11
12
13inherit native
14inherit autotools
15
16# pick up an eglibc patch
17FILESPATH = "${FILE_DIRNAME}/eglibc-${PV}"
18
19SRC_URI = "http://downloads.yoctoproject.org/releases/eglibc/eglibc-${PV}-svnr25243.tar.bz2 \
20 file://fix_for_centos_5.8.patch;patchdir=.. \
21 "
22SRC_URI[md5sum] = "197836c2ba42fb146e971222647198dd"
23SRC_URI[sha256sum] = "baaa030531fc308f7820c46acdf8e1b2f8e3c1f40bcd28b6e440d1c95d170d4c"
24
25S = "${WORKDIR}/eglibc-${PV}/localedef"
26
27do_unpack_append() {
28 bb.build.exec_func('do_move_ports', d)
29}
30
31do_move_ports() {
32 if test -d ${WORKDIR}/eglibc-${PV}/ports ; then
33 rm -rf ${WORKDIR}/libc/ports
34 mv ${WORKDIR}/eglibc-${PV}/ports ${WORKDIR}/libc/
35 fi
36}
37
38EXTRA_OECONF = "--with-glibc=${WORKDIR}/eglibc-${PV}/libc"
39CFLAGS += "-DNOT_IN_libc=1"
40
41do_configure () {
42 ${S}/configure ${EXTRA_OECONF}
43}
44
45
46do_install() {
47 install -d ${D}${bindir}
48 install -m 0755 ${B}/localedef ${D}${bindir}/cross-localedef
49}
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;
diff --git a/meta/recipes-core/eglibc/eglibc-collateral.inc b/meta/recipes-core/eglibc/eglibc-collateral.inc
new file mode 100644
index 0000000000..8feca09f2e
--- /dev/null
+++ b/meta/recipes-core/eglibc/eglibc-collateral.inc
@@ -0,0 +1,12 @@
1INHIBIT_DEFAULT_DEPS = "1"
2LICENSE = "GPLv2 & LGPLv2.1"
3HOMEPAGE = "http://www.eglibc.org/"
4
5do_fetch[noexec] = "1"
6do_unpack[noexec] = "1"
7do_patch[noexec] = "1"
8do_configure[noexec] = "1"
9do_compile[noexec] = "1"
10
11do_install[depends] += "virtual/${MLPREFIX}libc:do_populate_sysroot"
12
diff --git a/meta/recipes-core/eglibc/eglibc-common.inc b/meta/recipes-core/eglibc/eglibc-common.inc
new file mode 100644
index 0000000000..d18786ab93
--- /dev/null
+++ b/meta/recipes-core/eglibc/eglibc-common.inc
@@ -0,0 +1,9 @@
1SUMMARY = "Embedded GLIBC (GNU C Library)"
2DESCRIPTION = "Embedded GLIBC (EGLIBC) is a variant of the GNU C Library (GLIBC) that is designed to work well on embedded systems. EGLIBC strives to be source and binary compatible with GLIBC. EGLIBC's goals include reduced footprint, configurable components, better support for cross-compilation and cross-testing."
3HOMEPAGE = "http://www.eglibc.org/home"
4SECTION = "libs"
5LICENSE = "GPLv2 & LGPLv2.1"
6LIC_FILES_CHKSUM ?= "file://LICENSES;md5=07a394b26e0902b9ffdec03765209770 \
7 file://COPYING;md5=393a5ca445f6965873eca0259a17f833 \
8 file://posix/rxspencer/COPYRIGHT;md5=dc5485bb394a13b2332ec1c785f5d83a \
9 file://COPYING.LIB;md5=bbb461211a33b134d42ed5ee802b37ff "
diff --git a/meta/recipes-core/eglibc/eglibc-initial.inc b/meta/recipes-core/eglibc/eglibc-initial.inc
new file mode 100644
index 0000000000..0f0e1cd5e1
--- /dev/null
+++ b/meta/recipes-core/eglibc/eglibc-initial.inc
@@ -0,0 +1,78 @@
1DEPENDS = "linux-libc-headers virtual/${TARGET_PREFIX}gcc-initial"
2PROVIDES = "virtual/${TARGET_PREFIX}libc-initial"
3
4PACKAGES = ""
5PACKAGES_DYNAMIC = ""
6
7STAGINGCC = "gcc-cross-initial"
8STAGINGCC_class-nativesdk = "gcc-crosssdk-initial"
9TOOLCHAIN_OPTIONS = " --sysroot=${STAGING_DIR_TARGET}"
10
11do_configure () {
12 sed -ie 's,{ (exit 1); exit 1; }; },{ (exit 0); }; },g' ${S}/configure
13 chmod +x ${S}/configure
14 (cd ${S} && gnu-configize) || die "failure in running gnu-configize"
15 find ${S} -name "configure" | xargs touch
16 ${S}/configure --host=${TARGET_SYS} --build=${BUILD_SYS} \
17 --prefix=/usr \
18 --without-cvs --disable-sanity-checks \
19 --with-headers=${STAGING_DIR_TARGET}${includedir} \
20 --with-kconfig=${STAGING_BINDIR_NATIVE} \
21 --enable-hacker-mode --enable-addons
22}
23
24do_compile () {
25 :
26}
27
28do_install () {
29 oe_runmake cross-compiling=yes install_root=${D} \
30 includedir='${includedir}' prefix='${prefix}' \
31 install-bootstrap-headers=yes install-headers
32
33 oe_runmake csu/subdir_lib
34 mkdir -p ${D}${libdir}/
35 install -m 644 csu/crt[1in].o ${D}${libdir}
36
37 # Two headers -- stubs.h and features.h -- aren't installed by install-headers,
38 # so do them by hand. We can tolerate an empty stubs.h for the moment.
39 # See e.g. http://gcc.gnu.org/ml/gcc/2002-01/msg00900.html
40 mkdir -p ${D}${includedir}/gnu/
41 touch ${D}${includedir}/gnu/stubs.h
42 cp ${S}/include/features.h ${D}${includedir}/features.h
43
44 if [ -e ${B}/bits/stdio_lim.h ]; then
45 cp ${B}/bits/stdio_lim.h ${D}${includedir}/bits/
46 fi
47 # add links to linux-libc-headers: final eglibc build need this.
48 for t in linux asm asm-generic; do
49 ln -s ${STAGING_DIR_TARGET}${includedir}/$t ${D}${includedir}/
50 done
51}
52
53do_install_locale() {
54 :
55}
56
57do_siteconfig () {
58 :
59}
60
61SSTATEPOSTINSTFUNCS += "eglibcinitial_sstate_postinst"
62eglibcinitial_sstate_postinst() {
63 if [ "${BB_CURRENTTASK}" = "populate_sysroot" -o "${BB_CURRENTTASK}" = "populate_sysroot_setscene" ]
64 then
65 # Recreate the symlinks to ensure they point to the correct location
66 for t in linux asm asm-generic; do
67 rm -f ${STAGING_DIR_TCBOOTSTRAP}${includedir}/$t
68 ln -s ${STAGING_DIR_TARGET}${includedir}/$t ${STAGING_DIR_TCBOOTSTRAP}${includedir}/
69 done
70 fi
71}
72
73do_populate_sysroot[sstate-outputdirs] = "${STAGING_DIR_TCBOOTSTRAP}/"
74
75# We don't install any scripts so there is nothing to evacuate
76do_evacuate_scripts () {
77 :
78}
diff --git a/meta/recipes-core/eglibc/eglibc-initial_2.19.bb b/meta/recipes-core/eglibc/eglibc-initial_2.19.bb
new file mode 100644
index 0000000000..de45079603
--- /dev/null
+++ b/meta/recipes-core/eglibc/eglibc-initial_2.19.bb
@@ -0,0 +1,11 @@
1require eglibc_${PV}.bb
2require eglibc-initial.inc
3
4DEPENDS += "kconfig-frontends-native"
5
6# main eglibc recipes muck with TARGET_CPPFLAGS to point into
7# final target sysroot but we
8# are not there when building eglibc-initial
9# so reset it here
10
11TARGET_CPPFLAGS = ""
diff --git a/meta/recipes-core/eglibc/eglibc-ld.inc b/meta/recipes-core/eglibc/eglibc-ld.inc
new file mode 100644
index 0000000000..6261ae3419
--- /dev/null
+++ b/meta/recipes-core/eglibc/eglibc-ld.inc
@@ -0,0 +1,56 @@
1def ld_append_if_tune_exists(d, infos, dict):
2 tune = d.getVar("DEFAULTTUNE", True) or ""
3 libdir = d.getVar("base_libdir", True) or ""
4 if tune in dict:
5 infos['ldconfig'].add('{"' + libdir + '/' + dict[tune][0] + '",' + dict[tune][1] + ' }')
6 infos['lddrewrite'].add(libdir+'/'+dict[tune][0])
7
8def eglibc_dl_info(d):
9 ld_info_all = {
10 "mips": ["ld.so.1", "FLAG_ELF_LIBC6"],
11 "mips64-n32": ["ld.so.1", "FLAG_ELF_LIBC6"],
12 "mips64": ["ld.so.1", "FLAG_ELF_LIBC6"],
13 "mipsel": ["ld.so.1", "FLAG_ELF_LIBC6"],
14 "mips64el-n32": ["ld.so.1", "FLAG_ELF_LIBC6"],
15 "mips64el": ["ld.so.1", "FLAG_ELF_LIBC6"],
16 "mips-nf": ["ld.so.1", "FLAG_ELF_LIBC6"],
17 "mips64-nf-n32": ["ld.so.1", "FLAG_ELF_LIBC6"],
18 "mips64-nf": ["ld.so.1", "FLAG_ELF_LIBC6"],
19 "mips64el-nf-n32": ["ld.so.1", "FLAG_ELF_LIBC6"],
20 "mips64el-nf": ["ld.so.1", "FLAG_ELF_LIBC6"],
21 "powerpc": ["ld.so.1", "FLAG_ELF_LIBC6"],
22 "powerpc-nf": ["ld.so.1", "FLAG_ELF_LIBC6"],
23 "powerpc64": ["ld64.so.1", "FLAG_ELF_LIBC6"],
24 "powerpc64-nf": ["ld64.so.1", "FLAG_ELF_LIBC6"],
25 "core2-32": ["ld-linux.so.2", "FLAG_ELF_LIBC6"],
26 "core2-64": ["ld-linux-x86-64.so.2", "FLAG_ELF_LIBC6"],
27 "x86": ["ld-linux.so.2", "FLAG_ELF_LIBC6"],
28 "x86-64": ["ld-linux-x86-64.so.2", "FLAG_ELF_LIBC6"],
29 "i586": ["ld-linux.so.2", "FLAG_ELF_LIBC6"],
30 "corei7-32": ["ld-linux.so.2", "FLAG_ELF_LIBC6"],
31 "corei7-64": ["ld-linux-x86-64.so.2", "FLAG_ELF_LIBC6"],
32 }
33
34 infos = {'ldconfig':set(), 'lddrewrite':set()}
35 ld_append_if_tune_exists(d, infos, ld_info_all)
36
37 #DEFAULTTUNE_MULTILIB_ORIGINAL
38 original_tune=d.getVar("DEFAULTTUNE_MULTILIB_ORIGINAL",True)
39 if original_tune:
40 localdata = bb.data.createCopy(d)
41 localdata.setVar("DEFAULTTUNE", original_tune)
42 ld_append_if_tune_exists(localdata, infos, ld_info_all)
43
44 variants = d.getVar("MULTILIB_VARIANTS", True) or ""
45 for item in variants.split():
46 localdata = bb.data.createCopy(d)
47 overrides = localdata.getVar("OVERRIDES", False) + ":virtclass-multilib-" + item
48 localdata.setVar("OVERRIDES", overrides)
49 bb.data.update_data(localdata)
50 ld_append_if_tune_exists(localdata, infos, ld_info_all)
51 infos['ldconfig'] = ','.join(infos['ldconfig'])
52 infos['lddrewrite'] = ' '.join(infos['lddrewrite'])
53 return infos
54
55EGLIBC_KNOWN_INTERPRETER_NAMES = "${@eglibc_dl_info(d)['ldconfig']}"
56RTLDLIST = "${@eglibc_dl_info(d)['lddrewrite']}"
diff --git a/meta/recipes-core/eglibc/eglibc-locale.inc b/meta/recipes-core/eglibc/eglibc-locale.inc
new file mode 100644
index 0000000000..4da5abd778
--- /dev/null
+++ b/meta/recipes-core/eglibc/eglibc-locale.inc
@@ -0,0 +1,96 @@
1include eglibc-collateral.inc
2
3SUMMARY = "Locale data from eglibc"
4
5BPN = "eglibc"
6LOCALEBASEPN = "${MLPREFIX}eglibc"
7
8# eglibc-collateral.inc inhibits all default deps, but do_package needs objcopy
9# ERROR: objcopy failed with exit code 127 (cmd was 'i586-webos-linux-objcopy' --only-keep-debug 'eglibc-locale/2.17-r0/package/usr/lib/gconv/IBM1166.so' 'eglibc-locale/2.17-r0/package/usr/lib/gconv/.debug/IBM1166.so')
10# ERROR: Function failed: split_and_strip_files
11BINUTILSDEP = "virtual/${MLPREFIX}${TARGET_PREFIX}binutils:do_populate_sysroot"
12BINUTILSDEP_class-nativesdk = "virtual/${TARGET_PREFIX}binutils-crosssdk:do_populate_sysroot"
13do_package[depends] += "${BINUTILSDEP}"
14
15# Binary locales are generated at build time if ENABLE_BINARY_LOCALE_GENERATION
16# is set. The idea is to avoid running localedef on the target (at first boot)
17# to decrease initial boot time and avoid localedef being killed by the OOM
18# killer which used to effectively break i18n on machines with < 128MB RAM.
19
20# default to disabled
21ENABLE_BINARY_LOCALE_GENERATION ?= "0"
22ENABLE_BINARY_LOCALE_GENERATION_pn-nativesdk-eglibc-locale = "0"
23
24#enable locale generation on these arches
25# BINARY_LOCALE_ARCHES is a space separated list of regular expressions
26BINARY_LOCALE_ARCHES ?= "arm.* i[3-6]86 x86_64 powerpc mips mips64"
27
28# set "1" to use cross-localedef for locale generation
29# set "0" for qemu emulation of native localedef for locale generation
30LOCALE_GENERATION_WITH_CROSS-LOCALEDEF = "1"
31
32PROVIDES = "virtual/libc-locale"
33
34PACKAGES = "localedef ${PN}-dbg"
35
36PACKAGES_DYNAMIC = "^locale-base-.* \
37 ^eglibc-gconv-.* ^eglibc-charmap-.* ^eglibc-localedata-.* ^eglibc-binary-localedata-.* \
38 ^glibc-gconv-.* ^glibc-charmap-.* ^glibc-localedata-.* ^glibc-binary-localedata-.* \
39 ^${MLPREFIX}eglibc-gconv$"
40
41# Create a eglibc-binaries package
42ALLOW_EMPTY_${BPN}-binaries = "1"
43PACKAGES += "${BPN}-binaries"
44RRECOMMENDS_${BPN}-binaries = "${@" ".join([p for p in d.getVar('PACKAGES', True).split() if p.find("eglibc-binary") != -1])}"
45
46# Create a eglibc-charmaps package
47ALLOW_EMPTY_${BPN}-charmaps = "1"
48PACKAGES += "${BPN}-charmaps"
49RRECOMMENDS_${BPN}-charmaps = "${@" ".join([p for p in d.getVar('PACKAGES', True).split() if p.find("eglibc-charmap") != -1])}"
50
51# Create a eglibc-gconvs package
52ALLOW_EMPTY_${BPN}-gconvs = "1"
53PACKAGES += "${BPN}-gconvs"
54RRECOMMENDS_${BPN}-gconvs = "${@" ".join([p for p in d.getVar('PACKAGES', True).split() if p.find("eglibc-gconv") != -1])}"
55
56# Create a eglibc-localedatas package
57ALLOW_EMPTY_${BPN}-localedatas = "1"
58PACKAGES += "${BPN}-localedatas"
59RRECOMMENDS_${BPN}-localedatas = "${@" ".join([p for p in d.getVar('PACKAGES', True).split() if p.find("eglibc-localedata") != -1])}"
60
61DESCRIPTION_localedef = "eglibc: compile locale definition files"
62
63# eglibc-gconv is dynamically added into PACKAGES, thus
64# FILES_eglibc-gconv will not be automatically extended in multilib.
65# Explicitly add ${MLPREFIX} for FILES_eglibc-gconv.
66FILES_${MLPREFIX}eglibc-gconv = "${libdir}/gconv/*"
67FILES_${PN}-dbg += "${libdir}/gconv/.debug/*"
68FILES_localedef = "${bindir}/localedef"
69
70LOCALETREESRC = "${STAGING_INCDIR}/eglibc-locale-internal-${MULTIMACH_TARGET_SYS}"
71
72do_install () {
73 mkdir -p ${D}${bindir} ${D}${datadir} ${D}${libdir}
74 if [ -n "$(ls ${LOCALETREESRC}/${bindir})" ]; then
75 cp -fpPR ${LOCALETREESRC}/${bindir}/* ${D}${bindir}
76 fi
77 if [ -n "$(ls ${LOCALETREESRC}/${localedir})" ]; then
78 mkdir -p ${D}${localedir}
79 cp -fpPR ${LOCALETREESRC}/${localedir}/* ${D}${localedir}
80 fi
81 if [ -e ${LOCALETREESRC}/${libdir}/gconv ]; then
82 cp -fpPR ${LOCALETREESRC}/${libdir}/gconv ${D}${libdir}
83 fi
84 if [ -e ${LOCALETREESRC}/${datadir}/i18n ]; then
85 cp -fpPR ${LOCALETREESRC}/${datadir}/i18n ${D}${datadir}
86 fi
87 if [ -e ${LOCALETREESRC}/${datadir}/locale ]; then
88 cp -fpPR ${LOCALETREESRC}/${datadir}/locale ${D}${datadir}
89 fi
90 chown root.root -R ${D}
91 cp -fpPR ${LOCALETREESRC}/SUPPORTED ${WORKDIR}
92}
93
94inherit libc-package
95
96BBCLASSEXTEND = "nativesdk"
diff --git a/meta/recipes-core/eglibc/eglibc-locale_2.19.bb b/meta/recipes-core/eglibc/eglibc-locale_2.19.bb
new file mode 100644
index 0000000000..ce6c1d2320
--- /dev/null
+++ b/meta/recipes-core/eglibc/eglibc-locale_2.19.bb
@@ -0,0 +1 @@
require eglibc-locale.inc
diff --git a/meta/recipes-core/eglibc/eglibc-mtrace.inc b/meta/recipes-core/eglibc/eglibc-mtrace.inc
new file mode 100644
index 0000000000..d68783e439
--- /dev/null
+++ b/meta/recipes-core/eglibc/eglibc-mtrace.inc
@@ -0,0 +1,13 @@
1include eglibc-collateral.inc
2
3SUMMARY = "mtrace utility provided by eglibc"
4DESCRIPTION = "mtrace utility provided by eglibc"
5RDEPENDS_${PN} = "perl"
6RPROVIDES_${PN} = "libc-mtrace"
7
8SRC = "${STAGING_INCDIR}/eglibc-scripts-internal-${MULTIMACH_TARGET_SYS}"
9
10do_install() {
11 install -d -m 0755 ${D}${bindir}
12 install -m 0755 ${SRC}/mtrace ${D}${bindir}/
13}
diff --git a/meta/recipes-core/eglibc/eglibc-mtrace_2.19.bb b/meta/recipes-core/eglibc/eglibc-mtrace_2.19.bb
new file mode 100644
index 0000000000..6fa2be9cc9
--- /dev/null
+++ b/meta/recipes-core/eglibc/eglibc-mtrace_2.19.bb
@@ -0,0 +1 @@
require eglibc-mtrace.inc
diff --git a/meta/recipes-core/eglibc/eglibc-options.inc b/meta/recipes-core/eglibc/eglibc-options.inc
new file mode 100644
index 0000000000..0432758417
--- /dev/null
+++ b/meta/recipes-core/eglibc/eglibc-options.inc
@@ -0,0 +1,162 @@
1def eglibc_cfg(feature, tokens, cnf):
2 if type(tokens) == type(""):
3 tokens = [tokens]
4 if feature:
5 cnf.extend([token + '=y' for token in tokens])
6 else:
7 for token in tokens:
8 cnf.extend([token + '=n'])
9 if token == 'OPTION_EGLIBC_NSSWITCH':
10 cnf.extend(["OPTION_EGLIBC_NSSWITCH_FIXED_CONFIG=\"${S}/nss/nsswitch.conf\""])
11 cnf.extend(["OPTION_EGLIBC_NSSWITCH_FIXED_FUNCTIONS=\"${S}/nss/fixed-nsswitch.functions\""])
12
13# Map distro features to eglibc options settings
14def features_to_eglibc_settings(d):
15 cnf = ([])
16
17 ipv4 = base_contains('DISTRO_FEATURES', 'ipv4', True, False, d)
18 ipv6 = base_contains('DISTRO_FEATURES', 'ipv6', True, False, d)
19 libc_backtrace = base_contains('DISTRO_FEATURES', 'libc-backtrace', True, False, d)
20 libc_big_macros = base_contains('DISTRO_FEATURES', 'libc-big-macros', True, False, d)
21 libc_bsd = base_contains('DISTRO_FEATURES', 'libc-bsd', True, False, d)
22 libc_cxx_tests = base_contains('DISTRO_FEATURES', 'libc-cxx-tests', True, False, d)
23 libc_catgets = base_contains('DISTRO_FEATURES', 'libc-catgets', True, False, d)
24 libc_charsets = base_contains('DISTRO_FEATURES', 'libc-charsets', True, False, d)
25 libc_crypt = base_contains('DISTRO_FEATURES', 'libc-crypt', True, False, d)
26 libc_crypt_ufc = base_contains('DISTRO_FEATURES', 'libc-crypt-ufc', True, False, d)
27 libc_db_aliases = base_contains('DISTRO_FEATURES', 'libc-db-aliases', True, False, d)
28 libc_envz = base_contains('DISTRO_FEATURES', 'libc-envz', True, False, d)
29 libc_fcvt = base_contains('DISTRO_FEATURES', 'libc-fcvt', True, False, d)
30 libc_fmtmsg = base_contains('DISTRO_FEATURES', 'libc-fmtmsg', True, False, d)
31 libc_fstab = base_contains('DISTRO_FEATURES', 'libc-fstab', True, False, d)
32 libc_ftraverse = base_contains('DISTRO_FEATURES', 'libc-ftraverse', True, False, d)
33 libc_getlogin = base_contains('DISTRO_FEATURES', 'libc-getlogin', True, False, d)
34 libc_idn = base_contains('DISTRO_FEATURES', 'libc-idn', True, False, d)
35 libc_inet_anl = base_contains('DISTRO_FEATURES', 'libc-inet-anl', True, False, d)
36 libc_libm = base_contains('DISTRO_FEATURES', 'libc-libm', True, False, d)
37 libc_locales = base_contains('DISTRO_FEATURES', 'libc-locales', True, False, d)
38 libc_locale_code = base_contains('DISTRO_FEATURES', 'libc-locale-code', True, False, d)
39 libc_memusage = base_contains('DISTRO_FEATURES', 'libc-memusage', True, False, d)
40 libc_nis = base_contains('DISTRO_FEATURES', 'libc-nis', True, False, d)
41 libc_nsswitch = base_contains('DISTRO_FEATURES', 'libc-nsswitch', True, False, d)
42 libc_rcmd = base_contains('DISTRO_FEATURES', 'libc-rcmd', True, False, d)
43 libc_rtld_debug = base_contains('DISTRO_FEATURES', 'libc-rtld-debug', True, False, d)
44 libc_spawn = base_contains('DISTRO_FEATURES', 'libc-spawn', True, False, d)
45 libc_streams = base_contains('DISTRO_FEATURES', 'libc-streams', True, False, d)
46 libc_sunrpc = base_contains('DISTRO_FEATURES', 'libc-sunrpc', True, False, d)
47 libc_utmp = base_contains('DISTRO_FEATURES', 'libc-utmp', True, False, d)
48 libc_utmpx = base_contains('DISTRO_FEATURES', 'libc-utmpx', True, False, d)
49 libc_wordexp = base_contains('DISTRO_FEATURES', 'libc-wordexp', True, False, d)
50 libc_posix_clang_wchar = base_contains('DISTRO_FEATURES', 'libc-posix-clang-wchar', True, False, d)
51 libc_posix_regexp = base_contains('DISTRO_FEATURES', 'libc-posix-regexp', True, False, d)
52 libc_posix_regexp_glibc = base_contains('DISTRO_FEATURES', 'libc-posix-regexp-glibc', True, False, d)
53 libc_posix_wchar_io = base_contains('DISTRO_FEATURES', 'libc-posix-wchar-io', True, False, d)
54
55 # arrange the dependencies among eglibc configuable options according to file option-groups.def from eglibc source code
56 new_dep = True
57 while new_dep:
58 new_dep = False
59
60 if ipv6 and not ipv4:
61 new_dep = True
62 ipv4 = True
63
64 if ipv4 and not libc_nsswitch:
65 new_dep = True
66 libc_nsswitch = True
67
68 if libc_cxx_tests:
69 if not libc_posix_wchar_io:
70 new_dep = True
71 libc_posix_wchar_io = True
72 if not libc_libm:
73 new_dep = True
74 libc_libm = True
75
76 if libc_catgets and not libc_locale_code:
77 new_dep = True
78 libc_locale_code = True
79
80 if libc_crypt_ufc and not libc_crypt:
81 new_dep = True
82 libc_crypt = True
83
84 if libc_getlogin and not libc_utmp:
85 new_dep = True
86 libc_utmp = True
87
88 if libc_inet_anl and not ipv4:
89 new_dep = True
90 ipv4 = True
91
92 if libc_locale_code and not libc_posix_clang_wchar:
93 new_dep = True
94 libc_posix_clang_wchar = True
95
96 if libc_nis:
97 if not ipv4:
98 new_dep = True
99 ipv4 = True
100 if not libc_sunrpc:
101 new_dep = True
102 libc_sunrpc = True
103
104 if libc_rcmd and not ipv4:
105 new_dep = True
106 ipv4 = True
107
108 if libc_sunrpc and not ipv4:
109 new_dep = True
110 ipv4 = True
111
112 if libc_utmpx and not libc_utmp:
113 new_dep = True
114 libc_utmp = True
115
116 if libc_posix_regexp_glibc and not libc_posix_regexp:
117 new_dep = True
118 libc_posix_regexp = True
119
120 if libc_posix_wchar_io and not libc_posix_clang_wchar:
121 new_dep = True
122 libc_posix_clang_wchar = True
123
124 eglibc_cfg(ipv6, 'OPTION_EGLIBC_ADVANCED_INET6', cnf)
125 eglibc_cfg(libc_backtrace, 'OPTION_EGLIBC_BACKTRACE', cnf)
126 eglibc_cfg(libc_big_macros, 'OPTION_EGLIBC_BIG_MACROS', cnf)
127 eglibc_cfg(libc_bsd, 'OPTION_EGLIBC_BSD', cnf)
128 eglibc_cfg(libc_cxx_tests, 'OPTION_EGLIBC_CXX_TESTS', cnf)
129 eglibc_cfg(libc_catgets, 'OPTION_EGLIBC_CATGETS', cnf)
130 eglibc_cfg(libc_charsets, 'OPTION_EGLIBC_CHARSETS', cnf)
131 eglibc_cfg(libc_crypt, 'OPTION_EGLIBC_CRYPT', cnf)
132 eglibc_cfg(libc_crypt_ufc, 'OPTION_EGLIBC_CRYPT_UFC', cnf)
133 eglibc_cfg(libc_db_aliases, 'OPTION_EGLIBC_DB_ALIASES', cnf)
134 eglibc_cfg(libc_envz, 'OPTION_EGLIBC_ENVZ', cnf)
135 eglibc_cfg(libc_fcvt, 'OPTION_EGLIBC_FCVT', cnf)
136 eglibc_cfg(libc_fmtmsg, 'OPTION_EGLIBC_FMTMSG', cnf)
137 eglibc_cfg(libc_fstab, 'OPTION_EGLIBC_FSTAB', cnf)
138 eglibc_cfg(libc_ftraverse, 'OPTION_EGLIBC_FTRAVERSE', cnf)
139 eglibc_cfg(libc_getlogin, 'OPTION_EGLIBC_GETLOGIN', cnf)
140 eglibc_cfg(libc_idn, 'OPTION_EGLIBC_IDN', cnf)
141 eglibc_cfg(ipv4, 'OPTION_EGLIBC_INET', cnf)
142 eglibc_cfg(libc_inet_anl, 'OPTION_EGLIBC_INET_ANL', cnf)
143 eglibc_cfg(libc_libm, 'OPTION_EGLIBC_LIBM', cnf)
144 eglibc_cfg(libc_locales, 'OPTION_EGLIBC_LOCALES', cnf)
145 eglibc_cfg(libc_locale_code, 'OPTION_EGLIBC_LOCALE_CODE', cnf)
146 eglibc_cfg(libc_memusage, 'OPTION_EGLIBC_MEMUSAGE', cnf)
147 eglibc_cfg(libc_nis, 'OPTION_EGLIBC_NIS', cnf)
148 eglibc_cfg(libc_nsswitch, 'OPTION_EGLIBC_NSSWITCH', cnf)
149 eglibc_cfg(libc_rcmd, 'OPTION_EGLIBC_RCMD', cnf)
150 eglibc_cfg(libc_rtld_debug, 'OPTION_EGLIBC_RTLD_DEBUG', cnf)
151 eglibc_cfg(libc_spawn, 'OPTION_EGLIBC_SPAWN', cnf)
152 eglibc_cfg(libc_streams, 'OPTION_EGLIBC_STREAMS', cnf)
153 eglibc_cfg(libc_sunrpc, 'OPTION_EGLIBC_SUNRPC', cnf)
154 eglibc_cfg(libc_utmp, 'OPTION_EGLIBC_UTMP', cnf)
155 eglibc_cfg(libc_utmpx, 'OPTION_EGLIBC_UTMPX', cnf)
156 eglibc_cfg(libc_wordexp, 'OPTION_EGLIBC_WORDEXP', cnf)
157 eglibc_cfg(libc_posix_clang_wchar, 'OPTION_POSIX_C_LANG_WIDE_CHAR', cnf)
158 eglibc_cfg(libc_posix_regexp, 'OPTION_POSIX_REGEXP', cnf)
159 eglibc_cfg(libc_posix_regexp_glibc, 'OPTION_POSIX_REGEXP_GLIBC', cnf)
160 eglibc_cfg(libc_posix_wchar_io, 'OPTION_POSIX_WIDE_CHAR_DEVICE_IO', cnf)
161
162 return "\n".join(cnf)
diff --git a/meta/recipes-core/eglibc/eglibc-package.inc b/meta/recipes-core/eglibc/eglibc-package.inc
new file mode 100644
index 0000000000..6721819d2e
--- /dev/null
+++ b/meta/recipes-core/eglibc/eglibc-package.inc
@@ -0,0 +1,155 @@
1#
2# For now, we will skip building of a gcc package if it is a uclibc one
3# and our build is not a uclibc one, and we skip a eglibc one if our build
4# is a uclibc build.
5#
6# See the note in gcc/gcc_3.4.0.oe
7#
8
9python __anonymous () {
10 import bb, re
11 uc_os = (re.match('.*uclibc*', d.getVar('TARGET_OS', True)) != None)
12 if uc_os:
13 raise bb.parse.SkipPackage("incompatible with target %s" %
14 d.getVar('TARGET_OS', True))
15}
16
17# Set this to zero if you don't want ldconfig in the output package
18USE_LDCONFIG ?= "1"
19
20PACKAGES = "${PN}-dbg catchsegv sln nscd ldd ${PN}-utils eglibc-thread-db ${PN}-pic libcidn libmemusage libsegfault ${PN}-pcprofile libsotruss ${PN} eglibc-extra-nss ${PN}-dev ${PN}-staticdev ${PN}-doc"
21
22# The ld.so in this eglibc supports the GNU_HASH
23RPROVIDES_${PN} = "glibc rtld(GNU_HASH)"
24RPROVIDES_${PN}-utils = "glibc-utils"
25RPROVIDES_${PN}-mtrace = "glibc-mtrace libc-mtrace"
26RPROVIDES_${PN}-pic = "glibc-pic"
27RPROVIDES_${PN}-dev = "glibc-dev libc6-dev virtual-libc-dev"
28RPROVIDES_${PN}-staticdev = "glibc-staticdev"
29RPROVIDES_${PN}-doc = "glibc-doc"
30RPROVIDES_eglibc-extra-nss = "glibc-extra-nss"
31RPROVIDES_eglibc-thread-db = "glibc-thread-db"
32RPROVIDES_${PN}-pcprofile = "glibc-pcprofile"
33RPROVIDES_${PN}-dbg = "glibc-dbg"
34libc_baselibs = "${base_libdir}/libcrypt*.so.* ${base_libdir}/libcrypt-*.so ${base_libdir}/libc.so.* ${base_libdir}/libc-*.so ${base_libdir}/libm*.so.* ${base_libdir}/libm-*.so ${base_libdir}/ld*.so.* ${base_libdir}/ld-*.so ${base_libdir}/libpthread*.so.* ${base_libdir}/libpthread-*.so ${base_libdir}/libresolv*.so.* ${base_libdir}/libresolv-*.so ${base_libdir}/librt*.so.* ${base_libdir}/librt-*.so ${base_libdir}/libutil*.so.* ${base_libdir}/libutil-*.so ${base_libdir}/libnsl*.so.* ${base_libdir}/libnsl-*.so ${base_libdir}/libnss_files*.so.* ${base_libdir}/libnss_files-*.so ${base_libdir}/libnss_compat*.so.* ${base_libdir}/libnss_compat-*.so ${base_libdir}/libnss_dns*.so.* ${base_libdir}/libnss_dns-*.so ${base_libdir}/libdl*.so.* ${base_libdir}/libdl-*.so ${base_libdir}/libanl*.so.* ${base_libdir}/libanl-*.so ${base_libdir}/libBrokenLocale*.so.* ${base_libdir}/libBrokenLocale-*.so"
35
36FILES_${PN} = "${libc_baselibs} ${libexecdir}/* ${@base_conditional('USE_LDCONFIG', '1', '${base_sbindir}/ldconfig ${sysconfdir}/ld.so.conf', '', d)}"
37FILES_ldd = "${bindir}/ldd"
38FILES_libsegfault = "${base_libdir}/libSegFault*"
39FILES_libcidn = "${base_libdir}/libcidn-*.so ${base_libdir}/libcidn.so.*"
40FILES_libmemusage = "${base_libdir}/libmemusage.so"
41FILES_eglibc-extra-nss = "${base_libdir}/libnss_*-*.so ${base_libdir}/libnss_*.so.*"
42FILES_sln = "/sbin/sln"
43FILES_${PN}-pic = "${libdir}/*_pic.a ${libdir}/*_pic.map ${libdir}/libc_pic/*.o"
44FILES_libsotruss = "${libdir}/audit/sotruss-lib.so"
45FILES_SOLIBSDEV = "${libdir}/lib*${SOLIBSDEV}"
46FILES_${PN}-dev += "${bindir}/rpcgen ${libdir}/*_nonshared.a ${base_libdir}/*_nonshared.a ${base_libdir}/*.o ${datadir}/aclocal"
47FILES_${PN}-staticdev += "${libdir}/*.a ${base_libdir}/*.a"
48FILES_nscd = "${sbindir}/nscd*"
49FILES_${PN}-mtrace = "${bindir}/mtrace"
50FILES_${PN}-utils = "${bindir}/* ${sbindir}/*"
51FILES_${PN}-dbg += "${libexecdir}/*/.debug ${libdir}/audit/.debug"
52FILES_catchsegv = "${bindir}/catchsegv"
53RDEPENDS_catchsegv = "libsegfault"
54FILES_${PN}-pcprofile = "${base_libdir}/libpcprofile.so"
55FILES_eglibc-thread-db = "${base_libdir}/libthread_db.so.* ${base_libdir}/libthread_db-*.so"
56RPROVIDES_${PN}-dev += "libc-dev"
57RPROVIDES_${PN}-staticdev += "libc-staticdev"
58
59SUMMARY_sln = "The static ln"
60DESCRIPTION_sln = "Similar to the 'ln' utility, but statically linked. sln is useful to make symbolic links to dynamic libraries if the dynamic linking system, for some reason, is not functional."
61SUMMARY_nscd = "Name service cache daemon"
62DESCRIPTION_nscd = "nscd, name service cache daemon, caches name service lookups for the passwd, group and hosts information. It can damatically improvide performance with remote, such as NIS or NIS+, name services."
63SUMMARY_eglibc-extra-nss = "hesiod, NIS and NIS+ nss libraries"
64DESCRIPTION_eglibc-extra-nss = "eglibc: nis, nisplus and hesiod search services."
65SUMMARY_ldd = "print shared library dependencies"
66DESCRIPTION_ldd = "${bindir}/ldd prints shared library dependencies for each program or shared library specified on the command line."
67SUMMARY_${PN}-utils = "Miscellaneous utilities provided by eglibc"
68DESCRIPTION_${PN}-utils = "Miscellaneous utilities including getconf, iconf, locale, gencat, tzselect, zic, rpcinfo, ..."
69DESCRIPTION_libsotruss = "Library to support sotruss which traces calls through PLTs"
70
71inherit libc-common multilib_header
72
73do_install_append () {
74 rm -f ${D}${sysconfdir}/localtime
75 rm -rf ${D}${localstatedir}
76
77 # remove empty eglibc dir
78 if [ -d ${D}${libdir}/eglibc -a ! -e ${D}${libdir}/eglibc/pt_chown ]; then
79 rmdir ${D}${libdir}/eglibc
80 fi
81 oe_multilib_header bits/syscall.h
82
83 if [ -f ${D}${bindir}/mtrace ]; then
84 sed -i -e '1s,#!.*perl,#! ${USRBINPATH}/env perl,' -e '2s,exec.*perl,exec ${USRBINPATH}/env perl,' ${D}${bindir}/mtrace
85 fi
86 rm -rf ${D}${includedir}/rpcsvc/rquota*
87 # Info dir listing isn't interesting at this point so remove it if it exists.
88 if [ -e "${D}${infodir}/dir" ]; then
89 rm -f ${D}${infodir}/dir
90 fi
91
92 if [ "${USE_LDCONFIG}" != "1" ]; then
93 # We won't ship this file (see FILES above) so let's not install it
94 rm -f ${D}${sysconfdir}/ld.so.conf
95 # This directory will be empty now so remove it too.
96 # But check whether it exists first, since it won't for eglibc-initial.
97 if [ -d ${D}${sysconfdir} ]; then
98 rmdir ${D}${sysconfdir}
99 fi
100 fi
101}
102
103do_install_locale () {
104 dest=${D}/${includedir}/eglibc-locale-internal-${MULTIMACH_TARGET_SYS}
105 install -d ${dest}${base_libdir} ${dest}${bindir} ${dest}${libdir} ${dest}${datadir}
106 if [ "${base_libdir}" != "${libdir}" ]; then
107 cp -fpPR ${D}${base_libdir}/* ${dest}${base_libdir}
108 fi
109 if [ -e ${D}${bindir}/localedef ]; then
110 mv -f ${D}${bindir}/localedef ${dest}${bindir}
111 fi
112 if [ -e ${D}${libdir}/gconv ]; then
113 mv -f ${D}${libdir}/gconv ${dest}${libdir}
114 fi
115 if [ -e ${D}${exec_prefix}/lib ]; then
116 cp -fpPR ${D}${exec_prefix}/lib ${dest}${exec_prefix}
117 fi
118 if [ -e ${D}${datadir}/i18n ]; then
119 mv ${D}${datadir}/i18n ${dest}${datadir}
120 fi
121 cp -fpPR ${D}${datadir}/* ${dest}${datadir}
122 rm -rf ${D}${datadir}/locale/
123 cp -fpPR ${WORKDIR}/SUPPORTED ${dest}
124}
125
126addtask do_install_locale after do_install before do_populate_sysroot do_package
127
128bashscripts = "mtrace sotruss xtrace"
129
130do_evacuate_scripts () {
131 target=${D}${includedir}/eglibc-scripts-internal-${MULTIMACH_TARGET_SYS}
132 mkdir -p $target
133 for i in ${bashscripts}; do
134 if [ -f ${D}${bindir}/$i ]; then
135 cp ${D}${bindir}/$i $target/
136 fi
137 done
138}
139
140addtask evacuate_scripts after do_install before do_populate_sysroot do_package
141
142PACKAGE_PREPROCESS_FUNCS += "eglibc_package_preprocess"
143
144eglibc_package_preprocess () {
145 rm -rf ${PKGD}/${includedir}/eglibc-locale-internal-${MULTIMACH_TARGET_SYS}
146 rm -rf ${PKGD}/${includedir}/eglibc-scripts-internal-${MULTIMACH_TARGET_SYS}
147 for i in ${bashscripts}; do
148 rm -f ${PKGD}${bindir}/$i
149 done
150 rm -rf ${PKGD}/${localedir}
151 if [ "${libdir}" != "${exec_prefix}/lib" ]; then
152 # This dir only exists to hold locales
153 rm -rf ${PKGD}${exec_prefix}/lib
154 fi
155}
diff --git a/meta/recipes-core/eglibc/eglibc-scripts.inc b/meta/recipes-core/eglibc/eglibc-scripts.inc
new file mode 100644
index 0000000000..9ca6673404
--- /dev/null
+++ b/meta/recipes-core/eglibc/eglibc-scripts.inc
@@ -0,0 +1,16 @@
1include eglibc-collateral.inc
2
3SUMMARY = "utility scripts provided by eglibc"
4DESCRIPTION = "utility scripts provided by eglibc"
5RDEPENDS_${PN} = "bash eglibc-mtrace"
6
7SRC = "${STAGING_INCDIR}/eglibc-scripts-internal-${MULTIMACH_TARGET_SYS}"
8
9bashscripts = "sotruss xtrace"
10
11do_install() {
12 install -d -m 0755 ${D}${bindir}
13 for i in ${bashscripts}; do
14 install -m 0755 ${SRC}/$i ${D}${bindir}/
15 done
16}
diff --git a/meta/recipes-core/eglibc/eglibc-scripts_2.19.bb b/meta/recipes-core/eglibc/eglibc-scripts_2.19.bb
new file mode 100644
index 0000000000..31133621d1
--- /dev/null
+++ b/meta/recipes-core/eglibc/eglibc-scripts_2.19.bb
@@ -0,0 +1 @@
require eglibc-scripts.inc
diff --git a/meta/recipes-core/eglibc/eglibc-testing.inc b/meta/recipes-core/eglibc/eglibc-testing.inc
new file mode 100644
index 0000000000..ab3ec1555f
--- /dev/null
+++ b/meta/recipes-core/eglibc/eglibc-testing.inc
@@ -0,0 +1,79 @@
1do_compile_append () {
2 # now generate script to drive testing
3 echo "#!/usr/bin/env sh" >${B}/${HOST_PREFIX}testeglibc
4 set >> ${B}/${HOST_PREFIX}testeglibc
5 # prune out the unneeded vars
6 sed -i -e "/^BASH/d" ${B}/${HOST_PREFIX}testeglibc
7 sed -i -e "/^USER/d" ${B}/${HOST_PREFIX}testeglibc
8 sed -i -e "/^OPT/d" ${B}/${HOST_PREFIX}testeglibc
9 sed -i -e "/^DIRSTACK/d" ${B}/${HOST_PREFIX}testeglibc
10 sed -i -e "/^EUID/d" ${B}/${HOST_PREFIX}testeglibc
11 sed -i -e "/^FUNCNAME/d" ${B}/${HOST_PREFIX}testeglibc
12 sed -i -e "/^GROUPS/d" ${B}/${HOST_PREFIX}testeglibc
13 sed -i -e "/^HOST/d" ${B}/${HOST_PREFIX}testeglibc
14 sed -i -e "/^HOME/d" ${B}/${HOST_PREFIX}testeglibc
15 sed -i -e "/^IFS/d" ${B}/${HOST_PREFIX}testeglibc
16 sed -i -e "/^LC_ALL/d" ${B}/${HOST_PREFIX}testeglibc
17 sed -i -e "/^LOGNAME/d" ${B}/${HOST_PREFIX}testeglibc
18 sed -i -e "/^MACHTYPE/d" ${B}/${HOST_PREFIX}testeglibc
19 sed -i -e "/^OSTYPE/d" ${B}/${HOST_PREFIX}testeglibc
20 sed -i -e "/^PIPE/d" ${B}/${HOST_PREFIX}testeglibc
21 sed -i -e "/^SHELL/d" ${B}/${HOST_PREFIX}testeglibc
22 sed -i -e "/^'/d" ${B}/${HOST_PREFIX}testeglibc
23 sed -i -e "/^UID/d" ${B}/${HOST_PREFIX}testeglibc
24 sed -i -e "/^TERM/d" ${B}/${HOST_PREFIX}testeglibc
25 sed -i -e "/^PATCH_GET/d" ${B}/${HOST_PREFIX}testeglibc
26 sed -i -e "/^PKG_/d" ${B}/${HOST_PREFIX}testeglibc
27 sed -i -e "/^POSIXLY_/d" ${B}/${HOST_PREFIX}testeglibc
28 sed -i -e "/^PPID/d" ${B}/${HOST_PREFIX}testeglibc
29 sed -i -e "/^PS4/d" ${B}/${HOST_PREFIX}testeglibc
30 sed -i -e "/^Q/d" ${B}/${HOST_PREFIX}testeglibc
31 sed -i -e "/^SHLVL/d" ${B}/${HOST_PREFIX}testeglibc
32 sed -i -e "/^STAGING/d" ${B}/${HOST_PREFIX}testeglibc
33 sed -i -e "/^LD_LIBRARY_PATH/d" ${B}/${HOST_PREFIX}testeglibc
34 sed -i -e "/^PSEUDO/d" ${B}/${HOST_PREFIX}testeglibc
35
36 # point to real sysroot not the toolchain bootstrap sysroot
37 sed -i -e "s/\-tcbootstrap//g" ${B}/${HOST_PREFIX}testeglibc
38
39 # use the final cross-gcc to test since some tests need libstdc++
40 sed -i -e "s/^PATH=.*\.gcc-cross-initial\:/PATH=/g" ${B}/${HOST_PREFIX}testeglibc
41
42 # append execution part script
43cat >> ${B}/${HOST_PREFIX}testeglibc << STOP
44target="\$1"
45if [ "x\$target" = "x" ]
46then
47 echo "Please specify the target machine and remote user in form of user@target"
48 exit 1;
49fi
50ssh \$target ls \$PWD\ 2>&1 > /dev/null
51if [ "x\$?" != "x0" ]
52then
53 echo "Failed connecting to \$target it could be because of:"
54 echo "1. You dont have passwordless ssh setup to access \$target"
55 echo "2. NFS share on \$target is not mounted or if mounted then not matching the build tree layout."
56 echo " The tree should be accessible at same location on build host and target"
57 echo " You can add nfs-server to IMAGE_FEATURES to get the nfs client on target"
58 echo "3. nfs server on build host is not running."
59 echo " Please make sure that you have 'no_root_squash' added in /etc/exports if you want"
60 echo " to test as root user on target (usually its recommended to create a non"
61 echo " root user."
62 echo " As a sanity check make sure that target can read/write to the eglibc build tree"
63 echo " Please refer to ${S}/EGLIBC.cross-testing for further instructions on setup"
64 exit 1
65fi
66 echo "# we test using cross compiler from real sysroot therefore override the" > ${B}/configparms
67 echo "# definitions that come from ${B}/config.make" >> ${B}/configparms
68
69 fgrep tcbootstrap ${B}/config.make > ${B}/configparms
70 sed -i -e "s/\-tcbootstrap//g" ${B}/configparms
71wrapper="${S}/scripts/cross-test-ssh.sh \$target"
72localedef="${STAGING_BINDIR_NATIVE}/cross-localedef --little-endian --uint32-align=4"
73make tests-clean
74make cross-localedef="\$localedef" cross-test-wrapper="\$wrapper" -k check
75rm -rf ${B}/configparms
76STOP
77
78 chmod +x ${B}/${HOST_PREFIX}testeglibc
79}
diff --git a/meta/recipes-core/eglibc/eglibc.inc b/meta/recipes-core/eglibc/eglibc.inc
new file mode 100644
index 0000000000..375b9bc116
--- /dev/null
+++ b/meta/recipes-core/eglibc/eglibc.inc
@@ -0,0 +1,84 @@
1require eglibc-common.inc
2require eglibc-ld.inc
3require eglibc-testing.inc
4
5STAGINGCC = "gcc-cross-initial"
6STAGINGCC_class-nativesdk = "gcc-crosssdk-initial"
7PATH_prepend = "${STAGING_BINDIR_TOOLCHAIN}.${STAGINGCC}:"
8
9TOOLCHAIN_OPTIONS = " --sysroot=${STAGING_DIR_TCBOOTSTRAP}"
10
11# eglibc can't be built without optimization, if someone tries to compile an
12# entire image as -O0, we override it with -O2 here and give a note about it.
13def get_optimization(d):
14 selected_optimization = d.getVar("SELECTED_OPTIMIZATION", True)
15 if base_contains("SELECTED_OPTIMIZATION", "-O0", "x", "", d) == "x":
16 bb.note("eglibc can't be built with -O0, -O2 will be used instead.")
17 return selected_optimization.replace("-O0", "-O2")
18 return selected_optimization
19
20SELECTED_OPTIMIZATION := "${@get_optimization(d)}"
21
22# siteconfig.bbclass runs configure which needs a working compiler
23# For the compiler to work we need a working libc yet libc isn't
24# in the sysroots directory at this point. This means the libc.so
25# linker script won't work as the --sysroot setting isn't correct.
26# Here we create a hacked up libc linker script and pass in the right
27# flags to let configure work. Ugly.
28EXTRASITECONFIG = "CFLAGS='${CFLAGS} -Wl,-L${WORKDIR}/site_config_libc -L${WORKDIR}/site_config_libc -L${SYSROOT_DESTDIR}${libdir} -L${SYSROOT_DESTDIR}${base_libdir} -Wl,-L${SYSROOT_DESTDIR}${libdir} -Wl,-L${SYSROOT_DESTDIR}${base_libdir}'"
29siteconfig_do_siteconfig_gencache_prepend = " \
30 mkdir -p ${WORKDIR}/site_config_libc; \
31 cp ${SYSROOT_DESTDIR}${libdir}/libc.so ${WORKDIR}/site_config_libc; \
32 sed -i -e 's# ${base_libdir}# ${SYSROOT_DESTDIR}${base_libdir}#g' -e 's# ${libdir}# ${SYSROOT_DESTDIR}${libdir}#g' ${WORKDIR}/site_config_libc/libc.so; \
33"
34
35# nptl needs unwind support in gcc, which can't be built without glibc.
36DEPENDS = "virtual/${TARGET_PREFIX}gcc-initial linux-libc-headers virtual/${TARGET_PREFIX}libc-initial"
37# nptl needs libgcc but dlopens it, so our shlibs code doesn't detect this
38#RDEPENDS_${PN} += "${@['','libgcc']['nptl' in '${GLIBC_ADDONS}']}"
39PROVIDES = "virtual/libc virtual/${TARGET_PREFIX}libc-for-gcc"
40PROVIDES += "virtual/libintl virtual/libiconv"
41inherit autotools
42require eglibc-options.inc
43
44LEAD_SONAME = "libc.so"
45
46CACHED_CONFIGUREVARS += "ac_cv_path_KSH=${base_bindir}/bash \
47 ac_cv_path_BASH_SHELL=${base_bindir}/bash \
48 libc_cv_localedir=${localedir} \
49 libc_cv_ssp=no \
50 "
51
52GLIBC_EXTRA_OECONF ?= ""
53GLIBC_EXTRA_OECONF_class-nativesdk = ""
54INHIBIT_DEFAULT_DEPS = "1"
55
56ARM_INSTRUCTION_SET = "arm"
57
58# eglibc uses PARALLELMFLAGS variable to pass parallel build info so transfer
59# PARALLEL_MAKE into PARALLELMFLAGS and empty out PARALLEL_MAKE
60EGLIBCPARALLELISM := "PARALLELMFLAGS="${PARALLEL_MAKE}""
61EXTRA_OEMAKE[vardepsexclude] += "EGLIBCPARALLELISM"
62EXTRA_OEMAKE += "${EGLIBCPARALLELISM}"
63PARALLEL_MAKE = ""
64
65# eglibc make-syscalls.sh has a number of issues with /bin/dash and
66# it's output which make calls via the SHELL also has issues, so
67# ensure make uses /bin/bash
68EXTRA_OEMAKE += "SHELL=/bin/bash"
69
70OE_FEATURES = "${@features_to_eglibc_settings(d)}"
71do_configure_prepend() {
72 sed -e "s#@BASH@#/bin/sh#" -i ${S}/elf/ldd.bash.in
73 echo '${OE_FEATURES}' > ${B}/option-groups.config
74}
75
76do_configure_append() {
77 oe_runmake config
78
79 # Remove quotation marks from OPTION_EGLIBC_NSSWITCH_FIXED_*. This will
80 # avoid install error.
81 sed -i 's/^OPTION_EGLIBC_NSSWITCH_FIXED_\(.*\)="\(.*\)"$/OPTION_EGLIBC_NSSWITCH_FIXED_\1=\2/' option-groups.config
82}
83
84GLIBC_ADDONS ?= "ports,nptl,libidn"
diff --git a/meta/recipes-core/eglibc/eglibc_2.19.bb b/meta/recipes-core/eglibc/eglibc_2.19.bb
new file mode 100644
index 0000000000..8f096769ee
--- /dev/null
+++ b/meta/recipes-core/eglibc/eglibc_2.19.bb
@@ -0,0 +1,146 @@
1require eglibc.inc
2
3DEPENDS += "gperf-native kconfig-frontends-native"
4
5SRC_URI = "http://downloads.yoctoproject.org/releases/eglibc/eglibc-${PV}-svnr25243.tar.bz2 \
6 file://eglibc-svn-arm-lowlevellock-include-tls.patch \
7 file://IO-acquire-lock-fix.patch \
8 file://mips-rld-map-check.patch \
9 file://etc/ld.so.conf \
10 file://generate-supported.mk \
11 file://glibc.fix_sqrt2.patch \
12 file://multilib_readlib.patch \
13 file://ppc-sqrt_finite.patch \
14 file://GLRO_dl_debug_mask.patch \
15 file://initgroups_keys.patch \
16 file://eglibc_fix_findidx_parameters.patch \
17 file://ppc_slow_ieee754_sqrt.patch \
18 file://fileops-without-wchar-io.patch \
19 file://add_resource_h_to_wait_h.patch \
20 file://0001-eglibc-menuconfig-support.patch \
21 file://0002-eglibc-menuconfig-hex-string-options.patch \
22 file://0003-eglibc-menuconfig-build-instructions.patch \
23 file://fsl-ppc-no-fsqrt.patch \
24 file://0001-R_ARM_TLS_DTPOFF32.patch \
25 file://0001-eglibc-run-libm-err-tab.pl-with-specific-dirs-in-S.patch \
26 file://fix-tibetian-locales.patch \
27 file://ppce6500-32b_slow_ieee754_sqrt.patch \
28 "
29SRC_URI[md5sum] = "197836c2ba42fb146e971222647198dd"
30SRC_URI[sha256sum] = "baaa030531fc308f7820c46acdf8e1b2f8e3c1f40bcd28b6e440d1c95d170d4c"
31
32LIC_FILES_CHKSUM = "file://LICENSES;md5=e9a558e243b36d3209f380deb394b213 \
33 file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263 \
34 file://posix/rxspencer/COPYRIGHT;md5=dc5485bb394a13b2332ec1c785f5d83a \
35 file://COPYING.LIB;md5=4fbd65380cdd255951079008b364516c"
36
37SRC_URI_append_class-nativesdk = " file://ld-search-order.patch \
38 file://relocatable_sdk.patch \
39 file://relocatable_sdk_fix_openpath.patch \
40 "
41S = "${WORKDIR}/eglibc-${PV}/libc"
42B = "${WORKDIR}/build-${TARGET_SYS}"
43
44PACKAGES_DYNAMIC = ""
45
46# the -isystem in bitbake.conf screws up glibc do_stage
47BUILD_CPPFLAGS = "-I${STAGING_INCDIR_NATIVE}"
48TARGET_CPPFLAGS = "-I${STAGING_DIR_TARGET}${includedir}"
49
50GLIBC_BROKEN_LOCALES = " _ER _ET so_ET yn_ER sid_ET tr_TR mn_MN gez_ET gez_ER bn_BD te_IN es_CR.ISO-8859-1"
51
52FILESPATH = "${@base_set_filespath([ '${FILE_DIRNAME}/eglibc-${PV}', '${FILE_DIRNAME}/eglibc', '${FILE_DIRNAME}/files', '${FILE_DIRNAME}' ], d)}"
53
54#
55# For now, we will skip building of a gcc package if it is a uclibc one
56# and our build is not a uclibc one, and we skip a glibc one if our build
57# is a uclibc build.
58#
59# See the note in gcc/gcc_3.4.0.oe
60#
61
62python __anonymous () {
63 import re
64 uc_os = (re.match('.*uclibc$', d.getVar('TARGET_OS', True)) != None)
65 if uc_os:
66 raise bb.parse.SkipPackage("incompatible with target %s" %
67 d.getVar('TARGET_OS', True))
68}
69
70export libc_cv_slibdir = "${base_libdir}"
71
72EXTRA_OECONF = "--enable-kernel=${OLDEST_KERNEL} \
73 --without-cvs --disable-profile \
74 --disable-debug --without-gd \
75 --enable-clocale=gnu \
76 --enable-add-ons \
77 --with-headers=${STAGING_INCDIR} \
78 --without-selinux \
79 --enable-obsolete-rpc \
80 --with-kconfig=${STAGING_BINDIR_NATIVE} \
81 ${GLIBC_EXTRA_OECONF}"
82
83EXTRA_OECONF += "${@get_libc_fpu_setting(bb, d)}"
84
85do_patch_append() {
86 bb.build.exec_func('do_fix_readlib_c', d)
87}
88
89# for mips eglibc now builds syscall tables for all abi's
90# so we make sure that we choose right march option which is
91# compatible with o32,n32 and n64 abi's
92# e.g. -march=mips32 is not compatible with n32 and n64 therefore
93# we filter it out in such case -march=from-abi which will be
94# mips1 when using o32 and mips3 when using n32/n64
95
96TUNE_CCARGS_mips := "${@oe_filter_out('-march=mips32', '${TUNE_CCARGS}', d)}"
97TUNE_CCARGS_mipsel := "${@oe_filter_out('-march=mips32', '${TUNE_CCARGS}', d)}"
98
99do_fix_readlib_c () {
100 sed -i -e 's#OECORE_KNOWN_INTERPRETER_NAMES#${EGLIBC_KNOWN_INTERPRETER_NAMES}#' ${S}/elf/readlib.c
101}
102
103do_configure () {
104# override this function to avoid the autoconf/automake/aclocal/autoheader
105# calls for now
106# don't pass CPPFLAGS into configure, since it upsets the kernel-headers
107# version check and doesn't really help with anything
108 if [ -z "`which rpcgen`" ]; then
109 echo "rpcgen not found. Install glibc-devel."
110 exit 1
111 fi
112 (cd ${S} && gnu-configize) || die "failure in running gnu-configize"
113 find ${S} -name "configure" | xargs touch
114 CPPFLAGS="" oe_runconf
115}
116
117rpcsvc = "bootparam_prot.x nlm_prot.x rstat.x \
118 yppasswd.x klm_prot.x rex.x sm_inter.x mount.x \
119 rusers.x spray.x nfs_prot.x rquota.x key_prot.x"
120
121do_compile () {
122 # -Wl,-rpath-link <staging>/lib in LDFLAGS can cause breakage if another glibc is in staging
123 unset LDFLAGS
124 base_do_compile
125 (
126 cd ${S}/sunrpc/rpcsvc
127 for r in ${rpcsvc}; do
128 h=`echo $r|sed -e's,\.x$,.h,'`
129 rpcgen -h $r -o $h || bbwarn "unable to generate header for $r"
130 done
131 )
132 echo "Adjust ldd script"
133 if [ -n "${RTLDLIST}" ]
134 then
135 prevrtld=`cat ${B}/elf/ldd | grep "^RTLDLIST=" | sed 's#^RTLDLIST="\?\([^"]*\)"\?$#\1#'`
136 if [ "${prevrtld}" != "${RTLDLIST}" ]
137 then
138 sed -i ${B}/elf/ldd -e "s#^RTLDLIST=.*\$#RTLDLIST=\"${prevrtld} ${RTLDLIST}\"#"
139 fi
140 fi
141
142}
143
144require eglibc-package.inc
145
146BBCLASSEXTEND = "nativesdk"
diff --git a/meta/recipes-core/eglibc/ldconfig-native-2.12.1/32and64bit.patch b/meta/recipes-core/eglibc/ldconfig-native-2.12.1/32and64bit.patch
new file mode 100644
index 0000000000..cdfeaeadd8
--- /dev/null
+++ b/meta/recipes-core/eglibc/ldconfig-native-2.12.1/32and64bit.patch
@@ -0,0 +1,331 @@
1Upstream-Status: Inappropriate [embedded specific]
2
3We run the ldconfig in the cross fashion. make the code bitsize aware so that
4we can cross build ldconfig cache for various architectures.
5
6Richard Purdie <richard.purdie@linuxfoundation.org> 2009/05/19
7Nitin A Kamble <nitin.a.kamble@intel.com> 2009/03/29
8
9Index: ldconfig-native-2.12.1/readelflib.c
10===================================================================
11--- ldconfig-native-2.12.1.orig/readelflib.c
12+++ ldconfig-native-2.12.1/readelflib.c
13@@ -40,39 +40,212 @@ do \
14
15 /* Returns 0 if everything is ok, != 0 in case of error. */
16 int
17-process_elf_file (const char *file_name, const char *lib, int *flag,
18+process_elf_file32 (const char *file_name, const char *lib, int *flag,
19 unsigned int *osversion, char **soname, void *file_contents,
20 size_t file_length)
21 {
22 int i;
23 unsigned int j;
24- ElfW(Addr) loadaddr;
25+ Elf32_Addr loadaddr;
26 unsigned int dynamic_addr;
27 size_t dynamic_size;
28 char *program_interpreter;
29
30- ElfW(Ehdr) *elf_header;
31- ElfW(Phdr) *elf_pheader, *segment;
32- ElfW(Dyn) *dynamic_segment, *dyn_entry;
33+ Elf32_Ehdr *elf_header;
34+ Elf32_Phdr *elf_pheader, *segment;
35+ Elf32_Dyn *dynamic_segment, *dyn_entry;
36 char *dynamic_strings;
37
38- elf_header = (ElfW(Ehdr) *) file_contents;
39+ elf_header = (Elf32_Ehdr *) file_contents;
40 *osversion = 0;
41
42- if (elf_header->e_ident [EI_CLASS] != ElfW (CLASS))
43+ if (elf_header->e_type != ET_DYN)
44 {
45- if (opt_verbose)
46+ error (0, 0, _("%s is not a shared object file (Type: %d).\n"), file_name,
47+ elf_header->e_type);
48+ return 1;
49+ }
50+
51+ /* Get information from elf program header. */
52+ elf_pheader = (Elf32_Phdr *) (elf_header->e_phoff + file_contents);
53+ check_ptr (elf_pheader);
54+
55+ /* The library is an elf library, now search for soname and
56+ libc5/libc6. */
57+ *flag = FLAG_ELF;
58+
59+ loadaddr = -1;
60+ dynamic_addr = 0;
61+ dynamic_size = 0;
62+ program_interpreter = NULL;
63+ for (i = 0, segment = elf_pheader;
64+ i < elf_header->e_phnum; i++, segment++)
65+ {
66+ check_ptr (segment);
67+
68+ switch (segment->p_type)
69 {
70- if (elf_header->e_ident [EI_CLASS] == ELFCLASS32)
71- error (0, 0, _("%s is a 32 bit ELF file.\n"), file_name);
72- else if (elf_header->e_ident [EI_CLASS] == ELFCLASS64)
73- error (0, 0, _("%s is a 64 bit ELF file.\n"), file_name);
74- else
75- error (0, 0, _("Unknown ELFCLASS in file %s.\n"), file_name);
76+ case PT_LOAD:
77+ if (loadaddr == (Elf32_Addr) -1)
78+ loadaddr = segment->p_vaddr - segment->p_offset;
79+ break;
80+
81+ case PT_DYNAMIC:
82+ if (dynamic_addr)
83+ error (0, 0, _("more than one dynamic segment\n"));
84+
85+ dynamic_addr = segment->p_offset;
86+ dynamic_size = segment->p_filesz;
87+ break;
88+
89+ case PT_INTERP:
90+ program_interpreter = (char *) (file_contents + segment->p_offset);
91+ check_ptr (program_interpreter);
92+
93+ /* Check if this is enough to classify the binary. */
94+ for (j = 0; j < sizeof (interpreters) / sizeof (interpreters [0]);
95+ ++j)
96+ if (strcmp (program_interpreter, interpreters[j].soname) == 0)
97+ {
98+ *flag = interpreters[j].flag;
99+ break;
100+ }
101+ break;
102+
103+ case PT_NOTE:
104+ if (!*osversion && segment->p_filesz >= 32 && segment->p_align >= 4)
105+ {
106+ Elf32_Word *abi_note = (Elf32_Word *) (file_contents
107+ + segment->p_offset);
108+ Elf32_Addr size = segment->p_filesz;
109+
110+ while (abi_note [0] != 4 || abi_note [1] != 16
111+ || abi_note [2] != 1
112+ || memcmp (abi_note + 3, "GNU", 4) != 0)
113+ {
114+#define ROUND(len) (((len) + sizeof (Elf32_Word)) - 1) & -sizeof (Elf32_Word)))
115+ Elf32_Addr) note_size = 3 * sizeof (Elf32_Word))
116+ + ROUND (abi_note[0])
117+ + ROUND (abi_note[1]);
118+
119+ if (size - 32 < note_size || note_size == 0)
120+ {
121+ size = 0;
122+ break;
123+ }
124+ size -= note_size;
125+ abi_note = (void *) abi_note + note_size;
126+ }
127+
128+ if (size == 0)
129+ break;
130+
131+ *osversion = (abi_note [4] << 24) |
132+ ((abi_note [5] & 0xff) << 16) |
133+ ((abi_note [6] & 0xff) << 8) |
134+ (abi_note [7] & 0xff);
135+ }
136+ break;
137+
138+ default:
139+ break;
140+ }
141+
142+ }
143+ if (loadaddr == (Elf32_Addr) -1)
144+ {
145+ /* Very strange. */
146+ loadaddr = 0;
147+ }
148+
149+ /* Now we can read the dynamic sections. */
150+ if (dynamic_size == 0)
151+ return 1;
152+
153+ dynamic_segment = (Elf32_Dyn *) (file_contents + dynamic_addr);
154+ check_ptr (dynamic_segment);
155+
156+ /* Find the string table. */
157+ dynamic_strings = NULL;
158+ for (dyn_entry = dynamic_segment; dyn_entry->d_tag != DT_NULL;
159+ ++dyn_entry)
160+ {
161+ check_ptr (dyn_entry);
162+ if (dyn_entry->d_tag == DT_STRTAB)
163+ {
164+ dynamic_strings = (char *) (file_contents + dyn_entry->d_un.d_val - loadaddr);
165+ check_ptr (dynamic_strings);
166+ break;
167 }
168- return 1;
169 }
170
171+ if (dynamic_strings == NULL)
172+ return 1;
173+
174+ /* Now read the DT_NEEDED and DT_SONAME entries. */
175+ for (dyn_entry = dynamic_segment; dyn_entry->d_tag != DT_NULL;
176+ ++dyn_entry)
177+ {
178+ if (dyn_entry->d_tag == DT_NEEDED || dyn_entry->d_tag == DT_SONAME)
179+ {
180+ char *name = dynamic_strings + dyn_entry->d_un.d_val;
181+ check_ptr (name);
182+
183+ if (dyn_entry->d_tag == DT_NEEDED)
184+ {
185+
186+ if (*flag == FLAG_ELF)
187+ {
188+ /* Check if this is enough to classify the binary. */
189+ for (j = 0;
190+ j < sizeof (known_libs) / sizeof (known_libs [0]);
191+ ++j)
192+ if (strcmp (name, known_libs [j].soname) == 0)
193+ {
194+ *flag = known_libs [j].flag;
195+ break;
196+ }
197+ }
198+ }
199+
200+ else if (dyn_entry->d_tag == DT_SONAME)
201+ *soname = xstrdup (name);
202+
203+ /* Do we have everything we need? */
204+ if (*soname && *flag != FLAG_ELF)
205+ return 0;
206+ }
207+ }
208+
209+ /* We reach this point only if the file doesn't contain a DT_SONAME
210+ or if we can't classify the library. If it doesn't have a
211+ soname, return the name of the library. */
212+ if (*soname == NULL)
213+ *soname = xstrdup (lib);
214+
215+ return 0;
216+}
217+
218+int
219+process_elf_file64 (const char *file_name, const char *lib, int *flag,
220+ unsigned int *osversion, char **soname, void *file_contents,
221+ size_t file_length)
222+{
223+ int i;
224+ unsigned int j;
225+ Elf64_Addr loadaddr;
226+ unsigned int dynamic_addr;
227+ size_t dynamic_size;
228+ char *program_interpreter;
229+
230+ Elf64_Ehdr *elf_header;
231+ Elf64_Phdr *elf_pheader, *segment;
232+ Elf64_Dyn *dynamic_segment, *dyn_entry;
233+ char *dynamic_strings;
234+
235+ elf_header = (Elf64_Ehdr *) file_contents;
236+ *osversion = 0;
237+
238 if (elf_header->e_type != ET_DYN)
239 {
240 error (0, 0, _("%s is not a shared object file (Type: %d).\n"), file_name,
241@@ -81,7 +254,7 @@ process_elf_file (const char *file_name,
242 }
243
244 /* Get information from elf program header. */
245- elf_pheader = (ElfW(Phdr) *) (elf_header->e_phoff + file_contents);
246+ elf_pheader = (Elf64_Phdr *) (elf_header->e_phoff + file_contents);
247 check_ptr (elf_pheader);
248
249 /* The library is an elf library, now search for soname and
250@@ -100,7 +273,7 @@ process_elf_file (const char *file_name,
251 switch (segment->p_type)
252 {
253 case PT_LOAD:
254- if (loadaddr == (ElfW(Addr)) -1)
255+ if (loadaddr == (Elf64_Addr) -1)
256 loadaddr = segment->p_vaddr - segment->p_offset;
257 break;
258
259@@ -129,16 +302,16 @@ process_elf_file (const char *file_name,
260 case PT_NOTE:
261 if (!*osversion && segment->p_filesz >= 32 && segment->p_align >= 4)
262 {
263- ElfW(Word) *abi_note = (ElfW(Word) *) (file_contents
264+ Elf64_Word *abi_note = (Elf64_Word *) (file_contents
265 + segment->p_offset);
266- ElfW(Addr) size = segment->p_filesz;
267+ Elf64_Addr size = segment->p_filesz;
268
269 while (abi_note [0] != 4 || abi_note [1] != 16
270 || abi_note [2] != 1
271 || memcmp (abi_note + 3, "GNU", 4) != 0)
272 {
273-#define ROUND(len) (((len) + sizeof (ElfW(Word)) - 1) & -sizeof (ElfW(Word)))
274- ElfW(Addr) note_size = 3 * sizeof (ElfW(Word))
275+#define ROUND(len) (((len) + sizeof (Elf64_Word) - 1) & -sizeof (Elf64_Word))
276+ Elf64_Addr note_size = 3 * sizeof (Elf64_Word)
277 + ROUND (abi_note[0])
278 + ROUND (abi_note[1]);
279
280@@ -166,7 +339,7 @@ process_elf_file (const char *file_name,
281 }
282
283 }
284- if (loadaddr == (ElfW(Addr)) -1)
285+ if (loadaddr == (Elf64_Addr) -1)
286 {
287 /* Very strange. */
288 loadaddr = 0;
289@@ -176,7 +349,7 @@ process_elf_file (const char *file_name,
290 if (dynamic_size == 0)
291 return 1;
292
293- dynamic_segment = (ElfW(Dyn) *) (file_contents + dynamic_addr);
294+ dynamic_segment = (Elf64_Dyn *) (file_contents + dynamic_addr);
295 check_ptr (dynamic_segment);
296
297 /* Find the string table. */
298@@ -233,3 +406,33 @@ process_elf_file (const char *file_name,
299
300 return 0;
301 }
302+/* Returns 0 if everything is ok, != 0 in case of error. */
303+int
304+process_elf_file (const char *file_name, const char *lib, int *flag,
305+ unsigned int *osversion, char **soname, void *file_contents,
306+ size_t file_length)
307+{
308+ int i;
309+ unsigned int j;
310+ ElfW(Addr) loadaddr;
311+ unsigned int dynamic_addr;
312+ size_t dynamic_size;
313+ char *program_interpreter;
314+
315+ ElfW(Ehdr) *elf_header;
316+ ElfW(Phdr) *elf_pheader, *segment;
317+ ElfW(Dyn) *dynamic_segment, *dyn_entry;
318+ char *dynamic_strings;
319+
320+ elf_header = (ElfW(Ehdr) *) file_contents;
321+ *osversion = 0;
322+
323+ if (elf_header->e_ident [EI_CLASS] == ELFCLASS32)
324+ return process_elf_file32(file_name, lib,flag, osversion, soname, file_contents, file_length);
325+ else if (elf_header->e_ident [EI_CLASS] == ELFCLASS64)
326+ return process_elf_file64(file_name, lib,flag, osversion, soname, file_contents, file_length);
327+ error (0, 0, _("Unknown ELFCLASS in file %s.\n"), file_name);
328+ return 1;
329+}
330+
331+
diff --git a/meta/recipes-core/eglibc/ldconfig-native-2.12.1/README b/meta/recipes-core/eglibc/ldconfig-native-2.12.1/README
new file mode 100644
index 0000000000..43fb983729
--- /dev/null
+++ b/meta/recipes-core/eglibc/ldconfig-native-2.12.1/README
@@ -0,0 +1,8 @@
1The files are pulled verbatim from glibc 2.5 and then patched to allow
2standalone compilation of ldconfig.
3
4Richard Purdie
5OpenedHand Ltd.
6
7Upgraded the ldconfig recipe to eglibc 2.12.1
8Nitin A Kamble <nitin.a.kamble@intel.com> 2011/03/29
diff --git a/meta/recipes-core/eglibc/ldconfig-native-2.12.1/endian-ness_handling.patch b/meta/recipes-core/eglibc/ldconfig-native-2.12.1/endian-ness_handling.patch
new file mode 100644
index 0000000000..7f8e4db78a
--- /dev/null
+++ b/meta/recipes-core/eglibc/ldconfig-native-2.12.1/endian-ness_handling.patch
@@ -0,0 +1,454 @@
1Upstream-Status: Inappropriate [embedded specific]
2
3Do data input/output handling according to endien-ness of the library file. That
4enables use of ldconfig in the cross fashion for any architecture.
5
62011/04/04
7Richard Purdie <richard.purdie@linuxfoundation.org>
8Nitin Kamble <nitin.a.kamble@intel.com>
9
10Index: ldconfig-native-2.12.1/readelflib.c
11===================================================================
12--- ldconfig-native-2.12.1.orig/readelflib.c
13+++ ldconfig-native-2.12.1/readelflib.c
14@@ -38,6 +38,28 @@ do \
15 } \
16 while (0);
17
18+int be;
19+static uint16_t read16(uint16_t x, int be)
20+{
21+ if (be)
22+ return be16toh(x);
23+ return le16toh(x);
24+}
25+
26+static uint32_t read32(uint32_t x, int be)
27+{
28+ if (be)
29+ return be32toh(x);
30+ return le32toh(x);
31+}
32+
33+static uint64_t read64(uint64_t x, int be)
34+{
35+ if (be)
36+ return be64toh(x);
37+ return le64toh(x);
38+}
39+
40 /* Returns 0 if everything is ok, != 0 in case of error. */
41 int
42 process_elf_file32 (const char *file_name, const char *lib, int *flag,
43@@ -59,15 +81,17 @@ process_elf_file32 (const char *file_nam
44 elf_header = (Elf32_Ehdr *) file_contents;
45 *osversion = 0;
46
47- if (elf_header->e_type != ET_DYN)
48+ be = (elf_header->e_ident[EI_DATA] == ELFDATA2MSB);
49+
50+ if (read16(elf_header->e_type, be) != ET_DYN)
51 {
52 error (0, 0, _("%s is not a shared object file (Type: %d).\n"), file_name,
53- elf_header->e_type);
54+ read16(elf_header->e_type, be));
55 return 1;
56 }
57
58 /* Get information from elf program header. */
59- elf_pheader = (Elf32_Phdr *) (elf_header->e_phoff + file_contents);
60+ elf_pheader = (Elf32_Phdr *) (read32(elf_header->e_phoff, be) + file_contents);
61 check_ptr (elf_pheader);
62
63 /* The library is an elf library, now search for soname and
64@@ -79,27 +103,27 @@ process_elf_file32 (const char *file_nam
65 dynamic_size = 0;
66 program_interpreter = NULL;
67 for (i = 0, segment = elf_pheader;
68- i < elf_header->e_phnum; i++, segment++)
69+ i < read16(elf_header->e_phnum, be); i++, segment++)
70 {
71 check_ptr (segment);
72
73- switch (segment->p_type)
74+ switch (read32(segment->p_type, be))
75 {
76 case PT_LOAD:
77 if (loadaddr == (Elf32_Addr) -1)
78- loadaddr = segment->p_vaddr - segment->p_offset;
79+ loadaddr = read32(segment->p_vaddr, be) - read32(segment->p_offset, be);
80 break;
81
82 case PT_DYNAMIC:
83 if (dynamic_addr)
84 error (0, 0, _("more than one dynamic segment\n"));
85
86- dynamic_addr = segment->p_offset;
87- dynamic_size = segment->p_filesz;
88+ dynamic_addr = read32(segment->p_offset, be);
89+ dynamic_size = read32(segment->p_filesz, be);
90 break;
91
92 case PT_INTERP:
93- program_interpreter = (char *) (file_contents + segment->p_offset);
94+ program_interpreter = (char *) (file_contents + read32(segment->p_offset, be));
95 check_ptr (program_interpreter);
96
97 /* Check if this is enough to classify the binary. */
98@@ -113,20 +137,20 @@ process_elf_file32 (const char *file_nam
99 break;
100
101 case PT_NOTE:
102- if (!*osversion && segment->p_filesz >= 32 && segment->p_align >= 4)
103+ if (!*osversion && read32(segment->p_filesz, be) >= 32 && segment->p_align >= 4)
104 {
105 Elf32_Word *abi_note = (Elf32_Word *) (file_contents
106- + segment->p_offset);
107- Elf32_Addr size = segment->p_filesz;
108+ + read32(segment->p_offset, be));
109+ Elf32_Addr size = read32(segment->p_filesz, be);
110
111- while (abi_note [0] != 4 || abi_note [1] != 16
112- || abi_note [2] != 1
113+ while (read32(abi_note [0], be) != 4 || read32(abi_note [1], be) != 16
114+ || read32(abi_note [2], be) != 1
115 || memcmp (abi_note + 3, "GNU", 4) != 0)
116 {
117-#define ROUND(len) (((len) + sizeof (Elf32_Word)) - 1) & -sizeof (Elf32_Word)))
118- Elf32_Addr) note_size = 3 * sizeof (Elf32_Word))
119- + ROUND (abi_note[0])
120- + ROUND (abi_note[1]);
121+#define ROUND(len) (((len) + sizeof (Elf32_Word) - 1) & -sizeof (Elf32_Word))
122+ Elf32_Addr note_size = 3 * sizeof (Elf32_Word)
123+ + ROUND (read32(abi_note[0], be))
124+ + ROUND (read32(abi_note[1], be));
125
126 if (size - 32 < note_size || note_size == 0)
127 {
128@@ -140,10 +164,10 @@ process_elf_file32 (const char *file_nam
129 if (size == 0)
130 break;
131
132- *osversion = (abi_note [4] << 24) |
133- ((abi_note [5] & 0xff) << 16) |
134- ((abi_note [6] & 0xff) << 8) |
135- (abi_note [7] & 0xff);
136+ *osversion = (read32(abi_note [4], be) << 24) |
137+ ((read32(abi_note [5], be) & 0xff) << 16) |
138+ ((read32(abi_note [6], be) & 0xff) << 8) |
139+ (read32(abi_note [7], be) & 0xff);
140 }
141 break;
142
143@@ -167,13 +191,13 @@ process_elf_file32 (const char *file_nam
144
145 /* Find the string table. */
146 dynamic_strings = NULL;
147- for (dyn_entry = dynamic_segment; dyn_entry->d_tag != DT_NULL;
148+ for (dyn_entry = dynamic_segment; read32(dyn_entry->d_tag, be) != DT_NULL;
149 ++dyn_entry)
150 {
151 check_ptr (dyn_entry);
152- if (dyn_entry->d_tag == DT_STRTAB)
153+ if (read32(dyn_entry->d_tag, be) == DT_STRTAB)
154 {
155- dynamic_strings = (char *) (file_contents + dyn_entry->d_un.d_val - loadaddr);
156+ dynamic_strings = (char *) (file_contents + read32(dyn_entry->d_un.d_val, be) - loadaddr);
157 check_ptr (dynamic_strings);
158 break;
159 }
160@@ -183,15 +207,15 @@ process_elf_file32 (const char *file_nam
161 return 1;
162
163 /* Now read the DT_NEEDED and DT_SONAME entries. */
164- for (dyn_entry = dynamic_segment; dyn_entry->d_tag != DT_NULL;
165+ for (dyn_entry = dynamic_segment; read32(dyn_entry->d_tag, be) != DT_NULL;
166 ++dyn_entry)
167 {
168- if (dyn_entry->d_tag == DT_NEEDED || dyn_entry->d_tag == DT_SONAME)
169+ if (read32(dyn_entry->d_tag, be) == DT_NEEDED || read32(dyn_entry->d_tag, be) == DT_SONAME)
170 {
171- char *name = dynamic_strings + dyn_entry->d_un.d_val;
172+ char *name = dynamic_strings + read32(dyn_entry->d_un.d_val, be);
173 check_ptr (name);
174
175- if (dyn_entry->d_tag == DT_NEEDED)
176+ if (read32(dyn_entry->d_tag, be) == DT_NEEDED)
177 {
178
179 if (*flag == FLAG_ELF)
180@@ -208,7 +232,7 @@ process_elf_file32 (const char *file_nam
181 }
182 }
183
184- else if (dyn_entry->d_tag == DT_SONAME)
185+ else if (read32(dyn_entry->d_tag, be) == DT_SONAME)
186 *soname = xstrdup (name);
187
188 /* Do we have everything we need? */
189@@ -246,15 +270,17 @@ process_elf_file64 (const char *file_nam
190 elf_header = (Elf64_Ehdr *) file_contents;
191 *osversion = 0;
192
193- if (elf_header->e_type != ET_DYN)
194+ be = (elf_header->e_ident[EI_DATA] == ELFDATA2MSB);
195+
196+ if (read16(elf_header->e_type, be) != ET_DYN)
197 {
198 error (0, 0, _("%s is not a shared object file (Type: %d).\n"), file_name,
199- elf_header->e_type);
200+ read16(elf_header->e_type, be));
201 return 1;
202 }
203
204 /* Get information from elf program header. */
205- elf_pheader = (Elf64_Phdr *) (elf_header->e_phoff + file_contents);
206+ elf_pheader = (Elf64_Phdr *) (read64(elf_header->e_phoff, be) + file_contents);
207 check_ptr (elf_pheader);
208
209 /* The library is an elf library, now search for soname and
210@@ -266,27 +292,27 @@ process_elf_file64 (const char *file_nam
211 dynamic_size = 0;
212 program_interpreter = NULL;
213 for (i = 0, segment = elf_pheader;
214- i < elf_header->e_phnum; i++, segment++)
215+ i < read16(elf_header->e_phnum, be); i++, segment++)
216 {
217 check_ptr (segment);
218
219- switch (segment->p_type)
220+ switch (read32(segment->p_type, be))
221 {
222 case PT_LOAD:
223 if (loadaddr == (Elf64_Addr) -1)
224- loadaddr = segment->p_vaddr - segment->p_offset;
225+ loadaddr = read64(segment->p_vaddr, be) - read64(segment->p_offset, be);
226 break;
227
228 case PT_DYNAMIC:
229 if (dynamic_addr)
230 error (0, 0, _("more than one dynamic segment\n"));
231
232- dynamic_addr = segment->p_offset;
233- dynamic_size = segment->p_filesz;
234+ dynamic_addr = read64(segment->p_offset, be);
235+ dynamic_size = read32(segment->p_filesz, be);
236 break;
237
238 case PT_INTERP:
239- program_interpreter = (char *) (file_contents + segment->p_offset);
240+ program_interpreter = (char *) (file_contents + read64(segment->p_offset, be));
241 check_ptr (program_interpreter);
242
243 /* Check if this is enough to classify the binary. */
244@@ -300,20 +326,21 @@ process_elf_file64 (const char *file_nam
245 break;
246
247 case PT_NOTE:
248- if (!*osversion && segment->p_filesz >= 32 && segment->p_align >= 4)
249+ if (!*osversion && read32(segment->p_filesz, be) >= 32 && read32(segment->p_align, be) >= 4)
250 {
251 Elf64_Word *abi_note = (Elf64_Word *) (file_contents
252- + segment->p_offset);
253- Elf64_Addr size = segment->p_filesz;
254+ + read64(segment->p_offset, be));
255+ Elf64_Addr size = read32(segment->p_filesz, be);
256
257- while (abi_note [0] != 4 || abi_note [1] != 16
258- || abi_note [2] != 1
259+ while (read32(abi_note [0], be) != 4 || read32(abi_note [1], be) != 16
260+ || read32(abi_note [2], be) != 1
261 || memcmp (abi_note + 3, "GNU", 4) != 0)
262 {
263+#undef ROUND
264 #define ROUND(len) (((len) + sizeof (Elf64_Word) - 1) & -sizeof (Elf64_Word))
265 Elf64_Addr note_size = 3 * sizeof (Elf64_Word)
266- + ROUND (abi_note[0])
267- + ROUND (abi_note[1]);
268+ + ROUND (read32(abi_note[0], be))
269+ + ROUND (read32(abi_note[1], be));
270
271 if (size - 32 < note_size || note_size == 0)
272 {
273@@ -327,10 +354,10 @@ process_elf_file64 (const char *file_nam
274 if (size == 0)
275 break;
276
277- *osversion = (abi_note [4] << 24) |
278- ((abi_note [5] & 0xff) << 16) |
279- ((abi_note [6] & 0xff) << 8) |
280- (abi_note [7] & 0xff);
281+ *osversion = (read32(abi_note [4], be) << 24) |
282+ ((read32(abi_note [5], be) & 0xff) << 16) |
283+ ((read32(abi_note [6], be) & 0xff) << 8) |
284+ (read32(abi_note [7], be) & 0xff);
285 }
286 break;
287
288@@ -354,13 +381,13 @@ process_elf_file64 (const char *file_nam
289
290 /* Find the string table. */
291 dynamic_strings = NULL;
292- for (dyn_entry = dynamic_segment; dyn_entry->d_tag != DT_NULL;
293+ for (dyn_entry = dynamic_segment; read64(dyn_entry->d_tag, be) != DT_NULL;
294 ++dyn_entry)
295 {
296 check_ptr (dyn_entry);
297- if (dyn_entry->d_tag == DT_STRTAB)
298+ if (read64(dyn_entry->d_tag, be) == DT_STRTAB)
299 {
300- dynamic_strings = (char *) (file_contents + dyn_entry->d_un.d_val - loadaddr);
301+ dynamic_strings = (char *) (file_contents + read64(dyn_entry->d_un.d_val, be) - loadaddr);
302 check_ptr (dynamic_strings);
303 break;
304 }
305@@ -370,15 +397,15 @@ process_elf_file64 (const char *file_nam
306 return 1;
307
308 /* Now read the DT_NEEDED and DT_SONAME entries. */
309- for (dyn_entry = dynamic_segment; dyn_entry->d_tag != DT_NULL;
310+ for (dyn_entry = dynamic_segment; read64(dyn_entry->d_tag, be) != DT_NULL;
311 ++dyn_entry)
312 {
313- if (dyn_entry->d_tag == DT_NEEDED || dyn_entry->d_tag == DT_SONAME)
314+ if (read64(dyn_entry->d_tag, be) == DT_NEEDED || read64(dyn_entry->d_tag, be) == DT_SONAME)
315 {
316- char *name = dynamic_strings + dyn_entry->d_un.d_val;
317+ char *name = dynamic_strings + read64(dyn_entry->d_un.d_val, be);
318 check_ptr (name);
319
320- if (dyn_entry->d_tag == DT_NEEDED)
321+ if (read64(dyn_entry->d_tag, be) == DT_NEEDED)
322 {
323
324 if (*flag == FLAG_ELF)
325@@ -395,7 +422,7 @@ process_elf_file64 (const char *file_nam
326 }
327 }
328
329- else if (dyn_entry->d_tag == DT_SONAME)
330+ else if (read64(dyn_entry->d_tag, be) == DT_SONAME)
331 *soname = xstrdup (name);
332
333 /* Do we have everything we need? */
334Index: ldconfig-native-2.12.1/readlib.c
335===================================================================
336--- ldconfig-native-2.12.1.orig/readlib.c
337+++ ldconfig-native-2.12.1/readlib.c
338@@ -169,7 +169,8 @@ process_file (const char *real_file_name
339 ret = 1;
340 }
341 /* Libraries have to be shared object files. */
342- else if (elf_header->e_type != ET_DYN)
343+ else if ((elf_header->e_ident[EI_DATA] == ELFDATA2MSB && be16toh(elf_header->e_type) != ET_DYN) ||
344+ (elf_header->e_ident[EI_DATA] == ELFDATA2LSB && le16toh(elf_header->e_type) != ET_DYN))
345 ret = 1;
346 else if (process_elf_file (file_name, lib, flag, osversion, soname,
347 file_contents, statbuf.st_size))
348Index: ldconfig-native-2.12.1/cache.c
349===================================================================
350--- ldconfig-native-2.12.1.orig/cache.c
351+++ ldconfig-native-2.12.1/cache.c
352@@ -39,6 +39,29 @@
353 # define N_(msgid) msgid
354 #define _(msg) msg
355
356+extern int be;
357+
358+static uint16_t write16(uint16_t x, int be)
359+{
360+ if (be)
361+ return htobe16(x);
362+ return htole16(x);
363+}
364+
365+static uint32_t write32(uint32_t x, int be)
366+{
367+ if (be)
368+ return htobe32(x);
369+ return htole32(x);
370+}
371+
372+static uint64_t write64(uint64_t x, int be)
373+{
374+ if (be)
375+ return htobe64(x);
376+ return htole64(x);
377+}
378+
379 struct cache_entry
380 {
381 char *lib; /* Library name. */
382@@ -279,7 +302,12 @@ save_cache (const char *cache_name)
383 /* Number of normal cache entries. */
384 int cache_entry_old_count = 0;
385
386- for (entry = entries; entry != NULL; entry = entry->next)
387+ if (be)
388+ printf("saving cache in big endian encoding\n");
389+ else
390+ printf("saving cache in little endian encoding\n");
391+
392+ for (entry = entries; entry != NULL; entry = entry->next)
393 {
394 /* Account the final NULs. */
395 total_strlen += strlen (entry->lib) + strlen (entry->path) + 2;
396@@ -310,7 +338,7 @@ save_cache (const char *cache_name)
397 memset (file_entries, '\0', sizeof (struct cache_file));
398 memcpy (file_entries->magic, CACHEMAGIC, sizeof CACHEMAGIC - 1);
399
400- file_entries->nlibs = cache_entry_old_count;
401+ file_entries->nlibs = write32(cache_entry_old_count, be);
402 }
403
404 struct cache_file_new *file_entries_new = NULL;
405@@ -330,8 +358,8 @@ save_cache (const char *cache_name)
406 memcpy (file_entries_new->version, CACHE_VERSION,
407 sizeof CACHE_VERSION - 1);
408
409- file_entries_new->nlibs = cache_entry_count;
410- file_entries_new->len_strings = total_strlen;
411+ file_entries_new->nlibs = write32(cache_entry_count, be);
412+ file_entries_new->len_strings = write32(total_strlen, be);
413 }
414
415 /* Pad for alignment of cache_file_new. */
416@@ -358,9 +386,9 @@ save_cache (const char *cache_name)
417 /* First the library. */
418 if (opt_format != 2 && entry->hwcap == 0)
419 {
420- file_entries->libs[idx_old].flags = entry->flags;
421+ file_entries->libs[idx_old].flags = write32(entry->flags, be);
422 /* XXX: Actually we can optimize here and remove duplicates. */
423- file_entries->libs[idx_old].key = str_offset + pad;
424+ file_entries->libs[idx_old].key = write32(str_offset + pad, be);
425 }
426 if (opt_format != 0)
427 {
428@@ -368,10 +396,10 @@ save_cache (const char *cache_name)
429 not doing so makes the code easier, the string table
430 always begins at the beginning of the the new cache
431 struct. */
432- file_entries_new->libs[idx_new].flags = entry->flags;
433- file_entries_new->libs[idx_new].osversion = entry->osversion;
434- file_entries_new->libs[idx_new].hwcap = entry->hwcap;
435- file_entries_new->libs[idx_new].key = str_offset;
436+ file_entries_new->libs[idx_new].flags = write32(entry->flags, be);
437+ file_entries_new->libs[idx_new].osversion = write32(entry->osversion, be);
438+ file_entries_new->libs[idx_new].hwcap = write64(entry->hwcap, be);
439+ file_entries_new->libs[idx_new].key = write32(str_offset, be);
440 }
441
442 size_t len = strlen (entry->lib) + 1;
443@@ -379,9 +407,9 @@ save_cache (const char *cache_name)
444 str_offset += len;
445 /* Then the path. */
446 if (opt_format != 2 && entry->hwcap == 0)
447- file_entries->libs[idx_old].value = str_offset + pad;
448+ file_entries->libs[idx_old].value = write32(str_offset + pad, be);
449 if (opt_format != 0)
450- file_entries_new->libs[idx_new].value = str_offset;
451+ file_entries_new->libs[idx_new].value = write32(str_offset, be);
452 len = strlen (entry->path) + 1;
453 str = mempcpy (str, entry->path, len);
454 str_offset += len;
diff --git a/meta/recipes-core/eglibc/ldconfig-native-2.12.1/endianess-header.patch b/meta/recipes-core/eglibc/ldconfig-native-2.12.1/endianess-header.patch
new file mode 100644
index 0000000000..a18b2c20de
--- /dev/null
+++ b/meta/recipes-core/eglibc/ldconfig-native-2.12.1/endianess-header.patch
@@ -0,0 +1,113 @@
1Upstream-Status: Inappropriate [fix poky patch]
2
3This patch fixes build issues with a previous endian-ness_handling.patch on
4distros that don't have macros referenced
5
67/20/2011
7Matthew McClintock <msm@freescale.com>
8
9diff -purN ldconfig-native-2.12.1.orig/endian_extra.h ldconfig-native-2.12.1/endian_extra.h
10--- ldconfig-native-2.12.1.orig/endian_extra.h 1969-12-31 18:00:00.000000000 -0600
11+++ ldconfig-native-2.12.1/endian_extra.h 2011-07-19 18:09:14.323048417 -0500
12@@ -0,0 +1,64 @@
13+/* Copyright (C) 1992, 1996, 1997, 2000, 2008 Free Software Foundation, Inc.
14+ This file is part of the GNU C Library.
15+
16+ The GNU C Library is free software; you can redistribute it and/or
17+ modify it under the terms of the GNU Lesser General Public
18+ License as published by the Free Software Foundation; either
19+ version 2.1 of the License, or (at your option) any later version.
20+
21+ The GNU C Library is distributed in the hope that it will be useful,
22+ but WITHOUT ANY WARRANTY; without even the implied warranty of
23+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
24+ Lesser General Public License for more details.
25+
26+ You should have received a copy of the GNU Lesser General Public
27+ License along with the GNU C Library; if not, write to the Free
28+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
29+ 02111-1307 USA. */
30+
31+#include <endian.h>
32+
33+#ifndef _ENDIAN_EXTRA_H
34+#define _ENDIAN_EXTRA_H 1
35+
36+/* Don't redefine these macros if they already exist */
37+#ifndef htobe16
38+#ifdef __USE_BSD
39+/* Conversion interfaces. */
40+# include <byteswap.h>
41+
42+# if __BYTE_ORDER == __LITTLE_ENDIAN
43+# define htobe16(x) __bswap_16 (x)
44+# define htole16(x) (x)
45+# define be16toh(x) __bswap_16 (x)
46+# define le16toh(x) (x)
47+
48+# define htobe32(x) __bswap_32 (x)
49+# define htole32(x) (x)
50+# define be32toh(x) __bswap_32 (x)
51+# define le32toh(x) (x)
52+
53+# define htobe64(x) __bswap_64 (x)
54+# define htole64(x) (x)
55+# define be64toh(x) __bswap_64 (x)
56+# define le64toh(x) (x)
57+# else
58+# define htobe16(x) (x)
59+# define htole16(x) __bswap_16 (x)
60+# define be16toh(x) (x)
61+# define le16toh(x) __bswap_16 (x)
62+
63+# define htobe32(x) (x)
64+# define htole32(x) __bswap_32 (x)
65+# define be32toh(x) (x)
66+# define le32toh(x) __bswap_32 (x)
67+
68+# define htobe64(x) (x)
69+# define htole64(x) __bswap_64 (x)
70+# define be64toh(x) (x)
71+# define le64toh(x) __bswap_64 (x)
72+# endif
73+#endif
74+#endif
75+
76+#endif /* endian_extra.h */
77diff -purN ldconfig-native-2.12.1.orig/cache.c ldconfig-native-2.12.1/cache.c
78--- ldconfig-native-2.12.1.orig/cache.c 2011-07-19 18:21:28.347041301 -0500
79+++ ldconfig-native-2.12.1/cache.c 2011-07-19 18:22:54.118048064 -0500
80@@ -39,6 +39,8 @@
81 # define N_(msgid) msgid
82 #define _(msg) msg
83
84+#include "endian_extra.h"
85+
86 extern int be;
87
88 static uint16_t write16(uint16_t x, int be)
89diff -purN ldconfig-native-2.12.1.orig/readelflib.c ldconfig-native-2.12.1/readelflib.c
90--- ldconfig-native-2.12.1.orig/readelflib.c 2011-07-19 18:21:28.346041593 -0500
91+++ ldconfig-native-2.12.1/readelflib.c 2011-07-19 18:23:05.324059875 -0500
92@@ -25,6 +25,9 @@
93
94 /* check_ptr checks that a pointer is in the mmaped file and doesn't
95 point outside it. */
96+
97+#include "endian_extra.h"
98+
99 #undef check_ptr
100 #define check_ptr(ptr) \
101 do \
102diff -purN ldconfig-native-2.12.1.orig/readlib.c ldconfig-native-2.12.1/readlib.c
103--- ldconfig-native-2.12.1.orig/readlib.c 2011-07-19 18:21:28.346041593 -0500
104+++ ldconfig-native-2.12.1/readlib.c 2011-07-19 18:23:23.877046210 -0500
105@@ -40,6 +40,8 @@
106
107 #include "ldconfig.h"
108
109+#include "endian_extra.h"
110+
111 #define _(msg) msg
112
113 #define Elf32_CLASS ELFCLASS32
diff --git a/meta/recipes-core/eglibc/ldconfig-native-2.12.1/flag_fix.patch b/meta/recipes-core/eglibc/ldconfig-native-2.12.1/flag_fix.patch
new file mode 100644
index 0000000000..4e9aab9416
--- /dev/null
+++ b/meta/recipes-core/eglibc/ldconfig-native-2.12.1/flag_fix.patch
@@ -0,0 +1,24 @@
1Upstream-Status: Inappropriate [embedded specific]
2
3The native version of ldconfig was using native definition of LD_SO (i.e.
4ld-linux-x86-64.so.2 ) which is not correct for doing the cross ldconfig.
5This was causing libc.so on the target marked as ELF lib rather than
6FLAG_ELF_LIBC6 in the ld.so.cache.
7
8Nitin A Kamble <nitin.a.kamble@intel.com> 2011/04/4
9
10Index: ldconfig-native-2.12.1/readlib.c
11===================================================================
12--- ldconfig-native-2.12.1.orig/readlib.c
13+++ ldconfig-native-2.12.1/readlib.c
14@@ -51,6 +51,10 @@ struct known_names
15 int flag;
16 };
17
18+/* don't use host's definition of LD_SO */
19+#undef LD_SO
20+#define LD_SO "ld.so.1"
21+
22 static struct known_names interpreters[] =
23 {
24 { "/lib/" LD_SO, FLAG_ELF_LIBC6 },
diff --git a/meta/recipes-core/eglibc/ldconfig-native-2.12.1/ldconfig-native-2.12.1.tar.bz2 b/meta/recipes-core/eglibc/ldconfig-native-2.12.1/ldconfig-native-2.12.1.tar.bz2
new file mode 100644
index 0000000000..dc1e79888e
--- /dev/null
+++ b/meta/recipes-core/eglibc/ldconfig-native-2.12.1/ldconfig-native-2.12.1.tar.bz2
Binary files differ
diff --git a/meta/recipes-core/eglibc/ldconfig-native-2.12.1/ldconfig.patch b/meta/recipes-core/eglibc/ldconfig-native-2.12.1/ldconfig.patch
new file mode 100644
index 0000000000..52986e61c7
--- /dev/null
+++ b/meta/recipes-core/eglibc/ldconfig-native-2.12.1/ldconfig.patch
@@ -0,0 +1,471 @@
1Upstream-Status: Inappropriate [embedded specific]
2
3enable standalone building of ldconfig
4
5---
6 cache.c | 11 +-
7 chroot_canon.c | 7 +
8 dl-cache.c | 235 ---------------------------------------------------------
9 dl-cache.h | 3
10 ldconfig.c | 27 ++++--
11 readlib.c | 7 +
12 xstrdup.c | 11 --
13 7 files changed, 45 insertions(+), 256 deletions(-)
14
15Index: ldconfig-native-2.12.1/cache.c
16===================================================================
17--- ldconfig-native-2.12.1.orig/cache.c
18+++ ldconfig-native-2.12.1/cache.c
19@@ -16,6 +16,9 @@
20 along with this program; if not, write to the Free Software Foundation,
21 Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
22
23+#define _LARGEFILE64_SOURCE
24+#define _GNU_SOURCE
25+
26 #include <errno.h>
27 #include <error.h>
28 #include <dirent.h>
29@@ -31,8 +34,10 @@
30 #include <sys/stat.h>
31 #include <sys/types.h>
32
33-#include <ldconfig.h>
34-#include <dl-cache.h>
35+#include "ldconfig.h"
36+#include "dl-cache.h"
37+# define N_(msgid) msgid
38+#define _(msg) msg
39
40 struct cache_entry
41 {
42Index: ldconfig-native-2.12.1/chroot_canon.c
43===================================================================
44--- ldconfig-native-2.12.1.orig/chroot_canon.c
45+++ ldconfig-native-2.12.1/chroot_canon.c
46@@ -17,6 +17,9 @@
47 along with this program; if not, write to the Free Software Foundation,
48 Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
49
50+#define _LARGEFILE64_SOURCE
51+#define _GNU_SOURCE
52+
53 #include <stdlib.h>
54 #include <string.h>
55 #include <unistd.h>
56@@ -27,7 +30,9 @@
57 #include <stddef.h>
58 #include <stdint.h>
59
60-#include <ldconfig.h>
61+#include "ldconfig.h"
62+
63+#define __set_errno(Val) errno = (Val)
64
65 #ifndef PATH_MAX
66 #define PATH_MAX 1024
67Index: ldconfig-native-2.12.1/dl-cache.c
68===================================================================
69--- ldconfig-native-2.12.1.orig/dl-cache.c
70+++ ldconfig-native-2.12.1/dl-cache.c
71@@ -20,12 +20,12 @@
72
73 #include <assert.h>
74 #include <unistd.h>
75-#include <ldsodefs.h>
76+//#include "ldsodefs.h"
77 #include <sys/mman.h>
78 #include <dl-cache.h>
79 #include <dl-procinfo.h>
80
81-#include <stdio-common/_itoa.h>
82+//#include "_itoa.h"
83
84 #ifndef _DL_PLATFORMS_COUNT
85 # define _DL_PLATFORMS_COUNT 0
86@@ -39,103 +39,7 @@ static size_t cachesize;
87 /* 1 if cache_data + PTR points into the cache. */
88 #define _dl_cache_verify_ptr(ptr) (ptr < cache_data_size)
89
90-#define SEARCH_CACHE(cache) \
91-/* We use binary search since the table is sorted in the cache file. \
92- The first matching entry in the table is returned. \
93- It is important to use the same algorithm as used while generating \
94- the cache file. */ \
95-do \
96- { \
97- left = 0; \
98- right = cache->nlibs - 1; \
99- \
100- while (left <= right) \
101- { \
102- __typeof__ (cache->libs[0].key) key; \
103- \
104- middle = (left + right) / 2; \
105- \
106- key = cache->libs[middle].key; \
107- \
108- /* Make sure string table indices are not bogus before using \
109- them. */ \
110- if (! _dl_cache_verify_ptr (key)) \
111- { \
112- cmpres = 1; \
113- break; \
114- } \
115- \
116- /* Actually compare the entry with the key. */ \
117- cmpres = _dl_cache_libcmp (name, cache_data + key); \
118- if (__builtin_expect (cmpres == 0, 0)) \
119- { \
120- /* Found it. LEFT now marks the last entry for which we \
121- know the name is correct. */ \
122- left = middle; \
123- \
124- /* There might be entries with this name before the one we \
125- found. So we have to find the beginning. */ \
126- while (middle > 0) \
127- { \
128- __typeof__ (cache->libs[0].key) key; \
129- \
130- key = cache->libs[middle - 1].key; \
131- /* Make sure string table indices are not bogus before \
132- using them. */ \
133- if (! _dl_cache_verify_ptr (key) \
134- /* Actually compare the entry. */ \
135- || _dl_cache_libcmp (name, cache_data + key) != 0) \
136- break; \
137- --middle; \
138- } \
139- \
140- do \
141- { \
142- int flags; \
143- __typeof__ (cache->libs[0]) *lib = &cache->libs[middle]; \
144- \
145- /* Only perform the name test if necessary. */ \
146- if (middle > left \
147- /* We haven't seen this string so far. Test whether the \
148- index is ok and whether the name matches. Otherwise \
149- we are done. */ \
150- && (! _dl_cache_verify_ptr (lib->key) \
151- || (_dl_cache_libcmp (name, cache_data + lib->key) \
152- != 0))) \
153- break; \
154- \
155- flags = lib->flags; \
156- if (_dl_cache_check_flags (flags) \
157- && _dl_cache_verify_ptr (lib->value)) \
158- { \
159- if (best == NULL || flags == GLRO(dl_correct_cache_id)) \
160- { \
161- HWCAP_CHECK; \
162- best = cache_data + lib->value; \
163- \
164- if (flags == GLRO(dl_correct_cache_id)) \
165- /* We've found an exact match for the shared \
166- object and no general `ELF' release. Stop \
167- searching. */ \
168- break; \
169- } \
170- } \
171- } \
172- while (++middle <= right); \
173- break; \
174- } \
175- \
176- if (cmpres < 0) \
177- left = middle + 1; \
178- else \
179- right = middle - 1; \
180- } \
181- } \
182-while (0)
183-
184-
185 int
186-internal_function
187 _dl_cache_libcmp (const char *p1, const char *p2)
188 {
189 while (*p1 != '\0')
190@@ -172,139 +76,3 @@ _dl_cache_libcmp (const char *p1, const
191 }
192 return *p1 - *p2;
193 }
194-
195-
196-/* Look up NAME in ld.so.cache and return the file name stored there,
197- or null if none is found. */
198-
199-const char *
200-internal_function
201-_dl_load_cache_lookup (const char *name)
202-{
203- int left, right, middle;
204- int cmpres;
205- const char *cache_data;
206- uint32_t cache_data_size;
207- const char *best;
208-
209- /* Print a message if the loading of libs is traced. */
210- if (__builtin_expect (GLRO_dl_debug_mask & DL_DEBUG_LIBS, 0))
211- _dl_debug_printf (" search cache=%s\n", LD_SO_CACHE);
212-
213- if (cache == NULL)
214- {
215- /* Read the contents of the file. */
216- void *file = _dl_sysdep_read_whole_file (LD_SO_CACHE, &cachesize,
217- PROT_READ);
218-
219- /* We can handle three different cache file formats here:
220- - the old libc5/glibc2.0/2.1 format
221- - the old format with the new format in it
222- - only the new format
223- The following checks if the cache contains any of these formats. */
224- if (file != MAP_FAILED && cachesize > sizeof *cache
225- && memcmp (file, CACHEMAGIC, sizeof CACHEMAGIC - 1) == 0)
226- {
227- size_t offset;
228- /* Looks ok. */
229- cache = file;
230-
231- /* Check for new version. */
232- offset = ALIGN_CACHE (sizeof (struct cache_file)
233- + cache->nlibs * sizeof (struct file_entry));
234-
235- cache_new = (struct cache_file_new *) ((void *) cache + offset);
236- if (cachesize < (offset + sizeof (struct cache_file_new))
237- || memcmp (cache_new->magic, CACHEMAGIC_VERSION_NEW,
238- sizeof CACHEMAGIC_VERSION_NEW - 1) != 0)
239- cache_new = (void *) -1;
240- }
241- else if (file != MAP_FAILED && cachesize > sizeof *cache_new
242- && memcmp (file, CACHEMAGIC_VERSION_NEW,
243- sizeof CACHEMAGIC_VERSION_NEW - 1) == 0)
244- {
245- cache_new = file;
246- cache = file;
247- }
248- else
249- {
250- if (file != MAP_FAILED)
251- __munmap (file, cachesize);
252- cache = (void *) -1;
253- }
254-
255- assert (cache != NULL);
256- }
257-
258- if (cache == (void *) -1)
259- /* Previously looked for the cache file and didn't find it. */
260- return NULL;
261-
262- best = NULL;
263-
264- if (cache_new != (void *) -1)
265- {
266- uint64_t platform;
267-
268- /* This is where the strings start. */
269- cache_data = (const char *) cache_new;
270-
271- /* Now we can compute how large the string table is. */
272- cache_data_size = (const char *) cache + cachesize - cache_data;
273-
274- platform = _dl_string_platform (GLRO(dl_platform));
275- if (platform != (uint64_t) -1)
276- platform = 1ULL << platform;
277-
278-#define _DL_HWCAP_TLS_MASK (1LL << 63)
279- uint64_t hwcap_exclude = ~((GLRO(dl_hwcap) & GLRO(dl_hwcap_mask))
280- | _DL_HWCAP_PLATFORM | _DL_HWCAP_TLS_MASK);
281-
282- /* Only accept hwcap if it's for the right platform. */
283-#define HWCAP_CHECK \
284- if (lib->hwcap & hwcap_exclude) \
285- continue; \
286- if (GLRO(dl_osversion) && lib->osversion > GLRO(dl_osversion)) \
287- continue; \
288- if (_DL_PLATFORMS_COUNT \
289- && (lib->hwcap & _DL_HWCAP_PLATFORM) != 0 \
290- && (lib->hwcap & _DL_HWCAP_PLATFORM) != platform) \
291- continue
292- SEARCH_CACHE (cache_new);
293- }
294- else
295- {
296- /* This is where the strings start. */
297- cache_data = (const char *) &cache->libs[cache->nlibs];
298-
299- /* Now we can compute how large the string table is. */
300- cache_data_size = (const char *) cache + cachesize - cache_data;
301-
302-#undef HWCAP_CHECK
303-#define HWCAP_CHECK do {} while (0)
304- SEARCH_CACHE (cache);
305- }
306-
307- /* Print our result if wanted. */
308- if (__builtin_expect (GLRO_dl_debug_mask & DL_DEBUG_LIBS, 0)
309- && best != NULL)
310- _dl_debug_printf (" trying file=%s\n", best);
311-
312- return best;
313-}
314-
315-#ifndef MAP_COPY
316-/* If the system does not support MAP_COPY we cannot leave the file open
317- all the time since this would create problems when the file is replaced.
318- Therefore we provide this function to close the file and open it again
319- once needed. */
320-void
321-_dl_unload_cache (void)
322-{
323- if (cache != NULL && cache != (struct cache_file *) -1)
324- {
325- __munmap (cache, cachesize);
326- cache = NULL;
327- }
328-}
329-#endif
330Index: ldconfig-native-2.12.1/dl-cache.h
331===================================================================
332--- ldconfig-native-2.12.1.orig/dl-cache.h
333+++ ldconfig-native-2.12.1/dl-cache.h
334@@ -101,5 +101,4 @@ struct cache_file_new
335 (((addr) + __alignof__ (struct cache_file_new) -1) \
336 & (~(__alignof__ (struct cache_file_new) - 1)))
337
338-extern int _dl_cache_libcmp (const char *p1, const char *p2)
339- internal_function;
340+extern int _dl_cache_libcmp (const char *p1, const char *p2);
341Index: ldconfig-native-2.12.1/ldconfig.c
342===================================================================
343--- ldconfig-native-2.12.1.orig/ldconfig.c
344+++ ldconfig-native-2.12.1/ldconfig.c
345@@ -16,6 +16,9 @@
346 along with this program; if not, write to the Free Software Foundation,
347 Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
348
349+#define _LARGEFILE64_SOURCE
350+#define _GNU_SOURCE
351+
352 #define PROCINFO_CLASS static
353 #include <alloca.h>
354 #include <argp.h>
355@@ -39,10 +42,20 @@
356 #include <glob.h>
357 #include <libgen.h>
358
359-#include <ldconfig.h>
360-#include <dl-cache.h>
361+#include "ldconfig.h"
362+#include "dl-cache.h"
363+
364+#include "dl-procinfo.h"
365+
366+#include "argp.h"
367+
368+
369+#define SYSCONFDIR "/etc"
370+#define LIBDIR "/usr/lib"
371+#define SLIBDIR "/lib"
372+# define N_(msgid) msgid
373+#define _(msg) msg
374
375-#include <dl-procinfo.h>
376
377 #ifdef _DL_FIRST_PLATFORM
378 # define _DL_FIRST_EXTRA (_DL_FIRST_PLATFORM + _DL_PLATFORMS_COUNT)
379@@ -55,7 +68,7 @@
380 #endif
381
382 /* Get libc version number. */
383-#include <version.h>
384+#include "version.h"
385
386 #define PACKAGE _libc_intl_domainname
387
388@@ -152,8 +165,8 @@ static const struct argp_option options[
389 { NULL, 0, NULL, 0, NULL, 0 }
390 };
391
392-#define PROCINFO_CLASS static
393-#include <dl-procinfo.c>
394+//#define PROCINFO_CLASS static
395+//#include <dl-procinfo.c>
396
397 /* Short description of program. */
398 static const char doc[] = N_("Configure Dynamic Linker Run Time Bindings.");
399@@ -291,6 +304,7 @@ parse_opt (int key, char *arg, struct ar
400 return 0;
401 }
402
403+#define REPORT_BUGS_TO "mailing list : poky@yoctoproject.org"
404 /* Print bug-reporting information in the help message. */
405 static char *
406 more_help (int key, const char *text, void *input)
407@@ -315,7 +329,7 @@ For bug reporting instructions, please s
408 static void
409 print_version (FILE *stream, struct argp_state *state)
410 {
411- fprintf (stream, "ldconfig %s%s\n", PKGVERSION, VERSION);
412+ fprintf (stream, "ldconfig (Hacked Poky Version)\n");
413 fprintf (stream, gettext ("\
414 Copyright (C) %s Free Software Foundation, Inc.\n\
415 This is free software; see the source for copying conditions. There is NO\n\
416@@ -1233,6 +1247,7 @@ set_hwcap (void)
417 hwcap_mask = strtoul (mask, NULL, 0);
418 }
419
420+const char _libc_intl_domainname[] = "libc";
421
422 int
423 main (int argc, char **argv)
424Index: ldconfig-native-2.12.1/readlib.c
425===================================================================
426--- ldconfig-native-2.12.1.orig/readlib.c
427+++ ldconfig-native-2.12.1/readlib.c
428@@ -22,6 +22,9 @@
429 development version. Besides the simplification, it has also been
430 modified to read some other file formats. */
431
432+#define _LARGEFILE64_SOURCE
433+#define _GNU_SOURCE
434+
435 #include <a.out.h>
436 #include <elf.h>
437 #include <error.h>
438@@ -35,7 +38,9 @@
439 #include <sys/stat.h>
440 #include <gnu/lib-names.h>
441
442-#include <ldconfig.h>
443+#include "ldconfig.h"
444+
445+#define _(msg) msg
446
447 #define Elf32_CLASS ELFCLASS32
448 #define Elf64_CLASS ELFCLASS64
449Index: ldconfig-native-2.12.1/xstrdup.c
450===================================================================
451--- ldconfig-native-2.12.1.orig/xstrdup.c
452+++ ldconfig-native-2.12.1/xstrdup.c
453@@ -16,15 +16,10 @@
454 along with this program; if not, write to the Free Software Foundation,
455 Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
456
457-#ifdef HAVE_CONFIG_H
458-# include <config.h>
459-#endif
460+#define _GNU_SOURCE
461+
462+#include <string.h>
463
464-#if defined STDC_HEADERS || defined HAVE_STRING_H || _LIBC
465-# include <string.h>
466-#else
467-# include <strings.h>
468-#endif
469 void *xmalloc (size_t n) __THROW;
470 char *xstrdup (char *string) __THROW;
471
diff --git a/meta/recipes-core/eglibc/ldconfig-native-2.12.1/ldconfig_aux-cache_path_fix.patch b/meta/recipes-core/eglibc/ldconfig-native-2.12.1/ldconfig_aux-cache_path_fix.patch
new file mode 100644
index 0000000000..27bc411078
--- /dev/null
+++ b/meta/recipes-core/eglibc/ldconfig-native-2.12.1/ldconfig_aux-cache_path_fix.patch
@@ -0,0 +1,36 @@
1Upstream-Status: Pending
2
3Coming from this bug: http://sourceware.org/bugzilla/show_bug.cgi?id=11149
4
5Nitin A Kamble <nitin.a.kamble@intel.com>2011/03/29
6
7--- ldconfig-native-2.12.1.orig/ldconfig.c
8+++ ldconfig-native-2.12.1/ldconfig.c
9@@ -1359,14 +1359,9 @@ main (int argc, char **argv)
10
11 const char *aux_cache_file = _PATH_LDCONFIG_AUX_CACHE;
12 if (opt_chroot)
13- {
14- aux_cache_file = chroot_canon (opt_chroot, aux_cache_file);
15- if (aux_cache_file == NULL)
16- error (EXIT_FAILURE, errno, _("Can't open cache file %s\n"),
17- _PATH_LDCONFIG_AUX_CACHE);
18- }
19+ aux_cache_file = chroot_canon (opt_chroot, aux_cache_file);
20
21- if (! opt_ignore_aux_cache)
22+ if (! opt_ignore_aux_cache && aux_cache_file)
23 load_aux_cache (aux_cache_file);
24 else
25 init_aux_cache ();
26@@ -1376,7 +1371,8 @@ main (int argc, char **argv)
27 if (opt_build_cache)
28 {
29 save_cache (cache_file);
30- save_aux_cache (aux_cache_file);
31+ if (aux_cache_file)
32+ save_aux_cache (aux_cache_file);
33 }
34
35 return 0;
36
diff --git a/meta/recipes-core/eglibc/ldconfig-native_2.12.1.bb b/meta/recipes-core/eglibc/ldconfig-native_2.12.1.bb
new file mode 100644
index 0000000000..d7bc4446a8
--- /dev/null
+++ b/meta/recipes-core/eglibc/ldconfig-native_2.12.1.bb
@@ -0,0 +1,30 @@
1SUMMARY = "A standalone native ldconfig build"
2
3LICENSE = "GPLv2+"
4
5LIC_FILES_CHKSUM = "file://${S}/ldconfig.c;endline=17;md5=1d15f20937c055cb5de2329a4c054399"
6
7SRC_URI = "file://ldconfig-native-2.12.1.tar.bz2 \
8 file://ldconfig.patch \
9 file://ldconfig_aux-cache_path_fix.patch \
10 file://32and64bit.patch \
11 file://endian-ness_handling.patch \
12 file://flag_fix.patch \
13 file://endianess-header.patch"
14
15PR = "r2"
16
17FILESPATH = "${FILE_DIRNAME}/${PN}-${PV}/"
18
19inherit native
20
21S = "${WORKDIR}/${PN}-${PV}"
22
23do_compile () {
24 $CC ldconfig.c -std=gnu99 chroot_canon.c xmalloc.c xstrdup.c cache.c readlib.c -I. dl-cache.c -o ldconfig
25}
26
27do_install () {
28 install -d ${D}/${bindir}/
29 install ldconfig ${D}/${bindir}/
30}
diff --git a/meta/recipes-core/eglibc/site_config/funcs b/meta/recipes-core/eglibc/site_config/funcs
new file mode 100644
index 0000000000..ccc85392d7
--- /dev/null
+++ b/meta/recipes-core/eglibc/site_config/funcs
@@ -0,0 +1,474 @@
1a64l
2abs
3access
4__adjtimex
5alarm
6alphasort
7argz_append
8__argz_count
9argz_create_sep
10argz_insert
11__argz_next
12argz_next
13__argz_stringify
14argz_stringify
15asprintf
16atexit
17atof
18atoi
19bcmp
20bcopy
21bindresvport
22bind_textdomain_codeset
23btowc
24bzero
25calloc
26canonicalize_file_name
27catgets
28cfgetospeed
29cfsetispeed
30cfsetspeed
31chmod
32chown
33chroot
34clock
35close
36closedir
37closelog
38confstr
39connect
40daemon
41dcgettext
42difftime
43dirfd
44dirname
45dngettext
46dup2
47ecvt
48endgrent
49endmntent
50endpwent
51endutent
52endutxent
53epoll_ctl
54err
55ether_hostton
56ether_ntohost
57euidaccess
58execv
59fchdir
60fchmod
61fchmodat
62fchown
63fchownat
64fcntl
65fcvt
66fdatasync
67fdopendir
68feof_unlocked
69fgets_unlocked
70fgetxattr
71finite
72flistxattr
73flock
74flockfile
75fnmatch
76fork
77fpathconf
78__fpending
79fprintf
80free
81freeaddrinfo
82freeifaddrs
83fseeko
84__fsetlocking
85fsetxattr
86fstat64
87fstat
88fstatfs
89fsync
90ftello
91ftime
92ftruncate
93funlockfile
94futimes
95futimesat
96gai_strerror
97gcvt
98getaddrinfo
99getc_unlocked
100getcwd
101getdelim
102getdomainname
103getdtablesize
104getegid
105getenv
106geteuid
107getgid
108getgrent
109getgrent_r
110getgrgid_r
111getgrnam
112getgrnam_r
113getgrouplist
114getgroups
115gethostbyaddr_r
116gethostbyname2
117gethostbyname
118gethostbyname_r
119gethostent
120gethostid
121gethostname
122getifaddrs
123getline
124getloadavg
125getmntent
126getmsg
127getnameinfo
128getnetbyaddr_r
129getnetgrent_r
130getopt
131getopt_long
132getopt_long_only
133getpagesize
134getpass
135getpeername
136getpgrp
137getpid
138getppid
139getprotoent_r
140getpwent
141getpwent_r
142getpwnam
143getpwnam_r
144getpwuid
145getpwuid_r
146getresuid
147getrlimit
148getrusage
149getservbyname
150getservbyname_r
151getservbyport_r
152getservent
153getservent_r
154getspnam
155getspnam_r
156gettimeofday
157getttyent
158getttynam
159getuid
160getusershell
161getutent
162getutid
163getutline
164getutmp
165getutmpx
166getutxent
167getutxid
168getutxline
169getwd
170getxattr
171glob
172gmtime
173gmtime_r
174grantpt
175group_member
176herror
177hstrerror
178iconv
179iconv_open
180if_freenameindex
181if_indextoname
182if_nameindex
183if_nametoindex
184index
185inet_addr
186inet_aton
187inet_ntoa
188inet_ntop
189inet_pton
190initgroups
191innetgr
192iruserok
193isascii
194isatty
195isblank
196isgraph
197isinf
198isnan
199isprint
200isspace
201iswalnum
202iswcntrl
203iswctype
204iswprint
205iswspace
206iswupper
207isxdigit
208kill
209killpg
210lchown
211lckpwdf
212lgetxattr
213link
214listxattr
215llistxattr
216localtime
217localtime_r
218lockf
219lrand48
220lsearch
221lseek64
222lsetxattr
223lstat
224mallinfo
225malloc
226mblen
227mbrlen
228mbrtowc
229mbsinit
230mbsrtowcs
231mbtowc
232memalign
233memchr
234memcmp
235memcpy
236memmove
237mempcpy
238memrchr
239memset
240mkdir
241mkdirat
242mkdtemp
243mkfifo
244mknod
245mkstemp64
246mkstemp
247mktime
248mlock
249mmap
250mtrace
251munlock
252munmap
253nanosleep
254nice
255nl_langinfo
256ntp_adjtime
257ntp_gettime
258_obstack_free
259on_exit
260open64
261open
262openat
263opendir
264openlog
265pathconf
266pipe
267poll
268popen
269posix_memalign
270prctl
271pread
272printf
273__progname
274pselect
275pthread_mutex_lock
276ptsname
277putenv
278putgrent
279putpwent
280putspent
281pututline
282pututxline
283putwc
284pwrite
285qsort
286raise
287rand
288random
289rand_r
290read
291readdir
292readdir_r
293readlink
294realloc
295realpath
296re_comp
297recvmsg
298re_exec
299regcomp
300regexec
301remove
302rename
303re_search
304rmdir
305rpmatch
306rresvport_af
307ruserok
308ruserok_af
309sbrk
310scandir
311sched_setscheduler
312sched_yield
313__secure_getenv
314select
315semctl
316semget
317sendmsg
318setbuf
319setbuffer
320setegid
321setenv
322seteuid
323setgid
324setgroups
325sethostname
326setitimer
327_setjmp
328setjmp
329setlinebuf
330setlocale
331setmntent
332setpgid
333setpgrp
334setpriority
335setregid
336setresgid
337setresuid
338setreuid
339setrlimit
340setsid
341setsockopt
342settimeofday
343setuid
344setutent
345setutxent
346setvbuf
347setxattr
348sgetspent
349shmat
350shmctl
351shmdt
352shmget
353shutdown
354sigaction
355sigaddset
356sigaltstack
357sigblock
358sigemptyset
359sighold
360siginterrupt
361signal
362sigprocmask
363sigset
364sigsetmask
365sigstack
366sigsuspend
367sigvec
368snprintf
369socket
370socketpair
371sprintf
372srand48
373srand
374srandom
375sscanf
376stat
377statfs
378statvfs
379stime
380stpcpy
381strcasecmp
382strcasestr
383strchr
384strchrnul
385strcmp
386strcspn
387strdup
388strerror
389strerror_r
390strftime
391strlen
392strncasecmp
393strncmp
394strndup
395strnlen
396strpbrk
397strptime
398strrchr
399strsep
400strsignal
401strspn
402strstr
403strtod
404strtoimax
405strtok_r
406strtol
407strtoll
408strtoul
409strtoull
410strtoumax
411strverscmp
412strxfrm
413symlink
414sync
415sysconf
416sysctl
417sysinfo
418syslog
419_sys_siglist
420sys_siglist
421system
422tcgetattr
423tcgetpgrp
424tcsetattr
425tcsetpgrp
426time
427timegm
428times
429timezone
430tmpnam
431towlower
432towupper
433truncate
434tsearch
435ttyname
436tzset
437ulimit
438umask
439uname
440unlink
441unsetenv
442unshare
443updwtmp
444updwtmpx
445usleep
446ustat
447utime
448utimes
449utmpname
450utmpxname
451valloc
452vasprintf
453verrx
454vfork
455vfprintf
456vfscanf
457vhangup
458vprintf
459vsnprintf
460vsprintf
461wait3
462wait4
463waitpid
464wcrtomb
465wcscoll
466wcsdup
467wcslen
468wctob
469wctomb
470wctype
471wcwidth
472wmemchr
473wmemcpy
474wmempcpy
diff --git a/meta/recipes-core/eglibc/site_config/headers b/meta/recipes-core/eglibc/site_config/headers
new file mode 100644
index 0000000000..609ab53797
--- /dev/null
+++ b/meta/recipes-core/eglibc/site_config/headers
@@ -0,0 +1,156 @@
1aio.h
2alloca.h
3argz.h
4arpa/inet.h
5arpa/nameser.h
6asm/byteorder.h
7asm/ioctls.h
8asm/page.h
9asm/types.h
10assert.h
11byteswap.h
12crypt.h
13ctype.h
14dirent.h
15dlfcn.h
16elf.h
17endian.h
18err.h
19errno.h
20execinfo.h
21fcntl.h
22features.h
23float.h
24fstab.h
25ftw.h
26getopt.h
27glob.h
28grp.h
29iconv.h
30ifaddrs.h
31inttypes.h
32langinfo.h
33lastlog.h
34libgen.h
35libintl.h
36limits.h
37linux/capability.h
38linux/fd.h
39linux/fs.h
40linux/hayesesp.h
41linux/hdreg.h
42linux/icmp.h
43linux/in6.h
44linux/joystick.h
45linux/ptrace.h
46linux/serial.h
47linux/sonypi.h
48linux/unistd.h
49linux/utsname.h
50linux/version.h
51locale.h
52malloc.h
53math.h
54mcheck.h
55memory.h
56mntent.h
57mqueue.h
58netdb.h
59net/if.h
60netinet/ether.h
61netinet/in.h
62netinet/ip6.h
63netinet/ip.h
64netinet/tcp.h
65netinet/udp.h
66netipx/ipx.h
67net/route.h
68paths.h
69poll.h
70pthread.h
71pty.h
72pwd.h
73regex.h
74resolv.h
75rpc/rpc.h
76rpc/types.h
77sched.h
78scsi/scsi.h
79search.h
80semaphore.h
81setjmp.h
82sgtty.h
83shadow.h
84signal.h
85stdarg.h
86stdbool.h
87stdc
88stddef.h
89stdint.h
90stdio.h
91stdlib.h
92string.h
93strings.h
94stropts.h
95sys/bitypes.h
96sys/cdefs.h
97sys/dir.h
98sys/epoll.h
99sysexits.h
100sys/fcntl.h
101sys/file.h
102sys/fsuid.h
103sys/ioctl.h
104sys/ipc.h
105syslog.h
106sys/mman.h
107sys/mount.h
108sys/mtio.h
109sys/param.h
110sys/poll.h
111sys/prctl.h
112sys/ptrace.h
113sys/queue.h
114sys/reg.h
115sys/resource.h
116sys/select.h
117sys/sem.h
118sys/shm.h
119sys/signal.h
120sys/socket.h
121sys/socketvar.h
122sys/soundcard.h
123sys/statfs.h
124sys/stat.h
125sys/statvfs.h
126sys/stropts.h
127sys/swap.h
128sys/sysctl.h
129sys/sysinfo.h
130sys/sysmacros.h
131sys/termios.h
132sys/timeb.h
133sys/time.h
134sys/times.h
135sys/timex.h
136sys/types.h
137sys/uio.h
138sys/un.h
139sys/unistd.h
140sys/user.h
141sys/utsname.h
142sys/vfs.h
143sys/wait.h
144termio.h
145termios.h
146time.h
147ttyent.h
148ulimit.h
149unistd.h
150ustat.h
151utime.h
152utmp.h
153utmpx.h
154values.h
155wchar.h
156wctype.h
diff --git a/meta/recipes-core/eglibc/site_config/types b/meta/recipes-core/eglibc/site_config/types
new file mode 100644
index 0000000000..178bd85a00
--- /dev/null
+++ b/meta/recipes-core/eglibc/site_config/types
@@ -0,0 +1,21 @@
1char
2char *
3double
4float
5int
6long
7long double
8long int
9long long
10long long int
11short
12short int
13signed char
14unsigned char
15unsigned int
16unsigned long
17unsigned long int
18unsigned long long int
19unsigned short
20unsigned short int
21void *