mirror of
https://github.com/yann64/haikuports.git
synced 2026-04-23 04:00:05 +02:00
llvm_clang: apply to 3.5.2 recipe.
This commit is contained in:
@@ -31,11 +31,16 @@ other than the ones listed above.
|
||||
HOMEPAGE="http://www.llvm.org/"
|
||||
COPYRIGHT="2003-2014 University of Illinois at Urbana-Champaign"
|
||||
LICENSE="UIUC"
|
||||
REVISION="1"
|
||||
REVISION="2"
|
||||
SOURCE_URI="http://llvm.org/releases/${portVersion}/llvm-${portVersion}.src.tar.xz"
|
||||
SOURCE_URI_2="http://llvm.org/releases/${portVersion}/cfe-${portVersion}.src.tar.xz"
|
||||
SOURCE_URI_3="http://llvm.org/releases/${portVersion}/clang-tools-extra-${portVersion}.src.tar.xz"
|
||||
CHECKSUM_SHA256="44196156d5749eb4b4224fe471a29cc3984df92570a4a89fa859f7394fc0c575"
|
||||
CHECKSUM_SHA256_2="4feb575f74fb3a74b6245400460230141bf610f235ef3a25008cfe6137828620"
|
||||
CHECKSUM_SHA256_3="f21a374d74b194d8c984546266491b518859b5f12ed9abd49337b8060d3fc004"
|
||||
SOURCE_DIR="llvm-$portVersion.src"
|
||||
PATCHES="llvm-${portVersion}.patchset"
|
||||
PATCHES_2="clang-${portVersion}.patchset"
|
||||
|
||||
ARCHITECTURES="!x86_gcc2 x86 x86_64"
|
||||
SECONDARY_ARCHITECTURES="x86"
|
||||
@@ -183,11 +188,67 @@ PROVIDES="
|
||||
devel:libLTO$secondaryArchSuffix
|
||||
"
|
||||
REQUIRES="
|
||||
haiku$secondaryArchSuffix >= $haikuVersion
|
||||
haiku$secondaryArchSuffix
|
||||
"
|
||||
PROVIDES_clang="
|
||||
llvm${secondaryArchSuffix}_clang = $portVersion
|
||||
cmd:clang = $portVersion
|
||||
cmd:clang++ = $portVersion
|
||||
cmd:clang_apply_replacements = $portVersion
|
||||
cmd:clang_check = $portVersion
|
||||
cmd:clang_format = $portVersion
|
||||
cmd:clang_modernize = $portVersion
|
||||
cmd:clang_query = $portVersion
|
||||
cmd:clang_tblgen = $portVersion
|
||||
cmd:clang_tidy = $portVersion
|
||||
cmd:c_index_test = $portVersion
|
||||
cmd:pp_trace = $portVersion
|
||||
lib:libclang$secondaryArchSuffix = $portVersion
|
||||
devel:libclang$secondaryArchSuffix = $portVersion
|
||||
devel:libclangarcmigrate$secondaryArchSuffix = $portVersion
|
||||
devel:libclangast$secondaryArchSuffix = $portVersion
|
||||
devel:libclangastmatchers$secondaryArchSuffix = $portVersion
|
||||
devel:libclanganalysis$secondaryArchSuffix = $portVersion
|
||||
devel:libclangapplyreplacements$secondaryArchSuffix = $portVersion
|
||||
devel:libclangbasic$secondaryArchSuffix = $portVersion
|
||||
devel:libclangcodegen$secondaryArchSuffix = $portVersion
|
||||
devel:libclangdriver$secondaryArchSuffix = $portVersion
|
||||
devel:libclangdynamicastmatchers$secondaryArchSuffix = $portVersion
|
||||
devel:libclangedit$secondaryArchSuffix = $portVersion
|
||||
devel:libclangformat$secondaryArchSuffix = $portVersion
|
||||
devel:libclangfrontend$secondaryArchSuffix = $portVersion
|
||||
devel:libclangfrontendtool$secondaryArchSuffix = $portVersion
|
||||
devel:libclangindex$secondaryArchSuffix = $portVersion
|
||||
devel:libclanglex$secondaryArchSuffix = $portVersion
|
||||
devel:libclangparse$secondaryArchSuffix = $portVersion
|
||||
devel:libclangquery$secondaryArchSuffix = $portVersion
|
||||
devel:libclangrewrite$secondaryArchSuffix = $portVersion
|
||||
devel:libclangrewritefrontend$secondaryArchSuffix = $portVersion
|
||||
devel:libclangsema$secondaryArchSuffix = $portVersion
|
||||
devel:libclangserialization$secondaryArchSuffix = $portVersion
|
||||
devel:libclangstaticanalyzercheckers$secondaryArchSuffix = $portVersion
|
||||
devel:libclangstaticanalyzercore$secondaryArchSuffix = $portVersion
|
||||
devel:libclangstaticanalyzerfrontend$secondaryArchSuffix = $portVersion
|
||||
devel:libclangtidy$secondaryArchSuffix = $portVersion
|
||||
devel:libclangtidygooglemodule$secondaryArchSuffix = $portVersion
|
||||
devel:libclangtidyllvmmodule$secondaryArchSuffix = $portVersion
|
||||
devel:libclangtidymiscmodule$secondaryArchSuffix = $portVersion
|
||||
devel:libclangtooling$secondaryArchSuffix = $portVersion
|
||||
devel:libmodernizecore$secondaryArchSuffix = $portVersion
|
||||
"
|
||||
REQUIRES_clang="
|
||||
haiku$secondaryArchSuffix
|
||||
"
|
||||
PROVIDES_clang_analysis="
|
||||
llvm${secondaryArchSuffix}_clang_analysis = $portVersion
|
||||
cmd:scan_build$secondaryArchSuffix = $portVersion
|
||||
cmd:scan_view$secondaryArchSuffix = $portVersion
|
||||
"
|
||||
REQUIRES_clang_analysis="
|
||||
llvm${secondaryArchSuffix}_clang == $portVersion base
|
||||
"
|
||||
|
||||
BUILD_REQUIRES="
|
||||
haiku${secondaryArchSuffix}_devel >= $haikuVersion
|
||||
haiku${secondaryArchSuffix}_devel
|
||||
"
|
||||
BUILD_PREREQUIRES="
|
||||
cmd:aclocal
|
||||
@@ -195,17 +256,25 @@ BUILD_PREREQUIRES="
|
||||
cmd:automake
|
||||
cmd:find
|
||||
cmd:gcc$secondaryArchSuffix
|
||||
cmd:groff
|
||||
cmd:ld$secondaryArchSuffix
|
||||
cmd:libtoolize
|
||||
cmd:make
|
||||
cmd:python
|
||||
cmd:sed
|
||||
cmd:find
|
||||
cmd:grep
|
||||
"
|
||||
|
||||
BUILD()
|
||||
{
|
||||
# Add clang tools
|
||||
mkdir -p tools/clang
|
||||
cp -rd $sourceDir2/cfe-${portVersion}.src/* tools/clang/
|
||||
|
||||
# Add clang tools's tool's (really llvm?)
|
||||
mkdir -p tools/clang/tools/extra
|
||||
cp -rd $sourceDir3/clang-tools-extra-${portVersion}.src/* tools/clang/tools/extra
|
||||
|
||||
# Haiku C++ requires rtti in a lot of central system components
|
||||
# such as Mesa
|
||||
export REQUIRES_RTTI=1
|
||||
@@ -216,6 +285,10 @@ BUILD()
|
||||
|
||||
INSTALL()
|
||||
{
|
||||
mkdir -p $developDir
|
||||
mkdir -p $docDir
|
||||
mkdir -p $binDir
|
||||
|
||||
make install PROJ_datadir=$dataDir PROJ_docsdir=$docDir \
|
||||
PROJ_mandir=$manDir PROJ_includedir=$includeDir PROJ_libdir=$libDir
|
||||
|
||||
@@ -246,6 +319,40 @@ INSTALL()
|
||||
libLLVMScalarOpts libLLVMSelectionDAG libLLVMSupport libLLVMTableGen \
|
||||
libLLVMTarget libLLVMTransformUtils libLLVMVectorize libLLVMipa \
|
||||
libLLVMipo libLTO
|
||||
|
||||
make -C tools/clang install PROJ_datadir=$dataDir PROJ_docsdir=$docDir \
|
||||
PROJ_mandir=$manDir PROJ_includedir=$includeDir PROJ_libdir=$libDir
|
||||
|
||||
# Install static analysis tools
|
||||
mkdir -p $developDir/tools/clang$secondaryArchSuffix
|
||||
cp -Ra tools/clang/tools/scan-build $developDir/tools/clang$secondaryArchSuffix/
|
||||
cp -Ra tools/clang/tools/scan-view $developDir/tools/clang$secondaryArchSuffix/
|
||||
|
||||
ln -s $developDir/tools/clang$secondaryArchSuffix/scan-build/scan-build $binDir/scan-build
|
||||
ln -s $developDir/tools/clang$secondaryArchSuffix/scan-view/scan-view $binDir/scan-view
|
||||
ln -s $binDir/clang $developDir/tools/clang$secondaryArchSuffix/scan-build/clang
|
||||
|
||||
prepareInstalledDevelLibs libclang* libmodernizeCore
|
||||
|
||||
mv $prefix/include/* $includeDir/
|
||||
rmdir $prefix/include
|
||||
|
||||
# analysis package
|
||||
packageEntries clang \
|
||||
$binDir/c-index-test \
|
||||
$binDir/clang* \
|
||||
$binDir/pp-trace \
|
||||
$includeDir/clang* \
|
||||
$libDir/libclang* \
|
||||
$developLibDir/libclang* \
|
||||
$developLibDir/libmodernizeCore* \
|
||||
$manDir/man1/clang.1
|
||||
|
||||
# analysis package
|
||||
packageEntries clang_analysis \
|
||||
$binDir/scan-build \
|
||||
$binDir/scan-view \
|
||||
$developDir/tools/clang$secondaryArchSuffix
|
||||
}
|
||||
|
||||
TEST()
|
||||
|
||||
302
sys-devel/llvm/patches/clang-3.5.2.patchset
Normal file
302
sys-devel/llvm/patches/clang-3.5.2.patchset
Normal file
@@ -0,0 +1,302 @@
|
||||
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
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
From 9cc674f2aa0f54b900d1e773a6ffd201c23e4c05 Mon Sep 17 00:00:00 2001
|
||||
From 5ff5145ac1b8304b7fab9ecc57bd6a2b67fce47a Mon Sep 17 00:00:00 2001
|
||||
From: Alexander von Gluck IV <kallisti5@unixzen.com>
|
||||
Date: Wed, 22 Jan 2014 05:04:31 +0000
|
||||
Subject: haiku: fix Host.h for endian.h
|
||||
|
||||
|
||||
diff --git a/include/llvm/Support/Host.h b/include/llvm/Support/Host.h
|
||||
index 28c4cc7..ab985a4 100644
|
||||
index 8f4bf3c..8114f9b 100644
|
||||
--- a/include/llvm/Support/Host.h
|
||||
+++ b/include/llvm/Support/Host.h
|
||||
@@ -16,7 +16,7 @@
|
||||
@@ -18,20 +18,20 @@ index 28c4cc7..ab985a4 100644
|
||||
#else
|
||||
#if !defined(BYTE_ORDER) && !defined(LLVM_ON_WIN32)
|
||||
--
|
||||
1.8.3.4
|
||||
2.2.2
|
||||
|
||||
|
||||
From 577d261e8e74bc442fe75515e043f268db923ed3 Mon Sep 17 00:00:00 2001
|
||||
From 14acb59dc94d2dae7d13e7b9cfab4a3bcacef0f5 Mon Sep 17 00:00:00 2001
|
||||
From: Adrien Destugues <pulkomandy@pulkomandy.tk>
|
||||
Date: Sun, 18 May 2014 12:41:16 +0200
|
||||
Subject: libLTO: add soname when building on Haiku.
|
||||
|
||||
|
||||
diff --git a/tools/lto/Makefile b/tools/lto/Makefile
|
||||
index cedbee1..5ce530d 100644
|
||||
index a4fe9ac..b667105 100644
|
||||
--- a/tools/lto/Makefile
|
||||
+++ b/tools/lto/Makefile
|
||||
@@ -22,6 +22,10 @@ ifdef LLVM_VERSION_INFO
|
||||
@@ -21,6 +21,10 @@ ifdef LLVM_VERSION_INFO
|
||||
CXX.Flags += -DLLVM_VERSION_INFO='"$(LLVM_VERSION_INFO)"'
|
||||
endif
|
||||
|
||||
@@ -43,5 +43,53 @@ index cedbee1..5ce530d 100644
|
||||
# Special hack to allow libLTO to have an offset version number.
|
||||
ifdef LLVM_LTO_VERSION_OFFSET
|
||||
--
|
||||
1.8.3.4
|
||||
2.2.2
|
||||
|
||||
|
||||
From 44af3ac9034d9b48eabd0f43c394c3f565e2db1b 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 ed1c8c3..e22e243 100644
|
||||
--- a/tools/llvm-config/llvm-config.cpp
|
||||
+++ b/tools/llvm-config/llvm-config.cpp
|
||||
@@ -261,7 +261,11 @@ int main(int argc, char **argv) {
|
||||
"-I" + ActiveObjRoot + "/include");
|
||||
} else {
|
||||
ActivePrefix = CurrentExecPrefix;
|
||||
+#ifdef __HAIKU__
|
||||
+ ActiveIncludeDir = ActivePrefix + "/develop/headers";
|
||||
+#else
|
||||
ActiveIncludeDir = ActivePrefix + "/include";
|
||||
+#endif
|
||||
ActiveBinDir = ActivePrefix + "/bin";
|
||||
ActiveLibDir = ActivePrefix + "/lib";
|
||||
ActiveIncludeOption = "-I" + ActiveIncludeDir;
|
||||
@@ -321,10 +325,16 @@ int main(int argc, char **argv) {
|
||||
#else
|
||||
OS << "ON\n";
|
||||
#endif
|
||||
- } 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 {
|
||||
usage();
|
||||
}
|
||||
--
|
||||
2.2.2
|
||||
|
||||
|
||||
Reference in New Issue
Block a user