Bug 14386

Summary: patchelf breaks go -native executables
Product: [Build System, Metadata & Runtime] OE-Core Reporter: Bruce Ashfield <bruce.ashfield>
Component: devtools / tool chainAssignee: Unassigned <unassigned>
Status: RESOLVED WORKSFORME QA Contact:
Severity: normal    
Priority: Medium+ CC: a.chandrasekhar123, Martin.Jansa, meta.mr.watcher, meta.watcher, randy.macleod, sakib.sajal, tgamblin
Version: 3.4   
Target Milestone: 5.1 M2   
Hardware: x86   
OS: Multiple   
Whiteboard:
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: No (bug/feature does not impact docs)
Attachments:
Description Flags
executable before patchelf
none
executable after patchelf none

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.