summaryrefslogtreecommitdiffstats
path: root/meta/packages/pseudo/pseudo/ld_sacredness.patch
diff options
context:
space:
mode:
Diffstat (limited to 'meta/packages/pseudo/pseudo/ld_sacredness.patch')
-rw-r--r--meta/packages/pseudo/pseudo/ld_sacredness.patch68
1 files changed, 68 insertions, 0 deletions
diff --git a/meta/packages/pseudo/pseudo/ld_sacredness.patch b/meta/packages/pseudo/pseudo/ld_sacredness.patch
new file mode 100644
index 0000000000..55a39d99b4
--- /dev/null
+++ b/meta/packages/pseudo/pseudo/ld_sacredness.patch
@@ -0,0 +1,68 @@
1Image creation runs under a pseudo context and calls a script which refers
2to the build systems's python. This loads but can find a libpython from staging
3if these are incompatible, anything can break. These scripts should *not* be
4changing LD_LIBRARY_PATH, just adding an LD_PRELOAD with an absolute path. The
5dyanmic linker can figure out anything else with rpaths.
6
7Inspired by RP's patch of a similar intent for fakeroot
8
9JL 15/07/10
10
11Index: git/pseudo_util.c
12===================================================================
13--- git.orig/pseudo_util.c 2010-03-25 17:57:24.000000000 +0000
14+++ git/pseudo_util.c 2010-07-15 16:13:09.431459640 +0100
15@@ -362,40 +362,25 @@
16 */
17 void
18 pseudo_setupenv(char *opts) {
19- char *ld_env;
20 char *newenv;
21 size_t len;
22 char debugvalue[64];
23
24- newenv = "libpseudo.so";
25+ /* need to set LD_PRELOAD to the absolute library path, as tweaking
26+ * LD_LIBRARY_PATH makes the Beaver sad.
27+ * Fortunately we can hack this as we know we don't use lib64 :-)
28+ */
29+
30+ char *libname = "libpseudo.so";
31+ char *prefix = pseudo_prefix_path("lib");
32+ len = strlen(prefix) + strlen(libname) + 2;
33+ newenv = malloc(len);
34+
35+ snprintf(newenv, len, "%s/%s", prefix, libname);
36+
37 setenv("LD_PRELOAD", newenv, 1);
38
39- ld_env = getenv("LD_LIBRARY_PATH");
40- if (ld_env) {
41- char *prefix = pseudo_prefix_path(NULL);
42- if (!strstr(ld_env, prefix)) {
43- char *e1, *e2;
44- e1 = pseudo_prefix_path("lib");
45- e2 = pseudo_prefix_path("lib64");
46- len = strlen(ld_env) + strlen(e1) + strlen(e2) + 3;
47- newenv = malloc(len);
48- snprintf(newenv, len, "%s:%s:%s", ld_env, e1, e2);
49- free(e1);
50- free(e2);
51- setenv("LD_LIBRARY_PATH", newenv, 1);
52- free(newenv);
53- }
54- free(prefix);
55- } else {
56- char *e1, *e2;
57- e1 = pseudo_prefix_path("lib");
58- e2 = pseudo_prefix_path("lib64");
59- len = strlen(e1) + strlen(e2) + 2;
60- newenv = malloc(len);
61- snprintf(newenv, len, "%s:%s", e1, e2);
62- setenv("LD_LIBRARY_PATH", newenv, 1);
63- free(newenv);
64- }
65+ free(newenv);
66
67 if (max_debug_level) {
68 sprintf(debugvalue, "%d", max_debug_level);