[lld] [lld] handle re-exports for full framework paths (PR #137989)
Richard Howell via llvm-commits
llvm-commits at lists.llvm.org
Wed Apr 30 14:47:54 PDT 2025
================
@@ -1566,6 +1566,25 @@ static DylibFile *loadDylib(StringRef path, DylibFile *umbrella) {
return loadDylib(*mbref, umbrella);
}
+static StringRef findFramework(StringRef path, StringRef frameworkName) {
+ // Framework names can be in multiple formats:
+ // - Foo.framework/Foo
+ // - Foo.framework/Versions/A/Foo
+ size_t start;
+ size_t end = path.size();
+ while (true) {
+ start = path.rfind('/', end);
+ if (start == StringRef::npos)
+ return StringRef();
+
+ StringRef component = path.substr(start + 1, end - start - 1);
+ if (component == frameworkName)
+ return path.substr(start + 1);
+
+ end = start;
+ }
----------------
rmaz wrote:
I thought about this some more and I can't think of a case where you could have `Foo.framework` as the start of a load command, it would either have to be an absolute path or `@path/` prefixed, so checking with both prefix and suffix / should do it.
https://github.com/llvm/llvm-project/pull/137989
More information about the llvm-commits
mailing list