summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/patchelf/patchelf/handle-read-only-files.patch
diff options
context:
space:
mode:
authorFabio Berton <fabio.berton@ossystems.com.br>2016-09-14 09:30:29 -0300
committerRichard Purdie <richard.purdie@linuxfoundation.org>2016-09-15 12:15:07 +0100
commitd03439e0db02a0b6d165ca7da2d648add83d8649 (patch)
tree20e383a6698736bf9efa42c8e0084245d2751e74 /meta/recipes-devtools/patchelf/patchelf/handle-read-only-files.patch
parenta6f0bced4c15f93a5e1c1b8782aa5dc6ca8d1113 (diff)
downloadpoky-d03439e0db02a0b6d165ca7da2d648add83d8649.tar.gz
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: - https://github.com/NixOS/patchelf/issues/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 <fabio.berton@ossystems.com.br> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-devtools/patchelf/patchelf/handle-read-only-files.patch')
-rw-r--r--meta/recipes-devtools/patchelf/patchelf/handle-read-only-files.patch53
1 files changed, 53 insertions, 0 deletions
diff --git a/meta/recipes-devtools/patchelf/patchelf/handle-read-only-files.patch b/meta/recipes-devtools/patchelf/patchelf/handle-read-only-files.patch
new file mode 100644
index 0000000000..9fafec4b59
--- /dev/null
+++ b/meta/recipes-devtools/patchelf/patchelf/handle-read-only-files.patch
@@ -0,0 +1,53 @@
1From 2a603acb65993698c21f1c6eb7664f93ad830d52 Mon Sep 17 00:00:00 2001
2From: Fabio Berton <fabio.berton@ossystems.com.br>
3Date: Fri, 9 Sep 2016 16:00:42 -0300
4Subject: [PATCH] handle read-only files
5Organization: O.S. Systems Software LTDA.
6
7Patch from:
8https://github.com/darealshinji/patchelf/commit/40e66392bc4b96e9b4eda496827d26348a503509
9
10Upstream-Status: Pending
11
12Signed-off-by: Fabio Berton <fabio.berton@ossystems.com.br>
13---
14 src/patchelf.cc | 16 +++++++++++++++-
15 1 file changed, 15 insertions(+), 1 deletion(-)
16
17diff --git a/src/patchelf.cc b/src/patchelf.cc
18index 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--
522.1.4
53