diff --git a/sys-devel/llvm/llvm-3.8.1.recipe b/sys-devel/llvm/llvm-3.8.1.recipe new file mode 100644 index 000000000..1f5872c31 --- /dev/null +++ b/sys-devel/llvm/llvm-3.8.1.recipe @@ -0,0 +1,400 @@ +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" +SOURCE_URI="http://llvm.org/releases/${portVersion}/llvm-${portVersion}.src.tar.xz" +SOURCE_URI_2="http://llvm.org/releases/${portVersion}/cfe-${portVersion}.src.tar.xz" +SOURCE_URI_3="http://llvm.org/releases/${portVersion}/clang-tools-extra-${portVersion}.src.tar.xz" +CHECKSUM_SHA256="6e82ce4adb54ff3afc18053d6981b6aed1406751b8742582ed50f04b5ab475f9" +CHECKSUM_SHA256_2="4cd3836dfb4b88b597e075341cae86d61c63ce3963e45c7fe6a8bf59bb382cdf" +CHECKSUM_SHA256_3="664a5c60220de9c290bf2a5b03d902ab731a4f95fe73a00856175ead494ec396" +SOURCE_DIR="llvm-${portVersion}.src" +SOURCE_DIR_2="cfe-${portVersion}.src" +SOURCE_DIR_3="clang-tools-extra-${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: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_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_mc + cmd:llvm_mcmarkup + cmd:llvm_nm + cmd:llvm_objdump + 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_symbolizer + cmd:llvm_tblgen + cmd:macho_dump + cmd:verify_uselistorder + cmd:obj2yaml + cmd:yaml2obj + cmd:opt + cmd:FileCheck + cmd:count + cmd:not + cmd:sancov + lib:BugpointPasses$secondaryArchSuffix + lib:LLVMHello$secondaryArchSuffix + lib:libLTO$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: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:libLLVMCppBackendCodeGen$secondaryArchSuffix + devel:libLLVMCppBackendInfo$secondaryArchSuffix + devel:libLLVMDebugInfoCodeView$secondaryArchSuffix + devel:libLLVMDebugInfoDWARF$secondaryArchSuffix + devel:libLLVMDebugInfoPDB$secondaryArchSuffix + devel:libLLVMExecutionEngine$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: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: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: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_3.8 = $portVersion + cmd:clang++ = $portVersion + cmd:clang_apply_replacements = $portVersion + cmd:clang_check = $portVersion + cmd:clang_cl = $portVersion + cmd:clang_format = $portVersion + cmd:clang_modernize = $portVersion + cmd:clang_query = $portVersion + cmd:clang_rename = $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:libclangcodegen$secondaryArchSuffix = $portVersion + devel:libclangdriver$secondaryArchSuffix = $portVersion + devel:libclangdynamicastmatchers$secondaryArchSuffix = $portVersion + devel:libclangedit$secondaryArchSuffix = $portVersion + devel:libclangformat$secondaryArchSuffix = $portVersion + devel:libclangfrontend$secondaryArchSuffix = $portVersion + devel:libclangfrontendtool$secondaryArchSuffix = $portVersion + devel:libclangindex$secondaryArchSuffix = $portVersion + devel:libclanglex$secondaryArchSuffix = $portVersion + devel:libclangparse$secondaryArchSuffix = $portVersion + devel:libclangquery$secondaryArchSuffix = $portVersion + devel:libclangrename$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:libclangtidycertmodule$secondaryArchSuffix = $portVersion + devel:libclangtidycppcoreguidelinesmodule$secondaryArchSuffix = $portVersion + devel:libclangtidygooglemodule$secondaryArchSuffix = $portVersion + devel:libclangtidyllvmmodule$secondaryArchSuffix = $portVersion + devel:libclangtidymiscmodule$secondaryArchSuffix = $portVersion + devel:libclangtidymodernizemodule$secondaryArchSuffix = $portVersion + devel:libclangtidyperformancemodule$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 + + 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 + + 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 \ + libLLVM* \ + libLTO \ + libclang* + + mv $prefix/include/* $includeDir/ + mv $prefix/libexec/* $binDir/ + mv $prefix/share/man/* $manDir/ + mv $prefix/share/clang $dataDir/ + mv $prefix/share/llvm $dataDir/ + mv $prefix/share/scan-build $dataDir/ + mv $prefix/share/scan-view $dataDir/ + rmdir $prefix/include $prefix/libexec $prefix/share/man + + 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 +} diff --git a/sys-devel/llvm/patches/clang-3.8.1.patchset b/sys-devel/llvm/patches/clang-3.8.1.patchset new file mode 100644 index 000000000..a0b26e20b --- /dev/null +++ b/sys-devel/llvm/patches/clang-3.8.1.patchset @@ -0,0 +1,416 @@ +From e0469a87db42cc56e973f0e871b932dfada77f4c Mon Sep 17 00:00:00 2001 +From: Alexander von Gluck IV +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.7.0 + + +From 85d89241bbcbc0cbc8a62e637a8a4fbb76568a3f Mon Sep 17 00:00:00 2001 +From: Adrien Destugues +Date: Sun, 1 Feb 2015 15:15:45 +0000 +Subject: libclang: add soname when building on Haiku. + + +diff --git a/tools/libclang/Makefile b/tools/libclang/Makefile +index 84914e0..b9a6b74 100644 +--- a/tools/libclang/Makefile ++++ b/tools/libclang/Makefile +@@ -35,7 +35,7 @@ USEDLIBS = clangIndex.a clangARCMigrate.a \ + include $(CLANG_LEVEL)/Makefile + + # Add soname to the library. +-ifeq ($(HOST_OS), $(filter $(HOST_OS), Linux FreeBSD GNU GNU/kFreeBSD)) ++ifeq ($(HOST_OS), $(filter $(HOST_OS), Linux FreeBSD GNU GNU/kFreeBSD Haiku)) + LLVMLibsOptions += -Wl,-soname,lib$(LIBRARYNAME)$(SHLIBEXT) + endif + +-- +2.7.0 + + +From 3441f2eca85f72ab93dae5a6e645748e5578fd0f Mon Sep 17 00:00:00 2001 +From: Jerome Duval +Date: Tue, 22 Dec 2015 22:07:06 +0000 +Subject: don't include c++ headers in C include search paths. + +* define a Haiku toolchain, and add c++ headers path. + +diff --git a/lib/Driver/Driver.cpp b/lib/Driver/Driver.cpp +index 1e0a48d..f31b274 100644 +--- a/lib/Driver/Driver.cpp ++++ b/lib/Driver/Driver.cpp +@@ -2206,6 +2206,9 @@ const ToolChain &Driver::getToolChain(const ArgList &Args, + ToolChain *&TC = ToolChains[Target.str()]; + if (!TC) { + switch (Target.getOS()) { ++ case llvm::Triple::Haiku: ++ TC = new toolchains::Haiku(*this, Target, Args); ++ break; + case llvm::Triple::CloudABI: + TC = new toolchains::CloudABI(*this, Target, Args); + break; +diff --git a/lib/Driver/ToolChains.cpp b/lib/Driver/ToolChains.cpp +index 99c7b8e..5e95668 100644 +--- a/lib/Driver/ToolChains.cpp ++++ b/lib/Driver/ToolChains.cpp +@@ -2971,6 +2971,34 @@ Tool *CloudABI::buildLinker() const { + return new tools::cloudabi::Linker(*this); + } + ++/// Haiku - Haiku tool chain which can call as(1) and ld(1) directly. ++ ++Haiku::Haiku(const Driver &D, const llvm::Triple& Triple, const ArgList &Args) ++ : Generic_ELF(D, Triple, Args) { ++ ++} ++ ++void Haiku::AddClangCXXStdlibIncludeArgs(const ArgList &DriverArgs, ++ ArgStringList &CC1Args) const { ++ if (DriverArgs.hasArg(options::OPT_nostdlibinc) || ++ DriverArgs.hasArg(options::OPT_nostdincxx)) ++ return; ++ ++ switch (GetCXXStdlibType(DriverArgs)) { ++ case ToolChain::CST_Libstdcxx: ++ addSystemInclude(DriverArgs, CC1Args, ++ getDriver().SysRoot + "/system/develop/headers/c++"); ++ addSystemInclude(DriverArgs, CC1Args, ++ getDriver().SysRoot + "/system/develop/headers/c++/backward"); ++ ++ StringRef Triple = getTriple().str(); ++ addSystemInclude(DriverArgs, CC1Args, ++ getDriver().SysRoot + "/system/develop/headers/c++/" + ++ Triple); ++ break; ++ } ++} ++ + /// OpenBSD - OpenBSD tool chain which can call as(1) and ld(1) directly. + + OpenBSD::OpenBSD(const Driver &D, const llvm::Triple &Triple, +diff --git a/lib/Driver/ToolChains.h b/lib/Driver/ToolChains.h +index f940e58..7b7125e 100644 +--- a/lib/Driver/ToolChains.h ++++ b/lib/Driver/ToolChains.h +@@ -667,6 +667,18 @@ private: + void findGccLibDir(); + }; + ++class LLVM_LIBRARY_VISIBILITY Haiku : public Generic_ELF { ++public: ++ Haiku(const Driver &D, const llvm::Triple &Triple, ++ const llvm::opt::ArgList &Args); ++ ++ bool isPIEDefault() const override { return getTriple().getArch() == llvm::Triple::x86_64; } ++ ++ void ++ AddClangCXXStdlibIncludeArgs(const llvm::opt::ArgList &DriverArgs, ++ llvm::opt::ArgStringList &CC1Args) const override; ++}; ++ + class LLVM_LIBRARY_VISIBILITY OpenBSD : public Generic_ELF { + public: + OpenBSD(const Driver &D, const llvm::Triple &Triple, +diff --git a/lib/Frontend/InitHeaderSearch.cpp b/lib/Frontend/InitHeaderSearch.cpp +index 6066d2b..d8f0881 100644 +--- a/lib/Frontend/InitHeaderSearch.cpp ++++ b/lib/Frontend/InitHeaderSearch.cpp +@@ -295,8 +295,6 @@ void InitHeaderSearch::AddDefaultCIncludePaths(const llvm::Triple &triple, + AddPath("/boot/system/develop/headers/os/be_apps/Deskbar", System, false); + AddPath("/boot/system/develop/headers/os/be_apps/NetPositive", System, false); + AddPath("/boot/system/develop/headers/os/be_apps/Tracker", System, false); +- AddPath("/boot/system/develop/headers/cpp", System, false); +- AddPath("/boot/system/develop/headers/cpp/i586-pc-haiku", System, false); + AddPath("/boot/system/develop/headers/3rdparty", System, false); + AddPath("/boot/system/develop/headers/bsd", System, false); + AddPath("/boot/system/develop/headers/glibc", System, false); +-- +2.7.0 + + +From 005da8695c9e7213a48f44d78e81ae48b8d75d4a Mon Sep 17 00:00:00 2001 +From: Jerome Duval +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 9c6eaff..0dca18f 100644 +--- a/lib/Basic/Targets.cpp ++++ b/lib/Basic/Targets.cpp +@@ -373,6 +373,30 @@ public: + } + }; + ++// Haiku Target ++template ++class HaikuTargetInfo : public OSTargetInfo { ++protected: ++ void getOSDefines(const LangOptions &Opts, const llvm::Triple &Triple, ++ MacroBuilder &Builder) const override { ++ // Haiku defines; list based off of gcc output ++ Builder.defineMacro("__HAIKU__"); ++ Builder.defineMacro("__ELF__"); ++ DefineStd(Builder, "unix", Opts); ++ } ++public: ++ HaikuTargetInfo(const llvm::Triple &Triple) ++ : OSTargetInfo(Triple) { ++ this->SizeType = TargetInfo::UnsignedLong; ++ this->IntPtrType = TargetInfo::SignedLong; ++ this->PtrDiffType = TargetInfo::SignedLong; ++ this->ProcessIDType = TargetInfo::SignedLong; ++ this->TLSSupported = false; ++ this->UserLabelPrefix = ""; ++ ++ } ++}; ++ + // Minix Target + template + class MinixTargetInfo : public OSTargetInfo { +@@ -3875,21 +3899,16 @@ public: + }; + + // x86-32 Haiku target +-class HaikuX86_32TargetInfo : public X86_32TargetInfo { ++class HaikuX86_32TargetInfo : public HaikuTargetInfo { + public: +- HaikuX86_32TargetInfo(const llvm::Triple &Triple) : X86_32TargetInfo(Triple) { +- SizeType = UnsignedLong; +- IntPtrType = SignedLong; +- PtrDiffType = SignedLong; +- ProcessIDType = SignedLong; +- this->UserLabelPrefix = ""; +- this->TLSSupported = false; ++ HaikuX86_32TargetInfo(const llvm::Triple &Triple) ++ : HaikuTargetInfo(Triple) { + } ++ + void getTargetDefines(const LangOptions &Opts, + MacroBuilder &Builder) const override { +- X86_32TargetInfo::getTargetDefines(Opts, Builder); ++ HaikuTargetInfo::getTargetDefines(Opts, Builder); + Builder.defineMacro("__INTEL__"); +- Builder.defineMacro("__HAIKU__"); + } + }; + +@@ -7909,6 +7928,8 @@ static TargetInfo *AllocateTarget(const llvm::Triple &Triple) { + return new MicrosoftX86_64TargetInfo(Triple); + } + } ++ case llvm::Triple::Haiku: ++ return new HaikuTargetInfo(Triple); + case llvm::Triple::NaCl: + return new NaClTargetInfo(Triple); + case llvm::Triple::PS4: +-- +2.7.0 + + +From eb8c787ef742e36b3f9c1511b4b3a700fa73d9f4 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 ad2ac42..7d06c55 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -511,6 +511,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 5e95668..00cbca7 100644 +--- a/lib/Driver/ToolChains.cpp ++++ b/lib/Driver/ToolChains.cpp +@@ -2976,6 +2976,13 @@ Tool *CloudABI::buildLinker() 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, +@@ -2986,6 +2993,19 @@ void Haiku::AddClangCXXStdlibIncludeArgs(const ArgList &DriverArgs, + + switch (GetCXXStdlibType(DriverArgs)) { + 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, +@@ -2995,6 +3015,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 d8f0881..ddb5157 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.7.0 + diff --git a/sys-devel/llvm/patches/llvm-3.8.1.patchset b/sys-devel/llvm/patches/llvm-3.8.1.patchset new file mode 100644 index 000000000..ebe5ff379 --- /dev/null +++ b/sys-devel/llvm/patches/llvm-3.8.1.patchset @@ -0,0 +1,362 @@ +From f59ba1f51de1d4d20ea6cbfd5e2469bba2cec1cb Mon Sep 17 00:00:00 2001 +From: Alexander von Gluck IV +Date: Wed, 22 Jan 2014 05:04:31 +0000 +Subject: haiku: fix Host.h for endian.h + + +diff --git a/include/llvm/Support/Host.h b/include/llvm/Support/Host.h +index 8f4bf3c..8114f9b 100644 +--- a/include/llvm/Support/Host.h ++++ b/include/llvm/Support/Host.h +@@ -16,7 +16,7 @@ + + #include "llvm/ADT/StringMap.h" + +-#if defined(__linux__) || defined(__GNU__) ++#if defined(__linux__) || defined(__GNU__) || defined(__HAIKU__) + #include + #else + #if !defined(BYTE_ORDER) && !defined(LLVM_ON_WIN32) +-- +2.7.0 + + +From c5876fe33f9184a892fb426ad44af34f33f6863f Mon Sep 17 00:00:00 2001 +From: Adrien Destugues +Date: Sun, 18 May 2014 12:41:16 +0200 +Subject: libLTO: add soname when building on Haiku. + + +diff --git a/tools/lto/Makefile b/tools/lto/Makefile +index 530c05a..ffa76d2 100644 +--- a/tools/lto/Makefile ++++ b/tools/lto/Makefile +@@ -17,6 +17,10 @@ EXPORTED_SYMBOL_FILE = $(PROJ_SRC_DIR)/lto.exports + + include $(LEVEL)/Makefile.common + ++ifeq ($(HOST_OS),Haiku) ++ LLVMLibsOptions := $(LLVMLibsOptions) -Wl,-soname=$(SharedPrefix)LTO$(SHLIBEXT) ++endif ++ + ifeq ($(HOST_OS),Darwin) + # Special hack to allow libLTO to have an offset version number. + ifdef LLVM_LTO_VERSION_OFFSET +-- +2.7.0 + + +From 08538bfcbb4917e8952c00ef425694ca97dfdb31 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 80f6279..8275aac 100644 +--- a/tools/llvm-config/llvm-config.cpp ++++ b/tools/llvm-config/llvm-config.cpp +@@ -309,7 +309,11 @@ int main(int argc, char **argv) { + "-I" + ActiveObjRoot + "/include"); + } else { + ActivePrefix = CurrentExecPrefix; ++#ifdef __HAIKU__ ++ ActiveIncludeDir = ActivePrefix + "/develop/headers"; ++#else + ActiveIncludeDir = ActivePrefix + "/include"; ++#endif + ActiveBinDir = ActivePrefix + "/bin"; + ActiveLibDir = ActivePrefix + "/lib" + LLVM_LIBDIR_SUFFIX; + ActiveIncludeOption = "-I" + ActiveIncludeDir; +@@ -497,10 +501,16 @@ int main(int argc, char **argv) { + OS << LLVM_HAS_RTTI << '\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 { + usage(); + } +-- +2.7.0 + + +From 0338c143a0764b2c449c6ecd246ca4e5a76be4c5 Mon Sep 17 00:00:00 2001 +From: Jerome Duval +Date: Sun, 31 Jan 2016 10:23:24 +0000 +Subject: patch cmake build for Haiku. + + +diff --git a/autoconf/config.guess b/autoconf/config.guess +index b209a1a..776ef5c 100755 +--- a/autoconf/config.guess ++++ b/autoconf/config.guess +@@ -2,13 +2,13 @@ + # Attempt to guess a canonical system name. + # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, + # 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, +-# 2011 Free Software Foundation, Inc. ++# 2011, 2012, 2013 Free Software Foundation, Inc. + +-timestamp='2011-08-20' ++timestamp='2012-12-29' + + # This file is free software; you can redistribute it and/or modify it + # under the terms of the GNU General Public License as published by +-# the Free Software Foundation; either version 2 of the License, or ++# the Free Software Foundation; either version 3 of the License, or + # (at your option) any later version. + # + # This program is distributed in the hope that it will be useful, but +@@ -17,26 +17,22 @@ timestamp='2011-08-20' + # General Public License for more details. + # + # You should have received a copy of the GNU General Public License +-# along with this program; if not, write to the Free Software +-# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA +-# 02110-1301, USA. ++# along with this program; if not, see . + # + # As a special exception to the GNU General Public License, if you + # distribute this file as part of a program that contains a + # configuration script generated by Autoconf, you may include it under +-# the same distribution terms that you use for the rest of that program. +- +- +-# Originally written by Per Bothner. Please send patches (context +-# diff format) to and include a ChangeLog +-# entry. ++# the same distribution terms that you use for the rest of that ++# program. This Exception is an additional permission under section 7 ++# of the GNU General Public License, version 3 ("GPLv3"). + # +-# This script attempts to guess a canonical system name similar to +-# config.sub. If it succeeds, it prints the system name on stdout, and +-# exits with 0. Otherwise, it exits with 1. ++# Originally written by Per Bothner. + # + # You can get the latest version of this script from: + # http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD ++# ++# Please send patches with a ChangeLog entry to config-patches@gnu.org. ++ + + me=`echo "$0" | sed -e 's,.*/,,'` + +@@ -57,8 +53,8 @@ GNU config.guess ($timestamp) + + Originally written by Per Bothner. + Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, +-2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free +-Software Foundation, Inc. ++2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, ++2012, 2013 Free Software Foundation, Inc. + + This is free software; see the source for copying conditions. There is NO + warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." +@@ -145,7 +141,7 @@ UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown + case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in + *:NetBSD:*:*) + # NetBSD (nbsd) targets should (where applicable) match one or +- # more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*, ++ # more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*, + # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently + # switched to ELF, *-*-netbsd* would select the old + # object file format. This provides both forward +@@ -202,14 +198,14 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in + # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. + echo "${machine}-${os}${release}" + exit ;; +- *:OpenBSD:*:*) +- UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` +- echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE} +- exit ;; + *:Bitrig:*:*) + UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'` + echo ${UNAME_MACHINE_ARCH}-unknown-bitrig${UNAME_RELEASE} + exit ;; ++ *:OpenBSD:*:*) ++ UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` ++ echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE} ++ exit ;; + *:ekkoBSD:*:*) + echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE} + exit ;; +@@ -308,7 +304,7 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in + arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) + echo arm-acorn-riscix${UNAME_RELEASE} + exit ;; +- arm:riscos:*:*|arm:RISCOS:*:*) ++ arm*:riscos:*:*|arm*:RISCOS:*:*) + echo arm-unknown-riscos + exit ;; + SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) +@@ -807,10 +803,13 @@ EOF + i*:CYGWIN*:*) + echo ${UNAME_MACHINE}-pc-cygwin + exit ;; ++ *:MINGW64*:*) ++ echo ${UNAME_MACHINE}-pc-mingw64 ++ exit ;; + *:MINGW*:*) + echo ${UNAME_MACHINE}-pc-mingw32 + exit ;; +- *:MSYS*:*) ++ i*:MSYS*:*) + echo ${UNAME_MACHINE}-pc-msys + exit ;; + i*:windows32*:*) +@@ -867,8 +866,12 @@ EOF + i*86:Minix:*:*) + echo ${UNAME_MACHINE}-pc-minix + exit ;; +- aarch64*:Linux:*) +- echo ${UNAME_MACHINE}-unknown-linux-gnu ++ aarch64:Linux:*:*) ++ echo ${UNAME_MACHINE}-unknown-linux-gnu ++ exit ;; ++ aarch64_be:Linux:*:*) ++ UNAME_MACHINE=aarch64_be ++ echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + alpha:Linux:*:*) + case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in +@@ -904,13 +907,16 @@ EOF + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + cris:Linux:*:*) +- echo cris-axis-linux-gnu ++ echo ${UNAME_MACHINE}-axis-linux-gnu + exit ;; + crisv32:Linux:*:*) +- echo crisv32-axis-linux-gnu ++ echo ${UNAME_MACHINE}-axis-linux-gnu + exit ;; + frv:Linux:*:*) +- echo frv-unknown-linux-gnu ++ echo ${UNAME_MACHINE}-unknown-linux-gnu ++ exit ;; ++ hexagon:Linux:*:*) ++ echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + i*86:Linux:*:*) + LIBC=gnu +@@ -952,7 +958,7 @@ EOF + test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; } + ;; + or32:Linux:*:*) +- echo or32-unknown-linux-gnu ++ echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + padre:Linux:*:*) + echo sparc-unknown-linux-gnu +@@ -971,9 +977,6 @@ EOF + ppc64:Linux:*:*) + echo powerpc64-unknown-linux-gnu + exit ;; +- ppc64le:Linux:*:*) +- echo powerpc64le-unknown-linux-gnu +- exit ;; + ppc:Linux:*:*) + echo powerpc-unknown-linux-gnu + exit ;; +@@ -996,7 +999,7 @@ EOF + echo ${UNAME_MACHINE}-dec-linux-gnu + exit ;; + x86_64:Linux:*:*) +- echo x86_64-unknown-linux-gnu ++ echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + xtensa*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu +@@ -1203,6 +1206,9 @@ EOF + BePC:Haiku:*:*) # Haiku running on Intel PC compatible. + echo i586-pc-haiku + exit ;; ++ x86_64:Haiku:*:*) ++ echo x86_64-unknown-haiku ++ exit ;; + SX-4:SUPER-UX:*:*) + echo sx4-nec-superux${UNAME_RELEASE} + exit ;; +@@ -1258,7 +1264,7 @@ EOF + NEO-?:NONSTOP_KERNEL:*:*) + echo neo-tandem-nsk${UNAME_RELEASE} + exit ;; +- NSE-?:NONSTOP_KERNEL:*:*) ++ NSE-*:NONSTOP_KERNEL:*:*) + echo nse-tandem-nsk${UNAME_RELEASE} + exit ;; + NSR-?:NONSTOP_KERNEL:*:*) +@@ -1327,11 +1333,11 @@ EOF + i*86:AROS:*:*) + echo ${UNAME_MACHINE}-pc-aros + exit ;; ++ x86_64:VMkernel:*:*) ++ echo ${UNAME_MACHINE}-unknown-esx ++ exit ;; + esac + +-#echo '(No uname command or uname output not recognized.)' 1>&2 +-#echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2 +- + eval $set_cc_for_build + cat >$dummy.c <