Bug 14386 - patchelf breaks go -native executables
Summary: patchelf breaks go -native executables
Status: RESOLVED WORKSFORME
Alias: None
Product: OE-Core
Classification: Build System, Metadata & Runtime
Component: devtools / tool chain (show other bugs)
Version: 3.4
Hardware: x86 Multiple
: Medium+ normal
Target Milestone: 5.1 M2
Assignee: Unassigned
QA Contact:
URL:
Whiteboard:
Depends on:
Blocks:
 
Reported: 2021-05-07 16:12 UTC by Bruce Ashfield
Modified: 2024-07-25 15:03 UTC (History)
7 users (show)

See Also:
OS type for building Yocto: ---
Type of Regression: ---
Verified:
Documentation change: No (bug/feature does not impact docs)


Attachments
executable before patchelf (7.80 MB, application/octet-stream)
2021-05-07 16:13 UTC, Bruce Ashfield
no flags Details
executable after patchelf (7.80 MB, application/octet-stream)
2021-05-07 16:14 UTC, Bruce Ashfield
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Bruce Ashfield 2021-05-07 16:12:53 UTC
When uninative runs on a go -native executable, we end up with a broken binary which always core dumps.

A log of a manual/devshell run follows:

build [/opt/poky/...ners/umoci]> ./umoci --version
umoci version 0.4.7+dev~git758044fc26ad65eb900143e90d1e22c2d6e4484d
build [/opt/poky/...ners/umoci]> patchelf-uninative --set-interpreter /opt/poky/build/tmp/sysroots-uninative/x86_64-linux/lib/ld-linux-x86-64.so.2 umoci                                                                                                         
build [/opt/poky/...ners/umoci]> ./umoci --version
Segmentation fault (core dumped)

This has been an issue for ~2 years with patchelf, as can be seen in these upstream bug reports:

  https://forum.snapcraft.io/t/patchelf-broke-my-binary/4928
  https://github.com/NixOS/patchelf/issues/146

The workaround (for now) is to statically link the -native application to avoid the patchelf corruption.
Comment 1 Bruce Ashfield 2021-05-07 16:13:56 UTC
Created attachment 4797 [details]
executable before patchelf
Comment 2 Bruce Ashfield 2021-05-07 16:14:28 UTC
Created attachment 4798 [details]
executable after patchelf
Comment 3 Randy MacLeod 2023-07-26 21:22:05 UTC
Bulk move of 64 bugs to 4.3 M3 after a quick review.
If a bug is actually fixed, please add a commit link and resolve it.
-- Randy for YP bug team.
Comment 4 Trevor Gamblin 2023-09-14 16:44:18 UTC
Moved to M4.
Comment 5 Randy MacLeod 2023-10-30 15:29:15 UTC
Bulk move to 5.0 M1. -- Randy
Comment 6 Randy MacLeod 2023-12-21 20:50:49 UTC
Upstream bugs still open, moving to M3.
Comment 7 Randy MacLeod 2024-02-22 18:41:19 UTC
Upstream bugs still open, moving to M4.
Comment 9 Randy MacLeod 2024-07-25 15:03:05 UTC
No one has seen this in ages.