diff options
author | Mark Hatle <mark.hatle@windriver.com> | 2011-11-02 15:23:59 -0500 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2011-11-08 21:44:36 +0000 |
commit | e1e8910b9f43ee13f1a7688da23bd6b3ffca88f8 (patch) | |
tree | 4b42db09a769629d37712364669acb68ee8c0b05 /meta | |
parent | 3f854ed61898edc48235d43470b0eaec08c62b16 (diff) | |
download | poky-e1e8910b9f43ee13f1a7688da23bd6b3ffca88f8.tar.gz |
pseudo: Uprev pseudo to version 1.2
This adds a new feature, PSEUDO_UNLOAD, which can be used to eliminate
overhead of LD_PRELOAD when no longer necessary.
Also the, clone(2), support on Linux has been updated to resolve some
potential defects in the previous implementation.
(From OE-Core rev: 77fe9dd8fa0393132ac6aba00d5659c6781fbbde)
Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta')
-rw-r--r-- | meta/conf/distro/include/distro_tracking_fields.inc | 6 | ||||
-rw-r--r-- | meta/recipes-devtools/pseudo/pseudo/realpath_fix.patch | 165 | ||||
-rw-r--r-- | meta/recipes-devtools/pseudo/pseudo_1.1.1.bb | 11 | ||||
-rw-r--r-- | meta/recipes-devtools/pseudo/pseudo_1.2.bb | 10 | ||||
-rw-r--r-- | meta/recipes-devtools/pseudo/pseudo_git.bb | 6 |
5 files changed, 16 insertions, 182 deletions
diff --git a/meta/conf/distro/include/distro_tracking_fields.inc b/meta/conf/distro/include/distro_tracking_fields.inc index b2808a591b..e2bad6bd63 100644 --- a/meta/conf/distro/include/distro_tracking_fields.inc +++ b/meta/conf/distro/include/distro_tracking_fields.inc | |||
@@ -5944,11 +5944,11 @@ RECIPE_LAST_UPDATE_pn-gettext = "May 24, 2011" | |||
5944 | RECIPE_MANUAL_CHECK_DATE_pn-gettext = "Sep 29, 2011" | 5944 | RECIPE_MANUAL_CHECK_DATE_pn-gettext = "Sep 29, 2011" |
5945 | 5945 | ||
5946 | RECIPE_STATUS_pn-pseudo = "green" | 5946 | RECIPE_STATUS_pn-pseudo = "green" |
5947 | RECIPE_LATEST_VERSION_pn-pseudo = "1.1.1" | 5947 | RECIPE_LATEST_VERSION_pn-pseudo = "1.2" |
5948 | RECIPE_LAST_UPDATE_pn-pseudo = "Jun 06, 2011" | 5948 | RECIPE_LAST_UPDATE_pn-pseudo = "Nov 02, 2011" |
5949 | RECIPE_MAINTAINER_pn-pseudo = "Mark Hatle <mark.hatle@windriver.com>" | 5949 | RECIPE_MAINTAINER_pn-pseudo = "Mark Hatle <mark.hatle@windriver.com>" |
5950 | RECIPE_COMMENTS_pn-pseudo = "Yocto Project maintained" | 5950 | RECIPE_COMMENTS_pn-pseudo = "Yocto Project maintained" |
5951 | RECIPE_MANUAL_CHECK_DATE_pn-pseudo = "Jun 06, 2011" | 5951 | RECIPE_MANUAL_CHECK_DATE_pn-pseudo = "Nov 02, 2011" |
5952 | DISTRO_PN_ALIAS_pn-pseudo = "Windriver" | 5952 | DISTRO_PN_ALIAS_pn-pseudo = "Windriver" |
5953 | 5953 | ||
5954 | DISTRO_PN_ALIAS_pn-rt-tests = "Debian=rt-tests Ubuntu=rt-tests" | 5954 | DISTRO_PN_ALIAS_pn-rt-tests = "Debian=rt-tests Ubuntu=rt-tests" |
diff --git a/meta/recipes-devtools/pseudo/pseudo/realpath_fix.patch b/meta/recipes-devtools/pseudo/pseudo/realpath_fix.patch deleted file mode 100644 index 4a107e006c..0000000000 --- a/meta/recipes-devtools/pseudo/pseudo/realpath_fix.patch +++ /dev/null | |||
@@ -1,165 +0,0 @@ | |||
1 | commit c2f7c5ad8ef0f9c94a2a8382c109c8c6e16c8b18 | ||
2 | Author: Peter Seebach <peter.seebach@windriver.com> | ||
3 | Date: Thu Jun 9 10:53:32 2011 -0500 | ||
4 | |||
5 | Fix realpath(name, NULL) when PSEUDO_DISABLED=1 | ||
6 | |||
7 | On some Linux systems, dlsym("realpath", RTLD_NEXT) prefers | ||
8 | for reasons of its own to give a symbol that is also known | ||
9 | as old_realpath, which fails and yields EINVAL when called | ||
10 | with a null pointer as the second argument. This can be | ||
11 | avoided, on some systems, by using dlvsym() to request | ||
12 | the GLIBC_2.3 version of the symbol. | ||
13 | |||
14 | The wrapper logic is enhanced to allow for specifying | ||
15 | versions, although this currently only works for Linux | ||
16 | (Darwin has no dlvsym, apparently?). The test case is | ||
17 | a trivial program which calls realpath(name, NULL) run | ||
18 | with PSEUDO_DISABLED=1. | ||
19 | |||
20 | diff --git a/ChangeLog.txt b/ChangeLog.txt | ||
21 | index 7ffb74a..a2bbb61 100644 | ||
22 | --- a/ChangeLog.txt | ||
23 | +++ b/ChangeLog.txt | ||
24 | @@ -1,3 +1,8 @@ | ||
25 | +2011-06-08: | ||
26 | + * (seebs) Get the modern realpath from glibc instead of the old | ||
27 | + one inexplicably proferred by RTLD_NEXT. Fixes realpath(path, NULL) | ||
28 | + when PSEUDO_DISABLED=1. | ||
29 | + | ||
30 | 2011-06-06: | ||
31 | * (seebs) revise system() handler substantially. It now | ||
32 | pollutes the environment but works. | ||
33 | diff --git a/makewrappers b/makewrappers | ||
34 | index 6dcf889..20bbf2b 100755 | ||
35 | --- a/makewrappers | ||
36 | +++ b/makewrappers | ||
37 | @@ -211,6 +211,7 @@ class Function: | ||
38 | self.flags = '0' | ||
39 | self.port = port | ||
40 | self.directory = '' | ||
41 | + self.version = 'NULL' | ||
42 | # On Darwin, some functions are SECRETLY converted to foo$INODE64 | ||
43 | # when called. So we have to look those up for real_* | ||
44 | self.inode64 = None | ||
45 | diff --git a/ports/unix/wrapfuncs.in b/ports/unix/wrapfuncs.in | ||
46 | index 74bad89..e06e404 100644 | ||
47 | --- a/ports/unix/wrapfuncs.in | ||
48 | +++ b/ports/unix/wrapfuncs.in | ||
49 | @@ -18,7 +18,7 @@ int lutimes(const char *path, const struct timeval *tv); | ||
50 | char *mkdtemp(char *template); | ||
51 | char *mktemp(char *template); | ||
52 | long pathconf(const char *path, int name); | ||
53 | -char *realpath(const char *name, char *resolved_name); | ||
54 | +char *realpath(const char *name, char *resolved_name); /* version="GLIBC_2.3" */ | ||
55 | int remove(const char *path); /* flags=AT_SYMLINK_NOFOLLOW */ | ||
56 | DIR *opendir(const char *path); | ||
57 | char *tempnam(const char *template, const char *pfx); | ||
58 | diff --git a/pseudo_wrappers.c b/pseudo_wrappers.c | ||
59 | index 600a918..07a4429 100644 | ||
60 | --- a/pseudo_wrappers.c | ||
61 | +++ b/pseudo_wrappers.c | ||
62 | @@ -90,6 +90,42 @@ pseudo_reinit_libpseudo(void) { | ||
63 | _libpseudo_init(); | ||
64 | } | ||
65 | |||
66 | +static void | ||
67 | +pseudo_init_one_wrapper(pseudo_function *func) { | ||
68 | + int (*f)(void) = (int (*)(void)) NULL; | ||
69 | + char *e; | ||
70 | + if (*func->real != NULL) { | ||
71 | + /* already initialized */ | ||
72 | + return; | ||
73 | + } | ||
74 | + dlerror(); | ||
75 | + | ||
76 | +#if PSEUDO_PORT_LINUX | ||
77 | + if (func->version) | ||
78 | + f = dlvsym(RTLD_NEXT, func->name, func->version); | ||
79 | + /* fall through to the general case, if that failed */ | ||
80 | + if (!f) | ||
81 | +#endif | ||
82 | + f = dlsym(RTLD_NEXT, func->name); | ||
83 | + if (f) { | ||
84 | + *func->real = f; | ||
85 | + } else { | ||
86 | + e = dlerror(); | ||
87 | +#ifdef PSEUDO_NO_REAL_AT_FUNCTIONS | ||
88 | + char *s = func->name; | ||
89 | + s += strlen(s) - 2; | ||
90 | + /* *at() don't have to exist */ | ||
91 | + if (!strcmp(s, "at")) { | ||
92 | + continue; | ||
93 | + } | ||
94 | +#else | ||
95 | + if (e != NULL) { | ||
96 | + pseudo_diag("No real function for %s: %s\n", func->name, e); | ||
97 | + } | ||
98 | +#endif | ||
99 | + } | ||
100 | +} | ||
101 | + | ||
102 | void | ||
103 | pseudo_init_wrappers(void) { | ||
104 | int i; | ||
105 | @@ -103,29 +139,7 @@ pseudo_init_wrappers(void) { | ||
106 | */ | ||
107 | if (!done) { | ||
108 | for (i = 0; pseudo_functions[i].name; ++i) { | ||
109 | - if (*pseudo_functions[i].real == NULL) { | ||
110 | - int (*f)(void); | ||
111 | - char *e; | ||
112 | - dlerror(); | ||
113 | - f = dlsym(RTLD_NEXT, pseudo_functions[i].name); | ||
114 | - if (f) { | ||
115 | - *pseudo_functions[i].real = f; | ||
116 | - } else { | ||
117 | - e = dlerror(); | ||
118 | -#ifdef PSEUDO_NO_REAL_AT_FUNCTIONS | ||
119 | - char *s = pseudo_functions[i].name; | ||
120 | - s += strlen(s) - 2; | ||
121 | - /* *at() don't have to exist */ | ||
122 | - if (!strcmp(s, "at")) { | ||
123 | - continue; | ||
124 | - } | ||
125 | -#else | ||
126 | - if (e != NULL) { | ||
127 | - pseudo_diag("No real function for %s: %s\n", pseudo_functions[i].name, e); | ||
128 | - } | ||
129 | -#endif | ||
130 | - } | ||
131 | - } | ||
132 | + pseudo_init_one_wrapper(&pseudo_functions[i]); | ||
133 | } | ||
134 | done = 1; | ||
135 | } | ||
136 | diff --git a/templates/wrapper_table b/templates/wrapper_table | ||
137 | index 2e79fcd..bb30530 100644 | ||
138 | --- a/templates/wrapper_table | ||
139 | +++ b/templates/wrapper_table | ||
140 | @@ -4,17 +4,21 @@ | ||
141 | |||
142 | /* This file is generated and should not be modified. See the makewrappers | ||
143 | * script if you want to modify this. */ | ||
144 | -static struct { | ||
145 | +typedef struct { | ||
146 | char *name; /* the name */ | ||
147 | int (**real)(void); /* the underlying syscall */ | ||
148 | int (*wrapper)(void); /* the wrapper from guts/name.c */ | ||
149 | -} pseudo_functions[] = { | ||
150 | + char *version; /* the version, if we know and care */ | ||
151 | +} pseudo_function; | ||
152 | + | ||
153 | +static pseudo_function pseudo_functions[] = { | ||
154 | @body | ||
155 | { /* ${comment}; */ | ||
156 | "${name}${maybe_inode64}", | ||
157 | (int (**)(void)) &real_${name}, | ||
158 | - (int (*)(void)) wrap_${name} | ||
159 | + (int (*)(void)) wrap_${name}, | ||
160 | + ${version} | ||
161 | }, | ||
162 | @footer | ||
163 | - { NULL, NULL, NULL }, | ||
164 | + { NULL, NULL, NULL, NULL }, | ||
165 | }; | ||
diff --git a/meta/recipes-devtools/pseudo/pseudo_1.1.1.bb b/meta/recipes-devtools/pseudo/pseudo_1.1.1.bb deleted file mode 100644 index 0a61aecf19..0000000000 --- a/meta/recipes-devtools/pseudo/pseudo_1.1.1.bb +++ /dev/null | |||
@@ -1,11 +0,0 @@ | |||
1 | require pseudo.inc | ||
2 | |||
3 | PR = "r2" | ||
4 | |||
5 | SRC_URI = "http://www.yoctoproject.org/downloads/${BPN}/${BPN}-${PV}.tar.bz2 \ | ||
6 | file://oe-config.patch \ | ||
7 | file://realpath_fix.patch \ | ||
8 | file://static_sqlite.patch" | ||
9 | |||
10 | SRC_URI[md5sum] = "dd59766c17e199fe6144fce8a2c67802" | ||
11 | SRC_URI[sha256sum] = "c697f643577d661c3ce826504b9dcd11fa98e78a5d10e3c83931da8942f6bfad" | ||
diff --git a/meta/recipes-devtools/pseudo/pseudo_1.2.bb b/meta/recipes-devtools/pseudo/pseudo_1.2.bb new file mode 100644 index 0000000000..1d5fe1a702 --- /dev/null +++ b/meta/recipes-devtools/pseudo/pseudo_1.2.bb | |||
@@ -0,0 +1,10 @@ | |||
1 | require pseudo.inc | ||
2 | |||
3 | PR = "r3" | ||
4 | |||
5 | SRC_URI = "http://www.yoctoproject.org/downloads/${BPN}/${BPN}-${PV}.tar.bz2 \ | ||
6 | file://oe-config.patch \ | ||
7 | file://static_sqlite.patch" | ||
8 | |||
9 | SRC_URI[md5sum] = "a2819084bab7e991f06626d02cf55048" | ||
10 | SRC_URI[sha256sum] = "4749a22df687f44d24c26e97170d4781a1bd52d5ee092364a40877e4d96ff058" | ||
diff --git a/meta/recipes-devtools/pseudo/pseudo_git.bb b/meta/recipes-devtools/pseudo/pseudo_git.bb index c1f0432d59..5ed8cf7b8e 100644 --- a/meta/recipes-devtools/pseudo/pseudo_git.bb +++ b/meta/recipes-devtools/pseudo/pseudo_git.bb | |||
@@ -1,8 +1,8 @@ | |||
1 | require pseudo.inc | 1 | require pseudo.inc |
2 | 2 | ||
3 | SRCREV = "c2f7c5ad8ef0f9c94a2a8382c109c8c6e16c8b18" | 3 | SRCREV = "17c2233f93692f79684792750001ee6d13e03925" |
4 | PV = "1.1.1+git${SRCPV}" | 4 | PV = "1.2+git${SRCPV}" |
5 | PR = "r19" | 5 | PR = "r20" |
6 | 6 | ||
7 | DEFAULT_PREFERENCE = "-1" | 7 | DEFAULT_PREFERENCE = "-1" |
8 | 8 | ||