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)
downloadast2050-yocto-poky-e1345b76c04b5a829b7219c12772bec1fb301850.zip
ast2050-yocto-poky-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 0000000..25ebbdc
--- /dev/null
+++ b/meta/recipes-devtools/rpm/rpm/rpm-debug-platform.patch
@@ -0,0 +1,65 @@
+Debug the platform score generation...
+
+Index: rpm-5.4.9/lib/rpmrc.c
+===================================================================
+--- rpm-5.4.9.orig/lib/rpmrc.c
++++ rpm-5.4.9/lib/rpmrc.c
+@@ -465,6 +465,8 @@ static rpmRC rpmPlatform(const char * pl
+
+ rc = (rpmRC) rpmiobSlurp(platform, &iob);
+
++ fprintf(stderr, "D: rpmPlatform file %s\n", platform);
++
+ if (rc || iob == NULL) {
+ rc = RPMRC_FAIL;
+ goto exit;
+@@ -486,6 +488,7 @@ static rpmRC rpmPlatform(const char * pl
+ while (--t > p && xisspace(*t))
+ *t = '\0';
+ if (t > p) {
++ fprintf(stderr, "D: rpmPlatform mireAppend REGEX %s\n", p);
+ xx = mireAppend(RPMMIRE_REGEX, 0, p, NULL, &mi_re, &mi_nre);
+ }
+ continue;
+@@ -503,6 +506,11 @@ static rpmRC rpmPlatform(const char * pl
+ _gnu = rpmExpand("-", cvog->gnu, NULL);
+
+ addMacro(NULL, "_platform_gnu", NULL, (_gnu ? _gnu : ""), -1);
++ fprintf(stderr, "D: rpmPlatform addMacro %s-%s-%s(%s)\n",
++ rpmExpand("%{_platform_cpu}", NULL),
++ rpmExpand("%{_platform_vendor}", NULL),
++ rpmExpand("%{_platform_os}", NULL),
++ rpmExpand("%{_platform_gnu}", NULL));
+ #else
+ addMacro(NULL, "_host_cpu", NULL, cvog->cpu, -1);
+ addMacro(NULL, "_host_vendor", NULL, cvog->vendor, -1);
+@@ -510,6 +518,7 @@ static rpmRC rpmPlatform(const char * pl
+ #endif
+ }
+
++ fprintf(stderr, "D: rpmPlatform mireAppend STRCMP %s -- ", p);
+ #if defined(RPM_VENDOR_OPENPKG) /* explicit-platform */
+ /* do not use vendor and GNU attribution */
+ p = rpmExpand("%{_host_cpu}-%{_host_os}", NULL);
+@@ -518,6 +527,7 @@ static rpmRC rpmPlatform(const char * pl
+ (cvog && *cvog->gnu ? "-" : NULL),
+ (cvog ? cvog->gnu : NULL), NULL);
+ #endif
++ fprintf(stderr, "%s\n", p);
+ xx = mireAppend(RPMMIRE_STRCMP, 0, p, NULL, &mi_re, &mi_nre);
+ p = _free(p);
+
+@@ -686,9 +696,12 @@ int rpmPlatformScore(const char * platfo
+
+ if ((mire = (miRE) mi_re) != NULL)
+ for (i = 0; i < mi_nre; i++) {
+- if (mireRegexec(mire + i, platform, 0) >= 0)
++ if (mireRegexec(mire + i, platform, 0) >= 0) {
++ fprintf(stderr, "D: rpmPlatformScore %s (%d)\n", platform, i + 1);
+ return (i + 1);
++ }
+ }
++ fprintf(stderr, "D: rpmPlatformScore %s (%d)\n", platform, 0);
+ return 0;
+ }
+ /*@=onlytrans@*/
diff --git a/meta/recipes-devtools/rpm/rpm/rpm-platform.patch b/meta/recipes-devtools/rpm/rpm/rpm-platform.patch
index 7b81857..9e167d8 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
return rc;
}
-+#if defined(RPM_VENDOR_WINDRIVER)
++#if defined(RPM_VENDOR_WINDRIVER) || defined(RPM_VENDOR_POKY)
+#define _ETC_RPM_SYSINFO "%{_etcrpm}/sysinfo"
+#else
+#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 3d50e46..6683d8f 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).
Upstream-Status: Pending
We need to ensure that we set the _gnu flag somehow. We do this by reading
-from the platform file, and setting a new platform_gnu and related vars.
+from the platform file, and setting a new _platform_gnu and related vars.
-We then check for the existance of these things and change the configure
-time defaults to the run-time values as necessary.
+The default values of _host_cpu, _host_vendor and _host_os are changed to
+reference either the automatically determined _target_... or _platform_...
+values. The macros file uses the configure time defaults in _platform_...
+versions have not been defined. This preserves existing behavior, but
+ensures reasonable defaults are always available.
Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
@@ -14,17 +17,43 @@ Index: rpm-5.4.9/lib/rpmrc.c
===================================================================
--- rpm-5.4.9.orig/lib/rpmrc.c
+++ rpm-5.4.9/lib/rpmrc.c
-@@ -487,9 +487,10 @@ static rpmRC rpmPlatform(const char * pl
+@@ -328,10 +328,15 @@ static void setDefaults(void)
+ /*@modifies rpmGlobalMacroContext, internalState @*/
+ {
+
+-#if defined(RPM_VENDOR_WINDRIVER)
++#if defined(RPM_VENDOR_WINDRIVER) || defined(RPM_VENDOR_POKY)
+ addMacro(NULL, "_usrlibrpm", NULL, __usrlibrpm, RMIL_DEFAULT);
+ addMacro(NULL, "_etcrpm", NULL, __etcrpm, RMIL_DEFAULT);
+ addMacro(NULL, "_vendor", NULL, "%{?_host_vendor}%{!?_host_vendor:wrs}", RMIL_DEFAULT);
++
++ addMacro(NULL, "_host_cpu", NULL, "%{?_platform_cpu}%{!?_platform_cpu:%{?_target_cpu}}", RMIL_DEFAULT);
++ addMacro(NULL, "_host_vendor", NULL, "%{?_platform_vendor}%{!?_platform_cpu:%{?_target_vendor}}", RMIL_DEFAULT);
++ addMacro(NULL, "_host_os", NULL, "%{?_platform_os}%{!?_platform_os:%{?_target_os}}", RMIL_DEFAULT);
++ addMacro(NULL, "_host_gnu", NULL, "%{?_platform_gnu}%{!?_platform_gnu:%{?_gnu}}", RMIL_DEFAULT);
+ #endif
+
+ addMacro(NULL, "_usr", NULL, USRPREFIX, RMIL_DEFAULT);
+@@ -487,9 +492,22 @@ static rpmRC rpmPlatform(const char * pl
}
if (!parseCVOG(p, &cvog) && cvog != NULL) {
-- addMacro(NULL, "_host_cpu", NULL, cvog->cpu, -1);
-- addMacro(NULL, "_host_vendor", NULL, cvog->vendor, -1);
-- addMacro(NULL, "_host_os", NULL, cvog->os, -1);
++#if defined(RPM_VENDOR_POKY)
++ char * _gnu = NULL;
++
+ addMacro(NULL, "_platform_cpu", NULL, cvog->cpu, -1);
+ addMacro(NULL, "_platform_vendor", NULL, cvog->vendor, -1);
+ addMacro(NULL, "_platform_os", NULL, cvog->os, -1);
-+ addMacro(NULL, "_platform_gnu", NULL, cvog->gnu, -1);
++
++ if (cvog->gnu && cvog->gnu[0] != '\0')
++ _gnu = rpmExpand("-", cvog->gnu, NULL);
++
++ addMacro(NULL, "_platform_gnu", NULL, (_gnu ? _gnu : ""), -1);
++#else
+ addMacro(NULL, "_host_cpu", NULL, cvog->cpu, -1);
+ addMacro(NULL, "_host_vendor", NULL, cvog->vendor, -1);
+ addMacro(NULL, "_host_os", NULL, cvog->os, -1);
++#endif
}
#if defined(RPM_VENDOR_OPENPKG) /* explicit-platform */
@@ -32,25 +61,45 @@ Index: rpm-5.4.9/macros/macros.in
===================================================================
--- rpm-5.4.9.orig/macros/macros.in
+++ rpm-5.4.9/macros/macros.in
-@@ -873,7 +873,7 @@ $_arbitrary_tags_tests Foo:Bar
- %_build_arch @RPMCANONARCH@
- %_vendor @RPMCANONVENDOR@
+@@ -875,9 +875,9 @@ $_arbitrary_tags_tests Foo:Bar
%_os @RPMCANONOS@
--%_gnu @RPMCANONGNU@
-+%_gnu %{?_platform_gnu:-%{_platform_gnu}}%{!?_platform_gnu:@RPMCANONGNU@}
+ %_gnu @RPMCANONGNU@
+
+-%_host_platform %{_host_cpu}-%{_host_vendor}-%{_host_os}%{?_gnu}
+-%_build_platform %{_build_cpu}-%{_build_vendor}-%{_build_os}%{?_gnu}
+-%_target_platform %{_target_cpu}-%{_target_vendor}-%{_target_os}%{?_gnu}
++%_host_platform %{_host_cpu}-%{_host_vendor}-%{_host_os}%{?_host_gnu}%{!?_host_gnu:%{?_gnu}}
++%_build_platform %{_build_cpu}-%{_build_vendor}-%{_build_os}%{?_host_gnu}%{!?_host_gnu:%{?_gnu}}
++%_target_platform %{_target_cpu}-%{_target_vendor}-%{_target_os}%{?_host_gnu}%{!?_host_gnu:%{?_gnu}}
- %_host_platform %{_host_cpu}-%{_host_vendor}-%{_host_os}%{?_gnu}
- %_build_platform %{_build_cpu}-%{_build_vendor}-%{_build_os}%{?_gnu}
-@@ -920,9 +920,9 @@ $_arbitrary_tags_tests Foo:Bar
+ #==============================================================================
+ # ---- configure macros.
+@@ -920,9 +920,10 @@ $_arbitrary_tags_tests Foo:Bar
%_build_os %{_host_os}
%_host @host@
%_host_alias @host_alias@%{nil}
-%_host_cpu @host_cpu@
-%_host_vendor @host_vendor@
-%_host_os @host_os@
-+%_host_cpu %{?_platform_cpu}%{!?_platform_cpu:@host_cpu@}
-+%_host_vendor %{?_platform_vendor}%{!?_platform_vendor:@host_vendor@}
-+%_host_os %{?_platform_os}%{!?_platform_os:@host_os@}
++%_host_cpu %{?_platform_cpu}%{!?_platform_cpu:%{_arch}}
++%_host_vendor %{?_platform_vendor}%{!?_platform_vendor:%{_vendor}}
++%_host_os %{?_platform_os}%{!?_platform_os:%{_os}}
++%_host_gnu %{?_platform_gnu}%{!?_platform_gnu:%{_gnu}}
%_target %{_host}
%_target_alias %{_host_alias}
%_target_cpu %{_host_cpu}
+Index: rpm-5.4.9/python/rpmmodule.c
+===================================================================
+--- rpm-5.4.9.orig/python/rpmmodule.c
++++ rpm-5.4.9/python/rpmmodule.c
+@@ -65,8 +65,8 @@ static PyObject * archScore(PyObject * s
+ if (!PyArg_ParseTupleAndKeywords(args, kwds, "s", kwlist, &arch))
+ return NULL;
+
+-#if defined(RPM_VENDOR_WINDRIVER)
+- platform = rpmExpand(arch, "-%{_host_vendor}", "-%{_host_os}%{?_gnu}", NULL);
++#if defined(RPM_VENDOR_WINDRIVER) || defined(RPM_VENDOR_POKY)
++ platform = rpmExpand(arch, "-%{_host_vendor}", "-%{_host_os}%{?_host_gnu}%{!?_host_gnu:%{?_gnu}}", NULL);
+ #else
+ platform = rpmExpand(arch, "-", "%{_vendor}", "-", "%{_os}", NULL);
+ #endif
OpenPOWER on IntegriCloud