Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 762095 - sys-devel/binutils-apple: fix llvm patches to avoid exec loop
Summary: sys-devel/binutils-apple: fix llvm patches to avoid exec loop
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All OS X
: Normal normal (vote)
Assignee: Gentoo Prefix
Depends on:
Reported: 2020-12-28 02:37 UTC by Jacob Floyd
Modified: 2021-01-06 09:55 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---

modified llvm-prefix patch (binutils-apple-11.3.1-llvm-prefix.patch,11.19 KB, patch)
2020-12-28 02:41 UTC, Jacob Floyd
Details | Diff
modified llvm-shim patch (binutils-apple-11.3.1-llvm-shim.patch,4.03 KB, patch)
2020-12-28 02:41 UTC, Jacob Floyd
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
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:
- bump the ebuild to use the new patch archive:

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.