From f568bf9d9e2ea2df423778144ec51b290430fde8 Mon Sep 17 00:00:00 2001 From: Jerome Duval Date: Sun, 17 Sep 2017 09:36:49 +0200 Subject: [PATCH] llvm: add recipe for version 5.0.0. * switch git recipe to 6.0.0. --- sys-devel/llvm/llvm-5.0.0.recipe | 479 ++++++++++++++++++ ...5.0.0~git.recipe => llvm-6.0.0~git.recipe} | 77 ++- sys-devel/llvm/patches/clang-5.0.0.patchset | 175 +++++++ ...~git.patchset => clang-6.0.0~git.patchset} | 75 ++- ...5.0.0~git.patchset => llvm-5.0.0.patchset} | 44 +- .../llvm/patches/llvm-6.0.0~git.patchset | 77 +++ 6 files changed, 883 insertions(+), 44 deletions(-) create mode 100644 sys-devel/llvm/llvm-5.0.0.recipe rename sys-devel/llvm/{llvm-5.0.0~git.recipe => llvm-6.0.0~git.recipe} (88%) create mode 100644 sys-devel/llvm/patches/clang-5.0.0.patchset rename sys-devel/llvm/patches/{clang-5.0.0~git.patchset => clang-6.0.0~git.patchset} (69%) rename sys-devel/llvm/patches/{llvm-5.0.0~git.patchset => llvm-5.0.0.patchset} (50%) create mode 100644 sys-devel/llvm/patches/llvm-6.0.0~git.patchset diff --git a/sys-devel/llvm/llvm-5.0.0.recipe b/sys-devel/llvm/llvm-5.0.0.recipe new file mode 100644 index 000000000..75f420caf --- /dev/null +++ b/sys-devel/llvm/llvm-5.0.0.recipe @@ -0,0 +1,479 @@ +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="https://www.llvm.org/" +COPYRIGHT="2003-2014 University of Illinois at Urbana-Champaign" +LICENSE="UIUC" +REVISION="1" +SOURCE_URI="https://releases.llvm.org/${portVersion}/llvm-${portVersion}.src.tar.xz" +SOURCE_URI_2="https://releases.llvm.org/${portVersion}/cfe-${portVersion}.src.tar.xz" +SOURCE_URI_3="https://releases.llvm.org/${portVersion}/clang-tools-extra-${portVersion}.src.tar.xz" +SOURCE_URI_4="https://releases.llvm.org/${portVersion}/compiler-rt-${portVersion}.src.tar.xz" +CHECKSUM_SHA256="e35dcbae6084adcf4abb32514127c5eabd7d63b733852ccdb31e06f1373136da" +CHECKSUM_SHA256_2="019f23c2192df793ac746595e94a403908749f8e0c484b403476d2611dd20970" +CHECKSUM_SHA256_3="87d078b959c4a6e5ff9fd137c2f477cadb1245f93812512996f73986a6d973c6" +CHECKSUM_SHA256_4="d5ad5266462134a482b381f1f8115b6cad3473741b3bb7d1acc7f69fd0f0c0b3" +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" + +PROVIDES=" + llvm$secondaryArchSuffix = $portVersion + cmd:bugpoint + cmd:find_all_symbols + cmd:llc + cmd:lli + cmd:llvm_ar + cmd:llvm_as + cmd:llvm_bcanalyzer + cmd:llvm_c_test + cmd:llvm_cat + cmd:llvm_config + cmd:llvm_cov + cmd:llvm_cvtres + cmd:llvm_cxxdump + cmd:llvm_cxxfilt + cmd:llvm_diff + cmd:llvm_dis + cmd:llvm_dlltool + 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_modextract + cmd:llvm_mt + cmd:llvm_nm + cmd:llvm_objdump + cmd:llvm_opt_report + cmd:llvm_pdbdump + cmd:llvm_pdbutil + cmd:llvm_profdata + cmd:llvm_ranlib + cmd:llvm_readelf + 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:obj2yaml + cmd:opt + cmd:sancov + cmd:sanstats + cmd:verify_uselistorder + cmd:yaml2obj + lib:BugpointPasses$secondaryArchSuffix + lib:LLVMHello$secondaryArchSuffix + + devel:libfindAllSymbols$secondaryArchSuffix + devel:libLLVM_$portVersion$secondaryArchSuffix + devel:libLLVM_5.0$secondaryArchSuffix + devel:libLLVM$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:libLLVMBinaryFormat$secondaryArchSuffix + devel:libLLVMBitReader$secondaryArchSuffix + devel:libLLVMBitWriter$secondaryArchSuffix + devel:libLLVMBPFAsmPrinter$secondaryArchSuffix + devel:libLLVMBPFCodeGen$secondaryArchSuffix + devel:libLLVMBPFDesc$secondaryArchSuffix + devel:libLLVMBPFDisassembler$secondaryArchSuffix + devel:libLLVMBPFInfo$secondaryArchSuffix + devel:libLLVMCodeGen$secondaryArchSuffix + devel:libLLVMCore$secondaryArchSuffix + devel:libLLVMCoroutines$secondaryArchSuffix + devel:libLLVMCoverage$secondaryArchSuffix + devel:libLLVMDebugInfoCodeView$secondaryArchSuffix + devel:libLLVMDebugInfoDWARF$secondaryArchSuffix + devel:libLLVMDebugInfoMSF$secondaryArchSuffix + devel:libLLVMDebugInfoPDB$secondaryArchSuffix + devel:libLLVMDemangle$secondaryArchSuffix + devel:libLLVMDlltoolDriver$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:libLLVMLanaiAsmPrinter$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:libLLVMXRay$secondaryArchSuffix + devel:libLLVMipo$secondaryArchSuffix + devel:libLTO$secondaryArchSuffix + " +REQUIRES=" + haiku$secondaryArchSuffix + lib:libLLVM_5.0$secondaryArchSuffix + lib:libz$secondaryArchSuffix + " +PROVIDES_clang=" + llvm${secondaryArchSuffix}_clang = $portVersion + cmd:clang = $portVersion + cmd:clangd = $portVersion + cmd:clang_5.0 = $portVersion + cmd:clang++ = $portVersion + cmd:clang_apply_replacements = $portVersion + cmd:clang_change_namespace = $portVersion + cmd:clang_check = $portVersion + cmd:clang_cl = $portVersion + cmd:clang_cpp = $portVersion + cmd:clang_format = $portVersion + cmd:clang_import_test = $portVersion + cmd:clang_include_fixer = $portVersion + cmd:clang_offload_bundler = $portVersion + cmd:clang_query = $portVersion + cmd:clang_rename = $portVersion + cmd:clang_reorder_fields = $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:libclangdaemon$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:libclangtidyandroidmodule$secondaryArchSuffix = $portVersion + devel:libclangtidyboostmodule$secondaryArchSuffix = $portVersion + devel:libclangtidybugpronemodule$secondaryArchSuffix = $portVersion + devel:libclangtidycertmodule$secondaryArchSuffix = $portVersion + devel:libclangtidycppcoreguidelinesmodule$secondaryArchSuffix = $portVersion + devel:libclangtidygooglemodule$secondaryArchSuffix = $portVersion + devel:libclangtidyhicppmodule$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 + devel:libclangtoolingrefactor$secondaryArchSuffix = $portVersion + " +REQUIRES_clang=" + haiku$secondaryArchSuffix + lib:libLLVM_5.0$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 + " +PROVIDES_libs=" + llvm${secondaryArchSuffix}_libs = $portVersion + lib:libLLVM_5.0$secondaryArchSuffix + lib:libLTO$secondaryArchSuffix +" +REQUIRES_libs=" + haiku$secondaryArchSuffix + lib:libz$secondaryArchSuffix + " + +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_LINK_LLVM_DYLIB=YES \ + .. + 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/opt-viewer $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 \ + $libDir/cmake/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 + + # libs package + packageEntries libs \ + $libDir/libLLVM* \ + $libDir/libLTO* +} + +TEST() +{ + cd build + make $jobArgs check + make $jobArgs check-clang +} diff --git a/sys-devel/llvm/llvm-5.0.0~git.recipe b/sys-devel/llvm/llvm-6.0.0~git.recipe similarity index 88% rename from sys-devel/llvm/llvm-5.0.0~git.recipe rename to sys-devel/llvm/llvm-6.0.0~git.recipe index 0023a16a8..ff6d1ea06 100644 --- a/sys-devel/llvm/llvm-5.0.0~git.recipe +++ b/sys-devel/llvm/llvm-6.0.0~git.recipe @@ -28,14 +28,14 @@ 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/" +HOMEPAGE="https://www.llvm.org/" COPYRIGHT="2003-2014 University of Illinois at Urbana-Champaign" LICENSE="UIUC" -REVISION="2" -llvmSrcGitRev="4133d85d3395c13ea3291b00048d241739ed0e87" -clangSrcGitRev="916645c2637f8c80948eedcdea02258d0a6f79f5" -clangToolsExtraSrcGitRev="e775a55214eda56ecf98de38a52c7e046e9fec1f" -compilerRtSrcGitRev="2bd83302420b6c943f0e2b9e4fb769e2a59c8193" +REVISION="1" +llvmSrcGitRev="343595467c91e2db33e7e157adc87b2e53ddbe1a" +clangSrcGitRev="ad56fa864310d75036da71597ca7381aada68c09" +clangToolsExtraSrcGitRev="b294d892d607ba534dc900a5e165c72ce1070fe3" +compilerRtSrcGitRev="e7f4e4a3486317ee6287dc272427e0ae009f5362" 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" @@ -44,16 +44,16 @@ 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="6eb41584db4f71a8700ebd1480b7238a49ae3f00867432ca9480ef82d8bec7ee" -CHECKSUM_SHA256_2="3a36b5d89d6e933a2303bdd57fa35d634bec5927107b19ef5b16c9fcd744e15c" -CHECKSUM_SHA256_3="9a919408f19899fdaa03f02d185912db6aff452e497249330415d794a41f347f" -CHECKSUM_SHA256_4="2ddeaee9b9eea94e711d7e4e7a6840feb7ba77f682780e2add492f8f498974d4" +CHECKSUM_SHA256="74a9b0a4dfd65082acb134ef865ee82f4e77dfbd33bb14458253a7937232ed7e" +CHECKSUM_SHA256_2="fac6ac3e82a5b34a483d37c9aca82e514c58cebcf5b0520160de6efd5a53e351" +CHECKSUM_SHA256_3="a937b55593e920bd5e46d9ad42ba1404e2d3ea7c40a49830604ae703b41796e6" +CHECKSUM_SHA256_4="22b1e58b1cba4116a48a05f8019bc7d697956517665a4ba36ce27469a379cbe5" 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" +PATCHES="llvm-$portVersion.patchset" +PATCHES_2="clang-$portVersion.patchset" ARCHITECTURES="!x86_gcc2 ?x86 ?x86_64" SECONDARY_ARCHITECTURES="!x86" @@ -71,10 +71,12 @@ PROVIDES=" cmd:llvm_cat cmd:llvm_config cmd:llvm_cov + cmd:llvm_cvtres cmd:llvm_cxxdump cmd:llvm_cxxfilt cmd:llvm_diff cmd:llvm_dis + cmd:llvm_dlltool cmd:llvm_dsymutil cmd:llvm_dwarfdump cmd:llvm_dwp @@ -86,12 +88,17 @@ PROVIDES=" cmd:llvm_mc cmd:llvm_mcmarkup cmd:llvm_modextract + cmd:llvm_mt cmd:llvm_nm + cmd:llvm_objcopy cmd:llvm_objdump cmd:llvm_opt_report cmd:llvm_pdbdump + cmd:llvm_pdbutil cmd:llvm_profdata cmd:llvm_ranlib + cmd:llvm_rc + cmd:llvm_readelf cmd:llvm_readobj cmd:llvm_rtdyld cmd:llvm_size @@ -109,9 +116,11 @@ PROVIDES=" cmd:yaml2obj lib:BugpointPasses$secondaryArchSuffix lib:LLVMHello$secondaryArchSuffix - lib:libLTO$secondaryArchSuffix devel:libfindAllSymbols$secondaryArchSuffix + devel:libLLVM_6.0.0svn$secondaryArchSuffix + devel:libLLVM_6.0svn$secondaryArchSuffix + devel:libLLVM$secondaryArchSuffix devel:libLLVMAArch64AsmParser$secondaryArchSuffix devel:libLLVMAArch64AsmPrinter$secondaryArchSuffix devel:libLLVMAArch64CodeGen$secondaryArchSuffix @@ -132,16 +141,19 @@ PROVIDES=" devel:libLLVMARMDesc$secondaryArchSuffix devel:libLLVMARMDisassembler$secondaryArchSuffix devel:libLLVMARMInfo$secondaryArchSuffix + devel:libLLVMARMUtils$secondaryArchSuffix devel:libLLVMAnalysis$secondaryArchSuffix devel:libLLVMAsmParser$secondaryArchSuffix devel:libLLVMAsmPrinter$secondaryArchSuffix + devel:libLLVMBinaryFormat$secondaryArchSuffix + devel:libLLVMBitReader$secondaryArchSuffix + devel:libLLVMBitWriter$secondaryArchSuffix + devel:libLLVMBPFAsmParser$secondaryArchSuffix devel:libLLVMBPFAsmPrinter$secondaryArchSuffix devel:libLLVMBPFCodeGen$secondaryArchSuffix devel:libLLVMBPFDesc$secondaryArchSuffix devel:libLLVMBPFDisassembler$secondaryArchSuffix devel:libLLVMBPFInfo$secondaryArchSuffix - devel:libLLVMBitReader$secondaryArchSuffix - devel:libLLVMBitWriter$secondaryArchSuffix devel:libLLVMCodeGen$secondaryArchSuffix devel:libLLVMCore$secondaryArchSuffix devel:libLLVMCoroutines$secondaryArchSuffix @@ -151,7 +163,9 @@ PROVIDES=" devel:libLLVMDebugInfoMSF$secondaryArchSuffix devel:libLLVMDebugInfoPDB$secondaryArchSuffix devel:libLLVMDemangle$secondaryArchSuffix + devel:libLLVMDlltoolDriver$secondaryArchSuffix devel:libLLVMExecutionEngine$secondaryArchSuffix + devel:libLLVMFuzzMutate$secondaryArchSuffix devel:libLLVMGlobalISel$secondaryArchSuffix devel:libLLVMHexagonAsmParser$secondaryArchSuffix devel:libLLVMHexagonCodeGen$secondaryArchSuffix @@ -163,6 +177,7 @@ PROVIDES=" devel:libLLVMInstrumentation$secondaryArchSuffix devel:libLLVMInterpreter$secondaryArchSuffix devel:libLLVMLanaiAsmParser$secondaryArchSuffix + devel:libLLVMLanaiAsmPrinter$secondaryArchSuffix devel:libLLVMLanaiCodeGen$secondaryArchSuffix devel:libLLVMLanaiDesc$secondaryArchSuffix devel:libLLVMLanaiDisassembler$secondaryArchSuffix @@ -228,6 +243,7 @@ PROVIDES=" devel:libLLVMTarget$secondaryArchSuffix devel:libLLVMTransformUtils$secondaryArchSuffix devel:libLLVMVectorize$secondaryArchSuffix + devel:libLLVMWindowsManifest$secondaryArchSuffix devel:libLLVMX86AsmParser$secondaryArchSuffix devel:libLLVMX86AsmPrinter$secondaryArchSuffix devel:libLLVMX86CodeGen$secondaryArchSuffix @@ -246,12 +262,14 @@ PROVIDES=" " REQUIRES=" haiku$secondaryArchSuffix + lib:libLLVM_6.0svn$secondaryArchSuffix lib:libz$secondaryArchSuffix " PROVIDES_clang=" llvm${secondaryArchSuffix}_clang = $portVersion cmd:clang = $portVersion - cmd:clang_5.0 = $portVersion + cmd:clangd = $portVersion + cmd:clang_6.0 = $portVersion cmd:clang++ = $portVersion cmd:clang_apply_replacements = $portVersion cmd:clang_change_namespace = $portVersion @@ -263,6 +281,7 @@ PROVIDES_clang=" cmd:clang_include_fixer = $portVersion cmd:clang_offload_bundler = $portVersion cmd:clang_query = $portVersion + cmd:clang_refactor = $portVersion cmd:clang_rename = $portVersion cmd:clang_reorder_fields = $portVersion cmd:clang_tidy = $portVersion @@ -279,6 +298,7 @@ PROVIDES_clang=" devel:libclangbasic$secondaryArchSuffix = $portVersion devel:libclangchangenamespace$secondaryArchSuffix = $portVersion devel:libclangcodegen$secondaryArchSuffix = $portVersion + devel:libclangdaemon$secondaryArchSuffix = $portVersion devel:libclangdriver$secondaryArchSuffix = $portVersion devel:libclangdynamicastmatchers$secondaryArchSuffix = $portVersion devel:libclangedit$secondaryArchSuffix = $portVersion @@ -302,10 +322,13 @@ PROVIDES_clang=" devel:libclangstaticanalyzercore$secondaryArchSuffix = $portVersion devel:libclangstaticanalyzerfrontend$secondaryArchSuffix = $portVersion devel:libclangtidy$secondaryArchSuffix = $portVersion + devel:libclangtidyandroidmodule$secondaryArchSuffix = $portVersion devel:libclangtidyboostmodule$secondaryArchSuffix = $portVersion + devel:libclangtidybugpronemodule$secondaryArchSuffix = $portVersion devel:libclangtidycertmodule$secondaryArchSuffix = $portVersion devel:libclangtidycppcoreguidelinesmodule$secondaryArchSuffix = $portVersion devel:libclangtidygooglemodule$secondaryArchSuffix = $portVersion + devel:libclangtidyhicppmodule$secondaryArchSuffix = $portVersion devel:libclangtidyllvmmodule$secondaryArchSuffix = $portVersion devel:libclangtidymiscmodule$secondaryArchSuffix = $portVersion devel:libclangtidymodernizemodule$secondaryArchSuffix = $portVersion @@ -316,10 +339,13 @@ PROVIDES_clang=" devel:libclangtidyreadabilitymodule$secondaryArchSuffix = $portVersion devel:libclangtidyutils$secondaryArchSuffix = $portVersion devel:libclangtooling$secondaryArchSuffix = $portVersion + devel:libclangtoolingastdiff$secondaryArchSuffix = $portVersion devel:libclangtoolingcore$secondaryArchSuffix = $portVersion + devel:libclangtoolingrefactor$secondaryArchSuffix = $portVersion " REQUIRES_clang=" haiku$secondaryArchSuffix + lib:libLLVM_6.0svn$secondaryArchSuffix lib:libz$secondaryArchSuffix " PROVIDES_clang_analysis=" @@ -333,6 +359,16 @@ REQUIRES_clang_analysis=" llvm${secondaryArchSuffix}_clang == $portVersion base cmd:python " +PROVIDES_libs=" + llvm${secondaryArchSuffix}_libs = $portVersion + lib:libLLVM_6.0svn$secondaryArchSuffix + lib:libLTO$secondaryArchSuffix +" +REQUIRES_libs=" + haiku$secondaryArchSuffix + lib:libz$secondaryArchSuffix + " + BUILD_REQUIRES=" haiku${secondaryArchSuffix}_devel devel:libz$secondaryArchSuffix @@ -373,7 +409,7 @@ BUILD() # such as Mesa cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=$prefix \ -DCMAKE_SKIP_RPATH=YES $cmakeFlags \ - -DLLVM_ENABLE_RTTI=ON \ + -DLLVM_ENABLE_RTTI=ON -DLLVM_LINK_LLVM_DYLIB=YES \ .. make $jobArgs PROJ_datadir=$dataDir PROJ_docsdir=$docDir \ PROJ_mandir=$manDir PROJ_includedir=$includeDir PROJ_libdir=$libDir @@ -414,6 +450,7 @@ INSTALL() mv $prefix/libexec/* $binDir/ mv $prefix/share/man/* $manDir/ mv $prefix/share/clang $dataDir/ + mv $prefix/share/opt-viewer $dataDir/ mv $prefix/share/scan-build $dataDir/ mv $prefix/share/scan-view $dataDir/ rmdir $prefix/include $prefix/libexec $prefix/share/man $prefix/share @@ -431,6 +468,7 @@ INSTALL() $includeDir/clang* \ $libDir/libclang* \ $libDir/clang \ + $libDir/cmake/clang \ $developLibDir/libclang* # analysis package @@ -442,6 +480,11 @@ INSTALL() $dataDir/scan-build \ $dataDir/scan-view \ $manDir/man1/scan-build.1 + + # libs package + packageEntries libs \ + $libDir/libLLVM* \ + $libDir/libLTO* } TEST() diff --git a/sys-devel/llvm/patches/clang-5.0.0.patchset b/sys-devel/llvm/patches/clang-5.0.0.patchset new file mode 100644 index 000000000..18fbe10fe --- /dev/null +++ b/sys-devel/llvm/patches/clang-5.0.0.patchset @@ -0,0 +1,175 @@ +From f3aba21f79aa95600a610d1696e0de4365c0b0e9 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Duval?= +Date: Mon, 18 Jul 2016 14:13:19 +0200 +Subject: support for secondary arch. + + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 2667b1d..92b6f7a 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -387,6 +387,10 @@ if(CLANG_ANALYZER_BUILD_Z3) + message(FATAL_ERROR "Cannot find Z3 header file or shared library") + endif() + endif() ++if(DEFINED HAIKU_HYBRID_SECONDARY) ++ add_definitions(-DHAIKU_HYBRID_SECONDARY=${HAIKU_HYBRID_SECONDARY}) ++endif() ++ + + if(CLANG_ENABLE_ARCMT) + set(CLANG_ENABLE_OBJC_REWRITER ON) +diff --git a/lib/Driver/ToolChains/Haiku.cpp b/lib/Driver/ToolChains/Haiku.cpp +index 284d269..3a816aa 100644 +--- a/lib/Driver/ToolChains/Haiku.cpp ++++ b/lib/Driver/ToolChains/Haiku.cpp +@@ -20,6 +20,13 @@ using namespace llvm::opt; + 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 { +@@ -28,6 +35,12 @@ 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 + } +diff --git a/lib/Frontend/InitHeaderSearch.cpp b/lib/Frontend/InitHeaderSearch.cpp +index 1d7c8a0..e8ccd4e 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.13.1 + + +From afaba88ced274075fa40c718930addb236b09f2e Mon Sep 17 00:00:00 2001 +From: Jerome Duval +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.13.1 + + +From 5dc6804d033f1fee82f6cad0521f4bea93297201 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Duval?= +Date: Mon, 18 Jul 2016 14:13:19 +0200 +Subject: Enable thread-local storage and disable PIE by default + + +diff --git a/lib/Basic/Targets.cpp b/lib/Basic/Targets.cpp +index 5d75aa5..47b4e07 100644 +--- a/lib/Basic/Targets.cpp ++++ b/lib/Basic/Targets.cpp +@@ -436,8 +436,6 @@ public: + this->IntPtrType = TargetInfo::SignedLong; + this->PtrDiffType = TargetInfo::SignedLong; + this->ProcessIDType = TargetInfo::SignedLong; +- this->TLSSupported = false; +- + } + }; + +diff --git a/lib/Driver/ToolChains/Haiku.h b/lib/Driver/ToolChains/Haiku.h +index 8b5b48e..ccd851f 100644 +--- a/lib/Driver/ToolChains/Haiku.h ++++ b/lib/Driver/ToolChains/Haiku.h +@@ -23,9 +23,7 @@ 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; +- } ++ bool isPIEDefault() const override { return false; } + + std::string findLibCxxIncludePath() const override; + void addLibStdCxxIncludePaths( +-- +2.13.1 + diff --git a/sys-devel/llvm/patches/clang-5.0.0~git.patchset b/sys-devel/llvm/patches/clang-6.0.0~git.patchset similarity index 69% rename from sys-devel/llvm/patches/clang-5.0.0~git.patchset rename to sys-devel/llvm/patches/clang-6.0.0~git.patchset index c091d1909..e06e9d00c 100644 --- a/sys-devel/llvm/patches/clang-5.0.0~git.patchset +++ b/sys-devel/llvm/patches/clang-6.0.0~git.patchset @@ -1,29 +1,29 @@ -From 390990971be7f22ef0b1186564d5df4e7dacb1ca Mon Sep 17 00:00:00 2001 +From ddcd2987576bee7b9804c169d7d928c583b66e5d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Duval?= 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 +index b55c64d..73788af 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt -@@ -384,6 +384,10 @@ endif() - if(CLANG_ENABLE_STATIC_ANALYZER) - add_definitions(-DCLANG_ENABLE_STATIC_ANALYZER) +@@ -384,6 +384,10 @@ option(CLANG_ENABLE_PROTO_FUZZER "Build Clang protobuf fuzzer." OFF) + if(NOT CLANG_ENABLE_STATIC_ANALYZER AND (CLANG_ENABLE_ARCMT OR CLANG_ANALYZER_BUILD_Z3)) + message(FATAL_ERROR "Cannot disable static analyzer while enabling ARCMT or Z3") 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 { + if(CLANG_ANALYZER_BUILD_Z3) + find_package(Z3 4.5) +diff --git a/lib/Driver/ToolChains/Haiku.cpp b/lib/Driver/ToolChains/Haiku.cpp +index 284d269..3a816aa 100644 +--- a/lib/Driver/ToolChains/Haiku.cpp ++++ b/lib/Driver/ToolChains/Haiku.cpp +@@ -20,6 +20,13 @@ using namespace llvm::opt; Haiku::Haiku(const Driver &D, const llvm::Triple& Triple, const ArgList &Args) : Generic_ELF(D, Triple, Args) { @@ -37,13 +37,13 @@ index a06a0f8..5905908 100644 } std::string Haiku::findLibCxxIncludePath() const { -@@ -3554,8 +3561,14 @@ std::string Haiku::findLibCxxIncludePath() const { +@@ -28,6 +35,12 @@ 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(), "", "", "", ++ HAIKU_HYBRID_SECONDARY "/c++", getTriple().str(), "", "", "", + DriverArgs, CC1Args); +#else addLibStdCXXIncludePaths(getDriver().SysRoot, "/system/develop/headers/c++", @@ -51,10 +51,8 @@ index a06a0f8..5905908 100644 + 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 +index d0b4e45..91ebebd 100644 --- a/lib/Frontend/InitHeaderSearch.cpp +++ b/lib/Frontend/InitHeaderSearch.cpp @@ -233,7 +233,20 @@ void InitHeaderSearch::AddDefaultCIncludePaths(const llvm::Triple &triple, @@ -106,10 +104,10 @@ index c76ccea..bd14950 100644 break; case llvm::Triple::RTEMS: -- -2.2.2 +2.13.1 -From 668a883775cbea7930f7459d82f5ed9790c632e7 Mon Sep 17 00:00:00 2001 +From 08d1b5203f9c0b8e07ec694c8f839f9f73662233 Mon Sep 17 00:00:00 2001 From: Jerome Duval Date: Thu, 7 Apr 2016 18:30:52 +0000 Subject: add a test for haiku driver. @@ -135,5 +133,42 @@ index 0000000..9591739 +// CHECK-X86: gcc{{.*}}" "-o" "a.out" "{{.*}}.o" + -- -2.2.2 +2.13.1 + + +From e4614aa2cf4d49fe4486a0ba8533f0d2b827b7ab Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Duval?= +Date: Mon, 18 Jul 2016 14:13:19 +0200 +Subject: Enable thread-local storage and disable PIE by default + + +diff --git a/lib/Basic/Targets/OSTargets.h b/lib/Basic/Targets/OSTargets.h +index ca84a87..d5c0b63 100644 +--- a/lib/Basic/Targets/OSTargets.h ++++ b/lib/Basic/Targets/OSTargets.h +@@ -260,7 +260,6 @@ public: + this->IntPtrType = TargetInfo::SignedLong; + this->PtrDiffType = TargetInfo::SignedLong; + this->ProcessIDType = TargetInfo::SignedLong; +- this->TLSSupported = false; + } + }; + +diff --git a/lib/Driver/ToolChains/Haiku.h b/lib/Driver/ToolChains/Haiku.h +index 8b5b48e..ccd851f 100644 +--- a/lib/Driver/ToolChains/Haiku.h ++++ b/lib/Driver/ToolChains/Haiku.h +@@ -23,9 +23,7 @@ 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; +- } ++ bool isPIEDefault() const override { return false; } + + std::string findLibCxxIncludePath() const override; + void addLibStdCxxIncludePaths( +-- +2.13.1 diff --git a/sys-devel/llvm/patches/llvm-5.0.0~git.patchset b/sys-devel/llvm/patches/llvm-5.0.0.patchset similarity index 50% rename from sys-devel/llvm/patches/llvm-5.0.0~git.patchset rename to sys-devel/llvm/patches/llvm-5.0.0.patchset index 918b85aa9..aee4d426a 100644 --- a/sys-devel/llvm/patches/llvm-5.0.0~git.patchset +++ b/sys-devel/llvm/patches/llvm-5.0.0.patchset @@ -1,4 +1,4 @@ -From 55634a436bb7ae43726c4b6104a97baef912463e Mon Sep 17 00:00:00 2001 +From 2f505fd9a05b0476cd0f4d2f9a5b4e1c97c9056e Mon Sep 17 00:00:00 2001 From: Jerome Duval Date: Wed, 20 Jan 2016 21:13:28 +0000 Subject: llvm-config: use /develop/headers instead of /include @@ -6,22 +6,28 @@ 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 25344e4..664d4c6 100644 +index 08b096a..739213c 100644 --- a/tools/llvm-config/llvm-config.cpp +++ b/tools/llvm-config/llvm-config.cpp -@@ -332,7 +332,11 @@ int main(int argc, char **argv) { +@@ -332,11 +332,16 @@ int main(int argc, char **argv) { ("-I" + ActiveIncludeDir + " " + "-I" + ActiveObjRoot + "/include"); } else { ActivePrefix = CurrentExecPrefix; +#ifdef __HAIKU__ + ActiveIncludeDir = ActivePrefix + "/develop/headers"; ++ ActiveLibDir = ActivePrefix + "/develop/lib" + LLVM_LIBDIR_SUFFIX; +#else ActiveIncludeDir = ActivePrefix + "/include"; ++ ActiveLibDir = ActivePrefix + "/lib" + LLVM_LIBDIR_SUFFIX; +#endif - ActiveBinDir = ActivePrefix + "/bin"; - ActiveLibDir = ActivePrefix + "/lib" + LLVM_LIBDIR_SUFFIX; + SmallString<256> path(StringRef(LLVM_TOOLS_INSTALL_DIR)); + sys::fs::make_absolute(ActivePrefix, path); + ActiveBinDir = path.str(); +- ActiveLibDir = ActivePrefix + "/lib" + LLVM_LIBDIR_SUFFIX; ActiveCMakeDir = ActiveLibDir + "/cmake/llvm"; -@@ -554,10 +558,16 @@ int main(int argc, char **argv) { + ActiveIncludeOption = "-I" + ActiveIncludeDir; + } +@@ -556,10 +561,16 @@ int main(int argc, char **argv) { OS << (LLVM_HAS_GLOBAL_ISEL ? "ON" : "OFF") << '\n'; } else if (Arg == "--shared-mode") { PrintSharedMode = true; @@ -43,5 +49,29 @@ index 25344e4..664d4c6 100644 LinkDyLib = false; LinkMode = BuiltSharedLibs ? LinkModeShared : LinkModeAuto; -- -2.10.2 +2.13.1 + + +From e271c2cb8b8941c4b04160362ecf90867d0cfa60 Mon Sep 17 00:00:00 2001 +From: Jerome Duval +Date: Sat, 16 Sep 2017 15:02:46 +0200 +Subject: Haiku doesn't expose whether a FS is local or remote. + + +diff --git a/lib/Support/Unix/Path.inc b/lib/Support/Unix/Path.inc +index 45097eb..1790a0a 100644 +--- a/lib/Support/Unix/Path.inc ++++ b/lib/Support/Unix/Path.inc +@@ -381,6 +381,9 @@ static bool is_local_impl(struct STATVFS &Vfs) { + #elif defined(__CYGWIN__) + // Cygwin doesn't expose this information; would need to use Win32 API. + return false; ++#elif defined(__HAIKU__) ++ // Haiku doesn't expose this information ++ return false; + #elif defined(__sun) + // statvfs::f_basetype contains a null-terminated FSType name of the mounted target + StringRef fstype(Vfs.f_basetype); +-- +2.13.1 diff --git a/sys-devel/llvm/patches/llvm-6.0.0~git.patchset b/sys-devel/llvm/patches/llvm-6.0.0~git.patchset new file mode 100644 index 000000000..2934b2c2d --- /dev/null +++ b/sys-devel/llvm/patches/llvm-6.0.0~git.patchset @@ -0,0 +1,77 @@ +From 6f326bc4064aa7a42fe2a4bcef8add79eca1a9f7 Mon Sep 17 00:00:00 2001 +From: Jerome Duval +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 08b096a..01cc38d 100644 +--- a/tools/llvm-config/llvm-config.cpp ++++ b/tools/llvm-config/llvm-config.cpp +@@ -332,11 +332,16 @@ int main(int argc, char **argv) { + ("-I" + ActiveIncludeDir + " " + "-I" + ActiveObjRoot + "/include"); + } else { + ActivePrefix = CurrentExecPrefix; ++#ifdef __HAIKU__ ++ ActiveIncludeDir = ActivePrefix + "/develop/headers"; ++ ActiveLibDir = ActivePrefix + "/develop/lib" + LLVM_LIBDIR_SUFFIX; ++#else + ActiveIncludeDir = ActivePrefix + "/include"; ++ ActiveLibDir = ActivePrefix + "/lib" + LLVM_LIBDIR_SUFFIX; ++#endif + SmallString<256> path(StringRef(LLVM_TOOLS_INSTALL_DIR)); + sys::fs::make_absolute(ActivePrefix, path); + ActiveBinDir = path.str(); +- ActiveLibDir = ActivePrefix + "/lib" + LLVM_LIBDIR_SUFFIX; + ActiveCMakeDir = ActiveLibDir + "/cmake/llvm"; + ActiveIncludeOption = "-I" + ActiveIncludeDir; + } +@@ -556,10 +560,16 @@ int main(int argc, char **argv) { + OS << (LLVM_HAS_GLOBAL_ISEL ? "ON" : "OFF") << '\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 == "--ignore-libllvm") { + LinkDyLib = false; + LinkMode = BuiltSharedLibs ? LinkModeShared : LinkModeAuto; +-- +2.13.1 + + +From 725a79b6e375e7132bb15c1a9cef856f48e67525 Mon Sep 17 00:00:00 2001 +From: Jerome Duval +Date: Sat, 16 Sep 2017 15:02:46 +0200 +Subject: Haiku doesn't expose whether a FS is local or remote. + + +diff --git a/lib/Support/Unix/Path.inc b/lib/Support/Unix/Path.inc +index 3099c27..c9ee624 100644 +--- a/lib/Support/Unix/Path.inc ++++ b/lib/Support/Unix/Path.inc +@@ -380,6 +380,9 @@ static bool is_local_impl(struct STATVFS &Vfs) { + #elif defined(__CYGWIN__) + // Cygwin doesn't expose this information; would need to use Win32 API. + return false; ++#elif defined(__HAIKU__) ++ // Haiku doesn't expose this information ++ return false; + #elif defined(__sun) + // statvfs::f_basetype contains a null-terminated FSType name of the mounted target + StringRef fstype(Vfs.f_basetype); +-- +2.13.1 +