D93000: [lld-macho] Implement `-no_implicit_dylibs` applied to frameworks. Partial fix for PR48511.
Details
- Reviewers
thakis - Group Reviewers
Restricted Project - Commits
- rG3aa8e071dd1a: [lld-macho] Add implicit dylib support for frameworks
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
@thakis I'm unable to properly test PR48511 as the CoreGraphics on my local system seems to have a slightly different set of symbols (despite it being version 10.15.7 too). However, the binary is now trying to import the symbol from CoreGraphics rather than ApplicationServices, so I think this diff is on the right track.
Thanks! I tested this and put the details in https://bugs.llvm.org/show_bug.cgi?id=48511#c3 and https://bugs.llvm.org/show_bug.cgi?id=48511#c5 . Summary: This is a good change, but it's not sufficient for that bug. One comment about pedantic correctness below :)
lld/MachO/InputFiles.cpp | ||
---|---|---|
514 | This matches File<A>::isPublicLocation in ld64 which lists a few special cases here https://github.com/apple-opensource/ld64/blob/fd3feabb0a1eb18ab5d7910f3c3a5eed99cef6ab/src/ld/parsers/generic_dylib_file.hpp#L490 that this code as-is doesn't quite get right yet I think: // but only top level framework // /System/Library/Frameworks/Foo.framework/Versions/A/Foo ==> true // /System/Library/Frameworks/Foo.framework/Resources/libBar.dylib ==> false // /System/Library/Frameworks/Foo.framework/Frameworks/Bar.framework/Bar ==> false // /System/Library/Frameworks/Foo.framework/Frameworks/Xfoo.framework/XFoo ==> false |
I suppose even with the pedantic correctness thing fixed it's a progression, so I should lg. But probably good to get it fully right immediately so we can consider implicit_dylibs as done and forget about it -- I'd recommend implementing that suggestion before committing :)
lld/MachO/InputFiles.cpp | ||
---|---|---|
514 | I think the code gets this right, but I'll extend the test to verify :) |
This matches File<A>::isPublicLocation in ld64 which lists a few special cases here https://github.com/apple-opensource/ld64/blob/fd3feabb0a1eb18ab5d7910f3c3a5eed99cef6ab/src/ld/parsers/generic_dylib_file.hpp#L490 that this code as-is doesn't quite get right yet I think: