summaryrefslogtreecommitdiffstats
path: root/meta
diff options
context:
space:
mode:
authorAlexander Kanavin <alex.kanavin@gmail.com>2020-04-25 19:28:00 +0200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2020-05-02 09:08:52 +0100
commit365f24bee16ba4e9386f89158df29d577f192668 (patch)
tree38b812cec83aad0c39272a8a1f174b0bb66df2cf /meta
parentb55f765ae46eb08d9c92a862c6bc4b9044c0b42d (diff)
downloadpoky-365f24bee16ba4e9386f89158df29d577f192668.tar.gz
rpm: upgrade to 4.15.1
Drop patches that were merged upstream. 0001-mono-find-provides-requires-do-not-use-monodis-from-.patch modifies a file that was removed upstream. Add a 0001-rpmfc.c-do-not-run-file-classification-in-parallel.patch as unfortunately the new parallel file classification feature from upstream trips over somewhere in libmagic when inspected files are compressed: https://github.com/rpm-software-management/rpm/issues/756 (From OE-Core rev: 67257ca87c6fa8e6050a20ecea50daf834c7e869) Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta')
-rw-r--r--meta/recipes-devtools/rpm/files/0001-Do-not-add-an-unsatisfiable-dependency-when-building.patch28
-rw-r--r--meta/recipes-devtools/rpm/files/0001-Do-not-hardcode-lib-rpm-as-the-installation-path-for.patch14
-rw-r--r--meta/recipes-devtools/rpm/files/0001-Split-binary-package-building-into-a-separate-functi.patch84
-rw-r--r--meta/recipes-devtools/rpm/files/0001-mono-find-provides-requires-do-not-use-monodis-from-.patch58
-rw-r--r--meta/recipes-devtools/rpm/files/0001-rpmfc.c-do-not-run-file-classification-in-parallel.patch65
-rw-r--r--meta/recipes-devtools/rpm/files/0002-Run-binary-package-creation-via-thread-pools.patch127
-rw-r--r--meta/recipes-devtools/rpm/files/0003-rpmstrpool.c-make-operations-over-string-pools-threa.patch207
-rw-r--r--meta/recipes-devtools/rpm/files/0004-build-pack.c-remove-static-local-variables-from-buil.patch336
-rw-r--r--meta/recipes-devtools/rpm/rpm_4.15.1.bb (renamed from meta/recipes-devtools/rpm/rpm_4.14.2.1.bb)16
9 files changed, 90 insertions, 845 deletions
diff --git a/meta/recipes-devtools/rpm/files/0001-Do-not-add-an-unsatisfiable-dependency-when-building.patch b/meta/recipes-devtools/rpm/files/0001-Do-not-add-an-unsatisfiable-dependency-when-building.patch
index 80e2f0fad7..4029233fb7 100644
--- a/meta/recipes-devtools/rpm/files/0001-Do-not-add-an-unsatisfiable-dependency-when-building.patch
+++ b/meta/recipes-devtools/rpm/files/0001-Do-not-add-an-unsatisfiable-dependency-when-building.patch
@@ -1,4 +1,4 @@
1From 87cfc0db1ed6fe381a5ed5f0016d8c3344a31a11 Mon Sep 17 00:00:00 2001 1From f39c28eb52f12ae6e82db360ffd5a903ac8faca5 Mon Sep 17 00:00:00 2001
2From: Alexander Kanavin <alex.kanavin@gmail.com> 2From: Alexander Kanavin <alex.kanavin@gmail.com>
3Date: Mon, 9 Jan 2017 18:52:11 +0200 3Date: Mon, 9 Jan 2017 18:52:11 +0200
4Subject: [PATCH] Do not add an unsatisfiable dependency when building rpms in 4Subject: [PATCH] Do not add an unsatisfiable dependency when building rpms in
@@ -9,25 +9,23 @@ hand produces rpms that way by design.
9 9
10Upstream-Status: Inappropriate [oe-core specific] 10Upstream-Status: Inappropriate [oe-core specific]
11Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com> 11Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
12
12--- 13---
13 build/pack.c | 4 ---- 14 build/pack.c | 4 ----
14 1 file changed, 4 deletions(-) 15 1 file changed, 4 deletions(-)
15 16
16diff --git a/build/pack.c b/build/pack.c 17diff --git a/build/pack.c b/build/pack.c
17index 1261cdbba..bb2d6f4f6 100644 18index e6cec1816..810cd7351 100644
18--- a/build/pack.c 19--- a/build/pack.c
19+++ b/build/pack.c 20+++ b/build/pack.c
20@@ -595,10 +595,6 @@ rpmRC packageBinaries(rpmSpec spec, const char *cookie, int cheating) 21@@ -724,10 +724,6 @@ static rpmRC packageBinary(rpmSpec spec, Package pkg, const char *cookie, int ch
21 headerPutBin(pkg->header, RPMTAG_SOURCEPKGID, spec->sourcePkgId,16); 22 headerPutBin(pkg->header, RPMTAG_SOURCEPKGID, spec->sourcePkgId,16);
22 } 23 }
24
25- if (cheating) {
26- (void) rpmlibNeedsFeature(pkg, "ShortCircuited", "4.9.0-1");
27- }
28-
29 if ((rc = getPkgFilename(pkg->header, filename)))
30 return rc;
23 31
24- if (cheating) {
25- (void) rpmlibNeedsFeature(pkg, "ShortCircuited", "4.9.0-1");
26- }
27-
28 { char *binFormat = rpmGetPath("%{_rpmfilename}", NULL);
29 char *binRpm, *binDir;
30 binRpm = headerFormat(pkg->header, binFormat, &errorString);
31--
322.11.0
33
diff --git a/meta/recipes-devtools/rpm/files/0001-Do-not-hardcode-lib-rpm-as-the-installation-path-for.patch b/meta/recipes-devtools/rpm/files/0001-Do-not-hardcode-lib-rpm-as-the-installation-path-for.patch
index 82e7328757..52440d6818 100644
--- a/meta/recipes-devtools/rpm/files/0001-Do-not-hardcode-lib-rpm-as-the-installation-path-for.patch
+++ b/meta/recipes-devtools/rpm/files/0001-Do-not-hardcode-lib-rpm-as-the-installation-path-for.patch
@@ -1,4 +1,4 @@
1From bd08eb0ae1312f347f49949481daa7c923752df2 Mon Sep 17 00:00:00 2001 1From 2f3d1619b6510bc131c4375827caf912559f0fa2 Mon Sep 17 00:00:00 2001
2From: Alexander Kanavin <alex.kanavin@gmail.com> 2From: Alexander Kanavin <alex.kanavin@gmail.com>
3Date: Mon, 27 Feb 2017 09:43:30 +0200 3Date: Mon, 27 Feb 2017 09:43:30 +0200
4Subject: [PATCH] Do not hardcode "lib/rpm" as the installation path for 4Subject: [PATCH] Do not hardcode "lib/rpm" as the installation path for
@@ -14,10 +14,10 @@ Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
14 3 files changed, 4 insertions(+), 4 deletions(-) 14 3 files changed, 4 insertions(+), 4 deletions(-)
15 15
16diff --git a/configure.ac b/configure.ac 16diff --git a/configure.ac b/configure.ac
17index 09af7c4..9bd6903 100644 17index d3aeab86e..1a1f3f91f 100644
18--- a/configure.ac 18--- a/configure.ac
19+++ b/configure.ac 19+++ b/configure.ac
20@@ -1055,7 +1055,7 @@ else 20@@ -1086,7 +1086,7 @@ else
21 usrprefix=$prefix 21 usrprefix=$prefix
22 fi 22 fi
23 23
@@ -27,10 +27,10 @@ index 09af7c4..9bd6903 100644
27 27
28 AC_SUBST(OBJDUMP) 28 AC_SUBST(OBJDUMP)
29diff --git a/macros.in b/macros.in 29diff --git a/macros.in b/macros.in
30index a3aa7a9..62cee5c 100644 30index fe9803aad..d128675bf 100644
31--- a/macros.in 31--- a/macros.in
32+++ b/macros.in 32+++ b/macros.in
33@@ -970,7 +970,7 @@ package or when debugging this package.\ 33@@ -985,7 +985,7 @@ package or when debugging this package.\
34 %_sharedstatedir %{_prefix}/com 34 %_sharedstatedir %{_prefix}/com
35 %_localstatedir %{_prefix}/var 35 %_localstatedir %{_prefix}/var
36 %_lib lib 36 %_lib lib
@@ -40,7 +40,7 @@ index a3aa7a9..62cee5c 100644
40 %_infodir %{_datadir}/info 40 %_infodir %{_datadir}/info
41 %_mandir %{_datadir}/man 41 %_mandir %{_datadir}/man
42diff --git a/rpm.am b/rpm.am 42diff --git a/rpm.am b/rpm.am
43index 82c2d7c..6341b51 100644 43index 40b4ec55f..3139ce8f6 100644
44--- a/rpm.am 44--- a/rpm.am
45+++ b/rpm.am 45+++ b/rpm.am
46@@ -1,10 +1,10 @@ 46@@ -1,10 +1,10 @@
@@ -55,4 +55,4 @@ index 82c2d7c..6341b51 100644
55+rpmconfigdir = $(libdir)/rpm 55+rpmconfigdir = $(libdir)/rpm
56 56
57 # Libtool version (current-revision-age) for all our libraries 57 # Libtool version (current-revision-age) for all our libraries
58 rpm_version_info = 9:0:1 58 rpm_version_info = 9:1:0
diff --git a/meta/recipes-devtools/rpm/files/0001-Split-binary-package-building-into-a-separate-functi.patch b/meta/recipes-devtools/rpm/files/0001-Split-binary-package-building-into-a-separate-functi.patch
deleted file mode 100644
index 6e44f0b7fc..0000000000
--- a/meta/recipes-devtools/rpm/files/0001-Split-binary-package-building-into-a-separate-functi.patch
+++ /dev/null
@@ -1,84 +0,0 @@
1From 721a660a507d6d062e7aecafad886c643970a5d5 Mon Sep 17 00:00:00 2001
2From: Alexander Kanavin <alex.kanavin@gmail.com>
3Date: Thu, 25 May 2017 18:15:27 +0300
4Subject: [PATCH 1/4] Split binary package building into a separate function
5
6So that it can be run as a thread pool task.
7
8Upstream-Status: Submitted [https://github.com/rpm-software-management/rpm/pull/226]
9Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
10
11---
12 build/pack.c | 33 +++++++++++++++++++++------------
13 1 file changed, 21 insertions(+), 12 deletions(-)
14
15diff --git a/build/pack.c b/build/pack.c
16index 518f4e92a..ccfd614cc 100644
17--- a/build/pack.c
18+++ b/build/pack.c
19@@ -546,18 +546,13 @@ static rpmRC checkPackages(char *pkgcheck)
20 return RPMRC_OK;
21 }
22
23-rpmRC packageBinaries(rpmSpec spec, const char *cookie, int cheating)
24+static rpmRC packageBinary(rpmSpec spec, Package pkg, const char *cookie, int cheating, char** filename)
25 {
26- rpmRC rc;
27- const char *errorString;
28- Package pkg;
29- char *pkglist = NULL;
30-
31- for (pkg = spec->packages; pkg != NULL; pkg = pkg->next) {
32- char *fn;
33+ const char *errorString;
34+ rpmRC rc = RPMRC_OK;
35
36 if (pkg->fileList == NULL)
37- continue;
38+ return rc;
39
40 if ((rc = processScriptFiles(spec, pkg)))
41 return rc;
42@@ -587,7 +582,7 @@ rpmRC packageBinaries(rpmSpec spec, const char *cookie, int cheating)
43 headerGetString(pkg->header, RPMTAG_NAME), errorString);
44 return RPMRC_FAIL;
45 }
46- fn = rpmGetPath("%{_rpmdir}/", binRpm, NULL);
47+ *filename = rpmGetPath("%{_rpmdir}/", binRpm, NULL);
48 if ((binDir = strchr(binRpm, '/')) != NULL) {
49 struct stat st;
50 char *dn;
51@@ -609,14 +604,28 @@ rpmRC packageBinaries(rpmSpec spec, const char *cookie, int cheating)
52 free(binRpm);
53 }
54
55- rc = writeRPM(pkg, NULL, fn, NULL);
56+ rc = writeRPM(pkg, NULL, *filename, NULL);
57 if (rc == RPMRC_OK) {
58 /* Do check each written package if enabled */
59- char *pkgcheck = rpmExpand("%{?_build_pkgcheck} ", fn, NULL);
60+ char *pkgcheck = rpmExpand("%{?_build_pkgcheck} ", *filename, NULL);
61 if (pkgcheck[0] != ' ') {
62 rc = checkPackages(pkgcheck);
63 }
64 free(pkgcheck);
65+ }
66+ return rc;
67+}
68+
69+rpmRC packageBinaries(rpmSpec spec, const char *cookie, int cheating)
70+{
71+ rpmRC rc;
72+ Package pkg;
73+ char *pkglist = NULL;
74+
75+ for (pkg = spec->packages; pkg != NULL; pkg = pkg->next) {
76+ char *fn = NULL;
77+ rc = packageBinary(spec, pkg, cookie, cheating, &fn);
78+ if (rc == RPMRC_OK) {
79 rstrcat(&pkglist, fn);
80 rstrcat(&pkglist, " ");
81 }
82--
832.11.0
84
diff --git a/meta/recipes-devtools/rpm/files/0001-mono-find-provides-requires-do-not-use-monodis-from-.patch b/meta/recipes-devtools/rpm/files/0001-mono-find-provides-requires-do-not-use-monodis-from-.patch
deleted file mode 100644
index 24aa4c7fff..0000000000
--- a/meta/recipes-devtools/rpm/files/0001-mono-find-provides-requires-do-not-use-monodis-from-.patch
+++ /dev/null
@@ -1,58 +0,0 @@
1From 43fbc3f53302a395463e8450ac81c53f623eec3f Mon Sep 17 00:00:00 2001
2From: Alexander Kanavin <alex.kanavin@gmail.com>
3Date: Tue, 27 Aug 2019 17:42:34 +0200
4Subject: [PATCH] mono-find-provides/requires: do not use monodis from the host
5
6There was a host contamination issue here: if monodis was installed
7on the host, do_package would use that to resolve dependencies
8of mono libraries (and often fail in that). Without monodis,
9no dependencies are resolved, which is seemingly how things
10are supposed to work.
11
12Upstream-Status: Inappropriate [oe-core specific]
13Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
14---
15 scripts/mono-find-provides | 8 ++++----
16 scripts/mono-find-requires | 8 ++++----
17 2 files changed, 8 insertions(+), 8 deletions(-)
18
19diff --git a/scripts/mono-find-provides b/scripts/mono-find-provides
20index 9348457d3..b28872ffb 100644
21--- a/scripts/mono-find-provides
22+++ b/scripts/mono-find-provides
23@@ -18,11 +18,11 @@ monolist=($(printf "%s\n" "${filelist[@]}" | grep -E "\\.(exe|dll)\$"))
24 build_bindir="$2/usr/bin"
25 build_libdir="$2$3"
26
27-if [ -x $build_bindir/monodis ]; then
28- monodis="$build_bindir/monodis"
29+if [ -x $build_bindir/monodis.bogus ]; then
30+ monodis="$build_bindir/monodis.bogus"
31 export LD_LIBRARY_PATH=$build_libdir${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}
32-elif [ -x /usr/bin/monodis ]; then
33- monodis="/usr/bin/monodis"
34+elif [ -x /usr/bin/monodis.bogus ]; then
35+ monodis="/usr/bin/monodis.bogus"
36 else
37 exit 0;
38 fi
39diff --git a/scripts/mono-find-requires b/scripts/mono-find-requires
40index ea58cae48..d270169e1 100644
41--- a/scripts/mono-find-requires
42+++ b/scripts/mono-find-requires
43@@ -18,11 +18,11 @@ monolist=($(printf "%s\n" "${filelist[@]}" | grep -E "\\.(exe|dll)\$"))
44 build_bindir="$2/usr/bin"
45 build_libdir="$2$3"
46
47-if [ -x $build_bindir/monodis ]; then
48- monodis="$build_bindir/monodis"
49+if [ -x $build_bindir/monodis.bogus ]; then
50+ monodis="$build_bindir/monodis.bogus"
51 export LD_LIBRARY_PATH=$build_libdir${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}
52-elif [ -x /usr/bin/monodis ]; then
53- monodis="/usr/bin/monodis"
54+elif [ -x /usr/bin/monodis.bogus ]; then
55+ monodis="/usr/bin/monodis.bogus"
56 else
57 exit 0;
58 fi
diff --git a/meta/recipes-devtools/rpm/files/0001-rpmfc.c-do-not-run-file-classification-in-parallel.patch b/meta/recipes-devtools/rpm/files/0001-rpmfc.c-do-not-run-file-classification-in-parallel.patch
new file mode 100644
index 0000000000..d8d338792d
--- /dev/null
+++ b/meta/recipes-devtools/rpm/files/0001-rpmfc.c-do-not-run-file-classification-in-parallel.patch
@@ -0,0 +1,65 @@
1From 93c3c7f043f62e96941274e957c4ad9432032af1 Mon Sep 17 00:00:00 2001
2From: Alexander Kanavin <alex.kanavin@gmail.com>
3Date: Mon, 18 Nov 2019 16:22:56 +0100
4Subject: [PATCH] rpmfc.c: do not run file classification in parallel
5
6This is causing freezes with libmagic when the file in question is compressed:
7https://github.com/rpm-software-management/rpm/issues/756
8
9Upstream-Status: Inappropriate [upstream wants a proper fix]
10Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
11---
12 build/rpmfc.c | 8 --------
13 1 file changed, 8 deletions(-)
14
15diff --git a/build/rpmfc.c b/build/rpmfc.c
16index 3db7a9352..17afdd57a 100644
17--- a/build/rpmfc.c
18+++ b/build/rpmfc.c
19@@ -680,7 +680,6 @@ static void rpmfcAttributes(rpmfc fc, int ix, const char *ftype, const char *ful
20 /* Add attributes on libmagic type & path pattern matches */
21 if (matches(&(*attr)->incl, ftype, path, is_executable)) {
22 argvAddTokens(&fc->fattrs[ix], (*attr)->name);
23- #pragma omp critical(fahash)
24 fattrHashAddEntry(fc->fahash, attr-fc->atypes, ix);
25 }
26 }
27@@ -1105,7 +1104,6 @@ rpmRC rpmfcClassify(rpmfc fc, ARGV_t argv, rpm_mode_t * fmode)
28 /* Build (sorted) file class dictionary. */
29 fc->cdict = rpmstrPoolCreate();
30
31- #pragma omp parallel
32 {
33 /* libmagic is not thread-safe, each thread needs to a private handle */
34 magic_t ms = magic_open(msflags);
35@@ -1113,15 +1111,12 @@ rpmRC rpmfcClassify(rpmfc fc, ARGV_t argv, rpm_mode_t * fmode)
36 if (ms == NULL) {
37 rpmlog(RPMLOG_ERR, _("magic_open(0x%x) failed: %s\n"),
38 msflags, strerror(errno));
39- #pragma omp cancel parallel
40 }
41
42 if (magic_load(ms, NULL) == -1) {
43 rpmlog(RPMLOG_ERR, _("magic_load failed: %s\n"), magic_error(ms));
44- #pragma omp cancel parallel
45 }
46
47- #pragma omp for ordered reduction(+:nerrors)
48 for (int ix = 0; ix < fc->nfiles; ix++) {
49 rpmsid ftypeId;
50 const char * ftype;
51@@ -1185,14 +1180,11 @@ rpmRC rpmfcClassify(rpmfc fc, ARGV_t argv, rpm_mode_t * fmode)
52 fc->fcolor[ix] = fcolor;
53
54 /* Add to file class dictionary and index array */
55- #pragma omp ordered
56 if (fcolor != RPMFC_WHITE && (fcolor & RPMFC_INCLUDE)) {
57 ftypeId = rpmstrPoolId(fc->cdict, ftype, 1);
58- #pragma omp atomic
59 fc->fknown++;
60 } else {
61 ftypeId = rpmstrPoolId(fc->cdict, "", 1);
62- #pragma omp atomic
63 fc->fwhite++;
64 }
65 /* Pool id's start from 1, for headers we want it from 0 */
diff --git a/meta/recipes-devtools/rpm/files/0002-Run-binary-package-creation-via-thread-pools.patch b/meta/recipes-devtools/rpm/files/0002-Run-binary-package-creation-via-thread-pools.patch
deleted file mode 100644
index d10041c2e1..0000000000
--- a/meta/recipes-devtools/rpm/files/0002-Run-binary-package-creation-via-thread-pools.patch
+++ /dev/null
@@ -1,127 +0,0 @@
1From 513200cf76758de4668312c628d6362bdabfaf4b Mon Sep 17 00:00:00 2001
2From: Alexander Kanavin <alex.kanavin@gmail.com>
3Date: Thu, 25 May 2017 19:30:20 +0300
4Subject: [PATCH 1/3] Run binary package creation via thread pools.
5
6Upstream-Status: Submitted [https://github.com/rpm-software-management/rpm/pull/226]
7Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
8
9---
10 build/pack.c | 81 +++++++++++++++++++++++++++++++++++++++++++++++++-----------
11 configure.ac | 3 +++
12 2 files changed, 70 insertions(+), 14 deletions(-)
13
14diff --git a/build/pack.c b/build/pack.c
15index ccfd614cc..ed5b9ab4e 100644
16--- a/build/pack.c
17+++ b/build/pack.c
18@@ -616,25 +616,78 @@ static rpmRC packageBinary(rpmSpec spec, Package pkg, const char *cookie, int ch
19 return rc;
20 }
21
22-rpmRC packageBinaries(rpmSpec spec, const char *cookie, int cheating)
23+struct binaryPackageTaskData
24 {
25- rpmRC rc;
26 Package pkg;
27+ char *filename;
28+ rpmRC result;
29+ struct binaryPackageTaskData *next;
30+};
31+
32+static struct binaryPackageTaskData* runBinaryPackageTasks(rpmSpec spec, const char *cookie, int cheating)
33+{
34+ struct binaryPackageTaskData *tasks = NULL;
35+ struct binaryPackageTaskData *task = NULL;
36+ struct binaryPackageTaskData *prev = NULL;
37+
38+ for (Package pkg = spec->packages; pkg != NULL; pkg = pkg->next) {
39+ task = rcalloc(1, sizeof(*task));
40+ task->pkg = pkg;
41+ if (pkg == spec->packages) {
42+ // the first package needs to be processed ahead of others, as they copy
43+ // changelog data from it, and so otherwise data races would happen
44+ task->result = packageBinary(spec, pkg, cookie, cheating, &(task->filename));
45+ rpmlog(RPMLOG_NOTICE, _("Finished binary package job, result %d, filename %s\n"), task->result, task->filename);
46+ tasks = task;
47+ }
48+ if (prev != NULL) {
49+ prev->next = task;
50+ }
51+ prev = task;
52+ }
53+
54+ #pragma omp parallel
55+ #pragma omp single
56+ // re-declaring task variable is necessary, or older gcc versions will produce code that segfaults
57+ for (struct binaryPackageTaskData *task = tasks; task != NULL; task = task->next) {
58+ if (task != tasks)
59+ #pragma omp task
60+ {
61+ task->result = packageBinary(spec, task->pkg, cookie, cheating, &(task->filename));
62+ rpmlog(RPMLOG_NOTICE, _("Finished binary package job, result %d, filename %s\n"), task->result, task->filename);
63+ }
64+ }
65+
66+ return tasks;
67+}
68+
69+static void freeBinaryPackageTasks(struct binaryPackageTaskData* tasks)
70+{
71+ while (tasks != NULL) {
72+ struct binaryPackageTaskData* next = tasks->next;
73+ rfree(tasks->filename);
74+ rfree(tasks);
75+ tasks = next;
76+ }
77+}
78+
79+rpmRC packageBinaries(rpmSpec spec, const char *cookie, int cheating)
80+{
81 char *pkglist = NULL;
82
83- for (pkg = spec->packages; pkg != NULL; pkg = pkg->next) {
84- char *fn = NULL;
85- rc = packageBinary(spec, pkg, cookie, cheating, &fn);
86- if (rc == RPMRC_OK) {
87- rstrcat(&pkglist, fn);
88- rstrcat(&pkglist, " ");
89- }
90- free(fn);
91- if (rc != RPMRC_OK) {
92- pkglist = _free(pkglist);
93- return rc;
94- }
95+ struct binaryPackageTaskData *tasks = runBinaryPackageTasks(spec, cookie, cheating);
96+
97+ for (struct binaryPackageTaskData *task = tasks; task != NULL; task = task->next) {
98+ if (task->result == RPMRC_OK) {
99+ rstrcat(&pkglist, task->filename);
100+ rstrcat(&pkglist, " ");
101+ } else {
102+ _free(pkglist);
103+ freeBinaryPackageTasks(tasks);
104+ return RPMRC_FAIL;
105+ }
106 }
107+ freeBinaryPackageTasks(tasks);
108
109 /* Now check the package set if enabled */
110 if (pkglist != NULL) {
111diff --git a/configure.ac b/configure.ac
112index a506ec819..59fa0acaf 100644
113--- a/configure.ac
114+++ b/configure.ac
115@@ -17,6 +17,9 @@ AC_DISABLE_STATIC
116
117 PKG_PROG_PKG_CONFIG
118
119+AC_OPENMP
120+RPMCFLAGS="$OPENMP_CFLAGS $RPMCFLAGS"
121+
122 dnl Checks for programs.
123 AC_PROG_CXX
124 AC_PROG_AWK
125--
1262.11.0
127
diff --git a/meta/recipes-devtools/rpm/files/0003-rpmstrpool.c-make-operations-over-string-pools-threa.patch b/meta/recipes-devtools/rpm/files/0003-rpmstrpool.c-make-operations-over-string-pools-threa.patch
deleted file mode 100644
index c348ae5330..0000000000
--- a/meta/recipes-devtools/rpm/files/0003-rpmstrpool.c-make-operations-over-string-pools-threa.patch
+++ /dev/null
@@ -1,207 +0,0 @@
1From c80892f17e44331206c8318d53b63bb6a99554d0 Mon Sep 17 00:00:00 2001
2From: Alexander Kanavin <alex.kanavin@gmail.com>
3Date: Tue, 30 May 2017 13:58:30 +0300
4Subject: [PATCH 3/4] rpmstrpool.c: make operations over string pools
5 thread-safe
6
7Otherwise multithreaded rpm building explodes in various ways due
8to data races.
9
10Upstream-Status: Submitted [https://github.com/rpm-software-management/rpm/pull/226]
11Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
12
13---
14 rpmio/rpmstrpool.c | 56 +++++++++++++++++++++++++++++++++++++++++++++---------
15 1 file changed, 47 insertions(+), 9 deletions(-)
16
17diff --git a/rpmio/rpmstrpool.c b/rpmio/rpmstrpool.c
18index 30a57eb10..58ba95a02 100644
19--- a/rpmio/rpmstrpool.c
20+++ b/rpmio/rpmstrpool.c
21@@ -113,6 +113,8 @@ static poolHash poolHashCreate(int numBuckets)
22 return ht;
23 }
24
25+static const char * rpmstrPoolStrNoLock(rpmstrPool pool, rpmsid sid);
26+
27 static void poolHashResize(rpmstrPool pool, int numBuckets)
28 {
29 poolHash ht = pool->hash;
30@@ -120,7 +122,7 @@ static void poolHashResize(rpmstrPool pool, int numBuckets)
31
32 for (int i=0; i<ht->numBuckets; i++) {
33 if (!ht->buckets[i].keyid) continue;
34- unsigned int keyHash = rstrhash(rpmstrPoolStr(pool, ht->buckets[i].keyid));
35+ unsigned int keyHash = rstrhash(rpmstrPoolStrNoLock(pool, ht->buckets[i].keyid));
36 for (unsigned int j=0;;j++) {
37 unsigned int hash = hashbucket(keyHash, j) % numBuckets;
38 if (!buckets[hash].keyid) {
39@@ -149,7 +151,7 @@ static void poolHashAddHEntry(rpmstrPool pool, const char * key, unsigned int ke
40 ht->buckets[hash].keyid = keyid;
41 ht->keyCount++;
42 break;
43- } else if (!strcmp(rpmstrPoolStr(pool, ht->buckets[hash].keyid), key)) {
44+ } else if (!strcmp(rpmstrPoolStrNoLock(pool, ht->buckets[hash].keyid), key)) {
45 return;
46 }
47 }
48@@ -191,7 +193,7 @@ static void poolHashPrintStats(rpmstrPool pool)
49 int maxcollisions = 0;
50
51 for (i=0; i<ht->numBuckets; i++) {
52- unsigned int keyHash = rstrhash(rpmstrPoolStr(pool, ht->buckets[i].keyid));
53+ unsigned int keyHash = rstrhash(rpmstrPoolStrNoLock(pool, ht->buckets[i].keyid));
54 for (unsigned int j=0;;j++) {
55 unsigned int hash = hashbucket(keyHash, i) % ht->numBuckets;
56 if (hash==i) {
57@@ -221,7 +223,7 @@ static void rpmstrPoolRehash(rpmstrPool pool)
58
59 pool->hash = poolHashCreate(sizehint);
60 for (int i = 1; i <= pool->offs_size; i++)
61- poolHashAddEntry(pool, rpmstrPoolStr(pool, i), i);
62+ poolHashAddEntry(pool, rpmstrPoolStrNoLock(pool, i), i);
63 }
64
65 rpmstrPool rpmstrPoolCreate(void)
66@@ -245,6 +247,8 @@ rpmstrPool rpmstrPoolCreate(void)
67
68 rpmstrPool rpmstrPoolFree(rpmstrPool pool)
69 {
70+ #pragma omp critical(rpmstrpool)
71+ {
72 if (pool) {
73 if (pool->nrefs > 1) {
74 pool->nrefs--;
75@@ -260,18 +264,24 @@ rpmstrPool rpmstrPoolFree(rpmstrPool pool)
76 free(pool);
77 }
78 }
79+ }
80 return NULL;
81 }
82
83 rpmstrPool rpmstrPoolLink(rpmstrPool pool)
84 {
85+ #pragma omp critical(rpmstrpool)
86+ {
87 if (pool)
88 pool->nrefs++;
89+ }
90 return pool;
91 }
92
93 void rpmstrPoolFreeze(rpmstrPool pool, int keephash)
94 {
95+ #pragma omp critical(rpmstrpool)
96+ {
97 if (pool && !pool->frozen) {
98 if (!keephash) {
99 pool->hash = poolHashFree(pool->hash);
100@@ -281,16 +291,20 @@ void rpmstrPoolFreeze(rpmstrPool pool, int keephash)
101 pool->offs_alloced * sizeof(*pool->offs));
102 pool->frozen = 1;
103 }
104+ }
105 }
106
107 void rpmstrPoolUnfreeze(rpmstrPool pool)
108 {
109+ #pragma omp critical(rpmstrpool)
110+ {
111 if (pool) {
112 if (pool->hash == NULL) {
113 rpmstrPoolRehash(pool);
114 }
115 pool->frozen = 0;
116 }
117+ }
118 }
119
120 static rpmsid rpmstrPoolPut(rpmstrPool pool, const char *s, size_t slen, unsigned int hash)
121@@ -350,7 +364,7 @@ static rpmsid rpmstrPoolGet(rpmstrPool pool, const char * key, size_t keylen,
122 return 0;
123 }
124
125- s = rpmstrPoolStr(pool, ht->buckets[hash].keyid);
126+ s = rpmstrPoolStrNoLock(pool, ht->buckets[hash].keyid);
127 /* pool string could be longer than keylen, require exact matche */
128 if (strncmp(s, key, keylen) == 0 && s[keylen] == '\0')
129 return ht->buckets[hash].keyid;
130@@ -373,27 +387,31 @@ static inline rpmsid strn2id(rpmstrPool pool, const char *s, size_t slen,
131 rpmsid rpmstrPoolIdn(rpmstrPool pool, const char *s, size_t slen, int create)
132 {
133 rpmsid sid = 0;
134-
135+ #pragma omp critical(rpmstrpool)
136+ {
137 if (s != NULL) {
138 unsigned int hash = rstrnhash(s, slen);
139 sid = strn2id(pool, s, slen, hash, create);
140 }
141+ }
142 return sid;
143 }
144
145 rpmsid rpmstrPoolId(rpmstrPool pool, const char *s, int create)
146 {
147 rpmsid sid = 0;
148-
149+ #pragma omp critical(rpmstrpool)
150+ {
151 if (s != NULL) {
152 size_t slen;
153 unsigned int hash = rstrlenhash(s, &slen);
154 sid = strn2id(pool, s, slen, hash, create);
155 }
156+ }
157 return sid;
158 }
159
160-const char * rpmstrPoolStr(rpmstrPool pool, rpmsid sid)
161+static const char * rpmstrPoolStrNoLock(rpmstrPool pool, rpmsid sid)
162 {
163 const char *s = NULL;
164 if (pool && sid > 0 && sid <= pool->offs_size)
165@@ -401,12 +419,25 @@ const char * rpmstrPoolStr(rpmstrPool pool, rpmsid sid)
166 return s;
167 }
168
169+const char * rpmstrPoolStr(rpmstrPool pool, rpmsid sid)
170+{
171+ const char *s = NULL;
172+ #pragma omp critical(rpmstrpool)
173+ {
174+ s = rpmstrPoolStrNoLock(pool, sid);
175+ }
176+ return s;
177+}
178+
179 size_t rpmstrPoolStrlen(rpmstrPool pool, rpmsid sid)
180 {
181 size_t slen = 0;
182+ #pragma omp critical(rpmstrpool)
183+ {
184 if (pool && sid > 0 && sid <= pool->offs_size) {
185 slen = strlen(pool->offs[sid]);
186 }
187+ }
188 return slen;
189 }
190
191@@ -421,5 +452,12 @@ int rpmstrPoolStreq(rpmstrPool poolA, rpmsid sidA,
192
193 rpmsid rpmstrPoolNumStr(rpmstrPool pool)
194 {
195- return (pool != NULL) ? pool->offs_size : 0;
196+ rpmsid id = 0;
197+ #pragma omp critical(rpmstrpool)
198+ {
199+ if (pool) {
200+ id = pool->offs_size;
201+ }
202+ }
203+ return id;
204 }
205--
2062.11.0
207
diff --git a/meta/recipes-devtools/rpm/files/0004-build-pack.c-remove-static-local-variables-from-buil.patch b/meta/recipes-devtools/rpm/files/0004-build-pack.c-remove-static-local-variables-from-buil.patch
deleted file mode 100644
index 652e30b3e4..0000000000
--- a/meta/recipes-devtools/rpm/files/0004-build-pack.c-remove-static-local-variables-from-buil.patch
+++ /dev/null
@@ -1,336 +0,0 @@
1From 792693bb90768cfde4898e8dd31ee1b5de803d2f Mon Sep 17 00:00:00 2001
2From: Alexander Kanavin <alex.kanavin@gmail.com>
3Date: Thu, 8 Jun 2017 17:08:09 +0300
4Subject: [PATCH] build/pack.c: remove static local variables from buildHost()
5 and getBuildTime()
6
7Their use is causing difficult to diagnoze data races when building multiple
8packages in parallel, and is a bad idea in general, as it also makes it more
9difficult to reason about code.
10
11Upstream-Status: Submitted [https://github.com/rpm-software-management/rpm/pull/226]
12Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
13
14Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
15
16---
17 build/build.c | 54 ++++++++++++++++++++++++++++--
18 build/pack.c | 84 +++++++++--------------------------------------
19 build/rpmbuild_internal.h | 8 +++--
20 3 files changed, 74 insertions(+), 72 deletions(-)
21
22diff --git a/build/build.c b/build/build.c
23index 13c3df2..b154f08 100644
24--- a/build/build.c
25+++ b/build/build.c
26@@ -6,6 +6,8 @@
27 #include "system.h"
28
29 #include <errno.h>
30+#include <netdb.h>
31+#include <time.h>
32 #include <sys/wait.h>
33
34 #include <rpm/rpmlog.h>
35@@ -16,6 +18,50 @@
36
37 #include "debug.h"
38
39+static rpm_time_t getBuildTime(void)
40+{
41+ rpm_time_t buildTime = 0;
42+ char *srcdate;
43+ time_t epoch;
44+ char *endptr;
45+
46+ srcdate = getenv("SOURCE_DATE_EPOCH");
47+ if (srcdate) {
48+ errno = 0;
49+ epoch = strtol(srcdate, &endptr, 10);
50+ if (srcdate == endptr || *endptr || errno != 0)
51+ rpmlog(RPMLOG_ERR, _("unable to parse SOURCE_DATE_EPOCH\n"));
52+ else
53+ buildTime = (int32_t) epoch;
54+ } else
55+ buildTime = (int32_t) time(NULL);
56+
57+ return buildTime;
58+}
59+
60+static char * buildHost(void)
61+{
62+ char* hostname;
63+ struct hostent *hbn;
64+ char *bhMacro;
65+
66+ bhMacro = rpmExpand("%{?_buildhost}", NULL);
67+ if (strcmp(bhMacro, "") != 0) {
68+ rasprintf(&hostname, "%s", bhMacro);
69+ } else {
70+ hostname = rcalloc(1024, sizeof(*hostname));
71+ (void) gethostname(hostname, 1024);
72+ hbn = gethostbyname(hostname);
73+ if (hbn)
74+ strcpy(hostname, hbn->h_name);
75+ else
76+ rpmlog(RPMLOG_WARNING,
77+ _("Could not canonicalize hostname: %s\n"), hostname);
78+ }
79+ free(bhMacro);
80+ return(hostname);
81+}
82+
83 /**
84 */
85 static rpmRC doRmSource(rpmSpec spec)
86@@ -201,6 +247,9 @@ static rpmRC buildSpec(BTA_t buildArgs, rpmSpec spec, int what)
87 rpmRC rc = RPMRC_OK;
88 int test = (what & RPMBUILD_NOBUILD);
89 char *cookie = buildArgs->cookie ? xstrdup(buildArgs->cookie) : NULL;
90+ const char* host = buildHost();
91+ rpm_time_t buildTime = getBuildTime();
92+
93
94 if (rpmExpandNumeric("%{?source_date_epoch_from_changelog}") &&
95 getenv("SOURCE_DATE_EPOCH") == NULL) {
96@@ -269,11 +318,11 @@ static rpmRC buildSpec(BTA_t buildArgs, rpmSpec spec, int what)
97 goto exit;
98
99 if (((what & RPMBUILD_PACKAGESOURCE) && !test) &&
100- (rc = packageSources(spec, &cookie)))
101+ (rc = packageSources(spec, &cookie, buildTime, host)))
102 goto exit;
103
104 if (((what & RPMBUILD_PACKAGEBINARY) && !test) &&
105- (rc = packageBinaries(spec, cookie, (didBuild == 0))))
106+ (rc = packageBinaries(spec, cookie, (didBuild == 0), buildTime, host)))
107 goto exit;
108
109 if ((what & RPMBUILD_CLEAN) &&
110@@ -293,6 +342,7 @@ static rpmRC buildSpec(BTA_t buildArgs, rpmSpec spec, int what)
111 (void) unlink(spec->specFile);
112
113 exit:
114+ free(host);
115 free(cookie);
116 spec->rootDir = NULL;
117 if (rc != RPMRC_OK && rpmlogGetNrecs() > 0) {
118diff --git a/build/pack.c b/build/pack.c
119index df15876..17a4b09 100644
120--- a/build/pack.c
121+++ b/build/pack.c
122@@ -6,8 +6,6 @@
123 #include "system.h"
124
125 #include <errno.h>
126-#include <netdb.h>
127-#include <time.h>
128 #include <sys/wait.h>
129
130 #include <rpm/rpmlib.h> /* RPMSIGTAG*, rpmReadPackageFile */
131@@ -152,57 +150,6 @@ exit:
132 return rc;
133 }
134
135-static rpm_time_t * getBuildTime(void)
136-{
137- static rpm_time_t buildTime[1];
138- char *srcdate;
139- time_t epoch;
140- char *endptr;
141-
142- if (buildTime[0] == 0) {
143- srcdate = getenv("SOURCE_DATE_EPOCH");
144- if (srcdate) {
145- errno = 0;
146- epoch = strtol(srcdate, &endptr, 10);
147- if (srcdate == endptr || *endptr || errno != 0)
148- rpmlog(RPMLOG_ERR, _("unable to parse SOURCE_DATE_EPOCH\n"));
149- else
150- buildTime[0] = (int32_t) epoch;
151- } else
152- buildTime[0] = (int32_t) time(NULL);
153- }
154-
155- return buildTime;
156-}
157-
158-static const char * buildHost(void)
159-{
160- static char hostname[1024];
161- static int oneshot = 0;
162- struct hostent *hbn;
163- char *bhMacro;
164-
165- if (! oneshot) {
166- bhMacro = rpmExpand("%{?_buildhost}", NULL);
167- if (strcmp(bhMacro, "") != 0 && strlen(bhMacro) < 1024) {
168- strcpy(hostname, bhMacro);
169- } else {
170- if (strcmp(bhMacro, "") != 0)
171- rpmlog(RPMLOG_WARNING, _("The _buildhost macro is too long\n"));
172- (void) gethostname(hostname, sizeof(hostname));
173- hbn = gethostbyname(hostname);
174- if (hbn)
175- strcpy(hostname, hbn->h_name);
176- else
177- rpmlog(RPMLOG_WARNING,
178- _("Could not canonicalize hostname: %s\n"), hostname);
179- }
180- free(bhMacro);
181- oneshot = 1;
182- }
183- return(hostname);
184-}
185-
186 static rpmRC processScriptFiles(rpmSpec spec, Package pkg)
187 {
188 struct TriggerFileEntry *p;
189@@ -476,7 +423,8 @@ exit:
190 * order to how the RPM format is laid on disk.
191 */
192 static rpmRC writeRPM(Package pkg, unsigned char ** pkgidp,
193- const char *fileName, char **cookie)
194+ const char *fileName, char **cookie,
195+ rpm_time_t buildTime, const char* buildHost)
196 {
197 FD_t fd = NULL;
198 char * rpmio_flags = NULL;
199@@ -500,7 +448,7 @@ static rpmRC writeRPM(Package pkg, unsigned char ** pkgidp,
200
201 /* Create and add the cookie */
202 if (cookie) {
203- rasprintf(cookie, "%s %d", buildHost(), (int) (*getBuildTime()));
204+ rasprintf(cookie, "%s %d", buildHost, buildTime);
205 headerPutString(pkg->header, RPMTAG_COOKIE, *cookie);
206 }
207
208@@ -641,7 +589,7 @@ static rpmRC checkPackages(char *pkgcheck)
209 return RPMRC_OK;
210 }
211
212-static rpmRC packageBinary(rpmSpec spec, Package pkg, const char *cookie, int cheating, char** filename)
213+static rpmRC packageBinary(rpmSpec spec, Package pkg, const char *cookie, int cheating, char** filename, rpm_time_t buildTime, const char* buildHost)
214 {
215 const char *errorString;
216 rpmRC rc = RPMRC_OK;
217@@ -660,8 +608,8 @@ static rpmRC packageBinary(rpmSpec spec, Package pkg, const char *cookie, int ch
218 headerCopyTags(spec->packages->header, pkg->header, copyTags);
219
220 headerPutString(pkg->header, RPMTAG_RPMVERSION, VERSION);
221- headerPutString(pkg->header, RPMTAG_BUILDHOST, buildHost());
222- headerPutUint32(pkg->header, RPMTAG_BUILDTIME, getBuildTime(), 1);
223+ headerPutString(pkg->header, RPMTAG_BUILDHOST, buildHost);
224+ headerPutUint32(pkg->header, RPMTAG_BUILDTIME, &buildTime, 1);
225
226 if (spec->sourcePkgId != NULL) {
227 headerPutBin(pkg->header, RPMTAG_SOURCEPKGID, spec->sourcePkgId,16);
228@@ -699,7 +647,7 @@ static rpmRC packageBinary(rpmSpec spec, Package pkg, const char *cookie, int ch
229 free(binRpm);
230 }
231
232- rc = writeRPM(pkg, NULL, *filename, NULL);
233+ rc = writeRPM(pkg, NULL, *filename, NULL, buildTime, buildHost);
234 if (rc == RPMRC_OK) {
235 /* Do check each written package if enabled */
236 char *pkgcheck = rpmExpand("%{?_build_pkgcheck} ", *filename, NULL);
237@@ -719,7 +667,7 @@ struct binaryPackageTaskData
238 struct binaryPackageTaskData *next;
239 };
240
241-static struct binaryPackageTaskData* runBinaryPackageTasks(rpmSpec spec, const char *cookie, int cheating)
242+static struct binaryPackageTaskData* runBinaryPackageTasks(rpmSpec spec, const char *cookie, int cheating, rpm_time_t buildTime, char* buildHost)
243 {
244 struct binaryPackageTaskData *tasks = NULL;
245 struct binaryPackageTaskData *task = NULL;
246@@ -731,7 +679,7 @@ static struct binaryPackageTaskData* runBinaryPackageTasks(rpmSpec spec, const c
247 if (pkg == spec->packages) {
248 // the first package needs to be processed ahead of others, as they copy
249 // changelog data from it, and so otherwise data races would happen
250- task->result = packageBinary(spec, pkg, cookie, cheating, &(task->filename));
251+ task->result = packageBinary(spec, pkg, cookie, cheating, &(task->filename), buildTime, buildHost);
252 rpmlog(RPMLOG_NOTICE, _("Finished binary package job, result %d, filename %s\n"), task->result, task->filename);
253 tasks = task;
254 }
255@@ -748,7 +696,7 @@ static struct binaryPackageTaskData* runBinaryPackageTasks(rpmSpec spec, const c
256 if (task != tasks)
257 #pragma omp task
258 {
259- task->result = packageBinary(spec, task->pkg, cookie, cheating, &(task->filename));
260+ task->result = packageBinary(spec, task->pkg, cookie, cheating, &(task->filename), buildTime, buildHost);
261 rpmlog(RPMLOG_NOTICE, _("Finished binary package job, result %d, filename %s\n"), task->result, task->filename);
262 }
263 }
264@@ -766,11 +714,11 @@ static void freeBinaryPackageTasks(struct binaryPackageTaskData* tasks)
265 }
266 }
267
268-rpmRC packageBinaries(rpmSpec spec, const char *cookie, int cheating)
269+rpmRC packageBinaries(rpmSpec spec, const char *cookie, int cheating, rpm_time_t buildTime, char* buildHost)
270 {
271 char *pkglist = NULL;
272
273- struct binaryPackageTaskData *tasks = runBinaryPackageTasks(spec, cookie, cheating);
274+ struct binaryPackageTaskData *tasks = runBinaryPackageTasks(spec, cookie, cheating, buildTime, buildHost);
275
276 for (struct binaryPackageTaskData *task = tasks; task != NULL; task = task->next) {
277 if (task->result == RPMRC_OK) {
278@@ -797,7 +745,7 @@ rpmRC packageBinaries(rpmSpec spec, const char *cookie, int cheating)
279 return RPMRC_OK;
280 }
281
282-rpmRC packageSources(rpmSpec spec, char **cookie)
283+rpmRC packageSources(rpmSpec spec, char **cookie, rpm_time_t buildTime, char* buildHost)
284 {
285 Package sourcePkg = spec->sourcePackage;
286 rpmRC rc;
287@@ -805,8 +753,8 @@ rpmRC packageSources(rpmSpec spec, char **cookie)
288
289 /* Add some cruft */
290 headerPutString(sourcePkg->header, RPMTAG_RPMVERSION, VERSION);
291- headerPutString(sourcePkg->header, RPMTAG_BUILDHOST, buildHost());
292- headerPutUint32(sourcePkg->header, RPMTAG_BUILDTIME, getBuildTime(), 1);
293+ headerPutString(sourcePkg->header, RPMTAG_BUILDHOST, buildHost);
294+ headerPutUint32(sourcePkg->header, RPMTAG_BUILDTIME, &buildTime, 1);
295 headerPutUint32(sourcePkg->header, RPMTAG_SOURCEPACKAGE, &one, 1);
296
297 /* XXX this should be %_srpmdir */
298@@ -814,7 +762,7 @@ rpmRC packageSources(rpmSpec spec, char **cookie)
299 char *pkgcheck = rpmExpand("%{?_build_pkgcheck_srpm} ", fn, NULL);
300
301 spec->sourcePkgId = NULL;
302- rc = writeRPM(sourcePkg, &spec->sourcePkgId, fn, cookie);
303+ rc = writeRPM(sourcePkg, &spec->sourcePkgId, fn, cookie, buildTime, buildHost);
304
305 /* Do check SRPM package if enabled */
306 if (rc == RPMRC_OK && pkgcheck[0] != ' ') {
307diff --git a/build/rpmbuild_internal.h b/build/rpmbuild_internal.h
308index 439b7d3..07e8338 100644
309--- a/build/rpmbuild_internal.h
310+++ b/build/rpmbuild_internal.h
311@@ -427,19 +427,23 @@ rpmRC processSourceFiles(rpmSpec spec, rpmBuildPkgFlags pkgFlags);
312 * @param spec spec file control structure
313 * @param cookie build identifier "cookie" or NULL
314 * @param cheating was build shortcircuited?
315+ * @param buildTime the build timestamp that goes into packages
316+ * @param buildHost the hostname where the build is happening
317 * @return RPMRC_OK on success
318 */
319 RPM_GNUC_INTERNAL
320-rpmRC packageBinaries(rpmSpec spec, const char *cookie, int cheating);
321+rpmRC packageBinaries(rpmSpec spec, const char *cookie, int cheating, rpm_time_t buildTime, char* buildHost);
322
323 /** \ingroup rpmbuild
324 * Generate source package.
325 * @param spec spec file control structure
326 * @retval cookie build identifier "cookie" or NULL
327+ * @param buildTime the build timestamp that goes into packages
328+ * @param buildHost the hostname where the build is happening
329 * @return RPMRC_OK on success
330 */
331 RPM_GNUC_INTERNAL
332-rpmRC packageSources(rpmSpec spec, char **cookie);
333+rpmRC packageSources(rpmSpec spec, char **cookie, rpm_time_t buildTime, char* buildHost);
334
335 RPM_GNUC_INTERNAL
336 int addLangTag(rpmSpec spec, Header h, rpmTagVal tag,
diff --git a/meta/recipes-devtools/rpm/rpm_4.14.2.1.bb b/meta/recipes-devtools/rpm/rpm_4.15.1.bb
index 17255dc87a..5c1190a3df 100644
--- a/meta/recipes-devtools/rpm/rpm_4.14.2.1.bb
+++ b/meta/recipes-devtools/rpm/rpm_4.15.1.bb
@@ -24,7 +24,7 @@ HOMEPAGE = "http://www.rpm.org"
24LICENSE = "GPL-2.0" 24LICENSE = "GPL-2.0"
25LIC_FILES_CHKSUM = "file://COPYING;md5=c0bf017c0fd1920e6158a333acabfd4a" 25LIC_FILES_CHKSUM = "file://COPYING;md5=c0bf017c0fd1920e6158a333acabfd4a"
26 26
27SRC_URI = "git://github.com/rpm-software-management/rpm;branch=rpm-4.14.x \ 27SRC_URI = "git://github.com/rpm-software-management/rpm;branch=rpm-4.15.x \
28 file://0001-Do-not-add-an-unsatisfiable-dependency-when-building.patch \ 28 file://0001-Do-not-add-an-unsatisfiable-dependency-when-building.patch \
29 file://0001-Do-not-read-config-files-from-HOME.patch \ 29 file://0001-Do-not-read-config-files-from-HOME.patch \
30 file://0001-When-cross-installing-execute-package-scriptlets-wit.patch \ 30 file://0001-When-cross-installing-execute-package-scriptlets-wit.patch \
@@ -34,20 +34,15 @@ SRC_URI = "git://github.com/rpm-software-management/rpm;branch=rpm-4.14.x \
34 file://0001-Fix-build-with-musl-C-library.patch \ 34 file://0001-Fix-build-with-musl-C-library.patch \
35 file://0001-Add-a-color-setting-for-mips64_n32-binaries.patch \ 35 file://0001-Add-a-color-setting-for-mips64_n32-binaries.patch \
36 file://0011-Do-not-require-that-ELF-binaries-are-executable-to-b.patch \ 36 file://0011-Do-not-require-that-ELF-binaries-are-executable-to-b.patch \
37 file://0001-Split-binary-package-building-into-a-separate-functi.patch \
38 file://0002-Run-binary-package-creation-via-thread-pools.patch \
39 file://0003-rpmstrpool.c-make-operations-over-string-pools-threa.patch \
40 file://0004-build-pack.c-remove-static-local-variables-from-buil.patch \
41 file://0001-perl-disable-auto-reqs.patch \ 37 file://0001-perl-disable-auto-reqs.patch \
42 file://0001-rpm-rpmio.c-restrict-virtual-memory-usage-if-limit-s.patch \ 38 file://0001-rpm-rpmio.c-restrict-virtual-memory-usage-if-limit-s.patch \
43 file://0016-rpmscript.c-change-logging-level-around-scriptlets-t.patch \ 39 file://0016-rpmscript.c-change-logging-level-around-scriptlets-t.patch \
44 file://0001-mono-find-provides-requires-do-not-use-monodis-from-.patch \
45 file://0001-Rip-out-partial-support-for-unused-MD2-and-RIPEMD160.patch \
46 file://0001-rpmplugins.c-call-dlerror-prior-to-dlsym.patch \ 40 file://0001-rpmplugins.c-call-dlerror-prior-to-dlsym.patch \
41 file://0001-rpmfc.c-do-not-run-file-classification-in-parallel.patch \
47 " 42 "
48 43
49PE = "1" 44PE = "1"
50SRCREV = "4a9440006398646583f0d9ae1837dad2875013aa" 45SRCREV = "ab2179452c5be276a6b96c591afded485c7e58c3"
51 46
52S = "${WORKDIR}/git" 47S = "${WORKDIR}/git"
53 48
@@ -61,7 +56,7 @@ export PYTHON_ABI
61EXTRA_AUTORECONF_append = " --exclude=gnu-configize" 56EXTRA_AUTORECONF_append = " --exclude=gnu-configize"
62 57
63EXTRA_OECONF_append = " --without-lua --enable-python --with-crypto=openssl" 58EXTRA_OECONF_append = " --without-lua --enable-python --with-crypto=openssl"
64EXTRA_OECONF_append_libc-musl = " --disable-nls" 59EXTRA_OECONF_append_libc-musl = " --disable-nls --disable-openmp"
65 60
66# --sysconfdir prevents rpm from attempting to access machine-specific configuration in sysroot/etc; we need to have it in rootfs 61# --sysconfdir prevents rpm from attempting to access machine-specific configuration in sysroot/etc; we need to have it in rootfs
67# 62#
@@ -127,8 +122,7 @@ do_install_append () {
127 ${D}/${libdir}/rpm/macros 122 ${D}/${libdir}/rpm/macros
128 123
129 sed -i -e 's|/usr/bin/python|${USRBINPATH}/env ${PYTHON_PN}|' \ 124 sed -i -e 's|/usr/bin/python|${USRBINPATH}/env ${PYTHON_PN}|' \
130 ${D}${libdir}/rpm/pythondistdeps.py \ 125 ${D}${libdir}/rpm/pythondistdeps.py
131 ${D}${libdir}/rpm/python-macro-helper
132} 126}
133 127
134FILES_${PN} += "${libdir}/rpm-plugins/*.so \ 128FILES_${PN} += "${libdir}/rpm-plugins/*.so \