<html>
<head>
<base href="https://bugs.llvm.org/">
</head>
<body><table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Bug ID</th>
<td><a class="bz_bug_link
bz_status_NEW "
title="NEW - LLD Mach-O doesn't search for frameworks in specified -F paths"
href="https://bugs.llvm.org/show_bug.cgi?id=47680">47680</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>LLD Mach-O doesn't search for frameworks in specified -F paths
</td>
</tr>
<tr>
<th>Product</th>
<td>lld
</td>
</tr>
<tr>
<th>Version</th>
<td>unspecified
</td>
</tr>
<tr>
<th>Hardware</th>
<td>Macintosh
</td>
</tr>
<tr>
<th>OS</th>
<td>MacOS X
</td>
</tr>
<tr>
<th>Status</th>
<td>NEW
</td>
</tr>
<tr>
<th>Severity</th>
<td>enhancement
</td>
</tr>
<tr>
<th>Priority</th>
<td>P
</td>
</tr>
<tr>
<th>Component</th>
<td>MachO
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>tbruio@outlook.com
</td>
</tr>
<tr>
<th>CC</th>
<td>llvm-bugs@lists.llvm.org
</td>
</tr></table>
<p>
<div>
<pre>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]
<a href="https://github.com/llvm/llvm-project/blob/606a734755d1fb6c35a17680d0c251f834b79334/lld/lib/Driver/DarwinLdDriver.cpp#L600">https://github.com/llvm/llvm-project/blob/606a734755d1fb6c35a17680d0c251f834b79334/lld/lib/Driver/DarwinLdDriver.cpp#L600</a>
[2]
<a href="https://github.com/llvm/llvm-project/blob/ba5087f13025a15662e164eb371fe0678258e03f/lld/lib/ReaderWriter/MachO/MachOLinkingContext.cpp#L581">https://github.com/llvm/llvm-project/blob/ba5087f13025a15662e164eb371fe0678258e03f/lld/lib/ReaderWriter/MachO/MachOLinkingContext.cpp#L581</a>
[3]
<a href="https://github.com/llvm/llvm-project/blob/ba5087f13025a15662e164eb371fe0678258e03f/lld/lib/ReaderWriter/MachO/MachOLinkingContext.cpp#L521">https://github.com/llvm/llvm-project/blob/ba5087f13025a15662e164eb371fe0678258e03f/lld/lib/ReaderWriter/MachO/MachOLinkingContext.cpp#L521</a></pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are on the CC list for the bug.</li>
</ul>
</body>
</html>