Files
haikuports/sys-devel/llvm/patches/clang-3.8.0~rc3.patchset
2016-03-05 17:39:22 +00:00

302 lines
12 KiB
Plaintext

From 3d89411dbc475a5135e4470d0dac2ff430f00034 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/lib/Frontend/InitHeaderSearch.cpp b/lib/Frontend/InitHeaderSearch.cpp
index 26bab0d..6066d2b 100644
--- a/lib/Frontend/InitHeaderSearch.cpp
+++ b/lib/Frontend/InitHeaderSearch.cpp
@@ -267,38 +267,41 @@ void InitHeaderSearch::AddDefaultCIncludePaths(const llvm::Triple &triple,
}
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 51e141320e9e337978a551068ad84aaeb64a718b 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/tools/libclang/Makefile b/tools/libclang/Makefile
index 84914e0..b9a6b74 100644
--- a/tools/libclang/Makefile
+++ b/tools/libclang/Makefile
@@ -35,7 +35,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 b5749ce304a1490838e31c7e5df5fdd6f41572c3 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/lib/Driver/Driver.cpp b/lib/Driver/Driver.cpp
index 1e0a48d..f31b274 100644
--- a/lib/Driver/Driver.cpp
+++ b/lib/Driver/Driver.cpp
@@ -2206,6 +2206,9 @@ const ToolChain &Driver::getToolChain(const ArgList &Args,
ToolChain *&TC = ToolChains[Target.str()];
if (!TC) {
switch (Target.getOS()) {
+ case llvm::Triple::Haiku:
+ TC = new toolchains::Haiku(*this, Target, Args);
+ break;
case llvm::Triple::CloudABI:
TC = new toolchains::CloudABI(*this, Target, Args);
break;
diff --git a/lib/Driver/ToolChains.cpp b/lib/Driver/ToolChains.cpp
index beede2e..f6ca5c4 100644
--- a/lib/Driver/ToolChains.cpp
+++ b/lib/Driver/ToolChains.cpp
@@ -2971,6 +2971,34 @@ Tool *CloudABI::buildLinker() const {
return new tools::cloudabi::Linker(*this);
}
+/// 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,
diff --git a/lib/Driver/ToolChains.h b/lib/Driver/ToolChains.h
index b6fd426..906353b 100644
--- a/lib/Driver/ToolChains.h
+++ b/lib/Driver/ToolChains.h
@@ -667,6 +667,18 @@ private:
void findGccLibDir();
};
+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:
OpenBSD(const Driver &D, const llvm::Triple &Triple,
diff --git a/lib/Frontend/InitHeaderSearch.cpp b/lib/Frontend/InitHeaderSearch.cpp
index 6066d2b..d8f0881 100644
--- a/lib/Frontend/InitHeaderSearch.cpp
+++ b/lib/Frontend/InitHeaderSearch.cpp
@@ -295,8 +295,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 f3310e0a11fa3a030e79a5c5e509bff1fb297523 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/lib/Basic/Targets.cpp b/lib/Basic/Targets.cpp
index 1bc6c51..8160b8c 100644
--- a/lib/Basic/Targets.cpp
+++ b/lib/Basic/Targets.cpp
@@ -373,6 +373,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> {
@@ -3874,25 +3898,6 @@ public:
}
};
-// 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__");
- }
-};
-
// X86-32 MCU target
class MCUX86_32TargetInfo : public X86_32TargetInfo {
public:
@@ -7846,7 +7851,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:
@@ -7897,6 +7902,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);
case llvm::Triple::PS4:
--
2.2.2