Files
haikuports/sys-devel/llvm/patches/clang-3.5.2.patchset
2016-01-27 18:41:15 +00:00

303 lines
13 KiB
Plaintext

From ec3c2cfd7b95a3c7c7904abafebab5c7f56a83e9 Mon Sep 17 00:00:00 2001
From: Alexander von Gluck IV <kallisti5@unixzen.com>
Date: Sun, 1 Feb 2015 15:13:57 +0000
Subject: haiku: fix header search paths
* /boot/develop no longer exists
* /boot/common no longer exists
diff --git a/cfe-3.5.2.src/lib/Frontend/InitHeaderSearch.cpp b/cfe-3.5.2.src/lib/Frontend/InitHeaderSearch.cpp
index d2edc94..f91346b 100644
--- a/cfe-3.5.2.src/lib/Frontend/InitHeaderSearch.cpp
+++ b/cfe-3.5.2.src/lib/Frontend/InitHeaderSearch.cpp
@@ -271,38 +271,41 @@ void InitHeaderSearch::AddDefaultCIncludePaths(const llvm::Triple &triple,
llvm_unreachable("Include management is handled in the driver.");
case llvm::Triple::Haiku:
- AddPath("/boot/common/include", System, false);
- AddPath("/boot/develop/headers/os", System, false);
- AddPath("/boot/develop/headers/os/app", System, false);
- AddPath("/boot/develop/headers/os/arch", System, false);
- AddPath("/boot/develop/headers/os/device", System, false);
- AddPath("/boot/develop/headers/os/drivers", System, false);
- AddPath("/boot/develop/headers/os/game", System, false);
- AddPath("/boot/develop/headers/os/interface", System, false);
- AddPath("/boot/develop/headers/os/kernel", System, false);
- AddPath("/boot/develop/headers/os/locale", System, false);
- AddPath("/boot/develop/headers/os/mail", System, false);
- AddPath("/boot/develop/headers/os/media", System, false);
- AddPath("/boot/develop/headers/os/midi", System, false);
- AddPath("/boot/develop/headers/os/midi2", System, false);
- AddPath("/boot/develop/headers/os/net", System, false);
- AddPath("/boot/develop/headers/os/storage", System, false);
- AddPath("/boot/develop/headers/os/support", System, false);
- AddPath("/boot/develop/headers/os/translation", System, false);
- AddPath("/boot/develop/headers/os/add-ons/graphics", System, false);
- AddPath("/boot/develop/headers/os/add-ons/input_server", System, false);
- AddPath("/boot/develop/headers/os/add-ons/screen_saver", System, false);
- AddPath("/boot/develop/headers/os/add-ons/tracker", System, false);
- AddPath("/boot/develop/headers/os/be_apps/Deskbar", System, false);
- AddPath("/boot/develop/headers/os/be_apps/NetPositive", System, false);
- AddPath("/boot/develop/headers/os/be_apps/Tracker", System, false);
- AddPath("/boot/develop/headers/cpp", System, false);
- AddPath("/boot/develop/headers/cpp/i586-pc-haiku", System, false);
- AddPath("/boot/develop/headers/3rdparty", System, false);
- AddPath("/boot/develop/headers/bsd", System, false);
- AddPath("/boot/develop/headers/glibc", System, false);
- AddPath("/boot/develop/headers/posix", System, false);
- AddPath("/boot/develop/headers", System, false);
+ AddPath("/boot/system/non-packaged/develop/headers", System, false);
+ AddPath("/boot/system/develop/headers/os", System, false);
+ AddPath("/boot/system/develop/headers/os/app", System, false);
+ AddPath("/boot/system/develop/headers/os/arch", System, false);
+ AddPath("/boot/system/develop/headers/os/device", System, false);
+ AddPath("/boot/system/develop/headers/os/drivers", System, false);
+ AddPath("/boot/system/develop/headers/os/game", System, false);
+ AddPath("/boot/system/develop/headers/os/interface", System, false);
+ AddPath("/boot/system/develop/headers/os/kernel", System, false);
+ AddPath("/boot/system/develop/headers/os/locale", System, false);
+ AddPath("/boot/system/develop/headers/os/mail", System, false);
+ AddPath("/boot/system/develop/headers/os/media", System, false);
+ AddPath("/boot/system/develop/headers/os/midi", System, false);
+ AddPath("/boot/system/develop/headers/os/midi2", System, false);
+ AddPath("/boot/system/develop/headers/os/net", System, false);
+ AddPath("/boot/system/develop/headers/os/opengl", System, false);
+ AddPath("/boot/system/develop/headers/os/storage", System, false);
+ AddPath("/boot/system/develop/headers/os/support", System, false);
+ AddPath("/boot/system/develop/headers/os/translation", System, false);
+ AddPath("/boot/system/develop/headers/os/add-ons/graphics", System, false);
+ AddPath("/boot/system/develop/headers/os/add-ons/input_server", System, false);
+ AddPath("/boot/system/develop/headers/os/add-ons/mail_daemon", System, false);
+ AddPath("/boot/system/develop/headers/os/add-ons/registrar", System, false);
+ AddPath("/boot/system/develop/headers/os/add-ons/screen_saver", System, false);
+ AddPath("/boot/system/develop/headers/os/add-ons/tracker", System, false);
+ AddPath("/boot/system/develop/headers/os/be_apps/Deskbar", System, false);
+ AddPath("/boot/system/develop/headers/os/be_apps/NetPositive", System, false);
+ AddPath("/boot/system/develop/headers/os/be_apps/Tracker", System, false);
+ AddPath("/boot/system/develop/headers/cpp", System, false);
+ AddPath("/boot/system/develop/headers/cpp/i586-pc-haiku", System, false);
+ AddPath("/boot/system/develop/headers/3rdparty", System, false);
+ AddPath("/boot/system/develop/headers/bsd", System, false);
+ AddPath("/boot/system/develop/headers/glibc", System, false);
+ AddPath("/boot/system/develop/headers/posix", System, false);
+ AddPath("/boot/system/develop/headers", System, false);
break;
case llvm::Triple::RTEMS:
break;
--
2.2.2
From c504a37e10d3a064845342335c6330b638274031 Mon Sep 17 00:00:00 2001
From: Adrien Destugues <pulkomandy@pulkomandy.tk>
Date: Sun, 1 Feb 2015 15:15:45 +0000
Subject: libclang: add soname when building on Haiku.
diff --git a/cfe-3.5.2.src/tools/libclang/Makefile b/cfe-3.5.2.src/tools/libclang/Makefile
index db3d4f8..149f245 100644
--- a/cfe-3.5.2.src/tools/libclang/Makefile
+++ b/cfe-3.5.2.src/tools/libclang/Makefile
@@ -33,7 +33,7 @@ USEDLIBS = clangIndex.a clangARCMigrate.a \
include $(CLANG_LEVEL)/Makefile
# Add soname to the library.
-ifeq ($(HOST_OS), $(filter $(HOST_OS), Linux FreeBSD GNU GNU/kFreeBSD))
+ifeq ($(HOST_OS), $(filter $(HOST_OS), Linux FreeBSD GNU GNU/kFreeBSD Haiku))
LLVMLibsOptions += -Wl,-soname,lib$(LIBRARYNAME)$(SHLIBEXT)
endif
--
2.2.2
From 321f0a6f34747b5fb2ac588242ddcf5539163cc1 Mon Sep 17 00:00:00 2001
From: Jerome Duval <jerome.duval@gmail.com>
Date: Tue, 22 Dec 2015 22:07:06 +0000
Subject: don't include c++ headers in C include search paths.
* define a Haiku toolchain, and add c++ headers path.
diff --git a/cfe-3.5.2.src/lib/Driver/Driver.cpp b/cfe-3.5.2.src/lib/Driver/Driver.cpp
index ef26bfa..ca1f4c4 100644
--- a/cfe-3.5.2.src/lib/Driver/Driver.cpp
+++ b/cfe-3.5.2.src/lib/Driver/Driver.cpp
@@ -1982,6 +1982,9 @@ const ToolChain &Driver::getToolChain(const ArgList &Args,
case llvm::Triple::Solaris:
TC = new toolchains::Solaris(*this, Target, Args);
break;
+ case llvm::Triple::Haiku:
+ TC = new toolchains::Haiku(*this, Target, Args);
+ break;
case llvm::Triple::Win32:
switch (Target.getEnvironment()) {
default:
diff --git a/cfe-3.5.2.src/lib/Driver/ToolChains.cpp b/cfe-3.5.2.src/lib/Driver/ToolChains.cpp
index b46f69d..0701013 100644
--- a/cfe-3.5.2.src/lib/Driver/ToolChains.cpp
+++ b/cfe-3.5.2.src/lib/Driver/ToolChains.cpp
@@ -2429,6 +2429,34 @@ bool TCEToolChain::isPICDefaultForced() const {
return false;
}
+/// Haiku - Haiku tool chain which can call as(1) and ld(1) directly.
+
+Haiku::Haiku(const Driver &D, const llvm::Triple& Triple, const ArgList &Args)
+ : Generic_ELF(D, Triple, Args) {
+
+}
+
+void Haiku::AddClangCXXStdlibIncludeArgs(const ArgList &DriverArgs,
+ ArgStringList &CC1Args) const {
+ if (DriverArgs.hasArg(options::OPT_nostdlibinc) ||
+ DriverArgs.hasArg(options::OPT_nostdincxx))
+ return;
+
+ switch (GetCXXStdlibType(DriverArgs)) {
+ case ToolChain::CST_Libstdcxx:
+ addSystemInclude(DriverArgs, CC1Args,
+ getDriver().SysRoot + "/system/develop/headers/c++");
+ addSystemInclude(DriverArgs, CC1Args,
+ getDriver().SysRoot + "/system/develop/headers/c++/backward");
+
+ StringRef Triple = getTriple().str();
+ addSystemInclude(DriverArgs, CC1Args,
+ getDriver().SysRoot + "/system/develop/headers/c++/" +
+ Triple);
+ break;
+ }
+}
+
/// OpenBSD - OpenBSD tool chain which can call as(1) and ld(1) directly.
OpenBSD::OpenBSD(const Driver &D, const llvm::Triple& Triple, const ArgList &Args)
diff --git a/cfe-3.5.2.src/lib/Driver/ToolChains.h b/cfe-3.5.2.src/lib/Driver/ToolChains.h
index b5df866..add465d 100644
--- a/cfe-3.5.2.src/lib/Driver/ToolChains.h
+++ b/cfe-3.5.2.src/lib/Driver/ToolChains.h
@@ -528,6 +528,17 @@ protected:
};
+class LLVM_LIBRARY_VISIBILITY Haiku : public Generic_ELF {
+public:
+ Haiku(const Driver &D, const llvm::Triple &Triple,
+ const llvm::opt::ArgList &Args);
+
+ bool isPIEDefault() const override { return getTriple().getArch() == llvm::Triple::x86_64; }
+
+ void
+ AddClangCXXStdlibIncludeArgs(const llvm::opt::ArgList &DriverArgs,
+ llvm::opt::ArgStringList &CC1Args) const override;
+};
class LLVM_LIBRARY_VISIBILITY OpenBSD : public Generic_ELF {
public:
diff --git a/cfe-3.5.2.src/lib/Frontend/InitHeaderSearch.cpp b/cfe-3.5.2.src/lib/Frontend/InitHeaderSearch.cpp
index f91346b..f778752 100644
--- a/cfe-3.5.2.src/lib/Frontend/InitHeaderSearch.cpp
+++ b/cfe-3.5.2.src/lib/Frontend/InitHeaderSearch.cpp
@@ -299,8 +299,6 @@ void InitHeaderSearch::AddDefaultCIncludePaths(const llvm::Triple &triple,
AddPath("/boot/system/develop/headers/os/be_apps/Deskbar", System, false);
AddPath("/boot/system/develop/headers/os/be_apps/NetPositive", System, false);
AddPath("/boot/system/develop/headers/os/be_apps/Tracker", System, false);
- AddPath("/boot/system/develop/headers/cpp", System, false);
- AddPath("/boot/system/develop/headers/cpp/i586-pc-haiku", System, false);
AddPath("/boot/system/develop/headers/3rdparty", System, false);
AddPath("/boot/system/develop/headers/bsd", System, false);
AddPath("/boot/system/develop/headers/glibc", System, false);
--
2.2.2
From f1d18fb0afa3b4f1abb619747e4641d02c0c686d Mon Sep 17 00:00:00 2001
From: Jerome Duval <jerome.duval@gmail.com>
Date: Thu, 14 Jan 2016 19:19:14 +0000
Subject: add Haiku target info for x86_64
diff --git a/cfe-3.5.2.src/lib/Basic/Targets.cpp b/cfe-3.5.2.src/lib/Basic/Targets.cpp
index 075f905..09a4776 100644
--- a/cfe-3.5.2.src/lib/Basic/Targets.cpp
+++ b/cfe-3.5.2.src/lib/Basic/Targets.cpp
@@ -320,6 +320,30 @@ public:
}
};
+// Haiku Target
+template<typename Target>
+class HaikuTargetInfo : public OSTargetInfo<Target> {
+protected:
+ void getOSDefines(const LangOptions &Opts, const llvm::Triple &Triple,
+ MacroBuilder &Builder) const override {
+ // Haiku defines; list based off of gcc output
+ Builder.defineMacro("__HAIKU__");
+ Builder.defineMacro("__ELF__");
+ DefineStd(Builder, "unix", Opts);
+ }
+public:
+ HaikuTargetInfo(const llvm::Triple &Triple)
+ : OSTargetInfo<Target>(Triple) {
+ this->SizeType = TargetInfo::UnsignedLong;
+ this->IntPtrType = TargetInfo::SignedLong;
+ this->PtrDiffType = TargetInfo::SignedLong;
+ this->ProcessIDType = TargetInfo::SignedLong;
+ this->TLSSupported = false;
+ this->UserLabelPrefix = "";
+
+ }
+};
+
// Minix Target
template<typename Target>
class MinixTargetInfo : public OSTargetInfo<Target> {
@@ -3210,27 +3234,6 @@ public:
};
} // end anonymous namespace
-namespace {
-// x86-32 Haiku target
-class HaikuX86_32TargetInfo : public X86_32TargetInfo {
-public:
- HaikuX86_32TargetInfo(const llvm::Triple &Triple) : X86_32TargetInfo(Triple) {
- SizeType = UnsignedLong;
- IntPtrType = SignedLong;
- PtrDiffType = SignedLong;
- ProcessIDType = SignedLong;
- this->UserLabelPrefix = "";
- this->TLSSupported = false;
- }
- void getTargetDefines(const LangOptions &Opts,
- MacroBuilder &Builder) const override {
- X86_32TargetInfo::getTargetDefines(Opts, Builder);
- Builder.defineMacro("__INTEL__");
- Builder.defineMacro("__HAIKU__");
- }
-};
-} // end anonymous namespace
-
// RTEMS Target
template<typename Target>
class RTEMSTargetInfo : public OSTargetInfo<Target> {
@@ -6321,7 +6324,7 @@ static TargetInfo *AllocateTarget(const llvm::Triple &Triple) {
}
}
case llvm::Triple::Haiku:
- return new HaikuX86_32TargetInfo(Triple);
+ return new HaikuTargetInfo<X86_32TargetInfo>(Triple);
case llvm::Triple::RTEMS:
return new RTEMSX86_32TargetInfo(Triple);
case llvm::Triple::NaCl:
@@ -6363,6 +6366,8 @@ static TargetInfo *AllocateTarget(const llvm::Triple &Triple) {
return new MicrosoftX86_64TargetInfo(Triple);
}
}
+ case llvm::Triple::Haiku:
+ return new HaikuTargetInfo<X86_64TargetInfo>(Triple);
case llvm::Triple::NaCl:
return new NaClTargetInfo<X86_64TargetInfo>(Triple);
default:
--
2.2.2