summaryrefslogtreecommitdiffstats
path: root/meta/recipes-core
diff options
context:
space:
mode:
authorKhem Raj <raj.khem@gmail.com>2012-01-17 23:06:08 -0800
committerRichard Purdie <richard.purdie@linuxfoundation.org>2012-01-19 11:34:11 +0000
commitea8e63df249715333ee5464a65a4d9684f7484b1 (patch)
treeb7f28d43020518d4c3107cd9f23f7cc6c81eb4ed /meta/recipes-core
parent13a62254e8b44694245b1adb81f61ce1dc82b259 (diff)
downloadpoky-ea8e63df249715333ee5464a65a4d9684f7484b1.tar.gz
uclibc: Upgrade to latest master
Document the patches (From OE-Core rev: fdcae83ad715af92a4d25f4ef5b30c49ce6ceb69) Signed-off-by: Khem Raj <raj.khem@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-core')
-rw-r--r--meta/recipes-core/uclibc/uclibc-git/cross_compile_check.patch13
-rw-r--r--meta/recipes-core/uclibc/uclibc-git/fix_libdl.patch83
-rw-r--r--meta/recipes-core/uclibc/uclibc-git/ldso_use_arm_dl_linux_resolve_in_thumb_mode.patch6
-rw-r--r--meta/recipes-core/uclibc/uclibc-git/orign_path.patch183
-rw-r--r--meta/recipes-core/uclibc/uclibc-git/powerpc_copysignl.patch6
-rw-r--r--meta/recipes-core/uclibc/uclibc-git/remove_attribute_optimize_Os.patch5
-rw-r--r--meta/recipes-core/uclibc/uclibc-git/rtld_no.patch216
-rw-r--r--meta/recipes-core/uclibc/uclibc-git/uClibc.distro2
-rw-r--r--meta/recipes-core/uclibc/uclibc-git/uclibc-arm-ftruncate64.patch5
-rw-r--r--meta/recipes-core/uclibc/uclibc-git/uclibc-execvpe.patch3
-rw-r--r--meta/recipes-core/uclibc/uclibc-git/uclibc_enable_log2_test.patch5
-rw-r--r--meta/recipes-core/uclibc/uclibc-git/uclibc_scheduler_update.patch455
-rw-r--r--meta/recipes-core/uclibc/uclibc.inc2
-rw-r--r--meta/recipes-core/uclibc/uclibc_git.bb10
14 files changed, 134 insertions, 860 deletions
diff --git a/meta/recipes-core/uclibc/uclibc-git/cross_compile_check.patch b/meta/recipes-core/uclibc/uclibc-git/cross_compile_check.patch
new file mode 100644
index 0000000000..f009cb97f7
--- /dev/null
+++ b/meta/recipes-core/uclibc/uclibc-git/cross_compile_check.patch
@@ -0,0 +1,13 @@
1diff --git a/Rules.mak b/Rules.mak
2index 84baa97..571da05 100644
3--- a/Rules.mak
4+++ b/Rules.mak
5@@ -158,7 +158,7 @@ endif
6 comma:=,
7 space:= #
8
9-ifndef CROSS_COMPILE
10+ifeq ($(CROSS_COMPILE),)
11 CROSS_COMPILE=$(call qstrip,$(CROSS_COMPILER_PREFIX))
12 endif
13
diff --git a/meta/recipes-core/uclibc/uclibc-git/fix_libdl.patch b/meta/recipes-core/uclibc/uclibc-git/fix_libdl.patch
new file mode 100644
index 0000000000..16e48b1bca
--- /dev/null
+++ b/meta/recipes-core/uclibc/uclibc-git/fix_libdl.patch
@@ -0,0 +1,83 @@
1Defer removal of the local scope of a dl-opened library after
2all the destructors (of itself and related dependencies) are actually
3get unloaded, otherwise any function registered via atexit()
4won't be resolved.
5
6Signed-off-by: Khem Raj <raj.khem at gmail.com>
7Signed-off-by: Filippo Arcidiacono <filippo.arcidiacono at st.com>
8Signed-off-by: Carmelo Amoroso <carmelo.amoroso at st.com>
9---
10 ldso/libdl/libdl.c | 33 +++++++++++++++++++++------------
11 1 files changed, 21 insertions(+), 12 deletions(-)
12
13
14Upstream-Status: Pending
15
16Index: git/ldso/libdl/libdl.c
17===================================================================
18--- git.orig/ldso/libdl/libdl.c 2012-01-17 17:38:44.930821794 -0800
19+++ git/ldso/libdl/libdl.c 2012-01-17 17:39:02.754822656 -0800
20@@ -780,7 +780,9 @@
21 struct dyn_elf *handle;
22 unsigned int end = 0, start = 0xffffffff;
23 unsigned int i, j;
24- struct r_scope_elem *ls;
25+ struct r_scope_elem *ls, *ls_next = NULL;
26+ struct elf_resolve **handle_rlist;
27+
28 #if defined(USE_TLS) && USE_TLS
29 bool any_tls = false;
30 size_t tls_free_start = NO_TLS_OFFSET;
31@@ -813,6 +815,19 @@
32 free(handle);
33 return 0;
34 }
35+
36+ /* Store the handle's local scope array for later removal */
37+ handle_rlist = handle->dyn->symbol_scope.r_list;
38+
39+ /* Store references to the local scope entries for later removal */
40+ for (ls = &_dl_loaded_modules->symbol_scope; ls && ls->next; ls = ls->next)
41+ if (ls->next->r_list[0] == handle->dyn) {
42+ break;
43+ }
44+ /* ls points to the previous local symbol scope */
45+ if(ls && ls->next)
46+ ls_next = ls->next->next;
47+
48 /* OK, this is a valid handle - now close out the file */
49 for (j = 0; j < handle->init_fini.nlist; ++j) {
50 tpnt = handle->init_fini.init_fini[j];
51@@ -974,16 +989,6 @@
52 }
53 }
54
55- if (handle->dyn == tpnt) {
56- /* Unlink the local scope from global one */
57- for (ls = &_dl_loaded_modules->symbol_scope; ls; ls = ls->next)
58- if (ls->next->r_list[0] == tpnt) {
59- _dl_if_debug_print("removing symbol_scope: %s\n", tpnt->libname);
60- break;
61- }
62- ls->next = ls->next->next;
63- }
64-
65 /* Next, remove tpnt from the global symbol table list */
66 if (_dl_symbol_tables) {
67 if (_dl_symbol_tables->dyn == tpnt) {
68@@ -1005,10 +1010,14 @@
69 }
70 }
71 free(tpnt->libname);
72- free(tpnt->symbol_scope.r_list);
73 free(tpnt);
74 }
75 }
76+ /* Unlink and release the handle's local scope from global one */
77+ if(ls)
78+ ls->next = ls_next;
79+ free(handle_rlist);
80+
81 for (rpnt1 = handle->next; rpnt1; rpnt1 = rpnt1_tmp) {
82 rpnt1_tmp = rpnt1->next;
83 free(rpnt1);
diff --git a/meta/recipes-core/uclibc/uclibc-git/ldso_use_arm_dl_linux_resolve_in_thumb_mode.patch b/meta/recipes-core/uclibc/uclibc-git/ldso_use_arm_dl_linux_resolve_in_thumb_mode.patch
index cfa68ce52d..d44accadbb 100644
--- a/meta/recipes-core/uclibc/uclibc-git/ldso_use_arm_dl_linux_resolve_in_thumb_mode.patch
+++ b/meta/recipes-core/uclibc/uclibc-git/ldso_use_arm_dl_linux_resolve_in_thumb_mode.patch
@@ -1,3 +1,9 @@
1resolver code should always be in arm mode
2
3Signed-off-by: Khem Raj <raj.khem@gmail.com>
4
5Upstream-Status: Pending
6
1Index: uClibc/ldso/ldso/arm/resolve.S 7Index: uClibc/ldso/ldso/arm/resolve.S
2=================================================================== 8===================================================================
3--- uClibc.orig/ldso/ldso/arm/resolve.S 2009-03-20 12:03:32.000000000 -0700 9--- uClibc.orig/ldso/ldso/arm/resolve.S 2009-03-20 12:03:32.000000000 -0700
diff --git a/meta/recipes-core/uclibc/uclibc-git/orign_path.patch b/meta/recipes-core/uclibc/uclibc-git/orign_path.patch
deleted file mode 100644
index b22be8ce63..0000000000
--- a/meta/recipes-core/uclibc/uclibc-git/orign_path.patch
+++ /dev/null
@@ -1,183 +0,0 @@
1Patch is backported from
2http://lists.busybox.net/pipermail/uclibc/2011-March/045003.html
3
4Upstream-Status: Pending
5
6Index: git/ldso/ldso/dl-elf.c
7===================================================================
8--- git.orig/ldso/ldso/dl-elf.c 2011-07-01 15:20:51.000000000 -0700
9+++ git/ldso/ldso/dl-elf.c 2011-07-01 15:21:47.493578777 -0700
10@@ -133,53 +133,60 @@
11 * in uClibc/ldso/util/ldd.c */
12 static struct elf_resolve *
13 search_for_named_library(const char *name, int secure, const char *path_list,
14- struct dyn_elf **rpnt)
15+ struct dyn_elf **rpnt, const char *origin)
16 {
17- char *path, *path_n, *mylibname;
18+ char *mylibname;
19+ const char *p, *pn;
20 struct elf_resolve *tpnt;
21- int done;
22+ int plen;
23
24 if (path_list==NULL)
25 return NULL;
26
27- /* We need a writable copy of this string, but we don't
28- * need this allocated permanently since we don't want
29- * to leak memory, so use alloca to put path on the stack */
30- done = _dl_strlen(path_list);
31- path = alloca(done + 1);
32-
33 /* another bit of local storage */
34 mylibname = alloca(2050);
35
36- _dl_memcpy(path, path_list, done+1);
37-
38 /* Unlike ldd.c, don't bother to eliminate double //s */
39
40 /* Replace colons with zeros in path_list */
41 /* : at the beginning or end of path maps to CWD */
42 /* :: anywhere maps CWD */
43 /* "" maps to CWD */
44- done = 0;
45- path_n = path;
46- do {
47- if (*path == 0) {
48- *path = ':';
49- done = 1;
50- }
51- if (*path == ':') {
52- *path = 0;
53- if (*path_n)
54- _dl_strcpy(mylibname, path_n);
55- else
56- _dl_strcpy(mylibname, "."); /* Assume current dir if empty path */
57- _dl_strcat(mylibname, "/");
58- _dl_strcat(mylibname, name);
59- if ((tpnt = _dl_load_elf_shared_library(secure, rpnt, mylibname)) != NULL)
60- return tpnt;
61- path_n = path+1;
62+ for (p = path_list; p != NULL; p = pn) {
63+ pn = _dl_strchr(p + 1, ':');
64+ if (pn != NULL) {
65+ plen = pn - p;
66+ pn++;
67+ } else
68+ plen = _dl_strlen(p);
69+
70+ if (plen >= 7 && _dl_memcmp(p, "$ORIGIN", 7) == 0) {
71+ int olen;
72+ if (secure && plen != 7)
73+ continue;
74+ if (origin == NULL)
75+ continue;
76+ for (olen = _dl_strlen(origin) - 1; olen >= 0 && origin[olen] != '/'; olen--)
77+ ;
78+ if (olen <= 0)
79+ continue;
80+ _dl_memcpy(&mylibname[0], origin, olen);
81+ _dl_memcpy(&mylibname[olen], p + 7, plen - 7);
82+ mylibname[olen + plen - 7] = 0;
83+ } else if (plen != 0) {
84+ _dl_memcpy(mylibname, p, plen);
85+ mylibname[plen] = 0;
86+ } else {
87+ _dl_strcpy(mylibname, ".");
88 }
89- path++;
90- } while (!done);
91+ _dl_strcat(mylibname, "/");
92+ _dl_strcat(mylibname, name);
93+
94+ tpnt = _dl_load_elf_shared_library(secure, rpnt, mylibname);
95+ if (tpnt != NULL)
96+ return tpnt;
97+ }
98+
99 return NULL;
100 }
101
102@@ -231,7 +238,8 @@
103 if (pnt) {
104 pnt += (unsigned long) tpnt->dynamic_info[DT_STRTAB];
105 _dl_if_debug_dprint("\tsearching RPATH='%s'\n", pnt);
106- if ((tpnt1 = search_for_named_library(libname, secure, pnt, rpnt)) != NULL)
107+ if ((tpnt1 = search_for_named_library(libname, secure, pnt, rpnt,
108+ tpnt->libname)) != NULL)
109 return tpnt1;
110 }
111 #endif
112@@ -239,7 +247,7 @@
113 /* Check in LD_{ELF_}LIBRARY_PATH, if specified and allowed */
114 if (_dl_library_path) {
115 _dl_if_debug_dprint("\tsearching LD_LIBRARY_PATH='%s'\n", _dl_library_path);
116- if ((tpnt1 = search_for_named_library(libname, secure, _dl_library_path, rpnt)) != NULL)
117+ if ((tpnt1 = search_for_named_library(libname, secure, _dl_library_path, rpnt, NULL)) != NULL)
118 {
119 return tpnt1;
120 }
121@@ -253,7 +261,7 @@
122 if (pnt) {
123 pnt += (unsigned long) tpnt->dynamic_info[DT_STRTAB];
124 _dl_if_debug_dprint("\tsearching RUNPATH='%s'\n", pnt);
125- if ((tpnt1 = search_for_named_library(libname, secure, pnt, rpnt)) != NULL)
126+ if ((tpnt1 = search_for_named_library(libname, secure, pnt, rpnt, NULL)) != NULL)
127 return tpnt1;
128 }
129 #endif
130@@ -287,7 +295,7 @@
131 /* Look for libraries wherever the shared library loader
132 * was installed */
133 _dl_if_debug_dprint("\tsearching ldso dir='%s'\n", _dl_ldsopath);
134- tpnt1 = search_for_named_library(libname, secure, _dl_ldsopath, rpnt);
135+ tpnt1 = search_for_named_library(libname, secure, _dl_ldsopath, rpnt, NULL);
136 if (tpnt1 != NULL)
137 return tpnt1;
138
139@@ -300,7 +308,7 @@
140 #ifndef __LDSO_CACHE_SUPPORT__
141 ":" UCLIBC_RUNTIME_PREFIX "usr/X11R6/lib"
142 #endif
143- , rpnt);
144+ , rpnt, NULL);
145 if (tpnt1 != NULL)
146 return tpnt1;
147
148Index: git/ldso/ldso/ldso.c
149===================================================================
150--- git.orig/ldso/ldso/ldso.c 2011-07-01 15:20:51.000000000 -0700
151+++ git/ldso/ldso/ldso.c 2011-07-01 15:24:32.363820591 -0700
152@@ -370,6 +370,20 @@
153 return p - list;
154 }
155
156+static void _dl_setup_progname(const char *argv0)
157+{
158+ char image[PATH_MAX];
159+ ssize_t s;
160+
161+ s = _dl_readlink("/proc/self/exe", image, sizeof(image));
162+ if (s > 0 && image[0] == '/') {
163+ image[s] = 0;
164+ _dl_progname = _dl_strdup(image);
165+ } else if (argv0) {
166+ _dl_progname = argv0;
167+ }
168+}
169+
170 void *_dl_get_ready_to_run(struct elf_resolve *tpnt, DL_LOADADDR_TYPE load_addr,
171 ElfW(auxv_t) auxvt[AT_EGID + 1], char **envp, char **argv
172 DL_GET_READY_TO_RUN_EXTRA_PARMS)
173@@ -421,9 +435,7 @@
174 * been fixed up by now. Still no function calls outside of this
175 * library, since the dynamic resolver is not yet ready.
176 */
177- if (argv[0]) {
178- _dl_progname = argv[0];
179- }
180+ _dl_setup_progname(argv[0]);
181
182 #ifndef __LDSO_STANDALONE_SUPPORT__
183 if (_start == (void *) auxvt[AT_ENTRY].a_un.a_val) {
diff --git a/meta/recipes-core/uclibc/uclibc-git/powerpc_copysignl.patch b/meta/recipes-core/uclibc/uclibc-git/powerpc_copysignl.patch
index 339ce7f5cb..3fa10af4db 100644
--- a/meta/recipes-core/uclibc/uclibc-git/powerpc_copysignl.patch
+++ b/meta/recipes-core/uclibc/uclibc-git/powerpc_copysignl.patch
@@ -1,3 +1,9 @@
1Add ppc copysignl implementation
2
3Upstream-Status: Pending
4
5Signed-off-by: Khem Raj <raj.khem@gmail.com>
6
1Index: git/libc/sysdeps/linux/powerpc/Makefile.arch 7Index: git/libc/sysdeps/linux/powerpc/Makefile.arch
2=================================================================== 8===================================================================
3--- git.orig/libc/sysdeps/linux/powerpc/Makefile.arch 9--- git.orig/libc/sysdeps/linux/powerpc/Makefile.arch
diff --git a/meta/recipes-core/uclibc/uclibc-git/remove_attribute_optimize_Os.patch b/meta/recipes-core/uclibc/uclibc-git/remove_attribute_optimize_Os.patch
index 1930383260..90fd3db5c2 100644
--- a/meta/recipes-core/uclibc/uclibc-git/remove_attribute_optimize_Os.patch
+++ b/meta/recipes-core/uclibc/uclibc-git/remove_attribute_optimize_Os.patch
@@ -1,3 +1,8 @@
1Dont support localised optimizations this helps to have a global -O level
2
3Signed-off-by: Khem Raj <raj.khem@gmail.com>
4Upstream-Status: Pending
5
1Index: git/include/features.h 6Index: git/include/features.h
2=================================================================== 7===================================================================
3--- git.orig/include/features.h 8--- git.orig/include/features.h
diff --git a/meta/recipes-core/uclibc/uclibc-git/rtld_no.patch b/meta/recipes-core/uclibc/uclibc-git/rtld_no.patch
deleted file mode 100644
index 36fec651fe..0000000000
--- a/meta/recipes-core/uclibc/uclibc-git/rtld_no.patch
+++ /dev/null
@@ -1,216 +0,0 @@
1Patch is backported from
2http://lists.busybox.net/pipermail/uclibc/2011-March/045004.html
3
4Upstream-Status: Pending
5
6Index: git/ldso/include/dl-elf.h
7===================================================================
8--- git.orig/ldso/include/dl-elf.h 2011-07-01 15:20:51.000000000 -0700
9+++ git/ldso/include/dl-elf.h 2011-07-01 15:30:43.274364603 -0700
10@@ -26,16 +26,18 @@
11 static __inline__ void _dl_unmap_cache(void) { }
12 #endif
13
14+#define DL_RESOLVE_SECURE 0x0001
15+#define DL_RESOLVE_NOLOAD 0x0002
16
17 /* Function prototypes for non-static stuff in readelflib1.c */
18 extern void _dl_parse_lazy_relocation_information(struct dyn_elf *rpnt,
19 unsigned long rel_addr, unsigned long rel_size);
20 extern int _dl_parse_relocation_information(struct dyn_elf *rpnt,
21 struct r_scope_elem *scope, unsigned long rel_addr, unsigned long rel_size);
22-extern struct elf_resolve * _dl_load_shared_library(int secure,
23+extern struct elf_resolve * _dl_load_shared_library(int resolve_flags,
24 struct dyn_elf **rpnt, struct elf_resolve *tpnt, char *full_libname,
25 int trace_loaded_objects);
26-extern struct elf_resolve * _dl_load_elf_shared_library(int secure,
27+extern struct elf_resolve * _dl_load_elf_shared_library(int resolve_flags,
28 struct dyn_elf **rpnt, const char *libname);
29 extern struct elf_resolve *_dl_check_if_named_library_is_loaded(const char *full_libname,
30 int trace_loaded_objects);
31Index: git/ldso/ldso/dl-elf.c
32===================================================================
33--- git.orig/ldso/ldso/dl-elf.c 2011-07-01 15:21:47.000000000 -0700
34+++ git/ldso/ldso/dl-elf.c 2011-07-01 15:31:29.814432859 -0700
35@@ -132,7 +132,7 @@
36 /* This function's behavior must exactly match that
37 * in uClibc/ldso/util/ldd.c */
38 static struct elf_resolve *
39-search_for_named_library(const char *name, int secure, const char *path_list,
40+search_for_named_library(const char *name, int resolve_flags, const char *path_list,
41 struct dyn_elf **rpnt, const char *origin)
42 {
43 char *mylibname;
44@@ -162,7 +162,7 @@
45
46 if (plen >= 7 && _dl_memcmp(p, "$ORIGIN", 7) == 0) {
47 int olen;
48- if (secure && plen != 7)
49+ if ((resolve_flags & DL_RESOLVE_SECURE) && plen != 7)
50 continue;
51 if (origin == NULL)
52 continue;
53@@ -182,7 +182,7 @@
54 _dl_strcat(mylibname, "/");
55 _dl_strcat(mylibname, name);
56
57- tpnt = _dl_load_elf_shared_library(secure, rpnt, mylibname);
58+ tpnt = _dl_load_elf_shared_library(resolve_flags, rpnt, mylibname);
59 if (tpnt != NULL)
60 return tpnt;
61 }
62@@ -194,7 +194,7 @@
63 unsigned long _dl_error_number;
64 unsigned long _dl_internal_error_number;
65
66-struct elf_resolve *_dl_load_shared_library(int secure, struct dyn_elf **rpnt,
67+struct elf_resolve *_dl_load_shared_library(int resolve_flags, struct dyn_elf **rpnt,
68 struct elf_resolve *tpnt, char *full_libname, int attribute_unused trace_loaded_objects)
69 {
70 char *pnt;
71@@ -223,7 +223,7 @@
72
73 if (libname != full_libname) {
74 _dl_if_debug_dprint("\ttrying file='%s'\n", full_libname);
75- tpnt1 = _dl_load_elf_shared_library(secure, rpnt, full_libname);
76+ tpnt1 = _dl_load_elf_shared_library(resolve_flags, rpnt, full_libname);
77 if (tpnt1) {
78 return tpnt1;
79 }
80@@ -238,7 +238,7 @@
81 if (pnt) {
82 pnt += (unsigned long) tpnt->dynamic_info[DT_STRTAB];
83 _dl_if_debug_dprint("\tsearching RPATH='%s'\n", pnt);
84- if ((tpnt1 = search_for_named_library(libname, secure, pnt, rpnt,
85+ if ((tpnt1 = search_for_named_library(libname, resolve_flags, pnt, rpnt,
86 tpnt->libname)) != NULL)
87 return tpnt1;
88 }
89@@ -247,7 +247,7 @@
90 /* Check in LD_{ELF_}LIBRARY_PATH, if specified and allowed */
91 if (_dl_library_path) {
92 _dl_if_debug_dprint("\tsearching LD_LIBRARY_PATH='%s'\n", _dl_library_path);
93- if ((tpnt1 = search_for_named_library(libname, secure, _dl_library_path, rpnt, NULL)) != NULL)
94+ if ((tpnt1 = search_for_named_library(libname, resolve_flags, _dl_library_path, rpnt, NULL)) != NULL)
95 {
96 return tpnt1;
97 }
98@@ -261,7 +261,7 @@
99 if (pnt) {
100 pnt += (unsigned long) tpnt->dynamic_info[DT_STRTAB];
101 _dl_if_debug_dprint("\tsearching RUNPATH='%s'\n", pnt);
102- if ((tpnt1 = search_for_named_library(libname, secure, pnt, rpnt, NULL)) != NULL)
103+ if ((tpnt1 = search_for_named_library(libname, resolve_flags, pnt, rpnt, NULL)) != NULL)
104 return tpnt1;
105 }
106 #endif
107@@ -284,7 +284,7 @@
108 || libent[i].flags == LIB_ELF_LIBC0
109 || libent[i].flags == LIB_ELF_LIBC5)
110 && _dl_strcmp(libname, strs + libent[i].sooffset) == 0
111- && (tpnt1 = _dl_load_elf_shared_library(secure, rpnt, strs + libent[i].liboffset))
112+ && (tpnt1 = _dl_load_elf_shared_library(resolve_flags, rpnt, strs + libent[i].liboffset))
113 ) {
114 return tpnt1;
115 }
116@@ -295,14 +295,14 @@
117 /* Look for libraries wherever the shared library loader
118 * was installed */
119 _dl_if_debug_dprint("\tsearching ldso dir='%s'\n", _dl_ldsopath);
120- tpnt1 = search_for_named_library(libname, secure, _dl_ldsopath, rpnt, NULL);
121+ tpnt1 = search_for_named_library(libname, resolve_flags, _dl_ldsopath, rpnt, NULL);
122 if (tpnt1 != NULL)
123 return tpnt1;
124
125 /* Lastly, search the standard list of paths for the library.
126 This list must exactly match the list in uClibc/ldso/util/ldd.c */
127 _dl_if_debug_dprint("\tsearching full lib path list\n");
128- tpnt1 = search_for_named_library(libname, secure,
129+ tpnt1 = search_for_named_library(libname, resolve_flags,
130 UCLIBC_RUNTIME_PREFIX "lib:"
131 UCLIBC_RUNTIME_PREFIX "usr/lib"
132 #ifndef __LDSO_CACHE_SUPPORT__
133@@ -444,7 +444,7 @@
134 * are required.
135 */
136
137-struct elf_resolve *_dl_load_elf_shared_library(int secure,
138+struct elf_resolve *_dl_load_elf_shared_library(int resolve_flags,
139 struct dyn_elf **rpnt, const char *libname)
140 {
141 ElfW(Ehdr) *epnt;
142@@ -483,7 +483,7 @@
143 }
144 /* If we are in secure mode (i.e. a setu/gid binary using LD_PRELOAD),
145 we don't load the library if it isn't setuid. */
146- if (secure) {
147+ if (resolve_flags & DL_RESOLVE_SECURE) {
148 if (!(st.st_mode & S_ISUID)) {
149 _dl_close(infile);
150 return NULL;
151@@ -499,6 +499,10 @@
152 return tpnt;
153 }
154 }
155+ if (resolve_flags & DL_RESOLVE_NOLOAD) {
156+ _dl_close(infile);
157+ return NULL;
158+ }
159 header = _dl_mmap((void *) 0, _dl_pagesize, PROT_READ | PROT_WRITE,
160 MAP_PRIVATE | MAP_ANONYMOUS | MAP_UNINITIALIZE, -1, 0);
161 if (_dl_mmap_check_error(header)) {
162Index: git/ldso/ldso/ldso.c
163===================================================================
164--- git.orig/ldso/ldso/ldso.c 2011-07-01 15:24:32.000000000 -0700
165+++ git/ldso/ldso/ldso.c 2011-07-01 15:24:55.143854007 -0700
166@@ -854,7 +854,9 @@
167 if (!_dl_secure || _dl_strchr(str, '/') == NULL) {
168 _dl_if_debug_dprint("\tfile='%s'; needed by '%s'\n", str, _dl_progname);
169
170- tpnt1 = _dl_load_shared_library(_dl_secure, &rpnt, NULL, str, trace_loaded_objects);
171+ tpnt1 = _dl_load_shared_library(
172+ _dl_secure ? DL_RESOLVE_SECURE : 0,
173+ &rpnt, NULL, str, trace_loaded_objects);
174 if (!tpnt1) {
175 #ifdef __LDSO_LDD_SUPPORT__
176 if (trace_loaded_objects || _dl_trace_prelink)
177Index: git/ldso/libdl/libdl.c
178===================================================================
179--- git.orig/ldso/libdl/libdl.c 2011-07-01 15:20:51.000000000 -0700
180+++ git/ldso/libdl/libdl.c 2011-07-01 15:24:55.143854007 -0700
181@@ -305,7 +305,7 @@
182 #endif
183
184 /* A bit of sanity checking... */
185- if (!(flag & (RTLD_LAZY|RTLD_NOW))) {
186+ if (!(flag & (RTLD_LAZY|RTLD_NOW|RTLD_NOLOAD))) {
187 _dl_error_number = LD_BAD_HANDLE;
188 return NULL;
189 }
190@@ -375,8 +375,9 @@
191 /* Try to load the specified library */
192 _dl_if_debug_print("Trying to dlopen '%s', RTLD_GLOBAL:%d RTLD_NOW:%d\n",
193 (char*)libname, (flag & RTLD_GLOBAL ? 1:0), (now_flag & RTLD_NOW ? 1:0));
194- tpnt = _dl_load_shared_library(0, &rpnt, tfrom, (char*)libname, 0);
195
196+ tpnt = _dl_load_shared_library((flag & RTLD_NOLOAD) ? DL_RESOLVE_NOLOAD : 0,
197+ &rpnt, tfrom, (char*)libname, 0);
198 if (tpnt == NULL) {
199 _dl_unmap_cache();
200 return NULL;
201Index: git/libc/sysdeps/linux/common/bits/dlfcn.h
202===================================================================
203--- git.orig/libc/sysdeps/linux/common/bits/dlfcn.h 2011-07-01 15:20:52.000000000 -0700
204+++ git/libc/sysdeps/linux/common/bits/dlfcn.h 2011-07-01 15:24:55.143854007 -0700
205@@ -24,9 +24,9 @@
206 /* The MODE argument to `dlopen' contains one of the following: */
207 #define RTLD_LAZY 0x00001 /* Lazy function call binding. */
208 #define RTLD_NOW 0x00002 /* Immediate function call binding. */
209-#if 0 /* uClibc doesnt support these */
210-#define RTLD_BINDING_MASK 0x3 /* Mask of binding time value. */
211+#define RTLD_BINDING_MASK 0x3 /* Mask of binding time value. */
212 #define RTLD_NOLOAD 0x00004 /* Do not load the object. */
213+#if 0 /* uClibc doesnt support these */
214 #define RTLD_DEEPBIND 0x00008 /* Use deep binding. */
215 #endif
216
diff --git a/meta/recipes-core/uclibc/uclibc-git/uClibc.distro b/meta/recipes-core/uclibc/uclibc-git/uClibc.distro
index 9b2a0e5fae..3948d1a071 100644
--- a/meta/recipes-core/uclibc/uclibc-git/uClibc.distro
+++ b/meta/recipes-core/uclibc/uclibc-git/uClibc.distro
@@ -181,3 +181,5 @@ UCLIBC_HAS_FLOATS=y
181 181
182# needed by systemd 182# needed by systemd
183UCLIBC_HAS_UTMPX=y 183UCLIBC_HAS_UTMPX=y
184UCLIBC_LINUX_MODULE_26=y
185UCLIBC_HAS_RESOLVER_SUPPORT=y
diff --git a/meta/recipes-core/uclibc/uclibc-git/uclibc-arm-ftruncate64.patch b/meta/recipes-core/uclibc/uclibc-git/uclibc-arm-ftruncate64.patch
index 504d37bcd2..05a394d84b 100644
--- a/meta/recipes-core/uclibc/uclibc-git/uclibc-arm-ftruncate64.patch
+++ b/meta/recipes-core/uclibc/uclibc-git/uclibc-arm-ftruncate64.patch
@@ -1,3 +1,8 @@
1ftruncate64 has 4 args on arm
2
3Signed-off-by: Khem Raj <raj.khem@gmail.com>
4Upstream-Status: Pending
5
1Index: uclibc-0.9.29/libc/sysdeps/linux/arm/bits/uClibc_arch_features.h 6Index: uclibc-0.9.29/libc/sysdeps/linux/arm/bits/uClibc_arch_features.h
2=================================================================== 7===================================================================
3--- uclibc-0.9.29.orig/libc/sysdeps/linux/arm/bits/uClibc_arch_features.h 8--- uclibc-0.9.29.orig/libc/sysdeps/linux/arm/bits/uClibc_arch_features.h
diff --git a/meta/recipes-core/uclibc/uclibc-git/uclibc-execvpe.patch b/meta/recipes-core/uclibc/uclibc-git/uclibc-execvpe.patch
index cd90a09205..fe191fc496 100644
--- a/meta/recipes-core/uclibc/uclibc-git/uclibc-execvpe.patch
+++ b/meta/recipes-core/uclibc/uclibc-git/uclibc-execvpe.patch
@@ -12,6 +12,9 @@ Signed-off-by: Henning Heinold <heinold@inf.fu-berlin.de>
12 3 files changed, 46 insertions(+), 5 deletions(-) 12 3 files changed, 46 insertions(+), 5 deletions(-)
13 create mode 100644 libc/unistd/execvpe.c 13 create mode 100644 libc/unistd/execvpe.c
14 14
15
16Upstream-Status: Pending
17
15diff --git a/include/unistd.h b/include/unistd.h 18diff --git a/include/unistd.h b/include/unistd.h
16index 9568790..070e4f2 100644 19index 9568790..070e4f2 100644
17--- a/include/unistd.h 20--- a/include/unistd.h
diff --git a/meta/recipes-core/uclibc/uclibc-git/uclibc_enable_log2_test.patch b/meta/recipes-core/uclibc/uclibc-git/uclibc_enable_log2_test.patch
index f8f3a7d1aa..37a59884b8 100644
--- a/meta/recipes-core/uclibc/uclibc-git/uclibc_enable_log2_test.patch
+++ b/meta/recipes-core/uclibc/uclibc-git/uclibc_enable_log2_test.patch
@@ -1,3 +1,8 @@
1uclibc now has log2 so enable the tests
2
3Signed-off-by: Khem Raj <raj.khem@gmail.com>
4Upstream-Status: Pending
5
1Index: uClibc/test/math/libm-test.inc 6Index: uClibc/test/math/libm-test.inc
2=================================================================== 7===================================================================
3--- uClibc/test/math/libm-test.inc (revision 23784) 8--- uClibc/test/math/libm-test.inc (revision 23784)
diff --git a/meta/recipes-core/uclibc/uclibc-git/uclibc_scheduler_update.patch b/meta/recipes-core/uclibc/uclibc-git/uclibc_scheduler_update.patch
deleted file mode 100644
index 78401bd2ad..0000000000
--- a/meta/recipes-core/uclibc/uclibc-git/uclibc_scheduler_update.patch
+++ /dev/null
@@ -1,455 +0,0 @@
1From 2becc16ecbef71c496644d9dc6cbd7383d7cdca3 Mon Sep 17 00:00:00 2001
2From: Henning Heinold <heinold@inf.fu-berlin.de>
3Date: Sat, 4 Jun 2011 21:21:41 +0200
4Subject: [PATCH 1/2] libc: updates the linux scheduler functions, most stuff
5 was taken from the eglibc
6
7
8Signed-off-by: Henning Heinold <heinold@inf.fu-berlin.de>
9---
10 include/sched.h | 52 ++++++++++++----
11 libc/sysdeps/linux/common/Makefile.in | 4 +-
12 libc/sysdeps/linux/common/bits/sched.h | 96 +++++++++++++++++++++++-----
13 libc/sysdeps/linux/common/sched_cpualloc.c | 27 ++++++++
14 libc/sysdeps/linux/common/sched_cpucount.c | 60 +++++++++++++++++
15 libc/sysdeps/linux/common/sched_cpufree.c | 27 ++++++++
16 libc/sysdeps/linux/common/sched_getcpu.c | 37 +++++++++++
17 libc/sysdeps/linux/common/unshare.c | 12 ++++
18 8 files changed, 286 insertions(+), 29 deletions(-)
19 create mode 100644 libc/sysdeps/linux/common/sched_cpualloc.c
20 create mode 100644 libc/sysdeps/linux/common/sched_cpucount.c
21 create mode 100644 libc/sysdeps/linux/common/sched_cpufree.c
22 create mode 100644 libc/sysdeps/linux/common/sched_getcpu.c
23 create mode 100644 libc/sysdeps/linux/common/unshare.c
24
25diff --git a/include/sched.h b/include/sched.h
26index 0d110c3..e265b84 100644
27--- a/include/sched.h
28+++ b/include/sched.h
29@@ -1,5 +1,5 @@
30 /* Definitions for POSIX 1003.1b-1993 (aka POSIX.4) scheduling interface.
31- Copyright (C) 1996,1997,1999,2001-2003,2004 Free Software Foundation, Inc.
32+ Copyright (C) 1996,1997,1999,2001-2004,2007 Free Software Foundation, Inc.
33 This file is part of the GNU C Library.
34
35 The GNU C Library is free software; you can redistribute it and/or
36@@ -25,6 +25,9 @@
37 /* Get type definitions. */
38 #include <bits/types.h>
39
40+#define __need_size_t
41+#include <stddef.h>
42+
43 #define __need_timespec
44 #include <time.h>
45
46@@ -65,11 +68,42 @@ extern int sched_rr_get_interval (__pid_t __pid, struct timespec *__t) __THROW;
47
48 #if defined __USE_GNU && defined __UCLIBC_LINUX_SPECIFIC__
49 /* Access macros for `cpu_set'. */
50-#define CPU_SETSIZE __CPU_SETSIZE
51-#define CPU_SET(cpu, cpusetp) __CPU_SET (cpu, cpusetp)
52-#define CPU_CLR(cpu, cpusetp) __CPU_CLR (cpu, cpusetp)
53-#define CPU_ISSET(cpu, cpusetp) __CPU_ISSET (cpu, cpusetp)
54-#define CPU_ZERO(cpusetp) __CPU_ZERO (cpusetp)
55+# define CPU_SETSIZE __CPU_SETSIZE
56+# define CPU_SET(cpu, cpusetp) __CPU_SET_S (cpu, sizeof (cpu_set_t), cpusetp)
57+# define CPU_CLR(cpu, cpusetp) __CPU_CLR_S (cpu, sizeof (cpu_set_t), cpusetp)
58+# define CPU_ISSET(cpu, cpusetp) __CPU_ISSET_S (cpu, sizeof (cpu_set_t), \
59+ cpusetp)
60+# define CPU_ZERO(cpusetp) __CPU_ZERO_S (sizeof (cpu_set_t), cpusetp)
61+# define CPU_COUNT(cpusetp) __CPU_COUNT_S (sizeof (cpu_set_t), cpusetp)
62+
63+# define CPU_SET_S(cpu, setsize, cpusetp) __CPU_SET_S (cpu, setsize, cpusetp)
64+# define CPU_CLR_S(cpu, setsize, cpusetp) __CPU_CLR_S (cpu, setsize, cpusetp)
65+# define CPU_ISSET_S(cpu, setsize, cpusetp) __CPU_ISSET_S (cpu, setsize, \
66+ cpusetp)
67+# define CPU_ZERO_S(setsize, cpusetp) __CPU_ZERO_S (setsize, cpusetp)
68+# define CPU_COUNT_S(setsize, cpusetp) __CPU_COUNT_S (setsize, cpusetp)
69+
70+# define CPU_EQUAL(cpusetp1, cpusetp2) \
71+ __CPU_EQUAL_S (sizeof (cpu_set_t), cpusetp1, cpusetp2)
72+# define CPU_EQUAL_S(setsize, cpusetp1, cpusetp2) \
73+ __CPU_EQUAL_S (setsize, cpusetp1, cpusetp2)
74+
75+# define CPU_AND(destset, srcset1, srcset2) \
76+ __CPU_OP_S (sizeof (cpu_set_t), destset, srcset1, srcset2, &)
77+# define CPU_OR(destset, srcset1, srcset2) \
78+ __CPU_OP_S (sizeof (cpu_set_t), destset, srcset1, srcset2, |)
79+# define CPU_XOR(destset, srcset1, srcset2) \
80+ __CPU_OP_S (sizeof (cpu_set_t), destset, srcset1, srcset2, ^)
81+# define CPU_AND_S(setsize, destset, srcset1, srcset2) \
82+ __CPU_OP_S (setsize, destset, srcset1, srcset2, &)
83+# define CPU_OR_S(setsize, destset, srcset1, srcset2) \
84+ __CPU_OP_S (setsize, destset, srcset1, srcset2, |)
85+# define CPU_XOR_S(setsize, destset, srcset1, srcset2) \
86+ __CPU_OP_S (setsize, destset, srcset1, srcset2, ^)
87+
88+# define CPU_ALLOC_SIZE(count) __CPU_ALLOC_SIZE (count)
89+# define CPU_ALLOC(count) __CPU_ALLOC (count)
90+# define CPU_FREE(cpuset) __CPU_FREE (cpuset)
91
92
93 /* Set the CPU affinity for a task */
94@@ -79,12 +113,6 @@ extern int sched_setaffinity (__pid_t __pid, size_t __cpusetsize,
95 /* Get the CPU affinity for a task */
96 extern int sched_getaffinity (__pid_t __pid, size_t __cpusetsize,
97 cpu_set_t *__cpuset) __THROW;
98-
99-extern int __clone (int (*__fn) (void *__arg), void *__child_stack,
100- int __flags, void *__arg, ...);
101-extern int __clone2 (int (*__fn) (void *__arg), void *__child_stack_base,
102- size_t __child_stack_size, int __flags, void *__arg, ...);
103-
104 #endif
105
106 __END_DECLS
107diff --git a/libc/sysdeps/linux/common/Makefile.in b/libc/sysdeps/linux/common/Makefile.in
108index 8f936ff..cb8c153 100644
109--- a/libc/sysdeps/linux/common/Makefile.in
110+++ b/libc/sysdeps/linux/common/Makefile.in
111@@ -22,9 +22,11 @@ CSRC-$(UCLIBC_LINUX_SPECIFIC) += capget.c capset.c inotify.c ioperm.c iopl.c \
112 modify_ldt.c pipe2.c personality.c ppoll.c prctl.c \
113 readahead.c reboot.c \
114 remap_file_pages.c sched_getaffinity.c sched_setaffinity.c \
115+ sched_cpualloc.c sched_cpucount.c sched_cpufree.c \
116 sendfile64.c sendfile.c setfsgid.c setfsuid.c setresuid.c \
117 splice.c vmsplice.c tee.c signalfd.c swapoff.c swapon.c \
118- sync_file_range.c sysctl.c sysinfo.c timerfd.c uselib.c vhangup.c
119+ sync_file_range.c sysctl.c sysinfo.c timerfd.c unshare.c \
120+ uselib.c vhangup.c
121 # NPTL needs these internally: madvise.c
122 CSRC-$(findstring y,$(UCLIBC_LINUX_SPECIFIC)$(UCLIBC_HAS_THREADS_NATIVE)) += madvise.c
123 ifeq ($(UCLIBC_HAS_THREADS_NATIVE),y)
124diff --git a/libc/sysdeps/linux/common/bits/sched.h b/libc/sysdeps/linux/common/bits/sched.h
125index b48a0c8..fea66a8 100644
126--- a/libc/sysdeps/linux/common/bits/sched.h
127+++ b/libc/sysdeps/linux/common/bits/sched.h
128@@ -1,6 +1,7 @@
129 /* Definitions of constants and data structure for POSIX 1003.1b-1993
130 scheduling interface.
131- Copyright (C) 1996-1999,2001-2003,2005,2006 Free Software Foundation, Inc.
132+ Copyright (C) 1996-1999,2001-2003,2005,2006,2007,2008
133+ Free Software Foundation, Inc.
134 This file is part of the GNU C Library.
135
136 The GNU C Library is free software; you can redistribute it and/or
137@@ -58,7 +59,13 @@
138 force CLONE_PTRACE on this clone. */
139 # define CLONE_CHILD_SETTID 0x01000000 /* Store TID in userlevel buffer in
140 the child. */
141-# define CLONE_STOPPED 0x02000000 /* Start in stopped state. */
142+# define CLONE_STOPPED 0x02000000 /* Start in stopped state. */
143+# define CLONE_NEWUTS 0x04000000 /* New utsname group. */
144+# define CLONE_NEWIPC 0x08000000 /* New ipcs. */
145+# define CLONE_NEWUSER 0x10000000 /* New user namespace. */
146+# define CLONE_NEWPID 0x20000000 /* New pid namespace. */
147+# define CLONE_NEWNET 0x40000000 /* New network namespace. */
148+# define CLONE_IO 0x80000000 /* Clone I/O context. */
149 #endif
150
151 /* The official definition. */
152@@ -74,10 +81,11 @@ __BEGIN_DECLS
153 extern int clone (int (*__fn) (void *__arg), void *__child_stack,
154 int __flags, void *__arg, ...) __THROW;
155
156-#if 0
157 /* Unshare the specified resources. */
158 extern int unshare (int __flags) __THROW;
159-#endif
160+
161+/* Get index of currently used CPU. */
162+extern int sched_getcpu (void) __THROW;
163 #endif
164
165 __END_DECLS
166@@ -102,7 +110,7 @@ struct __sched_param
167 # define __CPU_SETSIZE 1024
168 # define __NCPUBITS (8 * sizeof (__cpu_mask))
169
170-/* Type for array elements in 'cpu_set'. */
171+/* Type for array elements in 'cpu_set_t'. */
172 typedef unsigned long int __cpu_mask;
173
174 /* Basic access functions. */
175@@ -116,17 +124,73 @@ typedef struct
176 } cpu_set_t;
177
178 /* Access functions for CPU masks. */
179-# define __CPU_ZERO(cpusetp) \
180+# define __CPU_ZERO_S(setsize, cpusetp) \
181 do { \
182- unsigned int __i; \
183- cpu_set_t *__arr = (cpusetp); \
184- for (__i = 0; __i < sizeof (cpu_set_t) / sizeof (__cpu_mask); ++__i) \
185- __arr->__bits[__i] = 0; \
186+ size_t __i; \
187+ size_t __imax = (setsize) / sizeof (__cpu_mask); \
188+ __cpu_mask *__bits = (cpusetp)->__bits; \
189+ for (__i = 0; __i < __imax; ++__i) \
190+ __bits[__i] = 0; \
191 } while (0)
192-# define __CPU_SET(cpu, cpusetp) \
193- ((cpusetp)->__bits[__CPUELT (cpu)] |= __CPUMASK (cpu))
194-# define __CPU_CLR(cpu, cpusetp) \
195- ((cpusetp)->__bits[__CPUELT (cpu)] &= ~__CPUMASK (cpu))
196-# define __CPU_ISSET(cpu, cpusetp) \
197- (((cpusetp)->__bits[__CPUELT (cpu)] & __CPUMASK (cpu)) != 0)
198+# define __CPU_SET_S(cpu, setsize, cpusetp) \
199+ (__extension__ \
200+ ({ size_t __cpu = (cpu); \
201+ __cpu < 8 * (setsize) \
202+ ? (((__cpu_mask *) ((cpusetp)->__bits))[__CPUELT (__cpu)] \
203+ |= __CPUMASK (__cpu)) \
204+ : 0; }))
205+# define __CPU_CLR_S(cpu, setsize, cpusetp) \
206+ (__extension__ \
207+ ({ size_t __cpu = (cpu); \
208+ __cpu < 8 * (setsize) \
209+ ? (((__cpu_mask *) ((cpusetp)->__bits))[__CPUELT (__cpu)] \
210+ &= ~__CPUMASK (__cpu)) \
211+ : 0; }))
212+# define __CPU_ISSET_S(cpu, setsize, cpusetp) \
213+ (__extension__ \
214+ ({ size_t __cpu = (cpu); \
215+ __cpu < 8 * (setsize) \
216+ ? ((((__cpu_mask *) ((cpusetp)->__bits))[__CPUELT (__cpu)] \
217+ & __CPUMASK (__cpu))) != 0 \
218+ : 0; }))
219+
220+# define __CPU_COUNT_S(setsize, cpusetp) \
221+ __sched_cpucount (setsize, cpusetp)
222+
223+# define __CPU_EQUAL_S(setsize, cpusetp1, cpusetp2) \
224+ (__extension__ \
225+ ({ __cpu_mask *__arr1 = (cpusetp1)->__bits; \
226+ __cpu_mask *__arr2 = (cpusetp2)->__bits; \
227+ size_t __imax = (setsize) / sizeof (__cpu_mask); \
228+ size_t __i; \
229+ for (__i = 0; __i < __imax; ++__i) \
230+ if (__arr1[__i] != __arr2[__i]) \
231+ break; \
232+ __i == __imax; }))
233+
234+# define __CPU_OP_S(setsize, destset, srcset1, srcset2, op) \
235+ (__extension__ \
236+ ({ cpu_set_t *__dest = (destset); \
237+ __cpu_mask *__arr1 = (srcset1)->__bits; \
238+ __cpu_mask *__arr2 = (srcset2)->__bits; \
239+ size_t __imax = (setsize) / sizeof (__cpu_mask); \
240+ size_t __i; \
241+ for (__i = 0; __i < __imax; ++__i) \
242+ ((__cpu_mask *) __dest->__bits)[__i] = __arr1[__i] op __arr2[__i]; \
243+ __dest; }))
244+
245+# define __CPU_ALLOC_SIZE(count) \
246+ ((((count) + __NCPUBITS - 1) / __NCPUBITS) * sizeof (__cpu_mask))
247+# define __CPU_ALLOC(count) __sched_cpualloc (count)
248+# define __CPU_FREE(cpuset) __sched_cpufree (cpuset)
249+
250+__BEGIN_DECLS
251+
252+extern int __sched_cpucount (size_t __setsize, const cpu_set_t *__setp)
253+ __THROW;
254+extern cpu_set_t *__sched_cpualloc (size_t __count) __THROW __wur;
255+extern void __sched_cpufree (cpu_set_t *__set) __THROW;
256+
257+__END_DECLS
258+
259 #endif
260diff --git a/libc/sysdeps/linux/common/sched_cpualloc.c b/libc/sysdeps/linux/common/sched_cpualloc.c
261new file mode 100644
262index 0000000..2642a80
263--- /dev/null
264+++ b/libc/sysdeps/linux/common/sched_cpualloc.c
265@@ -0,0 +1,27 @@
266+/* Copyright (C) 2007 Free Software Foundation, Inc.
267+ This file is part of the GNU C Library.
268+
269+ The GNU C Library is free software; you can redistribute it and/or
270+ modify it under the terms of the GNU Lesser General Public
271+ License as published by the Free Software Foundation; either
272+ version 2.1 of the License, or (at your option) any later version.
273+
274+ The GNU C Library is distributed in the hope that it will be useful,
275+ but WITHOUT ANY WARRANTY; without even the implied warranty of
276+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
277+ Lesser General Public License for more details.
278+
279+ You should have received a copy of the GNU Lesser General Public
280+ License along with the GNU C Library; if not, write to the Free
281+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
282+ 02111-1307 USA. */
283+
284+#include <sched.h>
285+#include <stdlib.h>
286+
287+
288+cpu_set_t *
289+__sched_cpualloc (size_t count)
290+{
291+ return malloc (CPU_ALLOC_SIZE (count));
292+}
293diff --git a/libc/sysdeps/linux/common/sched_cpucount.c b/libc/sysdeps/linux/common/sched_cpucount.c
294new file mode 100644
295index 0000000..331c0b8
296--- /dev/null
297+++ b/libc/sysdeps/linux/common/sched_cpucount.c
298@@ -0,0 +1,60 @@
299+/* Copyright (C) 2007 Free Software Foundation, Inc.
300+ This file is part of the GNU C Library.
301+
302+ The GNU C Library is free software; you can redistribute it and/or
303+ modify it under the terms of the GNU Lesser General Public
304+ License as published by the Free Software Foundation; either
305+ version 2.1 of the License, or (at your option) any later version.
306+
307+ The GNU C Library is distributed in the hope that it will be useful,
308+ but WITHOUT ANY WARRANTY; without even the implied warranty of
309+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
310+ Lesser General Public License for more details.
311+
312+ You should have received a copy of the GNU Lesser General Public
313+ License along with the GNU C Library; if not, write to the Free
314+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
315+ 02111-1307 USA. */
316+
317+#include <limits.h>
318+#include <sched.h>
319+
320+
321+int
322+__sched_cpucount (size_t setsize, const cpu_set_t *setp)
323+{
324+ int s = 0;
325+ const __cpu_mask *p = setp->__bits;
326+ const __cpu_mask *end = &setp->__bits[setsize / sizeof (__cpu_mask)];
327+
328+ while (p < end)
329+ {
330+ __cpu_mask l = *p++;
331+
332+#ifdef POPCNT
333+ s += POPCNT (l);
334+#else
335+ if (l == 0)
336+ continue;
337+
338+# if LONG_BIT > 32
339+ l = (l & 0x5555555555555555ul) + ((l >> 1) & 0x5555555555555555ul);
340+ l = (l & 0x3333333333333333ul) + ((l >> 2) & 0x3333333333333333ul);
341+ l = (l & 0x0f0f0f0f0f0f0f0ful) + ((l >> 4) & 0x0f0f0f0f0f0f0f0ful);
342+ l = (l & 0x00ff00ff00ff00fful) + ((l >> 8) & 0x00ff00ff00ff00fful);
343+ l = (l & 0x0000ffff0000fffful) + ((l >> 16) & 0x0000ffff0000fffful);
344+ l = (l & 0x00000000fffffffful) + ((l >> 32) & 0x00000000fffffffful);
345+# else
346+ l = (l & 0x55555555ul) + ((l >> 1) & 0x55555555ul);
347+ l = (l & 0x33333333ul) + ((l >> 2) & 0x33333333ul);
348+ l = (l & 0x0f0f0f0ful) + ((l >> 4) & 0x0f0f0f0ful);
349+ l = (l & 0x00ff00fful) + ((l >> 8) & 0x00ff00fful);
350+ l = (l & 0x0000fffful) + ((l >> 16) & 0x0000fffful);
351+# endif
352+
353+ s += l;
354+#endif
355+ }
356+
357+ return s;
358+}
359diff --git a/libc/sysdeps/linux/common/sched_cpufree.c b/libc/sysdeps/linux/common/sched_cpufree.c
360new file mode 100644
361index 0000000..dd4c613
362--- /dev/null
363+++ b/libc/sysdeps/linux/common/sched_cpufree.c
364@@ -0,0 +1,27 @@
365+/* Copyright (C) 2007 Free Software Foundation, Inc.
366+ This file is part of the GNU C Library.
367+
368+ The GNU C Library is free software; you can redistribute it and/or
369+ modify it under the terms of the GNU Lesser General Public
370+ License as published by the Free Software Foundation; either
371+ version 2.1 of the License, or (at your option) any later version.
372+
373+ The GNU C Library is distributed in the hope that it will be useful,
374+ but WITHOUT ANY WARRANTY; without even the implied warranty of
375+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
376+ Lesser General Public License for more details.
377+
378+ You should have received a copy of the GNU Lesser General Public
379+ License along with the GNU C Library; if not, write to the Free
380+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
381+ 02111-1307 USA. */
382+
383+#include <sched.h>
384+#include <stdlib.h>
385+
386+
387+void
388+__sched_cpufree (cpu_set_t *set)
389+{
390+ free (set);
391+}
392diff --git a/libc/sysdeps/linux/common/sched_getcpu.c b/libc/sysdeps/linux/common/sched_getcpu.c
393new file mode 100644
394index 0000000..b193d65
395--- /dev/null
396+++ b/libc/sysdeps/linux/common/sched_getcpu.c
397@@ -0,0 +1,37 @@
398+/* Copyright (C) 2007 Free Software Foundation, Inc.
399+ This file is part of the GNU C Library.
400+
401+ The GNU C Library is free software; you can redistribute it and/or
402+ modify it under the terms of the GNU Lesser General Public
403+ License as published by the Free Software Foundation; either
404+ version 2.1 of the License, or (at your option) any later version.
405+
406+ The GNU C Library is distributed in the hope that it will be useful,
407+ but WITHOUT ANY WARRANTY; without even the implied warranty of
408+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
409+ Lesser General Public License for more details.
410+
411+ You should have received a copy of the GNU Lesser General Public
412+ License along with the GNU C Library; if not, write to the Free
413+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
414+ 02111-1307 USA. */
415+
416+#include <stdlib.h>
417+#include <errno.h>
418+#include <sched.h>
419+#include <sysdep.h>
420+
421+
422+int
423+sched_getcpu (void)
424+{
425+#ifdef __NR_getcpu
426+ unsigned int cpu;
427+ int r = INLINE_SYSCALL (getcpu, 3, &cpu, NULL, NULL);
428+
429+ return r == -1 ? r : cpu;
430+#else
431+ __set_errno (ENOSYS);
432+ return -1;
433+#endif
434+}
435diff --git a/libc/sysdeps/linux/common/unshare.c b/libc/sysdeps/linux/common/unshare.c
436new file mode 100644
437index 0000000..485bf88
438--- /dev/null
439+++ b/libc/sysdeps/linux/common/unshare.c
440@@ -0,0 +1,12 @@
441+/* vi: set sw=4 ts=4: */
442+/*
443+ * unshare() for uClibc
444+ *
445+ * Copyright (C) 2011 Henning Heinold <heinold@inf.fu-berlin.de>
446+ *
447+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
448+ */
449+
450+#include <sys/syscall.h>
451+#include <sched.h>
452+_syscall1(int, unshare, int, flags)
453--
4541.7.5.3
455
diff --git a/meta/recipes-core/uclibc/uclibc.inc b/meta/recipes-core/uclibc/uclibc.inc
index 92157bdb2a..077922197d 100644
--- a/meta/recipes-core/uclibc/uclibc.inc
+++ b/meta/recipes-core/uclibc/uclibc.inc
@@ -8,7 +8,7 @@ features, at the cost of ABI differences for different configurations. \
8uClibc has been designed from the ground up to be a C library for \ 8uClibc has been designed from the ground up to be a C library for \
9embedded Linux. It is NOT compatible with binaries linked against glibc." 9embedded Linux. It is NOT compatible with binaries linked against glibc."
10 10
11LICENSE = "LGPL" 11LICENSE = "LGPLv2.1+"
12SECTION = "libs" 12SECTION = "libs"
13LIC_FILES_CHKSUM = "file://COPYING.LIB;md5=a6f89e2100d9b6cdffcea4f398e37343 \ 13LIC_FILES_CHKSUM = "file://COPYING.LIB;md5=a6f89e2100d9b6cdffcea4f398e37343 \
14 file://COPYING.LIB.boilerplate;md5=aaddeadcddeb918297e0e4afc52ce46f \ 14 file://COPYING.LIB.boilerplate;md5=aaddeadcddeb918297e0e4afc52ce46f \
diff --git a/meta/recipes-core/uclibc/uclibc_git.bb b/meta/recipes-core/uclibc/uclibc_git.bb
index 8681233158..ee1b5e0cfc 100644
--- a/meta/recipes-core/uclibc/uclibc_git.bb
+++ b/meta/recipes-core/uclibc/uclibc_git.bb
@@ -1,4 +1,4 @@
1SRCREV="f87898ca4a7d4b7171779c06ff1f4848efeee431" 1SRCREV="a4421e60526d3420a9c0bd55bfa4a25a746cbc8e"
2 2
3require uclibc.inc 3require uclibc.inc
4 4
@@ -11,7 +11,7 @@ PROVIDES += "virtual/${TARGET_PREFIX}libc-for-gcc"
11 11
12FILESPATH = "${@base_set_filespath([ '${FILE_DIRNAME}/uclibc-git' ], d)}" 12FILESPATH = "${@base_set_filespath([ '${FILE_DIRNAME}/uclibc-git' ], d)}"
13 13
14SRC_URI = "git://uclibc.org/uClibc.git;branch=master;protocol=git \ 14SRC_URI = "git://busybox.osuosl.org/uClibc.git;branch=master;protocol=git \
15 file://uClibc.machine \ 15 file://uClibc.machine \
16 file://uClibc.distro \ 16 file://uClibc.distro \
17 file://uclibc-arm-ftruncate64.patch \ 17 file://uclibc-arm-ftruncate64.patch \
@@ -22,9 +22,9 @@ SRC_URI = "git://uclibc.org/uClibc.git;branch=master;protocol=git \
22 file://argp-headers.patch \ 22 file://argp-headers.patch \
23 file://remove_attribute_optimize_Os.patch \ 23 file://remove_attribute_optimize_Os.patch \
24 file://compile-arm-fork-with-O2.patch \ 24 file://compile-arm-fork-with-O2.patch \
25 file://orign_path.patch \
26 file://rtld_no.patch \
27 file://uclibc-execvpe.patch \ 25 file://uclibc-execvpe.patch \
28 file://uclibc_scheduler_update.patch \ 26 file://fix_libdl.patch \
27 file://cross_compile_check.patch \
29 " 28 "
29
30S = "${WORKDIR}/git" 30S = "${WORKDIR}/git"