diff --git a/clang/lib/Driver/ToolChains/CommonArgs.cpp b/clang/lib/Driver/ToolChains/CommonArgs.cpp --- a/clang/lib/Driver/ToolChains/CommonArgs.cpp +++ b/clang/lib/Driver/ToolChains/CommonArgs.cpp @@ -838,6 +838,9 @@ TC.getTriple().isOSNetBSD() || TC.getTriple().isOSOpenBSD()) CmdArgs.push_back("-lexecinfo"); + // There is no libresolv on Android. + if (!TC.getTriple().isAndroid()) + CmdArgs.push_back("-lresolv"); } static void diff --git a/compiler-rt/test/msan/Linux/b64.cpp b/compiler-rt/test/msan/Linux/b64.cpp --- a/compiler-rt/test/msan/Linux/b64.cpp +++ b/compiler-rt/test/msan/Linux/b64.cpp @@ -1,4 +1,4 @@ -// RUN: %clangxx_msan -O0 %s -o %t -lresolv && %run %t +// RUN: %clangxx_msan -O0 %s -o %t && %run %t // RUN: not %run %t NTOP_READ 2>&1 | FileCheck %s --check-prefix=NTOP_READ // RUN: not %run %t PTON_READ 2>&1 | FileCheck %s --check-prefix=PTON_READ diff --git a/compiler-rt/test/msan/Linux/dn_expand.cpp b/compiler-rt/test/msan/Linux/dn_expand.cpp --- a/compiler-rt/test/msan/Linux/dn_expand.cpp +++ b/compiler-rt/test/msan/Linux/dn_expand.cpp @@ -1,4 +1,4 @@ -// RUN: %clangxx_msan -O0 %s -o %t -lresolv && %run %t +// RUN: %clangxx_msan -O0 %s -o %t && %run %t #include #include diff --git a/compiler-rt/test/sanitizer_common/TestCases/Linux/b64.cpp b/compiler-rt/test/sanitizer_common/TestCases/Linux/b64.cpp --- a/compiler-rt/test/sanitizer_common/TestCases/Linux/b64.cpp +++ b/compiler-rt/test/sanitizer_common/TestCases/Linux/b64.cpp @@ -1,7 +1,4 @@ -// RUN: %clangxx %s -o %t -lresolv && %run %t %p - -// -lresolv fails on Android. -// UNSUPPORTED: android +// RUN: %clangxx %s -o %t && %run %t %p #include #include diff --git a/compiler-rt/test/sanitizer_common/TestCases/Linux/dn_expand.cpp b/compiler-rt/test/sanitizer_common/TestCases/Linux/dn_expand.cpp --- a/compiler-rt/test/sanitizer_common/TestCases/Linux/dn_expand.cpp +++ b/compiler-rt/test/sanitizer_common/TestCases/Linux/dn_expand.cpp @@ -1,7 +1,4 @@ -// RUN: %clangxx %s -o %t -lresolv && %run %t %p - -// -lresolv fails on Android. -// UNSUPPORTED: android +// RUN: %clangxx %s -o %t && %run %t %p #include #include