summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/rpm/rpm
diff options
context:
space:
mode:
authorMark Hatle <mark.hatle@windriver.com>2012-12-11 08:09:40 -0600
committerRichard Purdie <richard.purdie@linuxfoundation.org>2012-12-17 17:24:52 +0000
commite1345b76c04b5a829b7219c12772bec1fb301850 (patch)
tree793cf4775df349af9db83230272ea6d7bcc8b840 /meta/recipes-devtools/rpm/rpm
parent8b671644e1fa5cb4e4d8b6b0dc26a4b08e7485b7 (diff)
downloadpoky-e1345b76c04b5a829b7219c12772bec1fb301850.tar.gz
rpm/smart: Fix runtime-relocation issues w/ RPM and Smart
Fix runtime-relocation issues with the RPM and Smart wrappers. In addition the patches were necessary to fix related problems. The changes to the includes three categories of issues: *) Incorrect pathname evaluations *) Incorrect evaluation of the /etc/rpm/platform file contents *) Confusing vendor #define checks Finally, a simple way to debug the platformScore was added as that is necessary to debug how this works and into the smart system. (From OE-Core rev: 355a621caca66ed393d36fff6be8918921cf45ae) Signed-off-by: Mark Hatle <mark.hatle@windriver.com> Signed-off-by: Saul Wold <sgw@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-devtools/rpm/rpm')
-rw-r--r--meta/recipes-devtools/rpm/rpm/rpm-debug-platform.patch65
-rw-r--r--meta/recipes-devtools/rpm/rpm/rpm-platform.patch2
-rw-r--r--meta/recipes-devtools/rpm/rpm/rpm-platform2.patch87
3 files changed, 134 insertions, 20 deletions
diff --git a/meta/recipes-devtools/rpm/rpm/rpm-debug-platform.patch b/meta/recipes-devtools/rpm/rpm/rpm-debug-platform.patch
new file mode 100644
index 0000000000..25ebbdcbed
--- /dev/null
+++ b/meta/recipes-devtools/rpm/rpm/rpm-debug-platform.patch
@@ -0,0 +1,65 @@
1Debug the platform score generation...
2
3Index: rpm-5.4.9/lib/rpmrc.c
4===================================================================
5--- rpm-5.4.9.orig/lib/rpmrc.c
6+++ rpm-5.4.9/lib/rpmrc.c
7@@ -465,6 +465,8 @@ static rpmRC rpmPlatform(const char * pl
8
9 rc = (rpmRC) rpmiobSlurp(platform, &iob);
10
11+ fprintf(stderr, "D: rpmPlatform file %s\n", platform);
12+
13 if (rc || iob == NULL) {
14 rc = RPMRC_FAIL;
15 goto exit;
16@@ -486,6 +488,7 @@ static rpmRC rpmPlatform(const char * pl
17 while (--t > p && xisspace(*t))
18 *t = '\0';
19 if (t > p) {
20+ fprintf(stderr, "D: rpmPlatform mireAppend REGEX %s\n", p);
21 xx = mireAppend(RPMMIRE_REGEX, 0, p, NULL, &mi_re, &mi_nre);
22 }
23 continue;
24@@ -503,6 +506,11 @@ static rpmRC rpmPlatform(const char * pl
25 _gnu = rpmExpand("-", cvog->gnu, NULL);
26
27 addMacro(NULL, "_platform_gnu", NULL, (_gnu ? _gnu : ""), -1);
28+ fprintf(stderr, "D: rpmPlatform addMacro %s-%s-%s(%s)\n",
29+ rpmExpand("%{_platform_cpu}", NULL),
30+ rpmExpand("%{_platform_vendor}", NULL),
31+ rpmExpand("%{_platform_os}", NULL),
32+ rpmExpand("%{_platform_gnu}", NULL));
33 #else
34 addMacro(NULL, "_host_cpu", NULL, cvog->cpu, -1);
35 addMacro(NULL, "_host_vendor", NULL, cvog->vendor, -1);
36@@ -510,6 +518,7 @@ static rpmRC rpmPlatform(const char * pl
37 #endif
38 }
39
40+ fprintf(stderr, "D: rpmPlatform mireAppend STRCMP %s -- ", p);
41 #if defined(RPM_VENDOR_OPENPKG) /* explicit-platform */
42 /* do not use vendor and GNU attribution */
43 p = rpmExpand("%{_host_cpu}-%{_host_os}", NULL);
44@@ -518,6 +527,7 @@ static rpmRC rpmPlatform(const char * pl
45 (cvog && *cvog->gnu ? "-" : NULL),
46 (cvog ? cvog->gnu : NULL), NULL);
47 #endif
48+ fprintf(stderr, "%s\n", p);
49 xx = mireAppend(RPMMIRE_STRCMP, 0, p, NULL, &mi_re, &mi_nre);
50 p = _free(p);
51
52@@ -686,9 +696,12 @@ int rpmPlatformScore(const char * platfo
53
54 if ((mire = (miRE) mi_re) != NULL)
55 for (i = 0; i < mi_nre; i++) {
56- if (mireRegexec(mire + i, platform, 0) >= 0)
57+ if (mireRegexec(mire + i, platform, 0) >= 0) {
58+ fprintf(stderr, "D: rpmPlatformScore %s (%d)\n", platform, i + 1);
59 return (i + 1);
60+ }
61 }
62+ fprintf(stderr, "D: rpmPlatformScore %s (%d)\n", platform, 0);
63 return 0;
64 }
65 /*@=onlytrans@*/
diff --git a/meta/recipes-devtools/rpm/rpm/rpm-platform.patch b/meta/recipes-devtools/rpm/rpm/rpm-platform.patch
index 7b81857837..9e167d82f3 100644
--- a/meta/recipes-devtools/rpm/rpm/rpm-platform.patch
+++ b/meta/recipes-devtools/rpm/rpm/rpm-platform.patch
@@ -40,7 +40,7 @@ diff -ur rpm-5.4.0.orig/lib/depends.c rpm-5.4.0/lib/depends.c
40 return rc; 40 return rc;
41 } 41 }
42 42
43+#if defined(RPM_VENDOR_WINDRIVER) 43+#if defined(RPM_VENDOR_WINDRIVER) || defined(RPM_VENDOR_POKY)
44+#define _ETC_RPM_SYSINFO "%{_etcrpm}/sysinfo" 44+#define _ETC_RPM_SYSINFO "%{_etcrpm}/sysinfo"
45+#else 45+#else
46+#define _ETC_RPM_SYSINFO SYSCONFIGDIR "/sysinfo" 46+#define _ETC_RPM_SYSINFO SYSCONFIGDIR "/sysinfo"
diff --git a/meta/recipes-devtools/rpm/rpm/rpm-platform2.patch b/meta/recipes-devtools/rpm/rpm/rpm-platform2.patch
index 3d50e46c11..6683d8fdbf 100644
--- a/meta/recipes-devtools/rpm/rpm/rpm-platform2.patch
+++ b/meta/recipes-devtools/rpm/rpm/rpm-platform2.patch
@@ -3,10 +3,13 @@ Fix up platform and related sysinfo file loading (part 2).
3Upstream-Status: Pending 3Upstream-Status: Pending
4 4
5We need to ensure that we set the _gnu flag somehow. We do this by reading 5We need to ensure that we set the _gnu flag somehow. We do this by reading
6from the platform file, and setting a new platform_gnu and related vars. 6from the platform file, and setting a new _platform_gnu and related vars.
7 7
8We then check for the existance of these things and change the configure 8The default values of _host_cpu, _host_vendor and _host_os are changed to
9time defaults to the run-time values as necessary. 9reference either the automatically determined _target_... or _platform_...
10values. The macros file uses the configure time defaults in _platform_...
11versions have not been defined. This preserves existing behavior, but
12ensures reasonable defaults are always available.
10 13
11Signed-off-by: Mark Hatle <mark.hatle@windriver.com> 14Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
12 15
@@ -14,17 +17,43 @@ Index: rpm-5.4.9/lib/rpmrc.c
14=================================================================== 17===================================================================
15--- rpm-5.4.9.orig/lib/rpmrc.c 18--- rpm-5.4.9.orig/lib/rpmrc.c
16+++ rpm-5.4.9/lib/rpmrc.c 19+++ rpm-5.4.9/lib/rpmrc.c
17@@ -487,9 +487,10 @@ static rpmRC rpmPlatform(const char * pl 20@@ -328,10 +328,15 @@ static void setDefaults(void)
21 /*@modifies rpmGlobalMacroContext, internalState @*/
22 {
23
24-#if defined(RPM_VENDOR_WINDRIVER)
25+#if defined(RPM_VENDOR_WINDRIVER) || defined(RPM_VENDOR_POKY)
26 addMacro(NULL, "_usrlibrpm", NULL, __usrlibrpm, RMIL_DEFAULT);
27 addMacro(NULL, "_etcrpm", NULL, __etcrpm, RMIL_DEFAULT);
28 addMacro(NULL, "_vendor", NULL, "%{?_host_vendor}%{!?_host_vendor:wrs}", RMIL_DEFAULT);
29+
30+ addMacro(NULL, "_host_cpu", NULL, "%{?_platform_cpu}%{!?_platform_cpu:%{?_target_cpu}}", RMIL_DEFAULT);
31+ addMacro(NULL, "_host_vendor", NULL, "%{?_platform_vendor}%{!?_platform_cpu:%{?_target_vendor}}", RMIL_DEFAULT);
32+ addMacro(NULL, "_host_os", NULL, "%{?_platform_os}%{!?_platform_os:%{?_target_os}}", RMIL_DEFAULT);
33+ addMacro(NULL, "_host_gnu", NULL, "%{?_platform_gnu}%{!?_platform_gnu:%{?_gnu}}", RMIL_DEFAULT);
34 #endif
35
36 addMacro(NULL, "_usr", NULL, USRPREFIX, RMIL_DEFAULT);
37@@ -487,9 +492,22 @@ static rpmRC rpmPlatform(const char * pl
18 } 38 }
19 39
20 if (!parseCVOG(p, &cvog) && cvog != NULL) { 40 if (!parseCVOG(p, &cvog) && cvog != NULL) {
21- addMacro(NULL, "_host_cpu", NULL, cvog->cpu, -1); 41+#if defined(RPM_VENDOR_POKY)
22- addMacro(NULL, "_host_vendor", NULL, cvog->vendor, -1); 42+ char * _gnu = NULL;
23- addMacro(NULL, "_host_os", NULL, cvog->os, -1); 43+
24+ addMacro(NULL, "_platform_cpu", NULL, cvog->cpu, -1); 44+ addMacro(NULL, "_platform_cpu", NULL, cvog->cpu, -1);
25+ addMacro(NULL, "_platform_vendor", NULL, cvog->vendor, -1); 45+ addMacro(NULL, "_platform_vendor", NULL, cvog->vendor, -1);
26+ addMacro(NULL, "_platform_os", NULL, cvog->os, -1); 46+ addMacro(NULL, "_platform_os", NULL, cvog->os, -1);
27+ addMacro(NULL, "_platform_gnu", NULL, cvog->gnu, -1); 47+
48+ if (cvog->gnu && cvog->gnu[0] != '\0')
49+ _gnu = rpmExpand("-", cvog->gnu, NULL);
50+
51+ addMacro(NULL, "_platform_gnu", NULL, (_gnu ? _gnu : ""), -1);
52+#else
53 addMacro(NULL, "_host_cpu", NULL, cvog->cpu, -1);
54 addMacro(NULL, "_host_vendor", NULL, cvog->vendor, -1);
55 addMacro(NULL, "_host_os", NULL, cvog->os, -1);
56+#endif
28 } 57 }
29 58
30 #if defined(RPM_VENDOR_OPENPKG) /* explicit-platform */ 59 #if defined(RPM_VENDOR_OPENPKG) /* explicit-platform */
@@ -32,25 +61,45 @@ Index: rpm-5.4.9/macros/macros.in
32=================================================================== 61===================================================================
33--- rpm-5.4.9.orig/macros/macros.in 62--- rpm-5.4.9.orig/macros/macros.in
34+++ rpm-5.4.9/macros/macros.in 63+++ rpm-5.4.9/macros/macros.in
35@@ -873,7 +873,7 @@ $_arbitrary_tags_tests Foo:Bar 64@@ -875,9 +875,9 @@ $_arbitrary_tags_tests Foo:Bar
36 %_build_arch @RPMCANONARCH@
37 %_vendor @RPMCANONVENDOR@
38 %_os @RPMCANONOS@ 65 %_os @RPMCANONOS@
39-%_gnu @RPMCANONGNU@ 66 %_gnu @RPMCANONGNU@
40+%_gnu %{?_platform_gnu:-%{_platform_gnu}}%{!?_platform_gnu:@RPMCANONGNU@} 67
68-%_host_platform %{_host_cpu}-%{_host_vendor}-%{_host_os}%{?_gnu}
69-%_build_platform %{_build_cpu}-%{_build_vendor}-%{_build_os}%{?_gnu}
70-%_target_platform %{_target_cpu}-%{_target_vendor}-%{_target_os}%{?_gnu}
71+%_host_platform %{_host_cpu}-%{_host_vendor}-%{_host_os}%{?_host_gnu}%{!?_host_gnu:%{?_gnu}}
72+%_build_platform %{_build_cpu}-%{_build_vendor}-%{_build_os}%{?_host_gnu}%{!?_host_gnu:%{?_gnu}}
73+%_target_platform %{_target_cpu}-%{_target_vendor}-%{_target_os}%{?_host_gnu}%{!?_host_gnu:%{?_gnu}}
41 74
42 %_host_platform %{_host_cpu}-%{_host_vendor}-%{_host_os}%{?_gnu} 75 #==============================================================================
43 %_build_platform %{_build_cpu}-%{_build_vendor}-%{_build_os}%{?_gnu} 76 # ---- configure macros.
44@@ -920,9 +920,9 @@ $_arbitrary_tags_tests Foo:Bar 77@@ -920,9 +920,10 @@ $_arbitrary_tags_tests Foo:Bar
45 %_build_os %{_host_os} 78 %_build_os %{_host_os}
46 %_host @host@ 79 %_host @host@
47 %_host_alias @host_alias@%{nil} 80 %_host_alias @host_alias@%{nil}
48-%_host_cpu @host_cpu@ 81-%_host_cpu @host_cpu@
49-%_host_vendor @host_vendor@ 82-%_host_vendor @host_vendor@
50-%_host_os @host_os@ 83-%_host_os @host_os@
51+%_host_cpu %{?_platform_cpu}%{!?_platform_cpu:@host_cpu@} 84+%_host_cpu %{?_platform_cpu}%{!?_platform_cpu:%{_arch}}
52+%_host_vendor %{?_platform_vendor}%{!?_platform_vendor:@host_vendor@} 85+%_host_vendor %{?_platform_vendor}%{!?_platform_vendor:%{_vendor}}
53+%_host_os %{?_platform_os}%{!?_platform_os:@host_os@} 86+%_host_os %{?_platform_os}%{!?_platform_os:%{_os}}
87+%_host_gnu %{?_platform_gnu}%{!?_platform_gnu:%{_gnu}}
54 %_target %{_host} 88 %_target %{_host}
55 %_target_alias %{_host_alias} 89 %_target_alias %{_host_alias}
56 %_target_cpu %{_host_cpu} 90 %_target_cpu %{_host_cpu}
91Index: rpm-5.4.9/python/rpmmodule.c
92===================================================================
93--- rpm-5.4.9.orig/python/rpmmodule.c
94+++ rpm-5.4.9/python/rpmmodule.c
95@@ -65,8 +65,8 @@ static PyObject * archScore(PyObject * s
96 if (!PyArg_ParseTupleAndKeywords(args, kwds, "s", kwlist, &arch))
97 return NULL;
98
99-#if defined(RPM_VENDOR_WINDRIVER)
100- platform = rpmExpand(arch, "-%{_host_vendor}", "-%{_host_os}%{?_gnu}", NULL);
101+#if defined(RPM_VENDOR_WINDRIVER) || defined(RPM_VENDOR_POKY)
102+ platform = rpmExpand(arch, "-%{_host_vendor}", "-%{_host_os}%{?_host_gnu}%{!?_host_gnu:%{?_gnu}}", NULL);
103 #else
104 platform = rpmExpand(arch, "-", "%{_vendor}", "-", "%{_os}", NULL);
105 #endif