[libcxx-commits] [llvm] [compiler-rt] [libcxx] [lld] [lldb] [lld-macho] Find objects in library search path (PR #78628)

via libcxx-commits libcxx-commits at lists.llvm.org
Thu Jan 18 17:36:06 PST 2024


================
@@ -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:

a quick test with both `libcrt1.o.a` and `crt1.o` shows ld64 prefers crt1.o

https://github.com/llvm/llvm-project/pull/78628


More information about the libcxx-commits mailing list