Skip to content
This repository was archived by the owner on Apr 19, 2019. It is now read-only.

Commit c3ad97e

Browse files
fbertuxostroproject-ci
authored andcommitted
patchelf: Update to version 0.9
* Remove patch maxsize.patch already applied upstream. * Add patch Skip-empty-section-fixes-66.patch to prevent errors like: / |ERROR: go-cross-1.6.2-r0 do_populate_sysroot_setscene: '('patchelf-uninative', |'--set-interpreter', '/home/user/src/prj/build/tmp/sysroots-uninative/ |x86_64-linux/lib/ld-linux-x86-64.so.2', '/home/user/src/prj/build/tmp/ |work/x86_64-linux/go-cross/1.6.2-r0/sstate-install-populate_sysroot/x86_64- |linux/usr/bin/aarch64-prj-linux/go')' |failed with exit code 1 and the following output: |cannot find section .rela.dyn \ * Add patch handle-read-only-files.patch to fix error when building eSKD, the following error appears on task do_testsdkext / |ERROR: db-native-6.0.30-r1 do_populate_sysroot_setscene: '('patchelf-uninative', |'--set-interpreter', 'src/fsl-community-bsp/build/tmp/work/qemuarm-poky-linux- |gnueabi/core-image-minimal/1.0-r0/testsdkext/tc/tmp/sysroots-uninative/ |x86_64-linux/lib/ld-linux-x86-64.so.2', 'src/fsl-community-bsp/build/tmp/work/ |qemuarm-poky-linux-gnueabi/core-image-minimal/1.0-r0/testsdkext/tc/tmp/work/ |x86_64-linux/db-native/6.0.30-r1/sstate-install-populate_sysroot/x86_64-linux/ |usr/bin/db_tuner')' failed with exit code 1 and the following output: |b'open: Permission denied\n \ * Add patch Increase-maxSize-to-64MB.patch to fix error described bellow, the same issue is discussed here: - NixOS/patchelf#47 / |ERROR: qemu-native-2.5.0-r1 do_populate_sysroot_setscene: '('patchelf-uninative', |'--set-interpreter', '../build/tmp/sysroots-uninative/x86_64-linux/lib/ |ld-linux-x86-64.so.2', '../build/tmp/work/x86_64-linux/qemu-native/2.5.0-r1/ |sstate-install-populate_sysroot/x86_64-linux/usr/bin/qemu-mips64')' |failed with exit code 1 and the following output: |warning: working around a Linux kernel bug by creating a hole of 36032512 |bytes in ‘../build/tmp/work/x86_64-linux/qemu-native/2.5.0-r1/ |sstate-install-populate_sysroot/x86_64-linux/usr/bin/qemu-mips64’ |maximum file size exceeded \ (From OE-core rev: 18efcbcb896239c64fedd009ce57f3f0c668cbc0) Signed-off-by: Fabio Berton <[email protected]> Signed-off-by: Richard Purdie <[email protected]>
1 parent 3c77bdf commit c3ad97e

File tree

5 files changed

+136
-33
lines changed

5 files changed

