summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSylvestre Ledru <sylvestre@debian.org>2012-04-11 15:35:36 +0000
committerSylvestre Ledru <sylvestre@debian.org>2012-04-11 15:35:36 +0000
commit6fc30c26b7fa9e89c4e9ab99b7feab11389cc3f4 (patch)
treec9c0eb6e787e01990aabf2e15d388c01cf58769e
parent611afc0620aed7827b5fdf9072a1827952b684b6 (diff)
downloadllvm-6fc30c26b7fa9e89c4e9ab99b7feab11389cc3f4.tar.gz
llvm-6fc30c26b7fa9e89c4e9ab99b7feab11389cc3f4.tar.bz2
llvm-6fc30c26b7fa9e89c4e9ab99b7feab11389cc3f4.tar.xz
Fix the build under Debian GNU/Hurd.
Thanks to Pino Toscano for the patch git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@154500 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--Makefile.rules2
-rw-r--r--lib/Support/Unix/Path.inc5
-rw-r--r--lib/Support/Unix/PathV2.inc10
-rw-r--r--lib/Support/Unix/Process.inc4
-rw-r--r--tools/llvm-shlib/Makefile4
5 files changed, 20 insertions, 5 deletions
diff --git a/Makefile.rules b/Makefile.rules
index 76cec18ff8..0984dc0723 100644
--- a/Makefile.rules
+++ b/Makefile.rules
@@ -1432,7 +1432,7 @@ LD.Flags += -Wl,-exported_symbol,_main
endif
endif
-ifeq ($(HOST_OS), $(filter $(HOST_OS), Linux NetBSD FreeBSD))
+ifeq ($(HOST_OS), $(filter $(HOST_OS), Linux NetBSD FreeBSD GNU))
ifneq ($(ARCH), Mips)
LD.Flags += -Wl,--version-script=$(LLVM_SRC_ROOT)/autoconf/ExportMap.map
endif
diff --git a/lib/Support/Unix/Path.inc b/lib/Support/Unix/Path.inc
index b85b574ce3..ddc1e0f9ce 100644
--- a/lib/Support/Unix/Path.inc
+++ b/lib/Support/Unix/Path.inc
@@ -60,6 +60,11 @@
#include <mach-o/dyld.h>
#endif
+// For GNU Hurd
+#if defined(__GNU__) && !defined(MAXPATHLEN)
+# define MAXPATHLEN 4096
+#endif
+
// Put in a hack for Cygwin which falsely reports that the mkdtemp function
// is available when it is not.
#ifdef __CYGWIN__
diff --git a/lib/Support/Unix/PathV2.inc b/lib/Support/Unix/PathV2.inc
index c2d7df66d9..edb101efb0 100644
--- a/lib/Support/Unix/PathV2.inc
+++ b/lib/Support/Unix/PathV2.inc
@@ -46,6 +46,11 @@
#include <limits.h>
#endif
+// For GNU Hurd
+#if defined(__GNU__) && !defined(PATH_MAX)
+# define PATH_MAX 4096
+#endif
+
using namespace llvm;
namespace {
@@ -96,7 +101,12 @@ namespace sys {
namespace fs {
error_code current_path(SmallVectorImpl<char> &result) {
+#ifdef MAXPATHLEN
result.reserve(MAXPATHLEN);
+#else
+// For GNU Hurd
+ result.reserve(1024);
+#endif
while (true) {
if (::getcwd(result.data(), result.capacity()) == 0) {
diff --git a/lib/Support/Unix/Process.inc b/lib/Support/Unix/Process.inc
index 5cdb11cceb..2d7fd384e8 100644
--- a/lib/Support/Unix/Process.inc
+++ b/lib/Support/Unix/Process.inc
@@ -136,7 +136,7 @@ int Process::GetCurrentGroupId() {
return getgid();
}
-#ifdef HAVE_MACH_MACH_H
+#if defined(HAVE_MACH_MACH_H) && !defined(__GNU__)
#include <mach/mach.h>
#endif
@@ -150,7 +150,7 @@ void Process::PreventCoreFiles() {
setrlimit(RLIMIT_CORE, &rlim);
#endif
-#ifdef HAVE_MACH_MACH_H
+#if defined(HAVE_MACH_MACH_H) && !defined(__GNU__)
// Disable crash reporting on Mac OS X 10.0-10.4
// get information about the original set of exception ports for the task
diff --git a/tools/llvm-shlib/Makefile b/tools/llvm-shlib/Makefile
index 0035e3aebe..2d2e2c55b8 100644
--- a/tools/llvm-shlib/Makefile
+++ b/tools/llvm-shlib/Makefile
@@ -63,7 +63,7 @@ ifeq ($(HOST_OS),Darwin)
endif
endif
-ifeq ($(HOST_OS), $(filter $(HOST_OS), Linux FreeBSD OpenBSD))
+ifeq ($(HOST_OS), $(filter $(HOST_OS), Linux FreeBSD OpenBSD GNU))
# Include everything from the .a's into the shared library.
LLVMLibsOptions := -Wl,--whole-archive $(LLVMLibsOptions) \
-Wl,--no-whole-archive
@@ -71,7 +71,7 @@ ifeq ($(HOST_OS), $(filter $(HOST_OS), Linux FreeBSD OpenBSD))
LLVMLibsOptions += -Wl,--soname,lib$(LIBRARYNAME)$(SHLIBEXT)
endif
-ifeq ($(HOST_OS),Linux)
+ifeq ($(HOST_OS), $(filter $(HOST_OS), Linux GNU))
# Don't allow unresolved symbols.
LLVMLibsOptions += -Wl,--no-undefined
endif