Commit Graph

32 Commits

Author SHA1 Message Date
Martin Jansa
d505ab5ea5 patchelf: add 3 fixes to optimize and fix uninative
* uninative-3.10 and 4.0 doesn't work on e.g. ubuntu-18.04, because patchelf-uninative
  makes the binaries unusable and e.g. mkfs.ext4 segfaults in loader, see:
  https://github.com/NixOS/patchelf/issues/492

* mke2fs.real, mkfs.ext2.real, mkfs.ext3.real, mkfs.ext4.real are indentical
  binary with multiple hardlinks and we end calling patchelf-uninative 4
  times even when the interpreter is already set correctly from the build

  The issue was reported upstream with mkfs.ext4.real as possible reproducer:
  https://github.com/NixOS/patchelf/issues/492#issuecomment-1602862272

  To fix uninative we need to first release new uninative tarball and
  then upgrade it in master, mickledore, kirkstone, dunfell

* originally reported in:
  https://lists.openembedded.org/g/openembedded-core/message/182862
  with temporary work around (applicable locally without waiting for
  new uninative release):
  https://lists.openembedded.org/g/openembedded-core/message/183314

(From OE-Core rev: f0499b58d1dd149300a349dde8f6664679df13e6)

Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-08-01 09:51:20 +01:00
Richard Purdie
1b301fa2d5 patchelf: Upgrade 0.17.2 -> 0.18.0
Add package to contain the new zsh completion files.

(From OE-Core rev: 9db1a06969e33cb7a67b196b9ff7479202384151)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-05-03 07:33:18 +01:00
Wang Mingyu
e5f159c0e3 patchelf: upgrade 0.17.0 -> 0.17.2
8d2cb4f9ab8d564904c292099a022ffb3cccd52d.patch
included in 0.17.2

Changelog:
===========
 Also pass STRIP to the tests
 Fix Out-of-bounds read in the function modifySoname
 Split segment size fix

(From OE-Core rev: ae8319a6ce5af747a1882bd67384286fef75474a)

Signed-off-by: Wang Mingyu <wangmy@fujitsu.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-01-16 10:42:07 +00:00
Richard Purdie
44e148d616 patchelf: Add fix submitted upstream for uninative segfaults
The new uninative tarball is segfaulting in quilt (the underlying
patch binary). We see errors in dmesg like:

(patch): Uhuuh, elf segment at 0000000000400000 requested but the memory is mapped already

This patch submitted to patchelf upstream looks like an appropriate fix
for that.

(From OE-Core rev: cccd4bcaf381c2729adc000381bd89906003e72a)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-01-10 14:18:36 +00:00
Wang Mingyu
ce8970cdbf patchelf: upgrade 0.16.1 -> 0.17.0
Changelog:
==========
 fix pagesize on ia64
 write out replace sections in original order
 patchelf: correct page size for sparc64/sparc32
 update vendored elf file
 add workaround for readelf from binutils 2.30
 make objdump/objcopy/readelf configurable and respect cross-compiling
 build patchelf on windows

(From OE-Core rev: 8f7af3802d73c81af355e245cc057edc8cf1cd63)

Signed-off-by: Wang Mingyu <wangmy@fujitsu.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-12-06 15:23:18 +00:00
Richard Purdie
f64890e1fc patchelf: upgrade 0.15.0 -> 0.16.1
(From OE-Core rev: 4fed5eee37a25f9b06e91f2bbf5db2fcdf01df8c)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-11-03 07:46:47 +00:00
Alexander Kanavin
fd65379613 patchelf: replace a rejected patch with an equivalent uninative.bbclass tweak
This was the original reason to add the patch:
https://git.openembedded.org/openembedded-core/commit/?id=18efcbcb896239c64fedd009ce57f3f0c668cbc0

and this is the upstream discussion which suggests handling
read-only files explicitly outside of patchelf:
https://github.com/NixOS/patchelf/pull/89

(From OE-Core rev: 728775c87a7e35a03408675ce1c7a8cd061b2fda)

Signed-off-by: Alexander Kanavin <alex@linutronix.de>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-08-14 08:13:32 +01:00
Alexander Kanavin
51aa1c66dd patchelf: update 0.14.5 -> 0.15.0
Rebase handle-read-only-files.patch

(From OE-Core rev: 0b2f8da3ff9cbbb6fc2ab75fbe09ad1fe745c53b)

