summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSylvestre Ledru <sylvestre@debian.org>2015-02-10 17:16:13 +0000
committerSylvestre Ledru <sylvestre@debian.org>2015-02-10 17:16:13 +0000
commit57958b5d359aab5daab2d579daaa098b908a3ed6 (patch)
tree45020465b8ccf395738e22f056c16f01e5ddad27
parente73e82f2beb4d25c9007a0878ca131959ec1f1b2 (diff)
downloadbcm5719-llvm-57958b5d359aab5daab2d579daaa098b908a3ed6.tar.gz
bcm5719-llvm-57958b5d359aab5daab2d579daaa098b908a3ed6.zip
Fix the LLDB build under Debian Kfreebsd
Summary: I don't know if there is a better way for the change in source/Host/freebsd/ThisThread.cpp Reviewers: emaste Subscribers: hansw, emaste, lldb-commits Differential Revision: http://reviews.llvm.org/D7441 llvm-svn: 228710
-rw-r--r--lldb/scripts/Python/modules/Makefile4
-rw-r--r--lldb/source/Host/common/Host.cpp2
-rw-r--r--lldb/source/Host/freebsd/HostThreadFreeBSD.cpp2
-rw-r--r--lldb/source/Host/freebsd/ThisThread.cpp9
-rw-r--r--lldb/tools/lldb-mi/MICmnLogMediumFile.cpp2
-rw-r--r--lldb/tools/lldb-mi/MIUtilSystemLinux.cpp2
-rw-r--r--lldb/tools/lldb-mi/MIUtilSystemLinux.h2
7 files changed, 17 insertions, 6 deletions
diff --git a/lldb/scripts/Python/modules/Makefile b/lldb/scripts/Python/modules/Makefile
index 90dda098ff6..b6989889858 100644
--- a/lldb/scripts/Python/modules/Makefile
+++ b/lldb/scripts/Python/modules/Makefile
@@ -12,8 +12,8 @@ include $(LLDB_LEVEL)/../../Makefile.config
DIRS:=
-# only build the readline suppression module on Linux
-ifeq ($(HOST_OS), Linux)
+# only build the readline suppression module on Linux, Kfreebsd & Hurd
+ifeq ($(HOST_OS), $(filter $(HOST_OS), Linux GNU GNU/kFreeBSD))
DIRS += readline
endif
diff --git a/lldb/source/Host/common/Host.cpp b/lldb/source/Host/common/Host.cpp
index 30f5c868306..233cb5c572c 100644
--- a/lldb/source/Host/common/Host.cpp
+++ b/lldb/source/Host/common/Host.cpp
@@ -1054,7 +1054,7 @@ Host::SetCrashDescription (const char *description)
#endif
-#if !defined (__linux__) && !defined (__FreeBSD__) && !defined (__NetBSD__)
+#if !defined (__linux__) && !defined (__FreeBSD__) && !defined(__FreeBSD_kernel__) && !defined (__NetBSD__)
const lldb_private::UnixSignalsSP&
Host::GetUnixSignals ()
diff --git a/lldb/source/Host/freebsd/HostThreadFreeBSD.cpp b/lldb/source/Host/freebsd/HostThreadFreeBSD.cpp
index 7d611bb6894..a4302a9e67b 100644
--- a/lldb/source/Host/freebsd/HostThreadFreeBSD.cpp
+++ b/lldb/source/Host/freebsd/HostThreadFreeBSD.cpp
@@ -14,7 +14,9 @@
// C includes
#include <errno.h>
#include <pthread.h>
+#if defined (__FreeBSD__)
#include <pthread_np.h>
+#endif
#include <stdlib.h>
#include <sys/sysctl.h>
#include <sys/user.h>
diff --git a/lldb/source/Host/freebsd/ThisThread.cpp b/lldb/source/Host/freebsd/ThisThread.cpp
index fb25847be24..e524fd4ace3 100644
--- a/lldb/source/Host/freebsd/ThisThread.cpp
+++ b/lldb/source/Host/freebsd/ThisThread.cpp
@@ -13,18 +13,27 @@
#include "llvm/ADT/SmallVector.h"
#include <pthread.h>
+#if defined (__FreeBSD__)
#include <pthread_np.h>
+#endif
using namespace lldb_private;
void
ThisThread::SetName(llvm::StringRef name)
{
+#if defined (__FreeBSD__) // Kfreebsd does not have a simple alternative
::pthread_set_name_np(::pthread_self(), name.data());
+#endif
}
void
ThisThread::GetName(llvm::SmallVectorImpl<char> &name)
{
+#if defined (__FreeBSD__)
HostNativeThread::GetName(::pthread_getthreadid_np(), name);
+#else
+// Kfreebsd
+ HostNativeThread::GetName((unsigned)pthread_self(), name);
+#endif
}
diff --git a/lldb/tools/lldb-mi/MICmnLogMediumFile.cpp b/lldb/tools/lldb-mi/MICmnLogMediumFile.cpp
index add4426b935..75c46c899dc 100644
--- a/lldb/tools/lldb-mi/MICmnLogMediumFile.cpp
+++ b/lldb/tools/lldb-mi/MICmnLogMediumFile.cpp
@@ -24,7 +24,7 @@
#include "MICmnResources.h"
#if defined(_MSC_VER)
#include "MIUtilSystemWindows.h"
-#elif defined(__FreeBSD__) || defined(__linux__)
+#elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__linux__)
#include "MIUtilSystemLinux.h"
#elif defined(__APPLE__)
#include "MIUtilSystemOsx.h"
diff --git a/lldb/tools/lldb-mi/MIUtilSystemLinux.cpp b/lldb/tools/lldb-mi/MIUtilSystemLinux.cpp
index 8227302356c..f2b409dd64b 100644
--- a/lldb/tools/lldb-mi/MIUtilSystemLinux.cpp
+++ b/lldb/tools/lldb-mi/MIUtilSystemLinux.cpp
@@ -19,7 +19,7 @@
// Copyright: None.
//--
-#if defined(__FreeBSD__) || defined(__linux__)
+#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__linux__)
// In-house headers:
#include "MIUtilSystemLinux.h"
diff --git a/lldb/tools/lldb-mi/MIUtilSystemLinux.h b/lldb/tools/lldb-mi/MIUtilSystemLinux.h
index 451b887e209..57518bcde34 100644
--- a/lldb/tools/lldb-mi/MIUtilSystemLinux.h
+++ b/lldb/tools/lldb-mi/MIUtilSystemLinux.h
@@ -21,7 +21,7 @@
#pragma once
-#if defined(__FreeBSD__) || defined(__linux__)
+#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__linux__)
// In-house headers:
#include "MIUtilString.h"
OpenPOWER on IntegriCloud