mirror of
https://github.com/yann64/haikuports.git
synced 2026-05-04 22:18:55 +02:00
llvm_clang: add clang as package produced by llvm recipe.
* amend llvm-config to use /system/develop/headers.
This commit is contained in:
@@ -7,10 +7,17 @@ HOMEPAGE="http://www.llvm.org/"
|
|||||||
LICENSE="UIUC"
|
LICENSE="UIUC"
|
||||||
COPYRIGHT="2003-2014 University of Illinois at Urbana-Champaign"
|
COPYRIGHT="2003-2014 University of Illinois at Urbana-Champaign"
|
||||||
SOURCE_URI="http://llvm.org/releases/${portVersion}/llvm-${portVersion}.src.tar.xz"
|
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="bf3275d2d7890015c8d8f5e6f4f882f8cf3bf51967297ebe74111d6d8b53be15"
|
CHECKSUM_SHA256="bf3275d2d7890015c8d8f5e6f4f882f8cf3bf51967297ebe74111d6d8b53be15"
|
||||||
REVISION="1"
|
CHECKSUM_SHA256_2="6773f3f9cf815631cc7e779ec134ddd228dc8e9a250e1ea3a910610c59eb8f5c"
|
||||||
|
CHECKSUM_SHA256_3="e8d011250389cfc36eb51557ca25ae66ab08173e8d53536a0747356105d72906"
|
||||||
|
REVISION="2"
|
||||||
ARCHITECTURES="!x86_gcc2 x86 x86_64"
|
ARCHITECTURES="!x86_gcc2 x86 x86_64"
|
||||||
SECONDARY_ARCHITECTURES="x86"
|
SECONDARY_ARCHITECTURES="x86"
|
||||||
|
SOURCE_DIR="llvm-$portVersion.src"
|
||||||
|
PATCHES="llvm-${portVersion}.patchset"
|
||||||
|
PATCHES_2="clang-${portVersion}.patchset"
|
||||||
|
|
||||||
PROVIDES="
|
PROVIDES="
|
||||||
llvm$secondaryArchSuffix = $portVersion
|
llvm$secondaryArchSuffix = $portVersion
|
||||||
@@ -157,30 +164,91 @@ PROVIDES="
|
|||||||
REQUIRES="
|
REQUIRES="
|
||||||
haiku$secondaryArchSuffix >= $haikuVersion
|
haiku$secondaryArchSuffix >= $haikuVersion
|
||||||
"
|
"
|
||||||
|
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="
|
BUILD_REQUIRES="
|
||||||
|
haiku${secondaryArchSuffix}_devel
|
||||||
"
|
"
|
||||||
BUILD_PREREQUIRES="
|
BUILD_PREREQUIRES="
|
||||||
haiku${secondaryArchSuffix}_devel >= $haikuVersion
|
|
||||||
cmd:aclocal
|
cmd:aclocal
|
||||||
cmd:autoconf
|
cmd:autoconf
|
||||||
cmd:automake
|
cmd:automake
|
||||||
cmd:find
|
cmd:find
|
||||||
cmd:gcc$secondaryArchSuffix
|
cmd:gcc$secondaryArchSuffix
|
||||||
|
cmd:groff
|
||||||
cmd:ld$secondaryArchSuffix
|
cmd:ld$secondaryArchSuffix
|
||||||
cmd:libtoolize
|
cmd:libtoolize
|
||||||
cmd:make
|
cmd:make
|
||||||
cmd:python
|
cmd:python
|
||||||
cmd:sed
|
cmd:sed
|
||||||
cmd:find
|
|
||||||
cmd:grep
|
cmd:grep
|
||||||
"
|
"
|
||||||
|
|
||||||
PATCHES="llvm-${portVersion}.patchset"
|
|
||||||
|
|
||||||
SOURCE_DIR="llvm-$portVersion.src"
|
|
||||||
|
|
||||||
BUILD()
|
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
|
# Haiku C++ requires rtti in a lot of central system components
|
||||||
# such as Mesa
|
# such as Mesa
|
||||||
export REQUIRES_RTTI=1
|
export REQUIRES_RTTI=1
|
||||||
@@ -191,6 +259,10 @@ BUILD()
|
|||||||
|
|
||||||
INSTALL()
|
INSTALL()
|
||||||
{
|
{
|
||||||
|
mkdir -p $developDir
|
||||||
|
mkdir -p $docDir
|
||||||
|
mkdir -p $binDir
|
||||||
|
|
||||||
make install PROJ_datadir=$dataDir PROJ_docsdir=$docDir \
|
make install PROJ_datadir=$dataDir PROJ_docsdir=$docDir \
|
||||||
PROJ_mandir=$manDir PROJ_includedir=$includeDir PROJ_libdir=$libDir
|
PROJ_mandir=$manDir PROJ_includedir=$includeDir PROJ_libdir=$libDir
|
||||||
|
|
||||||
@@ -221,6 +293,40 @@ INSTALL()
|
|||||||
libLLVMScalarOpts libLLVMSelectionDAG libLLVMSupport libLLVMTableGen \
|
libLLVMScalarOpts libLLVMSelectionDAG libLLVMSupport libLLVMTableGen \
|
||||||
libLLVMTarget libLLVMTransformUtils libLLVMVectorize libLLVMipa \
|
libLLVMTarget libLLVMTransformUtils libLLVMVectorize libLLVMipa \
|
||||||
libLLVMipo libLTO
|
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()
|
TEST()
|
||||||
|
|||||||
302
sys-devel/llvm/patches/clang-3.5.1.patchset
Normal file
302
sys-devel/llvm/patches/clang-3.5.1.patchset
Normal file
@@ -0,0 +1,302 @@
|
|||||||
|
From 5cee69285df1bff7c1a8911e2a866457af414f50 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.1.src/lib/Frontend/InitHeaderSearch.cpp b/cfe-3.5.1.src/lib/Frontend/InitHeaderSearch.cpp
|
||||||
|
index d2edc94..f91346b 100644
|
||||||
|
--- a/cfe-3.5.1.src/lib/Frontend/InitHeaderSearch.cpp
|
||||||
|
+++ b/cfe-3.5.1.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 899e1eb7ee73e55e68c4d139c73e7ddc3859d1c5 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.1.src/tools/libclang/Makefile b/cfe-3.5.1.src/tools/libclang/Makefile
|
||||||
|
index db3d4f8..149f245 100644
|
||||||
|
--- a/cfe-3.5.1.src/tools/libclang/Makefile
|
||||||
|
+++ b/cfe-3.5.1.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 feedddcc5561774a081fecde1feb292a5a410982 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.1.src/lib/Driver/Driver.cpp b/cfe-3.5.1.src/lib/Driver/Driver.cpp
|
||||||
|
index ef26bfa..ca1f4c4 100644
|
||||||
|
--- a/cfe-3.5.1.src/lib/Driver/Driver.cpp
|
||||||
|
+++ b/cfe-3.5.1.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.1.src/lib/Driver/ToolChains.cpp b/cfe-3.5.1.src/lib/Driver/ToolChains.cpp
|
||||||
|
index b46f69d..0701013 100644
|
||||||
|
--- a/cfe-3.5.1.src/lib/Driver/ToolChains.cpp
|
||||||
|
+++ b/cfe-3.5.1.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.1.src/lib/Driver/ToolChains.h b/cfe-3.5.1.src/lib/Driver/ToolChains.h
|
||||||
|
index b5df866..add465d 100644
|
||||||
|
--- a/cfe-3.5.1.src/lib/Driver/ToolChains.h
|
||||||
|
+++ b/cfe-3.5.1.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.1.src/lib/Frontend/InitHeaderSearch.cpp b/cfe-3.5.1.src/lib/Frontend/InitHeaderSearch.cpp
|
||||||
|
index f91346b..f778752 100644
|
||||||
|
--- a/cfe-3.5.1.src/lib/Frontend/InitHeaderSearch.cpp
|
||||||
|
+++ b/cfe-3.5.1.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 b04cceb968495b02dd32d305fca9769f22c02bc3 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.1.src/lib/Basic/Targets.cpp b/cfe-3.5.1.src/lib/Basic/Targets.cpp
|
||||||
|
index 075f905..09a4776 100644
|
||||||
|
--- a/cfe-3.5.1.src/lib/Basic/Targets.cpp
|
||||||
|
+++ b/cfe-3.5.1.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 42a5734462221c17c6888e521b53599f37145d43 Mon Sep 17 00:00:00 2001
|
||||||
From: Alexander von Gluck IV <kallisti5@unixzen.com>
|
From: Alexander von Gluck IV <kallisti5@unixzen.com>
|
||||||
Date: Wed, 22 Jan 2014 05:04:31 +0000
|
Date: Wed, 22 Jan 2014 05:04:31 +0000
|
||||||
Subject: haiku: fix Host.h for endian.h
|
Subject: haiku: fix Host.h for endian.h
|
||||||
|
|
||||||
|
|
||||||
diff --git a/include/llvm/Support/Host.h b/include/llvm/Support/Host.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
|
--- a/include/llvm/Support/Host.h
|
||||||
+++ b/include/llvm/Support/Host.h
|
+++ b/include/llvm/Support/Host.h
|
||||||
@@ -16,7 +16,7 @@
|
@@ -16,7 +16,7 @@
|
||||||
@@ -18,20 +18,20 @@ index 28c4cc7..ab985a4 100644
|
|||||||
#else
|
#else
|
||||||
#if !defined(BYTE_ORDER) && !defined(LLVM_ON_WIN32)
|
#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 f2a83ee50fe6b4ad4a79996864a95c1a8ac9145c Mon Sep 17 00:00:00 2001
|
||||||
From: Adrien Destugues <pulkomandy@pulkomandy.tk>
|
From: Adrien Destugues <pulkomandy@pulkomandy.tk>
|
||||||
Date: Sun, 18 May 2014 12:41:16 +0200
|
Date: Sun, 18 May 2014 12:41:16 +0200
|
||||||
Subject: libLTO: add soname when building on Haiku.
|
Subject: libLTO: add soname when building on Haiku.
|
||||||
|
|
||||||
|
|
||||||
diff --git a/tools/lto/Makefile b/tools/lto/Makefile
|
diff --git a/tools/lto/Makefile b/tools/lto/Makefile
|
||||||
index cedbee1..5ce530d 100644
|
index a4fe9ac..b667105 100644
|
||||||
--- a/tools/lto/Makefile
|
--- a/tools/lto/Makefile
|
||||||
+++ b/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)"'
|
CXX.Flags += -DLLVM_VERSION_INFO='"$(LLVM_VERSION_INFO)"'
|
||||||
endif
|
endif
|
||||||
|
|
||||||
@@ -43,5 +43,53 @@ index cedbee1..5ce530d 100644
|
|||||||
# Special hack to allow libLTO to have an offset version number.
|
# Special hack to allow libLTO to have an offset version number.
|
||||||
ifdef LLVM_LTO_VERSION_OFFSET
|
ifdef LLVM_LTO_VERSION_OFFSET
|
||||||
--
|
--
|
||||||
1.8.3.4
|
2.2.2
|
||||||
|
|
||||||
|
|
||||||
|
From 8829b50366b40ed55c1c54d7b2fce9c1b3b3465c 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