lddtree.sh: Add an "ldd-mode" for when the command is executed as *ldd #17
Open
chewi wants to merge 3 commits intogentoo:masterfrom
Open
lddtree.sh: Add an "ldd-mode" for when the command is executed as *ldd #17chewi wants to merge 3 commits intogentoo:masterfrom
chewi wants to merge 3 commits intogentoo:masterfrom
Conversation
Member
Author
|
Ah, I'd overlooked the tests. 😅 |
The output resembles the regular ldd command. Signed-off-by: James Le Cuirot <chewi@gentoo.org>
Don't install lddtree.py unconditionally because it has additional dependencies.
It's counter-intuitive and doesn't play well with other programs that expect path arguments to work normally. Signed-off-by: James Le Cuirot <chewi@gentoo.org>
Member
Author
|
Sample "ldd-mode" output with real ldd comparison:
|
Member
|
I'd missed that you'd prepared this. There's a fair bit in master which needs a release and we should do one for https://bugs.gentoo.org/890577 especially, so I don't want to rush trying to review it now, will come back to it later (remind me if I forget). |
Member
Author
|
This is less necessary now that Dracut no longer uses ldd. It's still potentially useful though. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Dracut needs ldd to identify which libraries it needs to pull into the initrd. The regular ldd does not work across architectures though, so it suggests using this gist, which is based on a script from crosstool-ng. I suggested adding this to Gentoo's crossdev but there was little appetite to add yet another ldd implementation.
lddtree.sh almost outputs what we need, the main issue being that it includes the file being examined, even when it is the only file being examined. I decided to add an "ldd-mode" to make the output more like regular ldd when it is executed as *ldd. The intention is to install a symlink to it with crossdev. I had to restructure the code a bit to ensure it was still readable after adding a third output format.
lddtree.sh currently doesn't get installed when the Python implementation is chosen, which would make things awkward for crossdev. I have therefore made Meson install lddtree.sh unconditionally, adding an lddtree symlink pointing to the chosen implementation instead.
Both lddtree implementations enable the auto-root feature by default. This breaks Dracut as it passes regular rooted paths to ldd, meaning that /foo/bin/ls becomes /foo/foo/bin/ls. I don't want to have to create a wrapper to disable this option, and it seems like quite a counter-intuitive feature anyway, so I have now disabled it by default. Hopefully this isn't controversial. I can't see any use of lddtree by packages at build time or runtime.