Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 762095

Summary: sys-devel/binutils-apple: fix llvm patches to avoid exec loop
Product: Gentoo Linux Reporter: Jacob Floyd <cognifloyd+gentoobugs>
Component: Current packagesAssignee: Gentoo Prefix <prefix>
Status: UNCONFIRMED ---    
Severity: normal CC: sam
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: OS X   
See Also: https://bugs.gentoo.org/show_bug.cgi?id=631862
Whiteboard:
Package list:
Runtime testing required: ---
Attachments: modified llvm-prefix patch
modified llvm-shim patch

Description Jacob Floyd 2020-12-28 02:37:43 UTC
In my recent llvm-shim fix to enable dsymutil, I missed the case where /usr/bin gets checked for binaries before looking up binaries in lib/llvm/*/bin. So, it would find /usr/bin/nm which eventually symlinks to llvm-shim, thus execing the same thing over and over again. It manifests with a hung build during prefix bootstrap.

The fix requires:
- update two patches
- release a new patch archive:
  dev.gentoo.org/~grobian/distfiles/binutils-apple-patches-11.3-r2.tar.bz2
- bump the ebuild to use the new patch archive:
  binutils-apple-11.3.1-r2.ebuild

I will attach the two patches in a moment:
- binutils-apple-11.3.1-llvm-prefix.patch
- binutils-apple-11.3.1-llvm-shim.patch

Essentially, these patches allow skipping anything that is a symlink to llvm-shim.
Comment 1 Jacob Floyd 2020-12-28 02:41:09 UTC
Created attachment 679934 [details, diff]
modified llvm-prefix patch
Comment 2 Jacob Floyd 2020-12-28 02:41:37 UTC
Created attachment 679937 [details, diff]
modified llvm-shim patch
Comment 3 Jacob Floyd 2020-12-28 04:03:45 UTC
Swearing comic book style: @#*^!!

These patches removes the exec loop.
But now it fails to find dsymutil again.

Can someone else (more familiar with C than I am) take a look at this?
Maybe I'm using realpath incorrectly or something.

I will have very limited time to work on this for at least a few months.
Comment 4 Jacob Floyd 2020-12-28 04:05:16 UTC
Maybe look at reverting my llvm-shim patch, and instead change the llvm ebuild to install a symlink from llvm-dsymutil to dsymutil so that llvm-shim can find it without investigating symlinks.
Comment 5 Fabian Groffen gentoo-dev 2021-01-06 09:55:05 UTC
I think a more productive approach would be to focus on 8.2.1-r101.  I might at some point try and get the ld64 updated to the 11 variant there.