[PATCH] D127393: [Driver] Don't add -lresolv on FreeBSD

Andrew Turner via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Jun 13 04:10:36 PDT 2022


andrew updated this revision to Diff 436338.
andrew added a comment.

Update the comment


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D127393/new/

https://reviews.llvm.org/D127393

Files:
  clang/lib/Driver/ToolChains/CommonArgs.cpp
  clang/test/Driver/sanitizer-ld.c


Index: clang/test/Driver/sanitizer-ld.c
===================================================================
--- clang/test/Driver/sanitizer-ld.c
+++ clang/test/Driver/sanitizer-ld.c
@@ -107,7 +107,6 @@
 // CHECK-ASAN-FREEBSD: "--export-dynamic"
 // CHECK-ASAN-FREEBSD: "-lpthread"
 // CHECK-ASAN-FREEBSD: "-lrt"
-// CHECK-ASAN-FREEBSD: "-lresolv"
 
 // RUN: %clang -### %s 2>&1 \
 // RUN:     --target=i386-unknown-freebsd -fuse-ld=ld -fsanitize=address \
Index: clang/lib/Driver/ToolChains/CommonArgs.cpp
===================================================================
--- clang/lib/Driver/ToolChains/CommonArgs.cpp
+++ clang/lib/Driver/ToolChains/CommonArgs.cpp
@@ -838,8 +838,8 @@
       TC.getTriple().isOSNetBSD() ||
       TC.getTriple().isOSOpenBSD())
     CmdArgs.push_back("-lexecinfo");
-  // There is no libresolv on Android.
-  if (!TC.getTriple().isAndroid())
+  // There is no libresolv on Android or FreeBSD.
+  if (!TC.getTriple().isAndroid() && !TC.getTriple().isOSFreeBSD())
     CmdArgs.push_back("-lresolv");
 }
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D127393.436338.patch
Type: text/x-patch
Size: 1038 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20220613/abc33447/attachment.bin>


More information about the cfe-commits mailing list