[Lldb-commits] [lldb] r297612 - Fix android build
Pavel Labath via lldb-commits
lldb-commits at lists.llvm.org
Mon Mar 13 03:59:23 PDT 2017
Author: labath
Date: Mon Mar 13 05:59:23 2017
New Revision: 297612
URL: http://llvm.org/viewvc/llvm-project?rev=297612&view=rev
Log:
Fix android build
getpwent is not available on android until API level 21, and even then
it is only available when doing a non-static link. Since android's
concept of users is very different from linux, it's doubtful the home
directory resolution would be useful, so I approximate this state by
just not using getpwent on android.
We've had another getpwent occurance in FileSpec for a while -- it
wasn't causing problems because it was stripped out by the linker, but I
disable that also, for consistency's sake.
Modified:
lldb/trunk/source/Host/common/FileSpec.cpp
lldb/trunk/source/Utility/TildeExpressionResolver.cpp
Modified: lldb/trunk/source/Host/common/FileSpec.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Host/common/FileSpec.cpp?rev=297612&r1=297611&r2=297612&view=diff
==============================================================================
--- lldb/trunk/source/Host/common/FileSpec.cpp (original)
+++ lldb/trunk/source/Host/common/FileSpec.cpp Mon Mar 13 05:59:23 2017
@@ -218,7 +218,7 @@ void FileSpec::ResolveUsername(llvm::Sma
size_t FileSpec::ResolvePartialUsername(llvm::StringRef partial_name,
StringList &matches) {
-#ifndef LLVM_ON_WIN32
+#if !defined(LLVM_ON_WIN32) || !defined(__ANDROID__)
size_t extant_entries = matches.GetSize();
setpwent();
Modified: lldb/trunk/source/Utility/TildeExpressionResolver.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Utility/TildeExpressionResolver.cpp?rev=297612&r1=297611&r2=297612&view=diff
==============================================================================
--- lldb/trunk/source/Utility/TildeExpressionResolver.cpp (original)
+++ lldb/trunk/source/Utility/TildeExpressionResolver.cpp Mon Mar 13 05:59:23 2017
@@ -44,7 +44,7 @@ bool StandardTildeExpressionResolver::Re
assert(Expr.empty() || Expr[0] == '~');
Output.clear();
-#if defined(LLVM_ON_WIN32)
+#if defined(LLVM_ON_WIN32) || defined(__ANDROID__)
return false;
#else
if (Expr.empty())
More information about the lldb-commits
mailing list