Signed-off-by: Alexander Kanavin <alex@linutronix.de>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-08-14 08:13:32 +01:00
wangmy
d9cdd64d6e patchelf: upgrade 0.14.3 -> 0.14.5
(From OE-Core rev: 5d5b7126c71b57d049ecd9bdd28edd7d1166b101)

Signed-off-by: Wang Mingyu <wangmy@fujitsu.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-02-25 12:41:23 +00:00
Richard Purdie
b0130fcf91 meta/meta-selftest/meta-skeleton: Update LICENSE variable to use SPDX license identifiers
An automated conversion using scripts/contrib/convert-spdx-licenses.py to
convert to use the standard SPDX license identifiers. Two recipes in meta-selftest
were not converted as they're that way specifically for testing. A change in
linux-firmware was also skipped and may need a more manual tweak.

(From OE-Core rev: ceda3238cdbf1beb216ae9ddb242470d5dfc25e0)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-02-20 16:45:25 +00:00
Richard Purdie
a28c145aa4 patchelf: Fix corrupted file mode patch
The recent patchelf upgrades corrupted the file permissions patch we
carry as upstream inserted an early exit to the funciton.

This showed up as corrupted file modes when testing a new uninative tarball
containing this patchelf.

Rework and tweak the patch to fix this.

(From OE-Core rev: bcdba091d99f9a3ae67c0ba17fcf27329698a0c0)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-02-11 13:45:20 +00:00
Richard Purdie
6943aac26e patchelf: upgrade 0.14.2 -> 0.14.3
(From OE-Core rev: a1524bb96bddd221a08df73a88bca851d423959f)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-12-12 18:10:22 +00:00
Richard Purdie
3d7b493f11 patchelf: Upgrade 0.14.1 -> 0.14.2
(From OE-Core rev: aa396ec57d0e15bd257f710290074984f0efbeed)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-12-06 11:09:53 +00:00
wangmy
f7050dee8b patchelf: upgrade 0.13 -> 0.14.1
refresh handle-read-only-files.patch

(From OE-Core rev: 978f04fc520938b231c236c00582360aea63b364)

Signed-off-by: Wang Mingyu <wangmy@fujitsu.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-12-01 16:23:45 +00:00
Richard Purdie
ddcf16d1f7 meta: Add explict branch to git SRC_URIs
There is uncertainty about the default branch name in git going forward.
To try and cover the different possible outcomes, add branch names to all
git:// and gitsm:// SRC_URI entries.

This update was made with the script added to contrib in this patch which
aims to help others convert other layers.

(From OE-Core rev: b51c405faf6f8c0365f7533bfaf470d79152a463)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-10-30 18:56:47 +01:00
Alexander Kanavin
253fca8246 patchelf: upgrade 0.12 -> 0.13
(From OE-Core rev: 9fdfa49ac11eff7215fab8540114535b2c652b83)

Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-08-23 08:25:52 +01:00
Richard Purdie
c19e2c23be patchelf: Fix alignment patch
The previous fix was in the right direction but needed to account
for the section alignment of the current section. Tweak the patch
to handle this.

(From OE-Core rev: e464efc07a8997c43998a9c6a9544be11ab4f303)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-05-02 23:20:12 +01:00
Richard Purdie
cde414f571 patchelf: Fix note section alignment issues
Improve note section normalization was added to patchelf in recent versions
however if fails if there are two note sections which aren't sized to match
section alignment. Tweak the code to account for section alignment.

This fixes patchelf failures on the autobuilder, particularly to ccache-native.

(From OE-Core rev: fee8dde0d597b511b37d8dcf215e8355980d5f2b)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-05-01 22:43:11 +01:00
Richard Purdie
63b0992ab7 patchelf: Backport fix from upstream for note section overlap error
Backport a patch from upstream to fix an error:
patchelf: cannot normalize PT_NOTE segment: non-contiguous SHT_NOTE sections

seen on our ubuntu1604 autobuilder worker.

(From OE-Core rev: 80e8f7d34d7032cc94b61bf155eac7648e6b6c74)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-04-23 10:12:08 +01:00
Dorinda
8e4567bd5f meta/recipes-devtools: Add HOMEPAGE / DESCRIPTION
Added HOMEPAGE and DESCRIPTION for recipes with missing decriptions or homepage

