[llvm-bugs] [Bug 47680] New: LLD Mach-O doesn't search for frameworks in specified -F paths

via llvm-bugs llvm-bugs at lists.llvm.org
Tue Sep 29 08:33:55 PDT 2020


https://bugs.llvm.org/show_bug.cgi?id=47680

            Bug ID: 47680
           Summary: LLD Mach-O doesn't search for frameworks in specified
                    -F paths
           Product: lld
           Version: unspecified
          Hardware: Macintosh
                OS: MacOS X
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: MachO
          Assignee: unassignedbugs at nondot.org
          Reporter: tbruio at outlook.com
                CC: llvm-bugs at lists.llvm.org

On macOS, Clang ba950ad0a51066868fbca37, linking any program with `-framework
Metal` or any framework doesn't work. It fails with
```
Cannot find framework for <whatever>
```

Adding `-F /System/Library/Frameworks` to the linker flags doesn't help either.
Passing full paths to the Framework to clang also fails.

I looked at the code and it seems authors are aware of the weird rules that
control System Framework Search paths. [1]

clang passes the Xcode's SDK which doesn't contain the Framework Binary (with
the same name as the framework) which is searched by [2]. 

Also, since Xcode is in /Applications, which starts with "/" passing another
system path is also ineffective. [3]

[1]
https://github.com/llvm/llvm-project/blob/606a734755d1fb6c35a17680d0c251f834b79334/lld/lib/Driver/DarwinLdDriver.cpp#L600
[2]
https://github.com/llvm/llvm-project/blob/ba5087f13025a15662e164eb371fe0678258e03f/lld/lib/ReaderWriter/MachO/MachOLinkingContext.cpp#L581
[3]
https://github.com/llvm/llvm-project/blob/ba5087f13025a15662e164eb371fe0678258e03f/lld/lib/ReaderWriter/MachO/MachOLinkingContext.cpp#L521

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20200929/f39c66f2/attachment.html>


More information about the llvm-bugs mailing list