================
@@ -95,11 +95,16 @@ static std::optional<StringRef> findLibrary(StringRef name) 
{
               findPathCombination("lib" + name, config->librarySearchPaths,
                                   {".tbd", ".dylib", ".so"}))
         return path;
-      return findPathCombination("lib" + name, config->librarySearchPaths,
-                                 {".a"});
+      else if (std::optional<StringRef> path = findPathCombination(
+                   "lib" + name, config->librarySearchPaths, {".a"}))
+        return path;
+      return findPathCombination(name, config->librarySearchPaths, {""});
----------------
OldWorldOrdr wrote:

Looks like ld64 checks if the library name ends in `.o` and if so, assumes it's 
a Csu support file, and looks for a file in the library search path with that 
exact name, not searching for any `libcrt1.o.a`.

If a Csu support file is not found ld64 automatically changes the target to 
MacOS 10.8 which stopped requiring Csu support files, then continues without 
linking the object.

Apples new linker does the same, but it has no concept of Csu support files and 
just links with it like it were a normal file, exiting with an error if it's 
not found.

https://github.com/llvm/llvm-project/pull/78628
_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to