[YOCTO #13471]

(From OE-Core rev: bb05814335e7101bfd8df0a11dc18a044e867bed)

Signed-off-by: Dorinda Bassey <dorindabassey@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-02-26 15:21:21 +00:00
Richard Purdie
a6386db353 patchelf: upgrade 0.11 -> 0.12
(From OE-Core rev: 41694bc38996a6abfd2a4dabf6283434a538a6d3)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-09-02 16:00:46 +01:00
Richard Purdie
2fd754bed7 patchelf: Upgrade 0.10 -> 0.11
Two patches were merged upstream, the other needed refreshing.

(From OE-Core rev: 9a4547804f0a889dc583e84a00374085ecf7f361)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-06-17 16:31:52 +01:00
Richard Purdie
07223656d2 patchelf: Add patch to address corrupt shared library issue
patchelf can corrupt shared libraries if the program headers don't
immediately follow the elf header. Add a patch submitted upstream
to address this.

(From OE-Core rev: e7811c787bbe2f5d49b3506309499acc27189988)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-06-04 13:27:32 +01:00
Alexander Kanavin
40584e8719 patchelf: switch to git
The tarball download website is full of broken links;
while direct tarball download still works, exploring
around and checking for latest versions does not.

(From OE-Core rev: d1c11259464ba2d972e1e1ad5c540050ccc80c15)

Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-05-07 12:15:59 +01:00
Stefan Müller-Klieser
820c10e689 recipes: change SRC_URI to use https
Change all recipes to https where we get an http 301 permanent redirect.

(From OE-Core rev: e514acda9e12bccde6d3974e0fd1a37b3837191a)

Signed-off-by: Stefan Müller-Klieser <s.mueller-klieser@phytec.de>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-12-06 14:41:28 +00:00
Alex Kiernan
27c4975629 patchelf: Upgrade 0.9 -> 0.10
Drop patches merged (or redone differently) upstream

(From OE-Core rev: e81004fd334a8204852f271101ddcf4a39e9ccb5)

Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-05-08 12:15:17 +01:00
Ed Bartosh
ec5c4e97c8 patchelf: fix segfault for binaries linked by gold
Due to a bug in calculating adresses of modified program
headers patchelf breaks executables linked by Gold linker
causing them to segfault, e.g.
$ tmp/sysroots-components/x86_64/m4-native/usr/bin/m4 --help
Segmentation fault

This is reproducible only in some cases and only for executables
of ET_DYN type produced by Gold or by ld linked with pie.

This should be solved by fix-adjusting-startPage.patch that
fixes calculation logic.

[YOCTO #11785]

(From OE-Core rev: 4e4c96db4b1d2356b5d071cee6746a96eca20439)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-07-24 09:13:30 +01:00
Ed Bartosh
52f2d81c9a patchelf: change patch status
The patch has been accepted upstream.
Changed patch status Pending -> Accepted.

(From OE-Core rev: 4e9b1e9798e7b12664d4afc611e430a988b6b1ca)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-07-24 09:13:30 +01:00
Richard Purdie
c4901328fe patchelf: Fix issues with the 'hole' in binaries approach
We're seeing two issues with patchelf, one where it inflates binaries to MBs in
size, the other where stripping the resulting binary fails:

$ strip fixincl
Not enough room for program headers, try linking with -N
[.note.ABI-tag]: Bad value

The patch header describes more about what the problem is and how the patch
fixes it.

[YOCTO #11123]
[YOCTO #11009]

(From OE-Core rev: 39f5a05152aa0c3503735e18dd3b4c066b284107)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-03-07 20:05:31 +00:00
Fabio Berton
d03439e0db 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>
2016-09-15 12:15:07 +01:00
Richard Purdie
576a248b46 patchelf: Add patch to handle large files
There were "maximum size exceeded" errors from patchelf when processing
qemu-native. There is an issue open for this upstream, add a patch
proposed there for this issue. "32" was increased to "64" to handle our
qemu-ppc binary.

(From OE-Core rev: 79d320544202d719eeb5affd9b687505dcd9b725)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-02-06 23:10:45 +00:00
Richard Purdie
a90346e6c3 patchelf: Add patchelf recipe
This is useful since it allows us to edit the RPATH and interpreter fields
in ELF binaries. This is potentially particularly useful in improving the way
we can use the SDK and also potentially making native binaries more relocatable.

(From OE-Core rev: 003766fb2e50b11914ca06947ecfa039429b0815)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-08-28 15:12:42 +01:00