mirror of
https://github.com/yann64/haikuports.git
synced 2026-04-23 12:10:06 +02:00
llvm: add recipe for version 3.9.0.
* update git recipe.
This commit is contained in:
@@ -32,30 +32,28 @@ HOMEPAGE="http://www.llvm.org/"
|
||||
COPYRIGHT="2003-2014 University of Illinois at Urbana-Champaign"
|
||||
LICENSE="UIUC"
|
||||
REVISION="1"
|
||||
llvmSrcGitRev="4bd700523785848b3ee9c50da1b9fde52057be74"
|
||||
clangSrcGitRev="37b403d7009e66f7f040faffd979122acabaa693"
|
||||
clangToolsExtraSrcGitRev="75181d5ed02edc05452fd849bfdb52b3a132872f"
|
||||
SOURCE_URI="https://github.com/llvm-mirror/llvm/archive/$llvmSrcGitRev.tar.gz"
|
||||
SOURCE_URI_2="https://github.com/llvm-mirror/clang/archive/$clangSrcGitRev.tar.gz"
|
||||
SOURCE_URI_3="https://github.com/llvm-mirror/clang-tools-extra/archive/$clangToolsExtraSrcGitRev.tar.gz"
|
||||
SOURCE_FILENAME="llvm-${llvmSrcGitRev}.tar.gz"
|
||||
SOURCE_FILENAME_2="clang-${clangSrcGitRev}.tar.gz"
|
||||
SOURCE_FILENAME_3="clang-tools-extra-${clangToolsExtraSrcGitRev}.tar.gz"
|
||||
CHECKSUM_SHA256="2baf3ef1ce752bc10d806f53302c0cb73a47bcd38f06d81c70a8b97c76852fe5"
|
||||
CHECKSUM_SHA256_2="3ee7b50ca756bea61de6f23905da04a4865d28829053a274daa013990187b245"
|
||||
CHECKSUM_SHA256_3="5dbf67dbb0720056ea29f6b585ee6fa18c1d2f2632437f4f75e6a5a93791dc18"
|
||||
SOURCE_DIR="llvm-$llvmSrcGitRev"
|
||||
SOURCE_DIR_2="clang-$clangSrcGitRev"
|
||||
SOURCE_DIR_3="clang-tools-extra-$clangToolsExtraSrcGitRev"
|
||||
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"
|
||||
SOURCE_URI_4="http://llvm.org/releases/${portVersion}/compiler-rt-${portVersion}.src.tar.xz"
|
||||
CHECKSUM_SHA256="66c73179da42cee1386371641241f79ded250e117a79f571bbd69e56daa48948"
|
||||
CHECKSUM_SHA256_2="7596a7c7d9376d0c89e60028fe1ceb4d3e535e8ea8b89e0eb094e0dcb3183d28"
|
||||
CHECKSUM_SHA256_3="5b7aec46ec8e999ec683c87ad744082e1133781ee4b01905b4bdae5d20785f14"
|
||||
CHECKSUM_SHA256_4="e0e5224fcd5740b61e416c549dd3dcda92f10c524216c1edb5e979e42078a59a"
|
||||
SOURCE_DIR="llvm-${portVersion}.src"
|
||||
SOURCE_DIR_2="cfe-${portVersion}.src"
|
||||
SOURCE_DIR_3="clang-tools-extra-${portVersion}.src"
|
||||
SOURCE_DIR_4="compiler-rt-${portVersion}.src"
|
||||
PATCHES="llvm-${portVersion}.patchset"
|
||||
PATCHES_2="clang-${portVersion}.patchset"
|
||||
|
||||
ARCHITECTURES="!x86_gcc2 ?x86 ?x86_64"
|
||||
SECONDARY_ARCHITECTURES="?x86"
|
||||
ARCHITECTURES="!x86_gcc2 x86 x86_64"
|
||||
SECONDARY_ARCHITECTURES="x86"
|
||||
|
||||
PROVIDES="
|
||||
llvm$secondaryArchSuffix = $portVersion
|
||||
cmd:bugpoint
|
||||
cmd:find_all_symbols
|
||||
cmd:llc
|
||||
cmd:lli
|
||||
cmd:lli_child_target
|
||||
@@ -98,10 +96,12 @@ PROVIDES="
|
||||
cmd:count
|
||||
cmd:not
|
||||
cmd:sancov
|
||||
cmd:sanstats
|
||||
lib:BugpointPasses$secondaryArchSuffix
|
||||
lib:LLVMHello$secondaryArchSuffix
|
||||
lib:libLTO$secondaryArchSuffix
|
||||
|
||||
devel:libfindAllSymbols$secondaryArchSuffix
|
||||
devel:libLLVMAArch64AsmParser$secondaryArchSuffix
|
||||
devel:libLLVMAArch64AsmPrinter$secondaryArchSuffix
|
||||
devel:libLLVMAArch64CodeGen$secondaryArchSuffix
|
||||
@@ -113,6 +113,7 @@ PROVIDES="
|
||||
devel:libLLVMAMDGPUAsmPrinter$secondaryArchSuffix
|
||||
devel:libLLVMAMDGPUCodeGen$secondaryArchSuffix
|
||||
devel:libLLVMAMDGPUDesc$secondaryArchSuffix
|
||||
devel:libLLVMAMDGPUDisassembler$secondaryArchSuffix
|
||||
devel:libLLVMAMDGPUInfo$secondaryArchSuffix
|
||||
devel:libLLVMAMDGPUUtils$secondaryArchSuffix
|
||||
devel:libLLVMARMAsmParser$secondaryArchSuffix
|
||||
@@ -132,12 +133,14 @@ PROVIDES="
|
||||
devel:libLLVMBitWriter$secondaryArchSuffix
|
||||
devel:libLLVMCodeGen$secondaryArchSuffix
|
||||
devel:libLLVMCore$secondaryArchSuffix
|
||||
devel:libLLVMCoverage$secondaryArchSuffix
|
||||
devel:libLLVMCppBackendCodeGen$secondaryArchSuffix
|
||||
devel:libLLVMCppBackendInfo$secondaryArchSuffix
|
||||
devel:libLLVMDebugInfoCodeView$secondaryArchSuffix
|
||||
devel:libLLVMDebugInfoDWARF$secondaryArchSuffix
|
||||
devel:libLLVMDebugInfoPDB$secondaryArchSuffix
|
||||
devel:libLLVMExecutionEngine$secondaryArchSuffix
|
||||
devel:libLLVMGlobalISel$secondaryArchSuffix
|
||||
devel:libLLVMHexagonAsmParser$secondaryArchSuffix
|
||||
devel:libLLVMHexagonCodeGen$secondaryArchSuffix
|
||||
devel:libLLVMHexagonDesc$secondaryArchSuffix
|
||||
@@ -172,6 +175,7 @@ PROVIDES="
|
||||
devel:libLLVMNVPTXInfo$secondaryArchSuffix
|
||||
devel:libLLVMObjCARCOpts$secondaryArchSuffix
|
||||
devel:libLLVMObject$secondaryArchSuffix
|
||||
devel:libLLVMObjectYAML$secondaryArchSuffix
|
||||
devel:libLLVMOption$secondaryArchSuffix
|
||||
devel:libLLVMOrcJIT$secondaryArchSuffix
|
||||
devel:libLLVMPasses$secondaryArchSuffix
|
||||
@@ -231,6 +235,7 @@ PROVIDES_clang="
|
||||
cmd:clang_check = $portVersion
|
||||
cmd:clang_cl = $portVersion
|
||||
cmd:clang_format = $portVersion
|
||||
cmd:clang_include_fixer = $portVersion
|
||||
cmd:clang_modernize = $portVersion
|
||||
cmd:clang_query = $portVersion
|
||||
cmd:clang_rename = $portVersion
|
||||
@@ -254,6 +259,7 @@ PROVIDES_clang="
|
||||
devel:libclangformat$secondaryArchSuffix = $portVersion
|
||||
devel:libclangfrontend$secondaryArchSuffix = $portVersion
|
||||
devel:libclangfrontendtool$secondaryArchSuffix = $portVersion
|
||||
devel:libclangincludefixer$secondaryArchSuffix = $portVersion
|
||||
devel:libclangindex$secondaryArchSuffix = $portVersion
|
||||
devel:libclanglex$secondaryArchSuffix = $portVersion
|
||||
devel:libclangparse$secondaryArchSuffix = $portVersion
|
||||
@@ -267,6 +273,7 @@ PROVIDES_clang="
|
||||
devel:libclangstaticanalyzercore$secondaryArchSuffix = $portVersion
|
||||
devel:libclangstaticanalyzerfrontend$secondaryArchSuffix = $portVersion
|
||||
devel:libclangtidy$secondaryArchSuffix = $portVersion
|
||||
devel:libclangtidyboostmodule$secondaryArchSuffix = $portVersion
|
||||
devel:libclangtidycertmodule$secondaryArchSuffix = $portVersion
|
||||
devel:libclangtidycppcoreguidelinesmodule$secondaryArchSuffix = $portVersion
|
||||
devel:libclangtidygooglemodule$secondaryArchSuffix = $portVersion
|
||||
@@ -274,7 +281,7 @@ PROVIDES_clang="
|
||||
devel:libclangtidymiscmodule$secondaryArchSuffix = $portVersion
|
||||
devel:libclangtidymodernizemodule$secondaryArchSuffix = $portVersion
|
||||
devel:libclangtidyperformancemodule$secondaryArchSuffix = $portVersion
|
||||
devel:libclangtidyreadability$secondaryArchSuffix = $portVersion
|
||||
devel:libclangtidyplugin$secondaryArchSuffix = $portVersion
|
||||
devel:libclangtidyreadabilitymodule$secondaryArchSuffix = $portVersion
|
||||
devel:libclangtidyutils$secondaryArchSuffix = $portVersion
|
||||
devel:libclangtooling$secondaryArchSuffix = $portVersion
|
||||
@@ -286,10 +293,10 @@ REQUIRES_clang="
|
||||
"
|
||||
PROVIDES_clang_analysis="
|
||||
llvm${secondaryArchSuffix}_clang_analysis = $portVersion
|
||||
cmd:c++_analyzer$secondaryArchSuffix = $portVersion
|
||||
cmd:ccc_analyzer$secondaryArchSuffix = $portVersion
|
||||
cmd:scan_build$secondaryArchSuffix = $portVersion
|
||||
cmd:scan_view$secondaryArchSuffix = $portVersion
|
||||
cmd:c++_analyzer = $portVersion
|
||||
cmd:ccc_analyzer = $portVersion
|
||||
cmd:scan_build = $portVersion
|
||||
cmd:scan_view = $portVersion
|
||||
"
|
||||
REQUIRES_clang_analysis="
|
||||
llvm${secondaryArchSuffix}_clang == $portVersion base
|
||||
@@ -301,6 +308,7 @@ BUILD_REQUIRES="
|
||||
"
|
||||
BUILD_PREREQUIRES="
|
||||
cmd:cmake
|
||||
cmd:diff
|
||||
cmd:find
|
||||
cmd:gcc$secondaryArchSuffix
|
||||
cmd:groff
|
||||
@@ -321,11 +329,19 @@ BUILD()
|
||||
mkdir -p tools/clang/tools/extra
|
||||
cp -rd $sourceDir3/* tools/clang/tools/extra
|
||||
|
||||
mkdir -p projects/compiler-rt
|
||||
cp -rd $sourceDir4/* projects/compiler-rt
|
||||
|
||||
local cmakeFlags
|
||||
if [ -n "$secondaryArchSuffix" ]; then
|
||||
cmakeFlags=-DHAIKU_HYBRID_SECONDARY="\"${effectiveTargetArchitecture}\""
|
||||
fi
|
||||
|
||||
mkdir -p build; cd build
|
||||
# Haiku C++ requires rtti in a lot of central system components
|
||||
# such as Mesa
|
||||
cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=$prefix \
|
||||
-DCMAKE_SKIP_RPATH=YES \
|
||||
-DCMAKE_SKIP_RPATH=YES $cmakeFlags \
|
||||
-DLLVM_ENABLE_RTTI=ON -DLLVM_ENABLE_THREADS=NO \
|
||||
..
|
||||
make $jobArgs PROJ_datadir=$dataDir PROJ_docsdir=$docDir \
|
||||
@@ -340,17 +356,28 @@ INSTALL()
|
||||
make install PROJ_datadir=$dataDir PROJ_docsdir=$docDir \
|
||||
PROJ_mandir=$manDir PROJ_includedir=$includeDir PROJ_libdir=$libDir
|
||||
|
||||
make -C tools/clang install PROJ_datadir=$dataDir PROJ_docsdir=$docDir \
|
||||
PROJ_mandir=$manDir PROJ_includedir=$includeDir PROJ_libdir=$libDir
|
||||
|
||||
make -C projects/compiler-rt install PROJ_datadir=$dataDir PROJ_docsdir=$docDir \
|
||||
PROJ_mandir=$manDir PROJ_includedir=$includeDir PROJ_libdir=$libDir
|
||||
|
||||
if [ -n $secondaryArchSuffix ]; then
|
||||
mv $prefix/lib $prefix/lib2
|
||||
mkdir -p $libDir
|
||||
mv $prefix/lib2/* $libDir/
|
||||
rmdir $prefix/lib2
|
||||
binDir=$prefix/bin
|
||||
fi
|
||||
|
||||
# You can try and be fancy here parsing each arch in a for loop... but
|
||||
# not all arches contain the same libraries. The inventory for each arch
|
||||
# also changes between releases... so lets KISS.
|
||||
prepareInstalledDevelLibs \
|
||||
libfindAllSymbols \
|
||||
libLLVM* \
|
||||
libLTO
|
||||
|
||||
make -C tools/clang install PROJ_datadir=$dataDir PROJ_docsdir=$docDir \
|
||||
PROJ_mandir=$manDir PROJ_includedir=$includeDir PROJ_libdir=$libDir
|
||||
|
||||
prepareInstalledDevelLibs libclang*
|
||||
libLTO \
|
||||
libclang*
|
||||
|
||||
mv $prefix/include/* $includeDir/
|
||||
mv $prefix/libexec/* $binDir/
|
||||
@@ -388,5 +415,6 @@ INSTALL()
|
||||
|
||||
TEST()
|
||||
{
|
||||
make check
|
||||
cd build
|
||||
make $jobArgs check
|
||||
}
|
||||
456
sys-devel/llvm/llvm-4.0.0~git.recipe
Normal file
456
sys-devel/llvm/llvm-4.0.0~git.recipe
Normal file
@@ -0,0 +1,456 @@
|
||||
SUMMARY="Modular and reuseable compiler and toolchain technologies"
|
||||
DESCRIPTION="LLVM is a collection of modular and reuseable compiler and and \
|
||||
toolchain technologies.The LLVM compiler system for C and C++ includes the \
|
||||
following:
|
||||
|
||||
- Front-ends for C, C++, Objective-C, Fortran, etc. based on the GCC 4.2 \
|
||||
parsers. They support the ANSI-standard C and C++ languages to the same \
|
||||
degree that GCC supports them. Additionally, many GCC extensions are \
|
||||
supported.
|
||||
- A stable implementation of the LLVM instruction set, which serves as both \
|
||||
the online and offline code representation, together with assembly (ASCII) \
|
||||
and bytecode (binary) readers and writers, and a verifier.
|
||||
- A powerful pass-management system that automatically sequences passes \
|
||||
(including analysis, transformation, and code-generation passes) based on \
|
||||
their dependences, and pipelines them for efficiency.
|
||||
- A wide range of global scalar optimizations.
|
||||
- A link-time interprocedural optimization framework with a rich set of \
|
||||
analyses and transformations, including sophisticated whole-program pointer \
|
||||
analysis, call graph construction, and support for profile-guided optimizations.
|
||||
- An easily retargettable code generator, which currently supports X86, \
|
||||
X86-64, PowerPC, PowerPC-64, ARM, Thumb, SPARC, Alpha, CellSPU, MIPS, MSP430, \
|
||||
SystemZ, and XCore.
|
||||
- A Just-In-Time (JIT) code generation system, which currently supports X86, \
|
||||
X86-64, ARM, AArch64, Mips, SystemZ, PowerPC, and PowerPC-64.
|
||||
- Support for generating DWARF debugging information.
|
||||
- A C back-end useful for testing and for generating native code on targets \
|
||||
other than the ones listed above.
|
||||
- A profiling system similar to gprof.
|
||||
- A test framework with a number of benchmark codes and applications.
|
||||
- APIs and debugging tools to simplify rapid development of LLVM components."
|
||||
HOMEPAGE="http://www.llvm.org/"
|
||||
COPYRIGHT="2003-2014 University of Illinois at Urbana-Champaign"
|
||||
LICENSE="UIUC"
|
||||
REVISION="1"
|
||||
llvmSrcGitRev="c57d1d62952f85678048ab65af49cd1a452e40f7"
|
||||
clangSrcGitRev="aedeadddd4ccdc50dd68d7a65166e2635a7e03e2"
|
||||
clangToolsExtraSrcGitRev="e775a55214eda56ecf98de38a52c7e046e9fec1f"
|
||||
compilerRtSrcGitRev="4eb08d1dbd9bdfe505c146fcfbcdf94e9d26a173"
|
||||
SOURCE_URI="https://github.com/llvm-mirror/llvm/archive/$llvmSrcGitRev.tar.gz"
|
||||
SOURCE_URI_2="https://github.com/llvm-mirror/clang/archive/$clangSrcGitRev.tar.gz"
|
||||
SOURCE_URI_3="https://github.com/llvm-mirror/clang-tools-extra/archive/$clangToolsExtraSrcGitRev.tar.gz"
|
||||
SOURCE_URI_4="https://github.com/llvm-mirror/compiler-rt/archive/$compilerRtSrcGitRev.tar.gz"
|
||||
SOURCE_FILENAME="llvm-${llvmSrcGitRev}.tar.gz"
|
||||
SOURCE_FILENAME_2="clang-${clangSrcGitRev}.tar.gz"
|
||||
SOURCE_FILENAME_3="clang-tools-extra-${clangToolsExtraSrcGitRev}.tar.gz"
|
||||
SOURCE_FILENAME_4="compiler-rt-${compilerRtSrcGitRev}.tar.gz"
|
||||
CHECKSUM_SHA256="4f06133cdd3152ecc72ca23ec7c23b10c076a27a3ad558a66e941c816ba6388c"
|
||||
CHECKSUM_SHA256_2="dd09220f500098cac1efa88ea81850d6679412195342cc36267e76a0002e3463"
|
||||
CHECKSUM_SHA256_3="9a919408f19899fdaa03f02d185912db6aff452e497249330415d794a41f347f"
|
||||
CHECKSUM_SHA256_4="3e80176f908b4b105d9ea20a7e62b727eb5a5a6565f5adac45f9d0e063f9471b"
|
||||
SOURCE_DIR="llvm-$llvmSrcGitRev"
|
||||
SOURCE_DIR_2="clang-$clangSrcGitRev"
|
||||
SOURCE_DIR_3="clang-tools-extra-$clangToolsExtraSrcGitRev"
|
||||
SOURCE_DIR_4="compiler-rt-$compilerRtSrcGitRev"
|
||||
PATCHES="llvm-${portVersion}.patchset"
|
||||
PATCHES_2="clang-${portVersion}.patchset"
|
||||
|
||||
ARCHITECTURES="!x86_gcc2 ?x86 ?x86_64"
|
||||
SECONDARY_ARCHITECTURES="?x86"
|
||||
|
||||
PROVIDES="
|
||||
llvm$secondaryArchSuffix = $portVersion
|
||||
cmd:bugpoint
|
||||
cmd:find_all_symbols
|
||||
cmd:llc
|
||||
cmd:lli
|
||||
cmd:lli_child_target
|
||||
cmd:llvm_ar
|
||||
cmd:llvm_as
|
||||
cmd:llvm_bcanalyzer
|
||||
cmd:llvm_c_test
|
||||
cmd:llvm_config
|
||||
cmd:llvm_cov
|
||||
cmd:llvm_cxxdump
|
||||
cmd:llvm_cxxfilt
|
||||
cmd:llvm_diff
|
||||
cmd:llvm_dis
|
||||
cmd:llvm_dsymutil
|
||||
cmd:llvm_dwarfdump
|
||||
cmd:llvm_dwp
|
||||
cmd:llvm_extract
|
||||
cmd:llvm_lib
|
||||
cmd:llvm_link
|
||||
cmd:llvm_lto
|
||||
cmd:llvm_lto2
|
||||
cmd:llvm_mc
|
||||
cmd:llvm_mcmarkup
|
||||
cmd:llvm_nm
|
||||
cmd:llvm_objdump
|
||||
cmd:llvm_opt_report
|
||||
cmd:llvm_pdbdump
|
||||
cmd:llvm_profdata
|
||||
cmd:llvm_ranlib
|
||||
cmd:llvm_readobj
|
||||
cmd:llvm_rtdyld
|
||||
cmd:llvm_size
|
||||
cmd:llvm_split
|
||||
cmd:llvm_stress
|
||||
cmd:llvm_strings
|
||||
cmd:llvm_symbolizer
|
||||
cmd:llvm_tblgen
|
||||
cmd:llvm_xray
|
||||
cmd:macho_dump
|
||||
cmd:verify_uselistorder
|
||||
cmd:obj2yaml
|
||||
cmd:yaml2obj
|
||||
cmd:opt
|
||||
cmd:FileCheck
|
||||
cmd:count
|
||||
cmd:not
|
||||
cmd:sancov
|
||||
cmd:sanstats
|
||||
lib:BugpointPasses$secondaryArchSuffix
|
||||
lib:LLVMHello$secondaryArchSuffix
|
||||
lib:libLTO$secondaryArchSuffix
|
||||
|
||||
devel:libfindAllSymbols$secondaryArchSuffix
|
||||
devel:libLLVMAArch64AsmParser$secondaryArchSuffix
|
||||
devel:libLLVMAArch64AsmPrinter$secondaryArchSuffix
|
||||
devel:libLLVMAArch64CodeGen$secondaryArchSuffix
|
||||
devel:libLLVMAArch64Desc$secondaryArchSuffix
|
||||
devel:libLLVMAArch64Disassembler$secondaryArchSuffix
|
||||
devel:libLLVMAArch64Info$secondaryArchSuffix
|
||||
devel:libLLVMAArch64Utils$secondaryArchSuffix
|
||||
devel:libLLVMAMDGPUAsmParser$secondaryArchSuffix
|
||||
devel:libLLVMAMDGPUAsmPrinter$secondaryArchSuffix
|
||||
devel:libLLVMAMDGPUCodeGen$secondaryArchSuffix
|
||||
devel:libLLVMAMDGPUDesc$secondaryArchSuffix
|
||||
devel:libLLVMAMDGPUDisassembler$secondaryArchSuffix
|
||||
devel:libLLVMAMDGPUInfo$secondaryArchSuffix
|
||||
devel:libLLVMAMDGPUUtils$secondaryArchSuffix
|
||||
devel:libLLVMARMAsmParser$secondaryArchSuffix
|
||||
devel:libLLVMARMAsmPrinter$secondaryArchSuffix
|
||||
devel:libLLVMARMCodeGen$secondaryArchSuffix
|
||||
devel:libLLVMARMDesc$secondaryArchSuffix
|
||||
devel:libLLVMARMDisassembler$secondaryArchSuffix
|
||||
devel:libLLVMARMInfo$secondaryArchSuffix
|
||||
devel:libLLVMAnalysis$secondaryArchSuffix
|
||||
devel:libLLVMAsmParser$secondaryArchSuffix
|
||||
devel:libLLVMAsmPrinter$secondaryArchSuffix
|
||||
devel:libLLVMBPFAsmPrinter$secondaryArchSuffix
|
||||
devel:libLLVMBPFCodeGen$secondaryArchSuffix
|
||||
devel:libLLVMBPFDesc$secondaryArchSuffix
|
||||
devel:libLLVMBPFInfo$secondaryArchSuffix
|
||||
devel:libLLVMBitReader$secondaryArchSuffix
|
||||
devel:libLLVMBitWriter$secondaryArchSuffix
|
||||
devel:libLLVMCodeGen$secondaryArchSuffix
|
||||
devel:libLLVMCore$secondaryArchSuffix
|
||||
devel:libLLVMCoroutines$secondaryArchSuffix
|
||||
devel:libLLVMCoverage$secondaryArchSuffix
|
||||
devel:libLLVMCppBackendCodeGen$secondaryArchSuffix
|
||||
devel:libLLVMCppBackendInfo$secondaryArchSuffix
|
||||
devel:libLLVMDebugInfoCodeView$secondaryArchSuffix
|
||||
devel:libLLVMDebugInfoDWARF$secondaryArchSuffix
|
||||
devel:libLLVMDebugInfoMSF$secondaryArchSuffix
|
||||
devel:libLLVMDebugInfoPDB$secondaryArchSuffix
|
||||
devel:libLLVMDemangle$secondaryArchSuffix
|
||||
devel:libLLVMExecutionEngine$secondaryArchSuffix
|
||||
devel:libLLVMGlobalISel$secondaryArchSuffix
|
||||
devel:libLLVMHexagonAsmParser$secondaryArchSuffix
|
||||
devel:libLLVMHexagonCodeGen$secondaryArchSuffix
|
||||
devel:libLLVMHexagonDesc$secondaryArchSuffix
|
||||
devel:libLLVMHexagonDisassembler$secondaryArchSuffix
|
||||
devel:libLLVMHexagonInfo$secondaryArchSuffix
|
||||
devel:libLLVMIRReader$secondaryArchSuffix
|
||||
devel:libLLVMInstCombine$secondaryArchSuffix
|
||||
devel:libLLVMInstrumentation$secondaryArchSuffix
|
||||
devel:libLLVMInterpreter$secondaryArchSuffix
|
||||
devel:libLLVMLanaiAsmParser$secondaryArchSuffix
|
||||
devel:libLLVMLanaiCodeGen$secondaryArchSuffix
|
||||
devel:libLLVMLanaiDesc$secondaryArchSuffix
|
||||
devel:libLLVMLanaiDisassembler$secondaryArchSuffix
|
||||
devel:libLLVMLanaiInfo$secondaryArchSuffix
|
||||
devel:libLLVMLanaiInstPrinter$secondaryArchSuffix
|
||||
devel:libLLVMLTO$secondaryArchSuffix
|
||||
devel:libLLVMLibDriver$secondaryArchSuffix
|
||||
devel:libLLVMLineEditor$secondaryArchSuffix
|
||||
devel:libLLVMLinker$secondaryArchSuffix
|
||||
devel:libLLVMMC$secondaryArchSuffix
|
||||
devel:libLLVMMCDisassembler$secondaryArchSuffix
|
||||
devel:libLLVMMCJIT$secondaryArchSuffix
|
||||
devel:libLLVMMCParser$secondaryArchSuffix
|
||||
devel:libLLVMMIRParser$secondaryArchSuffix
|
||||
devel:libLLVMMSP430AsmPrinter$secondaryArchSuffix
|
||||
devel:libLLVMMSP430CodeGen$secondaryArchSuffix
|
||||
devel:libLLVMMSP430Desc$secondaryArchSuffix
|
||||
devel:libLLVMMSP430Info$secondaryArchSuffix
|
||||
devel:libLLVMMipsAsmParser$secondaryArchSuffix
|
||||
devel:libLLVMMipsAsmPrinter$secondaryArchSuffix
|
||||
devel:libLLVMMipsCodeGen$secondaryArchSuffix
|
||||
devel:libLLVMMipsDesc$secondaryArchSuffix
|
||||
devel:libLLVMMipsDisassembler$secondaryArchSuffix
|
||||
devel:libLLVMMipsInfo$secondaryArchSuffix
|
||||
devel:libLLVMNVPTXAsmPrinter$secondaryArchSuffix
|
||||
devel:libLLVMNVPTXCodeGen$secondaryArchSuffix
|
||||
devel:libLLVMNVPTXDesc$secondaryArchSuffix
|
||||
devel:libLLVMNVPTXInfo$secondaryArchSuffix
|
||||
devel:libLLVMObjCARCOpts$secondaryArchSuffix
|
||||
devel:libLLVMObject$secondaryArchSuffix
|
||||
devel:libLLVMObjectYAML$secondaryArchSuffix
|
||||
devel:libLLVMOption$secondaryArchSuffix
|
||||
devel:libLLVMOrcJIT$secondaryArchSuffix
|
||||
devel:libLLVMPasses$secondaryArchSuffix
|
||||
devel:libLLVMPowerPCAsmParser$secondaryArchSuffix
|
||||
devel:libLLVMPowerPCAsmPrinter$secondaryArchSuffix
|
||||
devel:libLLVMPowerPCCodeGen$secondaryArchSuffix
|
||||
devel:libLLVMPowerPCDesc$secondaryArchSuffix
|
||||
devel:libLLVMPowerPCDisassembler$secondaryArchSuffix
|
||||
devel:libLLVMPowerPCInfo$secondaryArchSuffix
|
||||
devel:libLLVMProfileData$secondaryArchSuffix
|
||||
devel:libLLVMRISCVCodeGen$secondaryArchSuffix
|
||||
devel:libLLVMRISCVDesc$secondaryArchSuffix
|
||||
devel:libLLVMRISCVInfo$secondaryArchSuffix
|
||||
devel:libLLVMRuntimeDyld$secondaryArchSuffix
|
||||
devel:libLLVMScalarOpts$secondaryArchSuffix
|
||||
devel:libLLVMSelectionDAG$secondaryArchSuffix
|
||||
devel:libLLVMSparcAsmParser$secondaryArchSuffix
|
||||
devel:libLLVMSparcAsmPrinter$secondaryArchSuffix
|
||||
devel:libLLVMSparcCodeGen$secondaryArchSuffix
|
||||
devel:libLLVMSparcDesc$secondaryArchSuffix
|
||||
devel:libLLVMSparcDisassembler$secondaryArchSuffix
|
||||
devel:libLLVMSparcInfo$secondaryArchSuffix
|
||||
devel:libLLVMSupport$secondaryArchSuffix
|
||||
devel:libLLVMSymbolize$secondaryArchSuffix
|
||||
devel:libLLVMSystemZAsmParser$secondaryArchSuffix
|
||||
devel:libLLVMSystemZAsmPrinter$secondaryArchSuffix
|
||||
devel:libLLVMSystemZCodeGen$secondaryArchSuffix
|
||||
devel:libLLVMSystemZDesc$secondaryArchSuffix
|
||||
devel:libLLVMSystemZDisassembler$secondaryArchSuffix
|
||||
devel:libLLVMSystemZInfo$secondaryArchSuffix
|
||||
devel:libLLVMTableGen$secondaryArchSuffix
|
||||
devel:libLLVMTarget$secondaryArchSuffix
|
||||
devel:libLLVMTransformUtils$secondaryArchSuffix
|
||||
devel:libLLVMVectorize$secondaryArchSuffix
|
||||
devel:libLLVMX86AsmParser$secondaryArchSuffix
|
||||
devel:libLLVMX86AsmPrinter$secondaryArchSuffix
|
||||
devel:libLLVMX86CodeGen$secondaryArchSuffix
|
||||
devel:libLLVMX86Desc$secondaryArchSuffix
|
||||
devel:libLLVMX86Disassembler$secondaryArchSuffix
|
||||
devel:libLLVMX86Info$secondaryArchSuffix
|
||||
devel:libLLVMX86Utils$secondaryArchSuffix
|
||||
devel:libLLVMXCoreAsmPrinter$secondaryArchSuffix
|
||||
devel:libLLVMXCoreCodeGen$secondaryArchSuffix
|
||||
devel:libLLVMXCoreDesc$secondaryArchSuffix
|
||||
devel:libLLVMXCoreDisassembler$secondaryArchSuffix
|
||||
devel:libLLVMXCoreInfo$secondaryArchSuffix
|
||||
devel:libLLVMipo$secondaryArchSuffix
|
||||
devel:libLTO$secondaryArchSuffix
|
||||
"
|
||||
REQUIRES="
|
||||
haiku$secondaryArchSuffix
|
||||
lib:libz$secondaryArchSuffix
|
||||
"
|
||||
PROVIDES_clang="
|
||||
llvm${secondaryArchSuffix}_clang = $portVersion
|
||||
cmd:clang = $portVersion
|
||||
cmd:clang_4.0 = $portVersion
|
||||
cmd:clang++ = $portVersion
|
||||
cmd:clang_apply_replacements = $portVersion
|
||||
cmd:clang_change_namespace
|
||||
cmd:clang_check = $portVersion
|
||||
cmd:clang_cl = $portVersion
|
||||
cmd:clang_cpp = $portVersion
|
||||
cmd:clang_format = $portVersion
|
||||
cmd:clang_include_fixer
|
||||
cmd:clang_modernize = $portVersion
|
||||
cmd:clang_offload_bundler
|
||||
cmd:clang_query = $portVersion
|
||||
cmd:clang_rename = $portVersion
|
||||
cmd:clang_reorder_fields = $portVersion
|
||||
cmd:clang_tblgen = $portVersion
|
||||
cmd:clang_tidy = $portVersion
|
||||
cmd:c_index_test = $portVersion
|
||||
cmd:git_clang_format = $portVersion
|
||||
cmd:modularize = $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:libclangchangenamespace$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:libclangincludefixer$secondaryArchSuffix = $portVersion
|
||||
devel:libclangincludefixerplugin$secondaryArchSuffix = $portVersion
|
||||
devel:libclangindex$secondaryArchSuffix = $portVersion
|
||||
devel:libclanglex$secondaryArchSuffix = $portVersion
|
||||
devel:libclangmove$secondaryArchSuffix = $portVersion
|
||||
devel:libclangparse$secondaryArchSuffix = $portVersion
|
||||
devel:libclangquery$secondaryArchSuffix = $portVersion
|
||||
devel:libclangrename$secondaryArchSuffix = $portVersion
|
||||
devel:libclangreorderfields$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:libclangtidyboostmodule$secondaryArchSuffix = $portVersion
|
||||
devel:libclangtidycertmodule$secondaryArchSuffix = $portVersion
|
||||
devel:libclangtidycppcoreguidelinesmodule$secondaryArchSuffix = $portVersion
|
||||
devel:libclangtidygooglemodule$secondaryArchSuffix = $portVersion
|
||||
devel:libclangtidyllvmmodule$secondaryArchSuffix = $portVersion
|
||||
devel:libclangtidymiscmodule$secondaryArchSuffix = $portVersion
|
||||
devel:libclangtidymodernizemodule$secondaryArchSuffix = $portVersion
|
||||
devel:libclangtidympimodule$secondaryArchSuffix = $portVersion
|
||||
devel:libclangtidyperformancemodule$secondaryArchSuffix = $portVersion
|
||||
devel:libclangtidyplugin$secondaryArchSuffix = $portVersion
|
||||
devel:libclangtidyreadability$secondaryArchSuffix = $portVersion
|
||||
devel:libclangtidyreadabilitymodule$secondaryArchSuffix = $portVersion
|
||||
devel:libclangtidyutils$secondaryArchSuffix = $portVersion
|
||||
devel:libclangtooling$secondaryArchSuffix = $portVersion
|
||||
devel:libclangtoolingcore$secondaryArchSuffix = $portVersion
|
||||
"
|
||||
REQUIRES_clang="
|
||||
haiku$secondaryArchSuffix
|
||||
lib:libz$secondaryArchSuffix
|
||||
"
|
||||
PROVIDES_clang_analysis="
|
||||
llvm${secondaryArchSuffix}_clang_analysis = $portVersion
|
||||
cmd:c++_analyzer = $portVersion
|
||||
cmd:ccc_analyzer = $portVersion
|
||||
cmd:scan_build = $portVersion
|
||||
cmd:scan_view = $portVersion
|
||||
"
|
||||
REQUIRES_clang_analysis="
|
||||
llvm${secondaryArchSuffix}_clang == $portVersion base
|
||||
cmd:python
|
||||
"
|
||||
BUILD_REQUIRES="
|
||||
haiku${secondaryArchSuffix}_devel
|
||||
devel:libz$secondaryArchSuffix
|
||||
"
|
||||
BUILD_PREREQUIRES="
|
||||
cmd:cmake
|
||||
cmd:diff
|
||||
cmd:find
|
||||
cmd:gcc$secondaryArchSuffix
|
||||
cmd:groff
|
||||
cmd:ld$secondaryArchSuffix
|
||||
cmd:make
|
||||
cmd:python
|
||||
cmd:sed
|
||||
cmd:grep
|
||||
"
|
||||
|
||||
BUILD()
|
||||
{
|
||||
# Add clang tools
|
||||
mkdir -p tools/clang
|
||||
cp -rd $sourceDir2/* tools/clang/
|
||||
|
||||
# Add clang tools's tool's (really llvm?)
|
||||
mkdir -p tools/clang/tools/extra
|
||||
cp -rd $sourceDir3/* tools/clang/tools/extra
|
||||
|
||||
mkdir -p projects/compiler-rt
|
||||
cp -rd $sourceDir4/* projects/compiler-rt
|
||||
|
||||
local cmakeFlags
|
||||
if [ -n "$secondaryArchSuffix" ]; then
|
||||
cmakeFlags=-DHAIKU_HYBRID_SECONDARY="\"${effectiveTargetArchitecture}\""
|
||||
fi
|
||||
|
||||
mkdir -p build; cd build
|
||||
# Haiku C++ requires rtti in a lot of central system components
|
||||
# such as Mesa
|
||||
cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=$prefix \
|
||||
-DCMAKE_SKIP_RPATH=YES $cmakeFlags \
|
||||
-DLLVM_ENABLE_RTTI=ON -DLLVM_ENABLE_THREADS=NO \
|
||||
..
|
||||
make $jobArgs PROJ_datadir=$dataDir PROJ_docsdir=$docDir \
|
||||
PROJ_mandir=$manDir PROJ_includedir=$includeDir PROJ_libdir=$libDir
|
||||
}
|
||||
|
||||
INSTALL()
|
||||
{
|
||||
cd build
|
||||
mkdir -p $binDir $developDir $dataDir $docDir $includeDir $manDir
|
||||
|
||||
make install PROJ_datadir=$dataDir PROJ_docsdir=$docDir \
|
||||
PROJ_mandir=$manDir PROJ_includedir=$includeDir PROJ_libdir=$libDir
|
||||
|
||||
make -C tools/clang install PROJ_datadir=$dataDir PROJ_docsdir=$docDir \
|
||||
PROJ_mandir=$manDir PROJ_includedir=$includeDir PROJ_libdir=$libDir
|
||||
|
||||
make -C projects/compiler-rt install PROJ_datadir=$dataDir PROJ_docsdir=$docDir \
|
||||
PROJ_mandir=$manDir PROJ_includedir=$includeDir PROJ_libdir=$libDir
|
||||
|
||||
if [ -n $secondaryArchSuffix ]; then
|
||||
mv $prefix/lib $prefix/lib2
|
||||
mkdir -p $libDir
|
||||
mv $prefix/lib2/* $libDir/
|
||||
rmdir $prefix/lib2
|
||||
binDir=$prefix/bin
|
||||
fi
|
||||
|
||||
# You can try and be fancy here parsing each arch in a for loop... but
|
||||
# not all arches contain the same libraries. The inventory for each arch
|
||||
# also changes between releases... so lets KISS.
|
||||
prepareInstalledDevelLibs \
|
||||
libfindAllSymbols \
|
||||
libLLVM* \
|
||||
libLTO \
|
||||
libclang*
|
||||
|
||||
mv $prefix/include/* $includeDir/
|
||||
mv $prefix/libexec/* $binDir/
|
||||
mv $prefix/share/man/* $manDir/
|
||||
mv $prefix/share/clang $dataDir/
|
||||
mv $prefix/share/scan-build $dataDir/
|
||||
mv $prefix/share/scan-view $dataDir/
|
||||
rmdir $prefix/include $prefix/libexec $prefix/share/man $prefix/share
|
||||
|
||||
sed -i 's|/libexec/|/bin/|' $binDir/scan-build
|
||||
sed -i 's|/share/|/data/|' $binDir/scan-build $binDir/scan-view
|
||||
|
||||
# clang package
|
||||
packageEntries clang \
|
||||
$binDir/c-index-test \
|
||||
$binDir/clang* \
|
||||
$binDir/git-clang-format \
|
||||
$binDir/modularize \
|
||||
$dataDir/clang \
|
||||
$includeDir/clang* \
|
||||
$libDir/libclang* \
|
||||
$libDir/clang \
|
||||
$developLibDir/libclang*
|
||||
|
||||
# analysis package
|
||||
packageEntries clang_analysis \
|
||||
$binDir/scan-build \
|
||||
$binDir/scan-view \
|
||||
$binDir/c++-analyzer \
|
||||
$binDir/ccc-analyzer \
|
||||
$dataDir/scan-build \
|
||||
$dataDir/scan-view \
|
||||
$manDir/man1/scan-build.1
|
||||
}
|
||||
|
||||
TEST()
|
||||
{
|
||||
cd build
|
||||
make $jobArgs check
|
||||
make $jobArgs check-clang
|
||||
}
|
||||
151
sys-devel/llvm/patches/clang-3.9.0.patchset
Normal file
151
sys-devel/llvm/patches/clang-3.9.0.patchset
Normal file
@@ -0,0 +1,151 @@
|
||||
From f67820d19fb6cd2077149cd749c62c48b7407300 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Duval?= <jerome.duval@gmail.com>
|
||||
Date: Mon, 18 Jul 2016 14:13:19 +0200
|
||||
Subject: support for secondary arch.
|
||||
|
||||
|
||||
diff --git a/CMakeLists.txt b/CMakeLists.txt
|
||||
index cfcd221..5ae28fd 100644
|
||||
--- a/CMakeLists.txt
|
||||
+++ b/CMakeLists.txt
|
||||
@@ -370,6 +370,10 @@ endif()
|
||||
if(CLANG_ENABLE_STATIC_ANALYZER)
|
||||
add_definitions(-DCLANG_ENABLE_STATIC_ANALYZER)
|
||||
endif()
|
||||
+if(DEFINED HAIKU_HYBRID_SECONDARY)
|
||||
+ add_definitions(-DHAIKU_HYBRID_SECONDARY=${HAIKU_HYBRID_SECONDARY})
|
||||
+endif()
|
||||
+
|
||||
|
||||
# Clang version information
|
||||
set(CLANG_EXECUTABLE_VERSION
|
||||
diff --git a/lib/Driver/ToolChains.cpp b/lib/Driver/ToolChains.cpp
|
||||
index 347aa29..8fc2b85 100644
|
||||
--- a/lib/Driver/ToolChains.cpp
|
||||
+++ b/lib/Driver/ToolChains.cpp
|
||||
@@ -3314,6 +3314,13 @@ SanitizerMask CloudABI::getDefaultSanitizers() const {
|
||||
Haiku::Haiku(const Driver &D, const llvm::Triple& Triple, const ArgList &Args)
|
||||
: Generic_ELF(D, Triple, Args) {
|
||||
|
||||
+#ifdef HAIKU_HYBRID_SECONDARY
|
||||
+ getProgramPaths().insert(getProgramPaths().begin(), getDriver().SysRoot
|
||||
+ + "/system/bin/" HAIKU_HYBRID_SECONDARY);
|
||||
+ getFilePaths().clear();
|
||||
+ getFilePaths().push_back(getDriver().SysRoot + "/system/lib/"
|
||||
+ HAIKU_HYBRID_SECONDARY);
|
||||
+#endif
|
||||
}
|
||||
|
||||
void Haiku::AddClangCXXStdlibIncludeArgs(const ArgList &DriverArgs,
|
||||
@@ -3328,6 +3335,19 @@ void Haiku::AddClangCXXStdlibIncludeArgs(const ArgList &DriverArgs,
|
||||
getDriver().SysRoot + "/system/develop/headers/c++/v1");
|
||||
break;
|
||||
case ToolChain::CST_Libstdcxx:
|
||||
+#ifdef HAIKU_HYBRID_SECONDARY
|
||||
+ addSystemInclude(DriverArgs, CC1Args,
|
||||
+ getDriver().SysRoot + "/system/develop/headers/"
|
||||
+ HAIKU_HYBRID_SECONDARY "/c++");
|
||||
+ addSystemInclude(DriverArgs, CC1Args,
|
||||
+ getDriver().SysRoot + "/system/develop/headers/"
|
||||
+ HAIKU_HYBRID_SECONDARY "/c++/backward");
|
||||
+
|
||||
+ StringRef Triple = getTriple().str();
|
||||
+ addSystemInclude(DriverArgs, CC1Args,
|
||||
+ getDriver().SysRoot + "/system/develop/headers/"
|
||||
+ HAIKU_HYBRID_SECONDARY "/c++/" + Triple);
|
||||
+#else
|
||||
addSystemInclude(DriverArgs, CC1Args,
|
||||
getDriver().SysRoot + "/system/develop/headers/c++");
|
||||
addSystemInclude(DriverArgs, CC1Args,
|
||||
@@ -3337,6 +3357,7 @@ void Haiku::AddClangCXXStdlibIncludeArgs(const ArgList &DriverArgs,
|
||||
addSystemInclude(DriverArgs, CC1Args,
|
||||
getDriver().SysRoot + "/system/develop/headers/c++/" +
|
||||
Triple);
|
||||
+#endif
|
||||
break;
|
||||
}
|
||||
}
|
||||
diff --git a/lib/Frontend/InitHeaderSearch.cpp b/lib/Frontend/InitHeaderSearch.cpp
|
||||
index 1b5c760..48b3357 100644
|
||||
--- a/lib/Frontend/InitHeaderSearch.cpp
|
||||
+++ b/lib/Frontend/InitHeaderSearch.cpp
|
||||
@@ -234,7 +234,20 @@ void InitHeaderSearch::AddDefaultCIncludePaths(const llvm::Triple &triple,
|
||||
if (HSOpts.UseBuiltinIncludes) {
|
||||
// Ignore the sys root, we *always* look for clang headers relative to
|
||||
// supplied path.
|
||||
+#ifdef HAIKU_HYBRID_SECONDARY
|
||||
+ // Remove version from foo/lib/clang/version
|
||||
+ StringRef Ver = llvm::sys::path::filename(HSOpts.ResourceDir);
|
||||
+ StringRef NoVer = llvm::sys::path::parent_path(HSOpts.ResourceDir);
|
||||
+ // Remove clang from foo/lib/clang
|
||||
+ StringRef Clang = llvm::sys::path::filename(NoVer);
|
||||
+ SmallString<128> P = llvm::sys::path::parent_path(NoVer);
|
||||
+
|
||||
+ // Get foo/include/c++/v1
|
||||
+ llvm::sys::path::append(P, HAIKU_HYBRID_SECONDARY, Clang, Ver);
|
||||
+#else
|
||||
SmallString<128> P = StringRef(HSOpts.ResourceDir);
|
||||
+#endif
|
||||
+
|
||||
llvm::sys::path::append(P, "include");
|
||||
AddUnmappedPath(P, ExternCSystem, false);
|
||||
}
|
||||
@@ -267,7 +280,12 @@ void InitHeaderSearch::AddDefaultCIncludePaths(const llvm::Triple &triple,
|
||||
}
|
||||
|
||||
case llvm::Triple::Haiku:
|
||||
+#ifdef HAIKU_HYBRID_SECONDARY
|
||||
+ AddPath("/boot/system/non-packaged/develop/headers/" HAIKU_HYBRID_SECONDARY,
|
||||
+ System, false);
|
||||
+#else
|
||||
AddPath("/boot/system/non-packaged/develop/headers", System, false);
|
||||
+#endif
|
||||
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);
|
||||
@@ -299,6 +317,13 @@ void InitHeaderSearch::AddDefaultCIncludePaths(const llvm::Triple &triple,
|
||||
AddPath("/boot/system/develop/headers/bsd", System, false);
|
||||
AddPath("/boot/system/develop/headers/glibc", System, false);
|
||||
AddPath("/boot/system/develop/headers/posix", System, false);
|
||||
+#ifdef HAIKU_HYBRID_SECONDARY
|
||||
+ AddPath("/boot/system/develop/headers/" HAIKU_HYBRID_SECONDARY, System, false);
|
||||
+ AddPath("/boot/system/develop/headers/" HAIKU_HYBRID_SECONDARY "/os", System,
|
||||
+ false);
|
||||
+ AddPath("/boot/system/develop/headers/" HAIKU_HYBRID_SECONDARY "/os/opengl",
|
||||
+ System, false);
|
||||
+#endif
|
||||
AddPath("/boot/system/develop/headers", System, false);
|
||||
break;
|
||||
case llvm::Triple::RTEMS:
|
||||
--
|
||||
2.2.2
|
||||
|
||||
|
||||
From 224324a9fa29ffacbe31329790909bf16983abe2 Mon Sep 17 00:00:00 2001
|
||||
From: Jerome Duval <jerome.duval@gmail.com>
|
||||
Date: Thu, 7 Apr 2016 18:30:52 +0000
|
||||
Subject: add a test for haiku driver.
|
||||
|
||||
* upstream wants a case for libcxx in ToolChains.cpp, so add it.
|
||||
|
||||
diff --git a/test/Driver/haiku.c b/test/Driver/haiku.c
|
||||
new file mode 100644
|
||||
index 0000000..9591739
|
||||
--- /dev/null
|
||||
+++ b/test/Driver/haiku.c
|
||||
@@ -0,0 +1,12 @@
|
||||
+// RUN: %clang -no-canonical-prefixes -target x86_64-unknown-haiku %s -### 2> %t.log
|
||||
+// RUN: FileCheck --check-prefix=CHECK-X86_64 -input-file %t.log %s
|
||||
+
|
||||
+// CHECK-X86_64: clang{{.*}}" "-cc1" "-triple" "x86_64-unknown-haiku"
|
||||
+// CHECK-X86_64: gcc{{.*}}" "-o" "a.out" "{{.*}}.o"
|
||||
+
|
||||
+// RUN: %clang -no-canonical-prefixes -target i586-pc-haiku %s -### 2> %t.log
|
||||
+// RUN: FileCheck --check-prefix=CHECK-X86 -input-file %t.log %s
|
||||
+
|
||||
+// CHECK-X86: clang{{.*}}" "-cc1" "-triple" "i586-pc-haiku"
|
||||
+// CHECK-X86: gcc{{.*}}" "-o" "a.out" "{{.*}}.o"
|
||||
+
|
||||
--
|
||||
2.2.2
|
||||
|
||||
@@ -1,320 +0,0 @@
|
||||
From 459637c4df935cb42b44a2c2ba2588f1cc1aedc8 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 0115888596994260188bcb7cfe46ac43bc2fb138 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 64903de..25a07b4 100644
|
||||
--- a/lib/Driver/Driver.cpp
|
||||
+++ b/lib/Driver/Driver.cpp
|
||||
@@ -2384,6 +2384,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 902338b..a9a11dc 100644
|
||||
--- a/lib/Driver/ToolChains.cpp
|
||||
+++ b/lib/Driver/ToolChains.cpp
|
||||
@@ -2992,6 +2992,34 @@ SanitizerMask CloudABI::getDefaultSanitizers() const {
|
||||
return SanitizerKind::SafeStack;
|
||||
}
|
||||
|
||||
+/// 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 e799217..6c4f03b 100644
|
||||
--- a/lib/Driver/ToolChains.h
|
||||
+++ b/lib/Driver/ToolChains.h
|
||||
@@ -678,6 +678,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 8467d9e526766e7d41215ea2880fa79418798c3c 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 7639b04..1713133 100644
|
||||
--- a/lib/Basic/Targets.cpp
|
||||
+++ b/lib/Basic/Targets.cpp
|
||||
@@ -375,6 +375,29 @@ public:
|
||||
: OSTargetInfo<Target>(Triple, Opts) {}
|
||||
};
|
||||
|
||||
+// 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, const TargetOptions &Opts)
|
||||
+ : OSTargetInfo<Target>(Triple, Opts) {
|
||||
+ this->SizeType = TargetInfo::UnsignedLong;
|
||||
+ this->IntPtrType = TargetInfo::SignedLong;
|
||||
+ this->PtrDiffType = TargetInfo::SignedLong;
|
||||
+ this->ProcessIDType = TargetInfo::SignedLong;
|
||||
+ this->TLSSupported = false;
|
||||
+
|
||||
+ }
|
||||
+};
|
||||
+
|
||||
// Minix Target
|
||||
template<typename Target>
|
||||
class MinixTargetInfo : public OSTargetInfo<Target> {
|
||||
@@ -3983,21 +4006,15 @@ public:
|
||||
};
|
||||
|
||||
// x86-32 Haiku target
|
||||
-class HaikuX86_32TargetInfo : public X86_32TargetInfo {
|
||||
+class HaikuX86_32TargetInfo : public HaikuTargetInfo<X86_32TargetInfo> {
|
||||
public:
|
||||
HaikuX86_32TargetInfo(const llvm::Triple &Triple, const TargetOptions &Opts)
|
||||
- : X86_32TargetInfo(Triple, Opts) {
|
||||
- SizeType = UnsignedLong;
|
||||
- IntPtrType = SignedLong;
|
||||
- PtrDiffType = SignedLong;
|
||||
- ProcessIDType = SignedLong;
|
||||
- this->TLSSupported = false;
|
||||
+ : HaikuTargetInfo<X86_32TargetInfo>(Triple, Opts) {
|
||||
}
|
||||
void getTargetDefines(const LangOptions &Opts,
|
||||
MacroBuilder &Builder) const override {
|
||||
- X86_32TargetInfo::getTargetDefines(Opts, Builder);
|
||||
+ HaikuTargetInfo<X86_32TargetInfo>::getTargetDefines(Opts, Builder);
|
||||
Builder.defineMacro("__INTEL__");
|
||||
- Builder.defineMacro("__HAIKU__");
|
||||
}
|
||||
};
|
||||
|
||||
@@ -4770,7 +4787,7 @@ public:
|
||||
} else if (Feature == "+dsp") {
|
||||
DSP = 1;
|
||||
} else if (Feature == "+fp-only-sp") {
|
||||
- HW_FP_remove |= HW_FP_DP;
|
||||
+ HW_FP_remove |= HW_FP_DP;
|
||||
} else if (Feature == "+strict-align") {
|
||||
Unaligned = 0;
|
||||
} else if (Feature == "+fp16") {
|
||||
@@ -8225,6 +8242,8 @@ static TargetInfo *AllocateTarget(const llvm::Triple &Triple,
|
||||
return new MicrosoftX86_64TargetInfo(Triple, Opts);
|
||||
}
|
||||
}
|
||||
+ case llvm::Triple::Haiku:
|
||||
+ return new HaikuTargetInfo<X86_64TargetInfo>(Triple, Opts);
|
||||
case llvm::Triple::NaCl:
|
||||
return new NaClTargetInfo<X86_64TargetInfo>(Triple, Opts);
|
||||
case llvm::Triple::PS4:
|
||||
--
|
||||
2.2.2
|
||||
|
||||
|
||||
From 7e065cba77bf166d2dfabf15943e65f408922fe0 Mon Sep 17 00:00:00 2001
|
||||
From: Jerome Duval <jerome.duval@gmail.com>
|
||||
Date: Thu, 7 Apr 2016 18:30:52 +0000
|
||||
Subject: add a test for haiku driver.
|
||||
|
||||
* upstream wants a case for libcxx in ToolChains.cpp, so add it.
|
||||
|
||||
diff --git a/lib/Driver/ToolChains.cpp b/lib/Driver/ToolChains.cpp
|
||||
index a9a11dc..0bd3251 100644
|
||||
--- a/lib/Driver/ToolChains.cpp
|
||||
+++ b/lib/Driver/ToolChains.cpp
|
||||
@@ -3006,6 +3006,10 @@ void Haiku::AddClangCXXStdlibIncludeArgs(const ArgList &DriverArgs,
|
||||
return;
|
||||
|
||||
switch (GetCXXStdlibType(DriverArgs)) {
|
||||
+ case ToolChain::CST_Libcxx:
|
||||
+ addSystemInclude(DriverArgs, CC1Args,
|
||||
+ getDriver().SysRoot + "/system/develop/headers/c++/v1");
|
||||
+ break;
|
||||
case ToolChain::CST_Libstdcxx:
|
||||
addSystemInclude(DriverArgs, CC1Args,
|
||||
getDriver().SysRoot + "/system/develop/headers/c++");
|
||||
diff --git a/test/Driver/haiku.c b/test/Driver/haiku.c
|
||||
new file mode 100644
|
||||
index 0000000..9591739
|
||||
--- /dev/null
|
||||
+++ b/test/Driver/haiku.c
|
||||
@@ -0,0 +1,12 @@
|
||||
+// RUN: %clang -no-canonical-prefixes -target x86_64-unknown-haiku %s -### 2> %t.log
|
||||
+// RUN: FileCheck --check-prefix=CHECK-X86_64 -input-file %t.log %s
|
||||
+
|
||||
+// CHECK-X86_64: clang{{.*}}" "-cc1" "-triple" "x86_64-unknown-haiku"
|
||||
+// CHECK-X86_64: gcc{{.*}}" "-o" "a.out" "{{.*}}.o"
|
||||
+
|
||||
+// RUN: %clang -no-canonical-prefixes -target i586-pc-haiku %s -### 2> %t.log
|
||||
+// RUN: FileCheck --check-prefix=CHECK-X86 -input-file %t.log %s
|
||||
+
|
||||
+// CHECK-X86: clang{{.*}}" "-cc1" "-triple" "i586-pc-haiku"
|
||||
+// CHECK-X86: gcc{{.*}}" "-o" "a.out" "{{.*}}.o"
|
||||
+
|
||||
--
|
||||
2.2.2
|
||||
|
||||
139
sys-devel/llvm/patches/clang-4.0.0~git.patchset
Normal file
139
sys-devel/llvm/patches/clang-4.0.0~git.patchset
Normal file
@@ -0,0 +1,139 @@
|
||||
From 390990971be7f22ef0b1186564d5df4e7dacb1ca Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Duval?= <jerome.duval@gmail.com>
|
||||
Date: Mon, 18 Jul 2016 14:13:19 +0200
|
||||
Subject: support for secondary arch.
|
||||
|
||||
|
||||
diff --git a/CMakeLists.txt b/CMakeLists.txt
|
||||
index 422beda..30cfe2d 100644
|
||||
--- a/CMakeLists.txt
|
||||
+++ b/CMakeLists.txt
|
||||
@@ -384,6 +384,10 @@ endif()
|
||||
if(CLANG_ENABLE_STATIC_ANALYZER)
|
||||
add_definitions(-DCLANG_ENABLE_STATIC_ANALYZER)
|
||||
endif()
|
||||
+if(DEFINED HAIKU_HYBRID_SECONDARY)
|
||||
+ add_definitions(-DHAIKU_HYBRID_SECONDARY=${HAIKU_HYBRID_SECONDARY})
|
||||
+endif()
|
||||
+
|
||||
|
||||
# Clang version information
|
||||
set(CLANG_EXECUTABLE_VERSION
|
||||
diff --git a/lib/Driver/ToolChains.cpp b/lib/Driver/ToolChains.cpp
|
||||
index a06a0f8..5905908 100644
|
||||
--- a/lib/Driver/ToolChains.cpp
|
||||
+++ b/lib/Driver/ToolChains.cpp
|
||||
@@ -3546,6 +3546,13 @@ SanitizerMask CloudABI::getDefaultSanitizers() const {
|
||||
Haiku::Haiku(const Driver &D, const llvm::Triple& Triple, const ArgList &Args)
|
||||
: Generic_ELF(D, Triple, Args) {
|
||||
|
||||
+#ifdef HAIKU_HYBRID_SECONDARY
|
||||
+ getProgramPaths().insert(getProgramPaths().begin(), getDriver().SysRoot
|
||||
+ + "/system/bin/" HAIKU_HYBRID_SECONDARY);
|
||||
+ getFilePaths().clear();
|
||||
+ getFilePaths().push_back(getDriver().SysRoot + "/system/lib/"
|
||||
+ HAIKU_HYBRID_SECONDARY);
|
||||
+#endif
|
||||
}
|
||||
|
||||
std::string Haiku::findLibCxxIncludePath() const {
|
||||
@@ -3554,8 +3561,14 @@ std::string Haiku::findLibCxxIncludePath() const {
|
||||
|
||||
void Haiku::addLibStdCxxIncludePaths(const llvm::opt::ArgList &DriverArgs,
|
||||
llvm::opt::ArgStringList &CC1Args) const {
|
||||
+#ifdef HAIKU_HYBRID_SECONDARY
|
||||
+ addLibStdCXXIncludePaths(getDriver().SysRoot, "/system/develop/headers"
|
||||
+ HAIKU_HYBRID_SECONDARY "/c++", getTriple().str(), "", "", "",
|
||||
+ DriverArgs, CC1Args);
|
||||
+#else
|
||||
addLibStdCXXIncludePaths(getDriver().SysRoot, "/system/develop/headers/c++",
|
||||
- getTriple().str(), "", "", "", DriverArgs, CC1Args);
|
||||
+ getTriple().str(), "", "", "", DriverArgs, CC1Args);
|
||||
+#endif
|
||||
}
|
||||
|
||||
/// OpenBSD - OpenBSD tool chain which can call as(1) and ld(1) directly.
|
||||
diff --git a/lib/Frontend/InitHeaderSearch.cpp b/lib/Frontend/InitHeaderSearch.cpp
|
||||
index c76ccea..bd14950 100644
|
||||
--- a/lib/Frontend/InitHeaderSearch.cpp
|
||||
+++ b/lib/Frontend/InitHeaderSearch.cpp
|
||||
@@ -233,7 +233,20 @@ void InitHeaderSearch::AddDefaultCIncludePaths(const llvm::Triple &triple,
|
||||
if (HSOpts.UseBuiltinIncludes) {
|
||||
// Ignore the sys root, we *always* look for clang headers relative to
|
||||
// supplied path.
|
||||
+#ifdef HAIKU_HYBRID_SECONDARY
|
||||
+ // Remove version from foo/lib/clang/version
|
||||
+ StringRef Ver = llvm::sys::path::filename(HSOpts.ResourceDir);
|
||||
+ StringRef NoVer = llvm::sys::path::parent_path(HSOpts.ResourceDir);
|
||||
+ // Remove clang from foo/lib/clang
|
||||
+ StringRef Clang = llvm::sys::path::filename(NoVer);
|
||||
+ SmallString<128> P = llvm::sys::path::parent_path(NoVer);
|
||||
+
|
||||
+ // Get foo/include/c++/v1
|
||||
+ llvm::sys::path::append(P, HAIKU_HYBRID_SECONDARY, Clang, Ver);
|
||||
+#else
|
||||
SmallString<128> P = StringRef(HSOpts.ResourceDir);
|
||||
+#endif
|
||||
+
|
||||
llvm::sys::path::append(P, "include");
|
||||
AddUnmappedPath(P, ExternCSystem, false);
|
||||
}
|
||||
@@ -266,7 +279,12 @@ void InitHeaderSearch::AddDefaultCIncludePaths(const llvm::Triple &triple,
|
||||
}
|
||||
|
||||
case llvm::Triple::Haiku:
|
||||
+#ifdef HAIKU_HYBRID_SECONDARY
|
||||
+ AddPath("/boot/system/non-packaged/develop/headers/" HAIKU_HYBRID_SECONDARY,
|
||||
+ System, false);
|
||||
+#else
|
||||
AddPath("/boot/system/non-packaged/develop/headers", System, false);
|
||||
+#endif
|
||||
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);
|
||||
@@ -298,6 +316,13 @@ void InitHeaderSearch::AddDefaultCIncludePaths(const llvm::Triple &triple,
|
||||
AddPath("/boot/system/develop/headers/bsd", System, false);
|
||||
AddPath("/boot/system/develop/headers/glibc", System, false);
|
||||
AddPath("/boot/system/develop/headers/posix", System, false);
|
||||
+#ifdef HAIKU_HYBRID_SECONDARY
|
||||
+ AddPath("/boot/system/develop/headers/" HAIKU_HYBRID_SECONDARY, System, false);
|
||||
+ AddPath("/boot/system/develop/headers/" HAIKU_HYBRID_SECONDARY "/os", System,
|
||||
+ false);
|
||||
+ AddPath("/boot/system/develop/headers/" HAIKU_HYBRID_SECONDARY "/os/opengl",
|
||||
+ System, false);
|
||||
+#endif
|
||||
AddPath("/boot/system/develop/headers", System, false);
|
||||
break;
|
||||
case llvm::Triple::RTEMS:
|
||||
--
|
||||
2.2.2
|
||||
|
||||
|
||||
From 668a883775cbea7930f7459d82f5ed9790c632e7 Mon Sep 17 00:00:00 2001
|
||||
From: Jerome Duval <jerome.duval@gmail.com>
|
||||
Date: Thu, 7 Apr 2016 18:30:52 +0000
|
||||
Subject: add a test for haiku driver.
|
||||
|
||||
* upstream wants a case for libcxx in ToolChains.cpp, so add it.
|
||||
|
||||
diff --git a/test/Driver/haiku.c b/test/Driver/haiku.c
|
||||
new file mode 100644
|
||||
index 0000000..9591739
|
||||
--- /dev/null
|
||||
+++ b/test/Driver/haiku.c
|
||||
@@ -0,0 +1,12 @@
|
||||
+// RUN: %clang -no-canonical-prefixes -target x86_64-unknown-haiku %s -### 2> %t.log
|
||||
+// RUN: FileCheck --check-prefix=CHECK-X86_64 -input-file %t.log %s
|
||||
+
|
||||
+// CHECK-X86_64: clang{{.*}}" "-cc1" "-triple" "x86_64-unknown-haiku"
|
||||
+// CHECK-X86_64: gcc{{.*}}" "-o" "a.out" "{{.*}}.o"
|
||||
+
|
||||
+// RUN: %clang -no-canonical-prefixes -target i586-pc-haiku %s -### 2> %t.log
|
||||
+// RUN: FileCheck --check-prefix=CHECK-X86 -input-file %t.log %s
|
||||
+
|
||||
+// CHECK-X86: clang{{.*}}" "-cc1" "-triple" "i586-pc-haiku"
|
||||
+// CHECK-X86: gcc{{.*}}" "-o" "a.out" "{{.*}}.o"
|
||||
+
|
||||
--
|
||||
2.2.2
|
||||
|
||||
54
sys-devel/llvm/patches/llvm-3.9.0.patchset
Normal file
54
sys-devel/llvm/patches/llvm-3.9.0.patchset
Normal file
@@ -0,0 +1,54 @@
|
||||
From 99fd5918bd3259536ec5bb32f7ab57e0d5d98caa 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.
|
||||
* use /develop/lib instead of /lib
|
||||
|
||||
diff --git a/tools/llvm-config/llvm-config.cpp b/tools/llvm-config/llvm-config.cpp
|
||||
index 94d426b..9dfc43c 100644
|
||||
--- a/tools/llvm-config/llvm-config.cpp
|
||||
+++ b/tools/llvm-config/llvm-config.cpp
|
||||
@@ -327,9 +327,17 @@ int main(int argc, char **argv) {
|
||||
("-I" + ActiveIncludeDir + " " + "-I" + ActiveObjRoot + "/include");
|
||||
} else {
|
||||
ActivePrefix = CurrentExecPrefix;
|
||||
+#ifdef __HAIKU__
|
||||
+ ActiveIncludeDir = ActivePrefix + "/develop/headers";
|
||||
+#else
|
||||
ActiveIncludeDir = ActivePrefix + "/include";
|
||||
+#endif
|
||||
ActiveBinDir = ActivePrefix + "/bin";
|
||||
+#ifdef __HAIKU__
|
||||
+ ActiveLibDir = ActivePrefix + "/develop/lib";
|
||||
+#else
|
||||
ActiveLibDir = ActivePrefix + "/lib" + LLVM_LIBDIR_SUFFIX;
|
||||
+#endif
|
||||
ActiveIncludeOption = "-I" + ActiveIncludeDir;
|
||||
}
|
||||
|
||||
@@ -537,10 +545,16 @@ int main(int argc, char **argv) {
|
||||
OS << LLVM_HAS_GLOBAL_ISEL << '\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 == "--link-shared") {
|
||||
LinkMode = LinkModeShared;
|
||||
} else if (Arg == "--link-static") {
|
||||
--
|
||||
2.2.2
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
From 2f0a97bebdd47be657fd459e09ab632fc1d4d141 Mon Sep 17 00:00:00 2001
|
||||
From 33b79868a28f8f5d26db521b3e0243b84ab93f00 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
|
||||
@@ -6,7 +6,7 @@ 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 94d426b..2942242 100644
|
||||
index c63733f..8ee41ca 100644
|
||||
--- a/tools/llvm-config/llvm-config.cpp
|
||||
+++ b/tools/llvm-config/llvm-config.cpp
|
||||
@@ -327,7 +327,11 @@ int main(int argc, char **argv) {
|
||||
Reference in New Issue
Block a user