Files
haikuports/sys-devel/llvm/patches/llvm-5.0.0.patchset
2017-11-11 20:39:36 +01:00

78 lines
2.8 KiB
Plaintext

From 3825ccfacb0e6db06ac955d58bb9d20dc43b52a8 Mon Sep 17 00:00:00 2001
From: Jerome Duval <jerome.duval@gmail.com>
Date: Wed, 20 Jan 2016 21:13:28 +0000
Subject: llvm-config: use /develop/headers instead of /include
* don't provide obj-root and src-root.
diff --git a/tools/llvm-config/llvm-config.cpp b/tools/llvm-config/llvm-config.cpp
index 08b096a..739213c 100644
--- a/tools/llvm-config/llvm-config.cpp
+++ b/tools/llvm-config/llvm-config.cpp
@@ -332,11 +332,16 @@ int main(int argc, char **argv) {
("-I" + ActiveIncludeDir + " " + "-I" + ActiveObjRoot + "/include");
} else {
ActivePrefix = CurrentExecPrefix;
+#ifdef __HAIKU__
+ ActiveIncludeDir = ActivePrefix + "/develop/headers";
+ ActiveLibDir = ActivePrefix + "/develop/lib" + LLVM_LIBDIR_SUFFIX;
+#else
ActiveIncludeDir = ActivePrefix + "/include";
+ ActiveLibDir = ActivePrefix + "/lib" + LLVM_LIBDIR_SUFFIX;
+#endif
SmallString<256> path(StringRef(LLVM_TOOLS_INSTALL_DIR));
sys::fs::make_absolute(ActivePrefix, path);
ActiveBinDir = path.str();
- ActiveLibDir = ActivePrefix + "/lib" + LLVM_LIBDIR_SUFFIX;
ActiveCMakeDir = ActiveLibDir + "/cmake/llvm";
ActiveIncludeOption = "-I" + ActiveIncludeDir;
}
@@ -556,10 +561,16 @@ int main(int argc, char **argv) {
OS << (LLVM_HAS_GLOBAL_ISEL ? "ON" : "OFF") << '\n';
} else if (Arg == "--shared-mode") {
PrintSharedMode = true;
- } else if (Arg == "--obj-root") {
- OS << ActivePrefix << '\n';
- } else if (Arg == "--src-root") {
- OS << LLVM_SRC_ROOT << '\n';
+ } else if (Arg == "--obj-root" || Arg == "--src-root") {
+ if (IsInDevelopmentTree) {
+ if (Arg == "--obj-root")
+ OS << ActivePrefix << '\n';
+ else
+ OS << LLVM_SRC_ROOT << '\n';
+ } else {
+ llvm::errs() << "llvm-config: sources not installed\n";
+ exit(1);
+ }
} else if (Arg == "--ignore-libllvm") {
LinkDyLib = false;
LinkMode = BuiltSharedLibs ? LinkModeShared : LinkModeAuto;
--
2.14.2
From 23ce807b3b13948116864f588a401c191b630b20 Mon Sep 17 00:00:00 2001
From: Jerome Duval <jerome.duval@gmail.com>
Date: Sat, 16 Sep 2017 15:02:46 +0200
Subject: Haiku doesn't expose whether a FS is local or remote.
diff --git a/lib/Support/Unix/Path.inc b/lib/Support/Unix/Path.inc
index 45097eb..1790a0a 100644
--- a/lib/Support/Unix/Path.inc
+++ b/lib/Support/Unix/Path.inc
@@ -381,6 +381,9 @@ static bool is_local_impl(struct STATVFS &Vfs) {
#elif defined(__CYGWIN__)
// Cygwin doesn't expose this information; would need to use Win32 API.
return false;
+#elif defined(__HAIKU__)
+ // Haiku doesn't expose this information
+ return false;
#elif defined(__sun)
// statvfs::f_basetype contains a null-terminated FSType name of the mounted target
StringRef fstype(Vfs.f_basetype);
--
2.14.2