+136
-33
lines changed
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
From e3658740ec100e4c8cf83295460b032979e1a99a Mon Sep 17 00:00:00 2001
2+
From: Fabio Berton <[email protected]>
3+
Date: Fri, 9 Sep 2016 18:21:32 -0300
4+
Subject: [PATCH] Increase maxSize to 64MB
5+
Organization: O.S. Systems Software LTDA.
6+
7+
Fix error:
8+
9+
/
10+
|ERROR: qemu-native-2.5.0-r1 do_populate_sysroot_setscene: '('patchelf-uninative',
11+
|'--set-interpreter', '../build/tmp/sysroots-uninative/x86_64-linux/lib/
12+
|ld-linux-x86-64.so.2', '../build/tmp/work/x86_64-linux/qemu-native/2.5.0-r1/
13+
|sstate-install-populate_sysroot/x86_64-linux/usr/bin/qemu-mips64')'
14+
|failed with exit code 1 and the following output:
15+
|warning: working around a Linux kernel bug by creating a hole of 36032512
16+
|bytes in ‘../build/tmp/work/x86_64-linux/qemu-native/2.5.0-r1/
17+
|sstate-install-populate_sysroot/x86_64-linux/usr/bin/qemu-mips64’
18+
|maximum file size exceeded
19+
\
20+
21+
Similar issue is discussed here:
22+
https://github.com/NixOS/patchelf/issues/47
23+
24+
Upstream-Status: Inappropriate [embedded specific]
25+
26+
Signed-off-by: Fabio Berton <[email protected]>
27+
---
28+
src/patchelf.cc | 2 +-
29+
1 file changed, 1 insertion(+), 1 deletion(-)
30+
31+
diff --git a/src/patchelf.cc b/src/patchelf.cc
32+
index a59c12d..0fd7355 100644
33+
--- a/src/patchelf.cc
34+
+++ b/src/patchelf.cc
35+
@@ -279,7 +279,7 @@ static void readFile(string fileName)
36+
struct stat st;
37+
if (stat(fileName.c_str(), &st) != 0) error("stat");
38+
fileSize = st.st_size;
39+
- maxSize = fileSize + 32 * 1024 * 1024;
40+
+ maxSize = fileSize + 64 * 1024 * 1024;
41+
42+
contents = (unsigned char *) malloc(fileSize + maxSize);
43+
if (!contents) abort();
44+
--
45+
2.1.4
46+
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
From 73526cb546ae6b00ea6169e40b01fb7b5f0dbb50 Mon Sep 17 00:00:00 2001
2+
From: Fabio Berton <[email protected]>
3+
Date: Thu, 28 Jul 2016 11:05:06 -0300
4+
Subject: [PATCH] Skip empty section (fixes #66)
5+
Organization: O.S. Systems Software LTDA.
6+
7+
Upstream-Status: Pending
8+
9+
Signed-off-by: Fabio Berton <[email protected]>
10+
---
11+
src/patchelf.cc | 3 +++
12+
1 file changed, 3 insertions(+)
13+
14+
diff --git a/src/patchelf.cc b/src/patchelf.cc
15+
index 136098f..2677a26 100644
16+
--- a/src/patchelf.cc
17+
+++ b/src/patchelf.cc
18+
@@ -684,6 +684,9 @@ void ElfFile<ElfFileParamNames>::rewriteSectionsExecutable()
19+
for (unsigned int i = 1; i <= lastReplaced; ++i) {
20+
Elf_Shdr & shdr(shdrs[i]);
21+
string sectionName = getSectionName(shdr);
22+
+ if (sectionName == "") {
23+
+ continue;
24+
+ }
25+
debug("looking at section `%s'\n", sectionName.c_str());
26+
/* !!! Why do we stop after a .dynstr section? I can't
27+
remember! */
28+
--
29+
2.1.4
30+
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
From 2a603acb65993698c21f1c6eb7664f93ad830d52 Mon Sep 17 00:00:00 2001
2+
From: Fabio Berton <[email protected]>
3+
Date: Fri, 9 Sep 2016 16:00:42 -0300
4+
Subject: [PATCH] handle read-only files
5+
Organization: O.S. Systems Software LTDA.
6+
7+
Patch from:
8+
https://github.com/darealshinji/patchelf/commit/40e66392bc4b96e9b4eda496827d26348a503509
9+
10+
Upstream-Status: Pending
11+
12+
Signed-off-by: Fabio Berton <[email protected]>
13+
---
14+
src/patchelf.cc | 16 +++++++++++++++-
15+
1 file changed, 15 insertions(+), 1 deletion(-)
16+
17+
diff --git a/src/patchelf.cc b/src/patchelf.cc
18+
index 136098f..aea360e 100644
19+
--- a/src/patchelf.cc
20+
+++ b/src/patchelf.cc
21+
@@ -388,7 +388,17 @@ void ElfFile<ElfFileParamNames>::sortShdrs()
22+
23+
static void writeFile(string fileName)
24+
{
25+
- int fd = open(fileName.c_str(), O_TRUNC | O_WRONLY);
26+
+ struct stat st;
27+
+ int fd;
28+
+
29+
+ if (stat(fileName.c_str(), &st) != 0)
30+
+ error("stat");
31+
+
32+
+ if (chmod(fileName.c_str(), 0600) != 0)
33+
+ error("chmod");
34+
+
35+
+ fd = open(fileName.c_str(), O_TRUNC | O_WRONLY);
36+
+
37+
if (fd == -1)
38+
error("open");
39+
40+
@@ -397,6 +407,10 @@ static void writeFile(string fileName)
41+
42+
if (close(fd) != 0)
43+
error("close");
44+
+
45+
+ if (chmod(fileName.c_str(), st.st_mode) != 0)
46+
+ error("chmod");
47+
+
48+
}
49+
50+
51+
--
52+
2.1.4
53+

meta/recipes-devtools/patchelf/patchelf/maxsize.patch

Lines changed: 0 additions & 30 deletions
This file was deleted.

meta/recipes-devtools/patchelf/patchelf_0.8.bb renamed to meta/recipes-devtools/patchelf/patchelf_0.9.bb

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,14 @@
11
SRC_URI = "http://nixos.org/releases/${BPN}/${BPN}-${PV}/${BPN}-${PV}.tar.bz2 \
2-
file://maxsize.patch"
2+
file://Skip-empty-section-fixes-66.patch \
3+
file://handle-read-only-files.patch \
4+
file://Increase-maxSize-to-64MB.patch \
5+
"
6+
37
LICENSE = "GPLv3"
48
SUMMARY = "Tool to allow editing of RPATH and interpreter fields in ELF binaries"
59

6-
SRC_URI[md5sum] = "5b151e3c83b31f5931b4a9fc01635bfd"
7-
SRC_URI[sha256sum] = "c99f84d124347340c36707089ec8f70530abd56e7827c54d506eb4cc097a17e7"
10+
SRC_URI[md5sum] = "d02687629c7e1698a486a93a0d607947"
11+
SRC_URI[sha256sum] = "a0f65c1ba148890e9f2f7823f4bedf7ecad5417772f64f994004f59a39014f83"
812

913
LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504"
1014

0 commit comments

Comments
 (0)