public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] repo/gentoo:master commit in: sys-devel/llvm/files/, sys-devel/llvm/
@ 2015-10-11 18:41 Bernard Cafarelli
  0 siblings, 0 replies; 11+ messages in thread
From: Bernard Cafarelli @ 2015-10-11 18:41 UTC (permalink / raw
  To: gentoo-commits

commit:     c4ea50ca83bfb8f0a402b4f9217eeaa9cbc85c20
Author:     Bernard Cafarelli <voyageur <AT> gentoo <DOT> org>
AuthorDate: Sun Oct 11 18:38:48 2015 +0000
Commit:     Bernard Cafarelli <voyageur <AT> gentoo <DOT> org>
CommitDate: Sun Oct 11 18:39:00 2015 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=c4ea50ca

sys-devel/llvm: bump to fix lldb python install

Bug: 562436
Bug: 562438

Package-Manager: portage-2.2.23

 sys-devel/llvm/files/llvm-3.7-lldb_python.patch |  23 ++
 sys-devel/llvm/llvm-3.7.0-r2.ebuild             | 504 ++++++++++++++++++++++++
 2 files changed, 527 insertions(+)

diff --git a/sys-devel/llvm/files/llvm-3.7-lldb_python.patch b/sys-devel/llvm/files/llvm-3.7-lldb_python.patch
new file mode 100644
index 0000000..1a95827
--- /dev/null
+++ b/sys-devel/llvm/files/llvm-3.7-lldb_python.patch
@@ -0,0 +1,23 @@
+diff -Naur llvm-3.7.0.src.orig/tools/lldb/scripts/Python/finishSwigPythonLLDB.py llvm-3.7.0.src/tools/lldb/scripts/Python/finishSwigPythonLLDB.py
+--- llvm-3.7.0.src.orig/tools/lldb/scripts/Python/finishSwigPythonLLDB.py	2015-06-04 05:12:37.000000000 +0200
++++ llvm-3.7.0.src/tools/lldb/scripts/Python/finishSwigPythonLLDB.py	2015-10-11 19:19:54.074935710 +0200
+@@ -371,14 +371,14 @@
+                 strLibFileExtn = ".dylib";
+             else:
+                 strLibFileExtn = ".so";
+-            strSrc = os.path.join("lib", "liblldb" + strLibFileExtn);
++            strSrc = os.path.join("GENTOO_LIBDIR", "liblldb" + strLibFileExtn);
+ 
+-    if eOSType != utilsOsType.EnumOsType.Windows:
++#    if eOSType != utilsOsType.EnumOsType.Windows:
+         # Create a symlink to the "lib" directory, to ensure liblldb's RPATH is
+         # effective.
+-        bOk, strErrMsg = make_symlink( vDictArgs, vstrFrameworkPythonDir, "lib", os.path.join("../lib") );
+-        if not bOk:
+-            return (bOk, strErrMsg)
++#        bOk, strErrMsg = make_symlink( vDictArgs, vstrFrameworkPythonDir, "lib", os.path.join("../lib") );
++#        if not bOk:
++#            return (bOk, strErrMsg)
+ 
+     bOk, strErrMsg = make_symlink( vDictArgs, vstrFrameworkPythonDir, strSrc, strTarget );
+ 

diff --git a/sys-devel/llvm/llvm-3.7.0-r2.ebuild b/sys-devel/llvm/llvm-3.7.0-r2.ebuild
new file mode 100644
index 0000000..de885b7
--- /dev/null
+++ b/sys-devel/llvm/llvm-3.7.0-r2.ebuild
@@ -0,0 +1,504 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+: ${CMAKE_MAKEFILE_GENERATOR:=ninja}
+PYTHON_COMPAT=( python2_7 pypy )
+
+inherit check-reqs cmake-utils eutils flag-o-matic multilib \
+	multilib-minimal python-r1 toolchain-funcs pax-utils
+
+DESCRIPTION="Low Level Virtual Machine"
+HOMEPAGE="http://llvm.org/"
+SRC_URI="http://llvm.org/releases/${PV}/${P}.src.tar.xz
+	clang? ( http://llvm.org/releases/${PV}/compiler-rt-${PV}.src.tar.xz
+		http://llvm.org/releases/${PV}/cfe-${PV}.src.tar.xz
+		http://llvm.org/releases/${PV}/clang-tools-extra-${PV}.src.tar.xz )
+	lldb? ( http://llvm.org/releases/${PV}/lldb-${PV}.src.tar.xz )
+	!doc? ( http://dev.gentoo.org/~voyageur/distfiles/${P}-manpages.tar.bz2 )"
+
+LICENSE="UoI-NCSA"
+SLOT="0/${PV}"
+KEYWORDS="~amd64 ~arm ~arm64 ~ppc ~ppc64 ~sparc ~x86 ~amd64-fbsd ~x86-fbsd ~x64-freebsd ~amd64-linux ~arm-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos"
+IUSE="clang debug doc gold libedit +libffi lldb multitarget ncurses ocaml
+	python +static-analyzer test xml video_cards_radeon kernel_Darwin"
+
+COMMON_DEPEND="
+	sys-libs/zlib:0=
+	clang? (
+		python? ( ${PYTHON_DEPS} )
+		static-analyzer? (
+			dev-lang/perl:*
+			${PYTHON_DEPS}
+		)
+		xml? ( dev-libs/libxml2:2=[${MULTILIB_USEDEP}] )
+	)
+	gold? ( >=sys-devel/binutils-2.22:*[cxx] )
+	libedit? ( dev-libs/libedit:0=[${MULTILIB_USEDEP}] )
+	libffi? ( >=virtual/libffi-3.0.13-r1:0=[${MULTILIB_USEDEP}] )
+	ncurses? ( >=sys-libs/ncurses-5.9-r3:0=[${MULTILIB_USEDEP}] )
+	ocaml? (
+		dev-lang/ocaml:0=
+		dev-ml/findlib
+		dev-ml/ocaml-ctypes )"
+# configparser-3.2 breaks the build (3.3 or none at all are fine)
+DEPEND="${COMMON_DEPEND}
+	dev-lang/perl
+	>=sys-devel/make-3.81
+	>=sys-devel/flex-2.5.4
+	>=sys-devel/bison-1.875d
+	|| ( >=sys-devel/gcc-3.0 >=sys-devel/llvm-3.5
+		( >=sys-freebsd/freebsd-lib-9.1-r10 sys-libs/libcxx )
+	)
+	|| ( >=sys-devel/binutils-2.18 >=sys-devel/binutils-apple-5.1 )
+	kernel_Darwin? ( sys-libs/libcxx )
+	clang? ( xml? ( virtual/pkgconfig ) )
+	doc? ( dev-python/sphinx )
+	gold? ( sys-libs/binutils-libs )
+	libffi? ( virtual/pkgconfig )
+	lldb? ( dev-lang/swig )
+	!!<dev-python/configparser-3.3.0.2
+	ocaml? ( test? ( dev-ml/ounit ) )
+	${PYTHON_DEPS}"
+RDEPEND="${COMMON_DEPEND}
+	clang? ( !<=sys-devel/clang-${PV}-r99 )
+	abi_x86_32? ( !<=app-emulation/emul-linux-x86-baselibs-20130224-r2
+		!app-emulation/emul-linux-x86-baselibs[-abi_x86_32(-)] )"
+PDEPEND="clang? ( =sys-devel/clang-${PV}-r100 )"
+
+# pypy gives me around 1700 unresolved tests due to open file limit
+# being exceeded. probably GC does not close them fast enough.
+REQUIRED_USE="${PYTHON_REQUIRED_USE}
+	lldb? ( clang )
+	test? ( || ( $(python_gen_useflags 'python*') ) )"
+
+S=${WORKDIR}/${P/_}.src
+
+pkg_pretend() {
+	# in megs
+	# !clang !debug !multitarget -O2       400
+	# !clang !debug  multitarget -O2       550
+	#  clang !debug !multitarget -O2       950
+	#  clang !debug  multitarget -O2      1200
+	# !clang  debug  multitarget -O2      5G
+	#  clang !debug  multitarget -O0 -g  12G
+	#  clang  debug  multitarget -O2     16G
+	#  clang  debug  multitarget -O0 -g  14G
+
+	local build_size=550
+	use clang && build_size=1200
+
+	if use debug; then
+		ewarn "USE=debug is known to increase the size of package considerably"
+		ewarn "and cause the tests to fail."
+		ewarn
+
+		(( build_size *= 14 ))
+	elif is-flagq '-g?(gdb)?([1-9])'; then
+		ewarn "The C++ compiler -g option is known to increase the size of the package"
+		ewarn "considerably. If you run out of space, please consider removing it."
+		ewarn
+
+		(( build_size *= 10 ))
+	fi
+
+	# Multiply by number of ABIs :).
+	local abis=( $(multilib_get_enabled_abis) )
+	(( build_size *= ${#abis[@]} ))
+
+	local CHECKREQS_DISK_BUILD=${build_size}M
+	check-reqs_pkg_pretend
+
+	if [[ ${MERGE_TYPE} != binary ]]; then
+		echo 'int main() {return 0;}' > "${T}"/test.cxx || die
+		ebegin "Trying to build a C++11 test program"
+		if ! $(tc-getCXX) -std=c++11 -o /dev/null "${T}"/test.cxx; then
+			eerror "LLVM-${PV} requires C++11-capable C++ compiler. Your current compiler"
+			eerror "does not seem to support -std=c++11 option. Please upgrade your compiler"
+			eerror "to gcc-4.7 or an equivalent version supporting C++11."
+			die "Currently active compiler does not support -std=c++11"
+		fi
+		eend ${?}
+	fi
+}
+
+pkg_setup() {
+	pkg_pretend
+}
+
+src_unpack() {
+	default
+
+	if use clang; then
+		mv "${WORKDIR}"/cfe-${PV/_}.src "${S}"/tools/clang \
+			|| die "clang source directory move failed"
+		mv "${WORKDIR}"/compiler-rt-${PV/_}.src "${S}"/projects/compiler-rt \
+			|| die "compiler-rt source directory move failed"
+		mv "${WORKDIR}"/clang-tools-extra-${PV/_}.src "${S}"/tools/clang/tools/extra \
+			|| die "clang-tools-extra source directory move failed"
+	fi
+
+	if use lldb; then
+		mv "${WORKDIR}"/lldb-${PV/_}.src "${S}"/tools/lldb \
+			|| die "lldb source directory move failed"
+	fi
+}
+
+src_prepare() {
+	# Make ocaml warnings non-fatal, bug #537308
+	sed -e "/RUN/s/-warn-error A//" -i test/Bindings/OCaml/*ml  || die
+	# Fix libdir for ocaml bindings install, bug #559134
+	epatch "${FILESDIR}"/cmake/${P}-ocaml-multilib.patch
+
+	# Make it possible to override Sphinx HTML install dirs
+	# https://llvm.org/bugs/show_bug.cgi?id=23780
+	epatch "${FILESDIR}"/cmake/0002-cmake-Support-overriding-Sphinx-HTML-doc-install-dir.patch
+
+	# Prevent race conditions with parallel Sphinx runs
+	# https://llvm.org/bugs/show_bug.cgi?id=23781
+	epatch "${FILESDIR}"/cmake/0003-cmake-Add-an-ordering-dep-between-HTML-man-Sphinx-ta.patch
+
+	# Prevent installing libgtest
+	# https://llvm.org/bugs/show_bug.cgi?id=18341
+	epatch "${FILESDIR}"/cmake/0004-cmake-Do-not-install-libgtest.patch
+
+	if use clang; then
+		# Automatically select active system GCC's libraries, bugs #406163 and #417913
+		epatch "${FILESDIR}"/clang-3.5-gentoo-runtime-gcc-detection-v3.patch
+
+		epatch "${FILESDIR}"/clang-3.6-gentoo-install.patch
+
+		sed -i -e "s^@EPREFIX@^${EPREFIX}^" \
+			tools/clang/tools/scan-build/scan-build || die
+
+		# Install clang runtime into /usr/lib/clang
+		# https://llvm.org/bugs/show_bug.cgi?id=23792
+		epatch "${FILESDIR}"/cmake/clang-0001-Install-clang-runtime-into-usr-lib-without-suffix.patch
+		epatch "${FILESDIR}"/cmake/compiler-rt-0001-cmake-Install-compiler-rt-into-usr-lib-without-suffi.patch
+
+		# Make it possible to override CLANG_LIBDIR_SUFFIX
+		# (that is used only to find LLVMgold.so)
+		# https://llvm.org/bugs/show_bug.cgi?id=23793
+		epatch "${FILESDIR}"/cmake/clang-0002-cmake-Make-CLANG_LIBDIR_SUFFIX-overridable.patch
+
+		# Fix WX sections, bug #421527
+		find "${S}"/projects/compiler-rt/lib/builtins -type f -name \*.S -exec sed \
+			 -e '$a\\n#if defined(__linux__) && defined(__ELF__)\n.section .note.GNU-stack,"",%progbits\n#endif' \
+			 -i {} \; || die
+	fi
+
+	if use lldb; then
+		# Do not install dummy readline.so module from
+		# https://llvm.org/bugs/show_bug.cgi?id=18841
+		sed -e 's/add_subdirectory(readline)/#&/' \
+			-i tools/lldb/scripts/Python/modules/CMakeLists.txt || die
+
+		# Fix Python paths, bugs #562436 and #562438
+		epatch "${FILESDIR}"/${PN}-3.7-lldb_python.patch
+		sed -e "s/GENTOO_LIBDIR/$(get_libdir)/" \
+			-i tools/lldb/scripts/Python/finishSwigPythonLLDB.py || die
+	fi
+
+	# User patches
+	epatch_user
+
+	python_setup
+
+	# Native libdir is used to hold LLVMgold.so
+	NATIVE_LIBDIR=$(get_libdir)
+}
+
+multilib_src_configure() {
+	local targets
+	if use multitarget; then
+		targets=all
+	else
+		targets='host;CppBackend'
+		use video_cards_radeon && targets+=';AMDGPU'
+	fi
+
+	local ffi_cflags ffi_ldflags
+	if use libffi; then
+		ffi_cflags=$(pkg-config --cflags-only-I libffi)
+		ffi_ldflags=$(pkg-config --libs-only-L libffi)
+	fi
+
+	local libdir=$(get_libdir)
+	local mycmakeargs=(
+		"${mycmakeargs[@]}"
+		-DLLVM_LIBDIR_SUFFIX=${libdir#lib}
+
+		-DBUILD_SHARED_LIBS=ON
+		-DLLVM_ENABLE_TIMESTAMPS=OFF
+		-DLLVM_TARGETS_TO_BUILD="${targets}"
+		-DLLVM_BUILD_TESTS=$(usex test)
+
+		-DLLVM_ENABLE_FFI=$(usex libffi)
+		-DLLVM_ENABLE_TERMINFO=$(usex ncurses)
+		-DLLVM_ENABLE_ASSERTIONS=$(usex debug)
+		-DLLVM_ENABLE_EH=ON
+		-DLLVM_ENABLE_RTTI=ON
+
+		-DWITH_POLLY=OFF # TODO
+
+		-DLLVM_HOST_TRIPLE="${CHOST}"
+
+		-DFFI_INCLUDE_DIR="${ffi_cflags#-I}"
+		-DFFI_LIBRARY_DIR="${ffi_ldflags#-L}"
+
+		-DHAVE_HISTEDIT_H=$(usex libedit)
+	)
+
+	if use lldb; then
+		mycmakeargs+=(
+			-DLLDB_DISABLE_LIBEDIT=$(usex !libedit)
+			-DLLDB_DISABLE_CURSES=$(usex !ncurses)
+			-DLLDB_ENABLE_TERMINFO=$(usex ncurses)
+		)
+	fi
+
+	if ! multilib_is_native_abi || ! use ocaml; then
+		mycmakeargs+=(
+			-DOCAMLFIND=NO
+		)
+	fi
+#	Note: go bindings have no CMake rules at the moment
+#	but let's kill the check in case they are introduced
+#	if ! multilib_is_native_abi || ! use go; then
+		mycmakeargs+=(
+			-DGO_EXECUTABLE=GO_EXECUTABLE-NOTFOUND
+		)
+#	fi
+
+	if multilib_is_native_abi; then
+		mycmakeargs+=(
+			-DLLVM_BUILD_DOCS=$(usex doc)
+			-DLLVM_ENABLE_SPHINX=$(usex doc)
+			-DLLVM_ENABLE_DOXYGEN=OFF
+			-DLLVM_INSTALL_HTML="${EPREFIX}/usr/share/doc/${PF}/html"
+			-DSPHINX_WARNINGS_AS_ERRORS=OFF
+			-DLLVM_INSTALL_UTILS=ON
+		)
+
+		if use clang; then
+			mycmakeargs+=(
+				-DCLANG_INSTALL_HTML="${EPREFIX}/usr/share/doc/${PF}/clang"
+			)
+		fi
+
+		if use gold; then
+			mycmakeargs+=(
+				-DLLVM_BINUTILS_INCDIR="${EPREFIX}"/usr/include
+			)
+		fi
+
+		if use lldb; then
+			mycmakeargs+=(
+				-DLLDB_DISABLE_PYTHON=$(usex !python)
+			)
+		fi
+
+	else
+		if use clang; then
+			mycmakeargs+=(
+				# disable compiler-rt on non-native ABI because:
+				# 1. it fails to configure because of -m32
+				# 2. it is shared between ABIs so no point building
+				# it multiple times
+				-DLLVM_EXTERNAL_COMPILER_RT_BUILD=OFF
+				-DLLVM_EXTERNAL_CLANG_TOOLS_EXTRA_BUILD=OFF
+			)
+		fi
+		if use lldb; then
+			mycmakeargs+=(
+				# only run swig on native abi
+				-DLLDB_DISABLE_PYTHON=ON
+			)
+		fi
+	fi
+
+	if use clang; then
+		mycmakeargs+=(
+			-DCLANG_ENABLE_ARCMT=$(usex static-analyzer)
+			-DCLANG_ENABLE_STATIC_ANALYZER=$(usex static-analyzer)
+			-DCLANG_LIBDIR_SUFFIX="${NATIVE_LIBDIR#lib}"
+		)
+
+		# -- not needed when compiler-rt is built with host compiler --
+		# cmake passes host C*FLAGS to compiler-rt build
+		# which is performed using clang, so we need to filter out
+		# some flags clang does not support
+		# (if you know some more flags that don't work, let us know)
+		#filter-flags -msahf -frecord-gcc-switches
+	fi
+
+	cmake-utils_src_configure
+}
+
+multilib_src_compile() {
+	cmake-utils_src_compile
+	# TODO: not sure why this target is not correctly called
+	multilib_is_native_abi && use doc && use ocaml && cmake-utils_src_make docs/ocaml_doc
+
+	pax-mark m "${BUILD_DIR}"/bin/llvm-rtdyld
+	pax-mark m "${BUILD_DIR}"/bin/lli
+	pax-mark m "${BUILD_DIR}"/bin/lli-child-target
+
+	if use test; then
+		pax-mark m "${BUILD_DIR}"/unittests/ExecutionEngine/Orc/OrcJITTests
+		pax-mark m "${BUILD_DIR}"/unittests/ExecutionEngine/MCJIT/MCJITTests
+		pax-mark m "${BUILD_DIR}"/unittests/Support/SupportTests
+	fi
+}
+
+multilib_src_test() {
+	# respect TMPDIR!
+	local -x LIT_PRESERVES_TMP=1
+	local test_targets=( check )
+	# clang tests won't work on non-native ABI because we skip compiler-rt
+	multilib_is_native_abi && use clang && test_targets+=( check-clang )
+	cmake-utils_src_make "${test_targets[@]}"
+}
+
+src_install() {
+	local MULTILIB_CHOST_TOOLS=(
+		/usr/bin/llvm-config
+	)
+
+	local MULTILIB_WRAPPED_HEADERS=(
+		/usr/include/llvm/Config/config.h
+		/usr/include/llvm/Config/llvm-config.h
+	)
+
+	if use clang; then
+		# note: magic applied in multilib_src_install()!
+		CLANG_VERSION=${PV%.*}
+
+		MULTILIB_CHOST_TOOLS+=(
+			/usr/bin/clang
+			/usr/bin/clang++
+			/usr/bin/clang-cl
+			/usr/bin/clang-${CLANG_VERSION}
+			/usr/bin/clang++-${CLANG_VERSION}
+			/usr/bin/clang-cl-${CLANG_VERSION}
+		)
+
+		MULTILIB_WRAPPED_HEADERS+=(
+			/usr/include/clang/Config/config.h
+		)
+	fi
+
+	multilib-minimal_src_install
+}
+
+multilib_src_install() {
+	cmake-utils_src_install
+
+	if multilib_is_native_abi; then
+		# Install man pages.
+		use doc || doman "${WORKDIR}"/${P}-manpages/*.1
+
+		# Symlink the gold plugin.
+		if use gold; then
+			dodir "/usr/${CHOST}/binutils-bin/lib/bfd-plugins"
+			dosym "../../../../$(get_libdir)/LLVMgold.so" \
+				"/usr/${CHOST}/binutils-bin/lib/bfd-plugins/LLVMgold.so"
+		fi
+	fi
+
+	# apply CHOST and CLANG_VERSION to clang executables
+	# they're statically linked so we don't have to worry about the lib
+	if use clang; then
+		local clang_tools=( clang clang++ clang-cl )
+		local i
+
+		# cmake gives us:
+		# - clang-X.Y
+		# - clang -> clang-X.Y
+		# - clang++, clang-cl -> clang
+		# we want to have:
+		# - clang-X.Y
+		# - clang++-X.Y, clang-cl-X.Y -> clang-X.Y
+		# - clang, clang++, clang-cl -> clang*-X.Y
+		# so we need to fix the two tools
+		for i in "${clang_tools[@]:1}"; do
+			rm "${ED%/}/usr/bin/${i}" || die
+			dosym "clang-${CLANG_VERSION}" "/usr/bin/${i}-${CLANG_VERSION}"
+			dosym "${i}-${CLANG_VERSION}" "/usr/bin/${i}"
+		done
+
+		# now prepend ${CHOST} and let the multilib-build.eclass symlink it
+		if ! multilib_is_native_abi; then
+			# non-native? let's replace it with a simple wrapper
+			for i in "${clang_tools[@]}"; do
+				rm "${ED%/}/usr/bin/${i}-${CLANG_VERSION}" || die
+				cat > "${T}"/wrapper.tmp <<-_EOF_
+					#!${EPREFIX}/bin/sh
+					exec "${i}-${CLANG_VERSION}" $(get_abi_CFLAGS) "\${@}"
+				_EOF_
+				newbin "${T}"/wrapper.tmp "${i}-${CLANG_VERSION}"
+			done
+		fi
+	fi
+}
+
+multilib_src_install_all() {
+	insinto /usr/share/vim/vimfiles
+	doins -r utils/vim/*/
+	# some users may find it useful
+	dodoc utils/vim/vimrc
+
+	if use clang; then
+		pushd tools/clang >/dev/null || die
+
+		if use static-analyzer ; then
+			pushd tools/scan-build >/dev/null || die
+
+			dobin ccc-analyzer scan-build
+			dosym ccc-analyzer /usr/bin/c++-analyzer
+			doman scan-build.1
+
+			insinto /usr/share/llvm
+			doins scanview.css sorttable.js
+
+			popd >/dev/null || die
+		fi
+
+		python_inst() {
+			if use static-analyzer ; then
+				pushd tools/scan-view >/dev/null || die
+
+				python_doscript scan-view
+
+				touch __init__.py || die
+				python_moduleinto clang
+				python_domodule *.py Resources
+
+				popd >/dev/null || die
+			fi
+
+			if use python ; then
+				pushd bindings/python/clang >/dev/null || die
+
+				python_moduleinto clang
+				python_domodule *.py
+
+				popd >/dev/null || die
+			fi
+
+			# AddressSanitizer symbolizer (currently separate)
+			python_doscript "${S}"/projects/compiler-rt/lib/asan/scripts/asan_symbolize.py
+		}
+		python_foreach_impl python_inst
+		popd >/dev/null || die
+	fi
+}
+
+pkg_postinst() {
+	if use clang; then
+		elog "To enable OpenMP support in clang, install sys-libs/libomp"
+		elog "and use the '-fopenmp=libomp' command line option"
+	fi
+}


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: sys-devel/llvm/files/, sys-devel/llvm/
@ 2015-12-05 15:50 Michał Górny
  0 siblings, 0 replies; 11+ messages in thread
From: Michał Górny @ 2015-12-05 15:50 UTC (permalink / raw
  To: gentoo-commits

commit:     820607525306cb9f19b9bc1452540b8b1cacb08d
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Sat Dec  5 15:45:40 2015 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Sat Dec  5 15:49:55 2015 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=82060752

sys-devel/llvm: Update live ebuild, fix Python install

Update the patches and install procedure for git changes. Switch to
python-single-r1 as most of the Python components are now installed
by CMake.

 .../llvm/files/clang-3.8-gentoo-install.patch      |  14 ---
 sys-devel/llvm/files/llvm-3.8-llvm-config.patch    | 103 +++++++++++++++++++++
 sys-devel/llvm/llvm-9999.ebuild                    |  61 +++++-------
 3 files changed, 125 insertions(+), 53 deletions(-)

diff --git a/sys-devel/llvm/files/clang-3.8-gentoo-install.patch b/sys-devel/llvm/files/clang-3.8-gentoo-install.patch
deleted file mode 100644
index 25c4fca..0000000
--- a/sys-devel/llvm/files/clang-3.8-gentoo-install.patch
+++ /dev/null
@@ -1,14 +0,0 @@
----
- tools/clang/tools/scan-view/scan-view   | 2 +-
-
-diff --git a/tools/clang/tools/scan-view/bin/scan-view b/tools/clang/tools/scan-view/bin/scan-view
-index fb27da6..1f8ddb8 100755
---- a/tools/clang/tools/scan-view/bin/scan-view
-+++ b/tools/clang/tools/scan-view/bin/scan-view
-@@ -66,2 +66,2 @@ def start_browser(port, options):
--    import ScanView
-+    from clang import ScanView
-     try:
--- 
-1.8.4.4
-

diff --git a/sys-devel/llvm/files/llvm-3.8-llvm-config.patch b/sys-devel/llvm/files/llvm-3.8-llvm-config.patch
new file mode 100644
index 0000000..acc0601
--- /dev/null
+++ b/sys-devel/llvm/files/llvm-3.8-llvm-config.patch
@@ -0,0 +1,103 @@
+From cc0ac62d1c03206bc3a1edba4d60f97921b854f5 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= <mgorny@gentoo.org>
+Date: Fri, 4 Dec 2015 20:45:33 +0100
+Subject: [PATCH] llvm-config: Clean up exported values, update for shared
+ linking
+
+Gentoo-specific fixup for llvm-config, including:
+- wiping build-specific CFLAGS, CXXFLAGS,
+- updating library suffixes for shared libs,
+- wiping --system-libs for shared linking,
+- banning --obj-root and --src-root due to no sources installed.
+
+Thanks to Steven Newbury for the initial patch.
+
+Bug: https://bugs.gentoo.org/565358
+Bug: https://bugs.gentoo.org/501684
+---
+ tools/llvm-config/CMakeLists.txt   |  9 +++++++--
+ tools/llvm-config/llvm-config.cpp  | 17 +++++++++++++----
+ utils/llvm-build/llvmbuild/main.py |  5 ++++-
+ 3 files changed, 24 insertions(+), 7 deletions(-)
+
+diff --git a/tools/llvm-config/CMakeLists.txt b/tools/llvm-config/CMakeLists.txt
+index 83794bb..21fd845 100644
+--- a/tools/llvm-config/CMakeLists.txt
++++ b/tools/llvm-config/CMakeLists.txt
+@@ -22,15 +22,20 @@ get_property(COMPILE_FLAGS TARGET llvm-config PROPERTY COMPILE_FLAGS)
+ set(LLVM_SRC_ROOT ${LLVM_MAIN_SRC_DIR})
+ set(LLVM_OBJ_ROOT ${LLVM_BINARY_DIR})
+ set(LLVM_CPPFLAGS "${CMAKE_CPP_FLAGS} ${CMAKE_CPP_FLAGS_${uppercase_CMAKE_BUILD_TYPE}} ${LLVM_DEFINITIONS}")
++# Just use CMAKE_CPP_FLAGS for CFLAGS and CXXFLAGS, otherwise compiler
++# specific flags will be set when we don't know what compiler will be used
++# with external project utilising llvm-config.  C++ Standard is required.
++# TODO: figure out if we can remove -std=c++11 and move it to revdeps.
+ set(LLVM_CFLAGS "${CMAKE_C_FLAGS} ${CMAKE_C_FLAGS_${uppercase_CMAKE_BUILD_TYPE}} ${LLVM_DEFINITIONS}")
+-set(LLVM_CXXFLAGS "${CMAKE_CXX_FLAGS} ${CMAKE_CXX_FLAGS_${uppercase_CMAKE_BUILD_TYPE}} ${COMPILE_FLAGS} ${LLVM_DEFINITIONS}")
++set(LLVM_CXXFLAGS "${CMAKE_CPP_FLAGS} -std=c++11 ${CMAKE_CXX_FLAGS_${uppercase_CMAKE_BUILD_TYPE}} ${LLVM_DEFINITIONS}")
+ set(LLVM_BUILD_SYSTEM cmake)
+ set(LLVM_HAS_RTTI ${LLVM_CONFIG_HAS_RTTI})
+ 
+ # Use the C++ link flags, since they should be a superset of C link flags.
+ set(LLVM_LDFLAGS "${CMAKE_CXX_LINK_FLAGS}")
+ set(LLVM_BUILDMODE ${CMAKE_BUILD_TYPE})
+-set(LLVM_SYSTEM_LIBS ${SYSTEM_LIBS})
++# We don't do static libs, so we don't need to supply any system-libs
++set(LLVM_SYSTEM_LIBS "")
+ if(BUILD_SHARED_LIBS)
+   set(LLVM_ENABLE_SHARED ON)
+ else()
+diff --git a/tools/llvm-config/llvm-config.cpp b/tools/llvm-config/llvm-config.cpp
+index 80f6279..b16b9a3 100644
+--- a/tools/llvm-config/llvm-config.cpp
++++ b/tools/llvm-config/llvm-config.cpp
+@@ -497,10 +497,19 @@ 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 {
++          // sources are not installed
++          llvm::errs() << "llvm-config: sources not installed, "
++                       << Arg << " not available\n";
++          exit(1);
++        }
+       } else {
+         usage();
+       }
+diff --git a/utils/llvm-build/llvmbuild/main.py b/utils/llvm-build/llvmbuild/main.py
+index f2472f6..a29fc83 100644
+--- a/utils/llvm-build/llvmbuild/main.py
++++ b/utils/llvm-build/llvmbuild/main.py
+@@ -393,6 +393,8 @@ subdirectories = %s
+ //
+ //===----------------------------------------------------------------------===//
+ 
++#include "llvm/Config/config.h"
++
+ """)
+         f.write('struct AvailableComponent {\n')
+         f.write('  /// The name of the component.\n')
+@@ -413,7 +415,8 @@ subdirectories = %s
+             if library_name is None:
+                 library_name_as_cstr = 'nullptr'
+             else:
+-                library_name_as_cstr = '"lib%s.a"' % library_name
++                library_name_as_cstr = '"lib%s" LTDL_SHLIB_EXT' % library_name
++
+             if is_installed:
+                 is_installed_as_cstr = 'true'
+             else:
+-- 
+2.6.3
+

diff --git a/sys-devel/llvm/llvm-9999.ebuild b/sys-devel/llvm/llvm-9999.ebuild
index ce52542..e65e573 100644
--- a/sys-devel/llvm/llvm-9999.ebuild
+++ b/sys-devel/llvm/llvm-9999.ebuild
@@ -5,10 +5,10 @@
 EAPI=5
 
 : ${CMAKE_MAKEFILE_GENERATOR:=ninja}
-PYTHON_COMPAT=( python2_7 pypy )
+PYTHON_COMPAT=( python2_7 )
 
 inherit check-reqs cmake-utils eutils flag-o-matic git-r3 multilib \
-	multilib-minimal python-r1 toolchain-funcs pax-utils
+	multilib-minimal python-single-r1 toolchain-funcs pax-utils
 
 DESCRIPTION="Low Level Virtual Machine"
 HOMEPAGE="http://llvm.org/"
@@ -25,12 +25,9 @@ IUSE="clang debug +doc gold libedit +libffi lldb multitarget ncurses ocaml
 COMMON_DEPEND="
 	sys-libs/zlib:0=
 	clang? (
-		python? ( ${PYTHON_DEPS} )
-		static-analyzer? (
-			dev-lang/perl:*
-			${PYTHON_DEPS}
-		)
+		static-analyzer? ( dev-lang/perl:* )
 		xml? ( dev-libs/libxml2:2=[${MULTILIB_USEDEP}] )
+		${PYTHON_DEPS}
 	)
 	gold? ( >=sys-devel/binutils-2.22:*[cxx] )
 	libedit? ( dev-libs/libedit:0=[${MULTILIB_USEDEP}] )
@@ -68,8 +65,7 @@ PDEPEND="clang? ( =sys-devel/clang-${PV}-r100 )"
 # pypy gives me around 1700 unresolved tests due to open file limit
 # being exceeded. probably GC does not close them fast enough.
 REQUIRED_USE="${PYTHON_REQUIRED_USE}
-	lldb? ( clang xml )
-	test? ( || ( $(python_gen_useflags 'python*') ) )"
+	lldb? ( clang xml )"
 
 pkg_pretend() {
 	# in megs
@@ -176,14 +172,12 @@ src_prepare() {
 
 	# Fix llvm-config for shared linking and sane flags
 	# https://bugs.gentoo.org/show_bug.cgi?id=565358
-	epatch "${FILESDIR}"/llvm-3.7-llvm-config.patch
+	epatch "${FILESDIR}"/llvm-3.8-llvm-config.patch
 
 	if use clang; then
 		# Automatically select active system GCC's libraries, bugs #406163 and #417913
 		epatch "${FILESDIR}"/clang-3.5-gentoo-runtime-gcc-detection-v3.patch
 
-		epatch "${FILESDIR}"/clang-3.8-gentoo-install.patch
-
 		# Install clang runtime into /usr/lib/clang
 		# https://llvm.org/bugs/show_bug.cgi?id=23792
 		epatch "${FILESDIR}"/cmake/clang-0001-Install-clang-runtime-into-usr-lib-without-suffix-3.8.patch
@@ -207,11 +201,11 @@ src_prepare() {
 			-i tools/lldb/scripts/Python/modules/CMakeLists.txt || die
 	fi
 
+	python_setup
+
 	# User patches
 	epatch_user
 
-	python_setup
-
 	# Native libdir is used to hold LLVMgold.so
 	NATIVE_LIBDIR=$(get_libdir)
 }
@@ -458,42 +452,31 @@ multilib_src_install() {
 
 multilib_src_install_all() {
 	insinto /usr/share/vim/vimfiles
-	doins -r utils/vim/*/
+	doins -r utils/vim/*/.
 	# some users may find it useful
 	dodoc utils/vim/vimrc
 
 	if use clang; then
 		pushd tools/clang >/dev/null || die
 
-		python_inst() {
-			if use static-analyzer ; then
-				pushd tools/scan-view/bin >/dev/null || die
-
-				python_doscript scan-view
+		if use python ; then
+			pushd bindings/python/clang >/dev/null || die
 
-				touch __init__.py || die
-				python_moduleinto clang
-				python_domodule *.py Resources
+			python_moduleinto clang
+			python_domodule *.py
 
-				popd >/dev/null || die
-
-				# TODO: remove files installed in /usr/share
-			fi
-
-			if use python ; then
-				pushd bindings/python/clang >/dev/null || die
-
-				python_moduleinto clang
-				python_domodule *.py
+			popd >/dev/null || die
+		fi
 
-				popd >/dev/null || die
-			fi
+		# AddressSanitizer symbolizer (currently separate)
+		dobin "${S}"/projects/compiler-rt/lib/asan/scripts/asan_symbolize.py
 
-			# AddressSanitizer symbolizer (currently separate)
-			python_doscript "${S}"/projects/compiler-rt/lib/asan/scripts/asan_symbolize.py
-		}
-		python_foreach_impl python_inst
 		popd >/dev/null || die
+
+		python_fix_shebang "${ED}"
+		if use static-analyzer; then
+			python_optimize "${ED}"usr/share/scan-view
+		fi
 	fi
 }
 


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: sys-devel/llvm/files/, sys-devel/llvm/
@ 2015-12-27 22:52 Michał Górny
  0 siblings, 0 replies; 11+ messages in thread
From: Michał Górny @ 2015-12-27 22:52 UTC (permalink / raw
  To: gentoo-commits

commit:     4ea0768355d83631d0baf5c7de9b712ea2ebe12a
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Sun Dec 27 22:47:38 2015 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Sun Dec 27 22:51:59 2015 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=4ea07683

sys-devel/llvm: Backport msan fix for 4.1+ kernels, bug #569894

 .../llvm/files/compiler-rt-3.7-msan-fix.patch      |  86 ++++
 sys-devel/llvm/files/llvm-3.7-msan-fix.patch       |  79 +++
 sys-devel/llvm/llvm-3.7.0-r5.ebuild                | 540 +++++++++++++++++++++
 3 files changed, 705 insertions(+)

diff --git a/sys-devel/llvm/files/compiler-rt-3.7-msan-fix.patch b/sys-devel/llvm/files/compiler-rt-3.7-msan-fix.patch
new file mode 100644
index 0000000..3854a18
--- /dev/null
+++ b/sys-devel/llvm/files/compiler-rt-3.7-msan-fix.patch
@@ -0,0 +1,86 @@
+From 5dad120f9c9bc74c73edadb0467d8df81ae46066 Mon Sep 17 00:00:00 2001
+From: "H.J. Lu" <hjl.tools@gmail.com>
+Date: Wed, 5 Aug 2015 05:34:27 -0700
+Subject: [PATCH 08/13] Apply split-layout-compiler-rt.patch
+
+https://llvm.org/bugs/show_bug.cgi?id=24155
+---
+ lib/msan/msan.h            | 30 ++++++++++++++++++++----------
+ lib/msan/msan_allocator.cc | 12 +++++++++++-
+ 2 files changed, 31 insertions(+), 11 deletions(-)
+
+diff --git a/lib/msan/msan.h b/lib/msan/msan.h
+index cd8bc19..6251b38 100644
+--- a/lib/msan/msan.h
++++ b/lib/msan/msan.h
+@@ -94,17 +94,27 @@ const MappingDesc kMemoryLayout[] = {
+ 
+ #elif SANITIZER_LINUX && SANITIZER_WORDSIZE == 64
+ 
+-// Requries PIE binary and ASLR enabled.
+-// Main thread stack and DSOs at 0x7f0000000000 (sometimes 0x7e0000000000).
+-// Heap at 0x600000000000.
++// All of the following configurations are supported.
++// ASLR disabled: main executable and DSOs at 0x555550000000
++// PIE and ASLR: main executable and DSOs at 0x7f0000000000
++// non-PIE: main executable below 0x100000000, DSOs at 0x7f0000000000
++// Heap at 0x700000000000.
+ const MappingDesc kMemoryLayout[] = {
+-    {0x000000000000ULL, 0x200000000000ULL, MappingDesc::INVALID, "invalid"},
+-    {0x200000000000ULL, 0x400000000000ULL, MappingDesc::SHADOW, "shadow"},
+-    {0x400000000000ULL, 0x600000000000ULL, MappingDesc::ORIGIN, "origin"},
+-    {0x600000000000ULL, 0x800000000000ULL, MappingDesc::APP, "app"}};
+-
+-#define MEM_TO_SHADOW(mem) (((uptr)(mem)) & ~0x400000000000ULL)
+-#define SHADOW_TO_ORIGIN(mem) (((uptr)(mem)) + 0x200000000000ULL)
++    {0x000000000000ULL, 0x050000000000ULL, MappingDesc::APP, "app-1"},
++    {0x050000000000ULL, 0x100000000000ULL, MappingDesc::SHADOW, "shadow-2"},
++    {0x100000000000ULL, 0x150000000000ULL, MappingDesc::INVALID, "invalid"},
++    {0x150000000000ULL, 0x200000000000ULL, MappingDesc::ORIGIN, "origin-2"},
++    {0x200000000000ULL, 0x300000000000ULL, MappingDesc::SHADOW, "shadow-3"},
++    {0x300000000000ULL, 0x400000000000ULL, MappingDesc::ORIGIN, "origin-3"},
++    {0x400000000000ULL, 0x500000000000ULL, MappingDesc::INVALID, "invalid"},
++    {0x500000000000ULL, 0x550000000000ULL, MappingDesc::SHADOW, "shadow-1"},
++    {0x550000000000ULL, 0x600000000000ULL, MappingDesc::APP, "app-2"},
++    {0x600000000000ULL, 0x650000000000ULL, MappingDesc::ORIGIN, "origin-1"},
++    {0x650000000000ULL, 0x700000000000ULL, MappingDesc::INVALID, "invalid"},
++    {0x700000000000ULL, 0x800000000000ULL, MappingDesc::APP, "app-3"}};
++
++#define MEM_TO_SHADOW(mem) (((uptr)(mem)) ^ 0x500000000000ULL)
++#define SHADOW_TO_ORIGIN(mem) (((uptr)(mem)) + 0x100000000000ULL)
+ 
+ #else
+ #error "Unsupported platform"
+diff --git a/lib/msan/msan_allocator.cc b/lib/msan/msan_allocator.cc
+index 6df3566..e588bf8 100644
+--- a/lib/msan/msan_allocator.cc
++++ b/lib/msan/msan_allocator.cc
+@@ -49,7 +49,8 @@ struct MsanMapUnmapCallback {
+   typedef SizeClassAllocator32<0, SANITIZER_MMAP_RANGE_SIZE, sizeof(Metadata),
+                                SizeClassMap, kRegionSizeLog, ByteMap,
+                                MsanMapUnmapCallback> PrimaryAllocator;
+-#elif defined(__x86_64__)
++
++#elif SANITIZER_FREEBSD && SANITIZER_WORDSIZE == 64
+   static const uptr kAllocatorSpace = 0x600000000000ULL;
+   static const uptr kAllocatorSize   = 0x80000000000;  // 8T.
+   static const uptr kMetadataSize  = sizeof(Metadata);
+@@ -67,6 +68,15 @@ struct MsanMapUnmapCallback {
+   typedef SizeClassAllocator64<kAllocatorSpace, kAllocatorSize, kMetadataSize,
+                              DefaultSizeClassMap,
+                              MsanMapUnmapCallback> PrimaryAllocator;
++#elif SANITIZER_LINUX && SANITIZER_WORDSIZE == 64
++  static const uptr kAllocatorSpace = 0x700000000000ULL;
++  static const uptr kAllocatorSize   = 0x80000000000;  // 8T.
++  static const uptr kMetadataSize  = sizeof(Metadata);
++  static const uptr kMaxAllowedMallocSize = 8UL << 30;
++
++  typedef SizeClassAllocator64<kAllocatorSpace, kAllocatorSize, kMetadataSize,
++                             DefaultSizeClassMap,
++                             MsanMapUnmapCallback> PrimaryAllocator;
+ #endif
+ typedef SizeClassAllocatorLocalCache<PrimaryAllocator> AllocatorCache;
+ typedef LargeMmapAllocator<MsanMapUnmapCallback> SecondaryAllocator;
+-- 
+2.6.4
+

diff --git a/sys-devel/llvm/files/llvm-3.7-msan-fix.patch b/sys-devel/llvm/files/llvm-3.7-msan-fix.patch
new file mode 100644
index 0000000..e44baa8
--- /dev/null
+++ b/sys-devel/llvm/files/llvm-3.7-msan-fix.patch
@@ -0,0 +1,79 @@
+From 8b0f2fff6e080c053e4fd94d44a694768b8c156e Mon Sep 17 00:00:00 2001
+From: "H.J. Lu" <hjl.tools@gmail.com>
+Date: Wed, 5 Aug 2015 05:35:26 -0700
+Subject: [PATCH 78/84] Apply split-layout-llvm.patch
+
+https://llvm.org/bugs/show_bug.cgi?id=24155
+---
+ lib/Transforms/Instrumentation/MemorySanitizer.cpp | 31 ++++++++++++++++------
+ 1 file changed, 23 insertions(+), 8 deletions(-)
+
+diff --git a/lib/Transforms/Instrumentation/MemorySanitizer.cpp b/lib/Transforms/Instrumentation/MemorySanitizer.cpp
+index 286a563..2ab8bfc 100644
+--- a/lib/Transforms/Instrumentation/MemorySanitizer.cpp
++++ b/lib/Transforms/Instrumentation/MemorySanitizer.cpp
+@@ -194,6 +194,12 @@ static cl::opt<bool> ClCheckConstantShadow("msan-check-constant-shadow",
+ static const char *const kMsanModuleCtorName = "msan.module_ctor";
+ static const char *const kMsanInitName = "__msan_init";
+ 
++static cl::opt<bool> ClSplitLayout(
++    "msan-split-layout", cl::desc(
++                             "use experimental memory layout compatible with "
++                             "non-pie and non-aslr execution"),
++    cl::Hidden, cl::init(true));
++
+ namespace {
+ 
+ // Memory map parameters used in application-to-shadow address calculation.
+@@ -228,6 +234,13 @@ static const MemoryMapParams Linux_X86_64_MemoryMapParams = {
+   0x200000000000,  // OriginBase
+ };
+ 
++static const MemoryMapParams Linux_X86_64_Split_MemoryMapParams = {
++  0,               // AndMask (not used)
++  0x500000000000,  // XorMask
++  0,               // ShadowBase (not used)
++  0x100000000000,  // OriginBase
++};
++
+ // mips64 Linux
+ static const MemoryMapParams Linux_MIPS64_MemoryMapParams = {
+   0x004000000000,  // AndMask
+@@ -483,7 +496,8 @@ bool MemorySanitizer::doInitialization(Module &M) {
+     case Triple::Linux:
+       switch (TargetTriple.getArch()) {
+         case Triple::x86_64:
+-          MapParams = Linux_X86_MemoryMapParams.bits64;
++          MapParams = ClSplitLayout ? &Linux_X86_64_Split_MemoryMapParams
++                                    : Linux_X86_MemoryMapParams.bits64;
+           break;
+         case Triple::x86:
+           MapParams = Linux_X86_MemoryMapParams.bits32;
+@@ -893,16 +907,17 @@ struct MemorySanitizerVisitor : public InstVisitor<MemorySanitizerVisitor> {
+   ///
+   /// Offset = (Addr & ~AndMask) ^ XorMask
+   Value *getShadowPtrOffset(Value *Addr, IRBuilder<> &IRB) {
++    Value *OffsetLong = IRB.CreatePointerCast(Addr, MS.IntptrTy);
++
+     uint64_t AndMask = MS.MapParams->AndMask;
+-    assert(AndMask != 0 && "AndMask shall be specified");
+-    Value *OffsetLong =
+-      IRB.CreateAnd(IRB.CreatePointerCast(Addr, MS.IntptrTy),
+-                    ConstantInt::get(MS.IntptrTy, ~AndMask));
++    if (AndMask)
++      OffsetLong =
++          IRB.CreateAnd(OffsetLong, ConstantInt::get(MS.IntptrTy, ~AndMask));
+ 
+     uint64_t XorMask = MS.MapParams->XorMask;
+-    if (XorMask != 0)
+-      OffsetLong = IRB.CreateXor(OffsetLong,
+-                                 ConstantInt::get(MS.IntptrTy, XorMask));
++    if (XorMask)
++      OffsetLong =
++          IRB.CreateXor(OffsetLong, ConstantInt::get(MS.IntptrTy, XorMask));
+     return OffsetLong;
+   }
+ 
+-- 
+2.6.4
+

diff --git a/sys-devel/llvm/llvm-3.7.0-r5.ebuild b/sys-devel/llvm/llvm-3.7.0-r5.ebuild
new file mode 100644
index 0000000..cc86192
--- /dev/null
+++ b/sys-devel/llvm/llvm-3.7.0-r5.ebuild
@@ -0,0 +1,540 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+: ${CMAKE_MAKEFILE_GENERATOR:=ninja}
+PYTHON_COMPAT=( python2_7 )
+
+inherit check-reqs cmake-utils eutils flag-o-matic multilib \
+	multilib-minimal python-single-r1 toolchain-funcs pax-utils
+
+DESCRIPTION="Low Level Virtual Machine"
+HOMEPAGE="http://llvm.org/"
+SRC_URI="http://llvm.org/releases/${PV}/${P}.src.tar.xz
+	clang? ( http://llvm.org/releases/${PV}/compiler-rt-${PV}.src.tar.xz
+		http://llvm.org/releases/${PV}/cfe-${PV}.src.tar.xz
+		http://llvm.org/releases/${PV}/clang-tools-extra-${PV}.src.tar.xz )
+	lldb? ( http://llvm.org/releases/${PV}/lldb-${PV}.src.tar.xz )
+	!doc? ( http://dev.gentoo.org/~voyageur/distfiles/${P}-manpages.tar.bz2 )"
+
+LICENSE="UoI-NCSA"
+SLOT="0/${PV}"
+KEYWORDS="~amd64 ~arm ~arm64 ~ppc ~ppc64 ~sparc ~x86 ~amd64-fbsd ~x86-fbsd ~x64-freebsd ~amd64-linux ~arm-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos"
+IUSE="clang debug doc gold libedit +libffi lldb multitarget ncurses ocaml
+	python +static-analyzer test xml video_cards_radeon kernel_Darwin"
+
+COMMON_DEPEND="
+	sys-libs/zlib:0=
+	clang? (
+		python? ( ${PYTHON_DEPS} )
+		static-analyzer? (
+			dev-lang/perl:*
+			${PYTHON_DEPS}
+		)
+		xml? ( dev-libs/libxml2:2=[${MULTILIB_USEDEP}] )
+	)
+	gold? ( >=sys-devel/binutils-2.22:*[cxx] )
+	libedit? ( dev-libs/libedit:0=[${MULTILIB_USEDEP}] )
+	libffi? ( >=virtual/libffi-3.0.13-r1:0=[${MULTILIB_USEDEP}] )
+	ncurses? ( >=sys-libs/ncurses-5.9-r3:0=[${MULTILIB_USEDEP}] )
+	ocaml? (
+		>=dev-lang/ocaml-4.00.0:0=
+		dev-ml/findlib
+		dev-ml/ocaml-ctypes
+		!!<=sys-devel/llvm-3.7.0-r1[ocaml] )"
+# configparser-3.2 breaks the build (3.3 or none at all are fine)
+DEPEND="${COMMON_DEPEND}
+	dev-lang/perl
+	>=sys-devel/make-3.81
+	>=sys-devel/flex-2.5.4
+	>=sys-devel/bison-1.875d
+	|| ( >=sys-devel/gcc-3.0 >=sys-devel/llvm-3.5
+		( >=sys-freebsd/freebsd-lib-9.1-r10 sys-libs/libcxx )
+	)
+	|| ( >=sys-devel/binutils-2.18 >=sys-devel/binutils-apple-5.1 )
+	kernel_Darwin? ( sys-libs/libcxx )
+	clang? ( xml? ( virtual/pkgconfig ) )
+	doc? ( dev-python/sphinx )
+	gold? ( sys-libs/binutils-libs )
+	libffi? ( virtual/pkgconfig )
+	lldb? ( dev-lang/swig )
+	!!<dev-python/configparser-3.3.0.2
+	ocaml? ( test? ( dev-ml/ounit ) )
+	${PYTHON_DEPS}"
+RDEPEND="${COMMON_DEPEND}
+	clang? ( !<=sys-devel/clang-${PV}-r99 )
+	abi_x86_32? ( !<=app-emulation/emul-linux-x86-baselibs-20130224-r2
+		!app-emulation/emul-linux-x86-baselibs[-abi_x86_32(-)] )"
+PDEPEND="clang? ( =sys-devel/clang-${PV}-r100 )"
+
+# pypy gives me around 1700 unresolved tests due to open file limit
+# being exceeded. probably GC does not close them fast enough.
+REQUIRED_USE="${PYTHON_REQUIRED_USE}
+	lldb? ( clang xml )"
+
+S=${WORKDIR}/${P/_}.src
+
+pkg_pretend() {
+	# in megs
+	# !clang !debug !multitarget -O2       400
+	# !clang !debug  multitarget -O2       550
+	#  clang !debug !multitarget -O2       950
+	#  clang !debug  multitarget -O2      1200
+	# !clang  debug  multitarget -O2      5G
+	#  clang !debug  multitarget -O0 -g  12G
+	#  clang  debug  multitarget -O2     16G
+	#  clang  debug  multitarget -O0 -g  14G
+
+	local build_size=550
+	use clang && build_size=1200
+
+	if use debug; then
+		ewarn "USE=debug is known to increase the size of package considerably"
+		ewarn "and cause the tests to fail."
+		ewarn
+
+		(( build_size *= 14 ))
+	elif is-flagq '-g?(gdb)?([1-9])'; then
+		ewarn "The C++ compiler -g option is known to increase the size of the package"
+		ewarn "considerably. If you run out of space, please consider removing it."
+		ewarn
+
+		(( build_size *= 10 ))
+	fi
+
+	# Multiply by number of ABIs :).
+	local abis=( $(multilib_get_enabled_abis) )
+	(( build_size *= ${#abis[@]} ))
+
+	local CHECKREQS_DISK_BUILD=${build_size}M
+	check-reqs_pkg_pretend
+
+	if [[ ${MERGE_TYPE} != binary ]]; then
+		echo 'int main() {return 0;}' > "${T}"/test.cxx || die
+		ebegin "Trying to build a C++11 test program"
+		if ! $(tc-getCXX) -std=c++11 -o /dev/null "${T}"/test.cxx; then
+			eerror "LLVM-${PV} requires C++11-capable C++ compiler. Your current compiler"
+			eerror "does not seem to support -std=c++11 option. Please upgrade your compiler"
+			eerror "to gcc-4.7 or an equivalent version supporting C++11."
+			die "Currently active compiler does not support -std=c++11"
+		fi
+		eend ${?}
+	fi
+}
+
+pkg_setup() {
+	pkg_pretend
+}
+
+src_unpack() {
+	default
+
+	if use clang; then
+		mv "${WORKDIR}"/cfe-${PV/_}.src "${S}"/tools/clang \
+			|| die "clang source directory move failed"
+		mv "${WORKDIR}"/compiler-rt-${PV/_}.src "${S}"/projects/compiler-rt \
+			|| die "compiler-rt source directory move failed"
+		mv "${WORKDIR}"/clang-tools-extra-${PV/_}.src "${S}"/tools/clang/tools/extra \
+			|| die "clang-tools-extra source directory move failed"
+	fi
+
+	if use lldb; then
+		mv "${WORKDIR}"/lldb-${PV/_}.src "${S}"/tools/lldb \
+			|| die "lldb source directory move failed"
+	fi
+}
+
+src_prepare() {
+	# Make ocaml warnings non-fatal, bug #537308
+	sed -e "/RUN/s/-warn-error A//" -i test/Bindings/OCaml/*ml  || die
+	# Fix libdir for ocaml bindings install, bug #559134
+	epatch "${FILESDIR}"/cmake/${P}-ocaml-multilib.patch
+	# Do not build/install ocaml docs with USE=-doc, bug #562008
+	epatch "${FILESDIR}"/cmake/${P}-ocaml-build_doc.patch
+
+	# Make it possible to override Sphinx HTML install dirs
+	# https://llvm.org/bugs/show_bug.cgi?id=23780
+	epatch "${FILESDIR}"/cmake/0002-cmake-Support-overriding-Sphinx-HTML-doc-install-dir.patch
+
+	# Prevent race conditions with parallel Sphinx runs
+	# https://llvm.org/bugs/show_bug.cgi?id=23781
+	epatch "${FILESDIR}"/cmake/0003-cmake-Add-an-ordering-dep-between-HTML-man-Sphinx-ta.patch
+
+	# Prevent installing libgtest
+	# https://llvm.org/bugs/show_bug.cgi?id=18341
+	epatch "${FILESDIR}"/cmake/0004-cmake-Do-not-install-libgtest.patch
+
+	# Fix llvm-config for shared linking and sane flags
+	# https://bugs.gentoo.org/show_bug.cgi?id=565358
+	epatch "${FILESDIR}"/llvm-3.7-llvm-config.patch
+
+	# Fix msan with newer kernels, #569894
+	epatch "${FILESDIR}"/llvm-3.7-msan-fix.patch
+
+	if use clang; then
+		# Automatically select active system GCC's libraries, bugs #406163 and #417913
+		epatch "${FILESDIR}"/clang-3.5-gentoo-runtime-gcc-detection-v3.patch
+
+		epatch "${FILESDIR}"/clang-3.6-gentoo-install.patch
+
+		sed -i -e "s^@EPREFIX@^${EPREFIX}^" \
+			tools/clang/tools/scan-build/scan-build || die
+
+		# Install clang runtime into /usr/lib/clang
+		# https://llvm.org/bugs/show_bug.cgi?id=23792
+		epatch "${FILESDIR}"/cmake/clang-0001-Install-clang-runtime-into-usr-lib-without-suffix.patch
+		epatch "${FILESDIR}"/cmake/compiler-rt-0001-cmake-Install-compiler-rt-into-usr-lib-without-suffi.patch
+
+		# Do not force -march flags on arm platforms
+		# https://bugs.gentoo.org/show_bug.cgi?id=562706
+		epatch "${FILESDIR}"/cmake/${P}-compiler_rt_arm_march_flags.patch
+
+		# Make it possible to override CLANG_LIBDIR_SUFFIX
+		# (that is used only to find LLVMgold.so)
+		# https://llvm.org/bugs/show_bug.cgi?id=23793
+		epatch "${FILESDIR}"/cmake/clang-0002-cmake-Make-CLANG_LIBDIR_SUFFIX-overridable.patch
+
+		pushd projects/compiler-rt >/dev/null || die
+
+		# Fix msan with newer kernels, compiler-rt part, #569894
+		epatch "${FILESDIR}"/compiler-rt-3.7-msan-fix.patch
+
+		# Fix WX sections, bug #421527
+		find lib/builtins -type f -name '*.S' -exec sed \
+			 -e '$a\\n#if defined(__linux__) && defined(__ELF__)\n.section .note.GNU-stack,"",%progbits\n#endif' \
+			 -i {} + || die
+
+		popd >/dev/null || die
+	fi
+
+	if use lldb; then
+		# Do not install dummy readline.so module from
+		# https://llvm.org/bugs/show_bug.cgi?id=18841
+		sed -e 's/add_subdirectory(readline)/#&/' \
+			-i tools/lldb/scripts/Python/modules/CMakeLists.txt || die
+
+		# Fix Python paths, bugs #562436 and #562438
+		epatch "${FILESDIR}"/${PN}-3.7-lldb_python.patch
+		sed -e "s/GENTOO_LIBDIR/$(get_libdir)/" \
+			-i tools/lldb/scripts/Python/finishSwigPythonLLDB.py || die
+
+		# Fix build with ncurses[tinfo], #560474
+		# http://llvm.org/viewvc/llvm-project?view=revision&revision=247842
+		epatch "${FILESDIR}"/cmake/${P}-lldb_tinfo.patch
+	fi
+
+	# User patches
+	epatch_user
+
+	python_setup
+
+	# Native libdir is used to hold LLVMgold.so
+	NATIVE_LIBDIR=$(get_libdir)
+}
+
+multilib_src_configure() {
+	local targets
+	if use multitarget; then
+		targets=all
+	else
+		targets='host;BPF;CppBackend'
+		use video_cards_radeon && targets+=';AMDGPU'
+	fi
+
+	local ffi_cflags ffi_ldflags
+	if use libffi; then
+		ffi_cflags=$(pkg-config --cflags-only-I libffi)
+		ffi_ldflags=$(pkg-config --libs-only-L libffi)
+	fi
+
+	local libdir=$(get_libdir)
+	local mycmakeargs=(
+		"${mycmakeargs[@]}"
+		-DLLVM_LIBDIR_SUFFIX=${libdir#lib}
+
+		-DBUILD_SHARED_LIBS=ON
+		-DLLVM_ENABLE_TIMESTAMPS=OFF
+		-DLLVM_TARGETS_TO_BUILD="${targets}"
+		-DLLVM_BUILD_TESTS=$(usex test)
+
+		-DLLVM_ENABLE_FFI=$(usex libffi)
+		-DLLVM_ENABLE_TERMINFO=$(usex ncurses)
+		-DLLVM_ENABLE_ASSERTIONS=$(usex debug)
+		-DLLVM_ENABLE_EH=ON
+		-DLLVM_ENABLE_RTTI=ON
+
+		-DWITH_POLLY=OFF # TODO
+
+		-DLLVM_HOST_TRIPLE="${CHOST}"
+
+		-DFFI_INCLUDE_DIR="${ffi_cflags#-I}"
+		-DFFI_LIBRARY_DIR="${ffi_ldflags#-L}"
+
+		-DHAVE_HISTEDIT_H=$(usex libedit)
+	)
+
+	if use clang; then
+		mycmakeargs+=(
+			-DCMAKE_DISABLE_FIND_PACKAGE_LibXml2=$(usex !xml)
+			# libgomp support fails to find headers without explicit -I
+			# furthermore, it provides only syntax checking
+			-DCLANG_DEFAULT_OPENMP_RUNTIME=libomp
+		)
+	fi
+
+	if use lldb; then
+		mycmakeargs+=(
+			-DLLDB_DISABLE_LIBEDIT=$(usex !libedit)
+			-DLLDB_DISABLE_CURSES=$(usex !ncurses)
+			-DLLDB_ENABLE_TERMINFO=$(usex ncurses)
+		)
+	fi
+
+	if ! multilib_is_native_abi || ! use ocaml; then
+		mycmakeargs+=(
+			-DOCAMLFIND=NO
+		)
+	fi
+#	Note: go bindings have no CMake rules at the moment
+#	but let's kill the check in case they are introduced
+#	if ! multilib_is_native_abi || ! use go; then
+		mycmakeargs+=(
+			-DGO_EXECUTABLE=GO_EXECUTABLE-NOTFOUND
+		)
+#	fi
+
+	if multilib_is_native_abi; then
+		mycmakeargs+=(
+			-DLLVM_BUILD_DOCS=$(usex doc)
+			-DLLVM_ENABLE_SPHINX=$(usex doc)
+			-DLLVM_ENABLE_DOXYGEN=OFF
+			-DLLVM_INSTALL_HTML="${EPREFIX}/usr/share/doc/${PF}/html"
+			-DSPHINX_WARNINGS_AS_ERRORS=OFF
+			-DLLVM_INSTALL_UTILS=ON
+		)
+
+		if use clang; then
+			mycmakeargs+=(
+				-DCLANG_INSTALL_HTML="${EPREFIX}/usr/share/doc/${PF}/clang"
+			)
+		fi
+
+		if use gold; then
+			mycmakeargs+=(
+				-DLLVM_BINUTILS_INCDIR="${EPREFIX}"/usr/include
+			)
+		fi
+
+		if use lldb; then
+			mycmakeargs+=(
+				-DLLDB_DISABLE_PYTHON=$(usex !python)
+			)
+		fi
+
+	else
+		if use clang; then
+			mycmakeargs+=(
+				# disable compiler-rt on non-native ABI because:
+				# 1. it fails to configure because of -m32
+				# 2. it is shared between ABIs so no point building
+				# it multiple times
+				-DLLVM_EXTERNAL_COMPILER_RT_BUILD=OFF
+				-DLLVM_EXTERNAL_CLANG_TOOLS_EXTRA_BUILD=OFF
+			)
+		fi
+		if use lldb; then
+			mycmakeargs+=(
+				# only run swig on native abi
+				-DLLDB_DISABLE_PYTHON=ON
+			)
+		fi
+	fi
+
+	if use clang; then
+		mycmakeargs+=(
+			-DCLANG_ENABLE_ARCMT=$(usex static-analyzer)
+			-DCLANG_ENABLE_STATIC_ANALYZER=$(usex static-analyzer)
+			-DCLANG_LIBDIR_SUFFIX="${NATIVE_LIBDIR#lib}"
+		)
+
+		# -- not needed when compiler-rt is built with host compiler --
+		# cmake passes host C*FLAGS to compiler-rt build
+		# which is performed using clang, so we need to filter out
+		# some flags clang does not support
+		# (if you know some more flags that don't work, let us know)
+		#filter-flags -msahf -frecord-gcc-switches
+	fi
+
+	cmake-utils_src_configure
+}
+
+multilib_src_compile() {
+	cmake-utils_src_compile
+	# TODO: not sure why this target is not correctly called
+	multilib_is_native_abi && use doc && use ocaml && cmake-utils_src_make docs/ocaml_doc
+
+	pax-mark m "${BUILD_DIR}"/bin/llvm-rtdyld
+	pax-mark m "${BUILD_DIR}"/bin/lli
+	pax-mark m "${BUILD_DIR}"/bin/lli-child-target
+
+	if use test; then
+		pax-mark m "${BUILD_DIR}"/unittests/ExecutionEngine/Orc/OrcJITTests
+		pax-mark m "${BUILD_DIR}"/unittests/ExecutionEngine/MCJIT/MCJITTests
+		pax-mark m "${BUILD_DIR}"/unittests/Support/SupportTests
+	fi
+}
+
+multilib_src_test() {
+	# respect TMPDIR!
+	local -x LIT_PRESERVES_TMP=1
+	local test_targets=( check )
+	# clang tests won't work on non-native ABI because we skip compiler-rt
+	multilib_is_native_abi && use clang && test_targets+=( check-clang )
+	cmake-utils_src_make "${test_targets[@]}"
+}
+
+src_install() {
+	local MULTILIB_CHOST_TOOLS=(
+		/usr/bin/llvm-config
+	)
+
+	local MULTILIB_WRAPPED_HEADERS=(
+		/usr/include/llvm/Config/config.h
+		/usr/include/llvm/Config/llvm-config.h
+	)
+
+	if use clang; then
+		# note: magic applied in multilib_src_install()!
+		CLANG_VERSION=${PV%.*}
+
+		MULTILIB_CHOST_TOOLS+=(
+			/usr/bin/clang
+			/usr/bin/clang++
+			/usr/bin/clang-cl
+			/usr/bin/clang-${CLANG_VERSION}
+			/usr/bin/clang++-${CLANG_VERSION}
+			/usr/bin/clang-cl-${CLANG_VERSION}
+		)
+
+		MULTILIB_WRAPPED_HEADERS+=(
+			/usr/include/clang/Config/config.h
+		)
+	fi
+
+	multilib-minimal_src_install
+}
+
+multilib_src_install() {
+	cmake-utils_src_install
+
+	if multilib_is_native_abi; then
+		# Install man pages.
+		use doc || doman "${WORKDIR}"/${P}-manpages/*.1
+
+		# Symlink the gold plugin.
+		if use gold; then
+			dodir "/usr/${CHOST}/binutils-bin/lib/bfd-plugins"
+			dosym "../../../../$(get_libdir)/LLVMgold.so" \
+				"/usr/${CHOST}/binutils-bin/lib/bfd-plugins/LLVMgold.so"
+		fi
+	fi
+
+	# apply CHOST and CLANG_VERSION to clang executables
+	# they're statically linked so we don't have to worry about the lib
+	if use clang; then
+		local clang_tools=( clang clang++ clang-cl )
+		local i
+
+		# cmake gives us:
+		# - clang-X.Y
+		# - clang -> clang-X.Y
+		# - clang++, clang-cl -> clang
+		# we want to have:
+		# - clang-X.Y
+		# - clang++-X.Y, clang-cl-X.Y -> clang-X.Y
+		# - clang, clang++, clang-cl -> clang*-X.Y
+		# so we need to fix the two tools
+		for i in "${clang_tools[@]:1}"; do
+			rm "${ED%/}/usr/bin/${i}" || die
+			dosym "clang-${CLANG_VERSION}" "/usr/bin/${i}-${CLANG_VERSION}"
+			dosym "${i}-${CLANG_VERSION}" "/usr/bin/${i}"
+		done
+
+		# now prepend ${CHOST} and let the multilib-build.eclass symlink it
+		if ! multilib_is_native_abi; then
+			# non-native? let's replace it with a simple wrapper
+			for i in "${clang_tools[@]}"; do
+				rm "${ED%/}/usr/bin/${i}-${CLANG_VERSION}" || die
+				cat > "${T}"/wrapper.tmp <<-_EOF_
+					#!${EPREFIX}/bin/sh
+					exec "${i}-${CLANG_VERSION}" $(get_abi_CFLAGS) "\${@}"
+				_EOF_
+				newbin "${T}"/wrapper.tmp "${i}-${CLANG_VERSION}"
+			done
+		fi
+	fi
+}
+
+multilib_src_install_all() {
+	insinto /usr/share/vim/vimfiles
+	doins -r utils/vim/*/.
+	# some users may find it useful
+	dodoc utils/vim/vimrc
+
+	if use clang; then
+		pushd tools/clang >/dev/null || die
+
+		if use static-analyzer ; then
+			pushd tools/scan-build >/dev/null || die
+
+			dobin ccc-analyzer scan-build
+			dosym ccc-analyzer /usr/bin/c++-analyzer
+			doman scan-build.1
+
+			insinto /usr/share/llvm
+			doins scanview.css sorttable.js
+
+			popd >/dev/null || die
+		fi
+
+		if use static-analyzer ; then
+			pushd tools/scan-view >/dev/null || die
+
+			python_doscript scan-view
+
+			touch __init__.py || die
+			python_moduleinto clang
+			python_domodule *.py Resources
+
+			popd >/dev/null || die
+		fi
+
+		if use python ; then
+			pushd bindings/python/clang >/dev/null || die
+
+			python_moduleinto clang
+			python_domodule *.py
+
+			popd >/dev/null || die
+		fi
+
+		# AddressSanitizer symbolizer (currently separate)
+		dobin "${S}"/projects/compiler-rt/lib/asan/scripts/asan_symbolize.py
+
+		popd >/dev/null || die
+
+		python_fix_shebang "${ED}"
+		if use lldb && use python; then
+			python_optimize
+		fi
+	fi
+}
+
+pkg_postinst() {
+	if use clang; then
+		elog "To enable OpenMP support in clang, install sys-libs/libomp"
+		elog "and use the '-fopenmp=libomp' command line option"
+	fi
+}


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: sys-devel/llvm/files/, sys-devel/llvm/
@ 2016-01-07 22:10 Michał Górny
  0 siblings, 0 replies; 11+ messages in thread
From: Michał Górny @ 2016-01-07 22:10 UTC (permalink / raw
  To: gentoo-commits

commit:     7449e122ce962900ac9411971a06c2416c967e08
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Thu Jan  7 09:16:57 2016 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Thu Jan  7 22:09:41 2016 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=7449e122

sys-devel/llvm: Remove ancient 2.8 version

 sys-devel/llvm/Manifest                     |   1 -
 sys-devel/llvm/files/llvm-2.8-alignof.patch |  59 ----------
 sys-devel/llvm/files/llvm-2.8-darwin8.patch |  15 ---
 sys-devel/llvm/llvm-2.8-r2.ebuild           | 168 ----------------------------
 4 files changed, 243 deletions(-)

diff --git a/sys-devel/llvm/Manifest b/sys-devel/llvm/Manifest
index 0ece351..f23c5de 100644
--- a/sys-devel/llvm/Manifest
+++ b/sys-devel/llvm/Manifest
@@ -20,7 +20,6 @@ DIST compiler-rt-3.7.0.src.tar.xz 1192832 SHA256 227fa998520bc94974a428dc8e7654d
 DIST compiler-rt-3.7.1.src.tar.xz 1181772 SHA256 9d4769e4a927d3824bcb7a9c82b01e307c68588e6de4e7f04ab82d82c5af8181 SHA512 bf434519ea0838264c30de1e1e8681320aa868df0ecc825a45c659077b963a4120c18216946558cbf8aea24a8ac8ec39af2066dab906bc7cabc0894d51d61325 WHIRLPOOL 0bea047e48622884a6fc6bb3826046e9de5b3192006cc41c0ccd9d6c611674869c3c15988b531a0f7d9fea2cf951b90ecef385b85db765c6f99a48692fdcf223
 DIST lldb-3.7.0.src.tar.xz 10649660 SHA256 f4d7505bc111044eaa4033af012221e492938405b62522b8e3e354c20c4b71e9 SHA512 52157782ef13e2c8b7b35ff3ccc05887195fe46ddb6bafcf0707a3c46c1e034734b55342b8dbfc46cae7a8c3cb1012345284e4bedb2344c5016b8d19a12e90df WHIRLPOOL 8c0803a51820ec67944e27061c858e95a92aefa38a1540241fead2b63c5b065c1268cf958b14d8841f62fc8aea5da1e20204704426598bfc2c4e61bcda135c43
 DIST lldb-3.7.1.src.tar.xz 10650524 SHA256 9a0bc315ef55f44c98cdf92d064df0847f453ed156dd0ef6a87e04f5fd6a0e01 SHA512 d2d3e1052026edd6ef9113ff5362acb4a32cef598098b4031c35e389301130ef2e1bda594f30de4d65c9fdc0beaecdd35afcf36676eb540baad34015aca294d1 WHIRLPOOL bba9c700788f0cf86ac1de51383a223e1c92f724719cdd327d83189cb77714c1e10fb78569aeed3b3c639062a3410bb114f646a271fd0d9e8c9a8e45d090330a
-DIST llvm-2.8-r1.tgz 9112527 SHA256 25addb742f1c6cc12877ed0ee924dda962d848368ee095be8e48342ae613d43b SHA512 8688d5cf415e8aef74cca6a14587af36234a6347e2238ac2c0d66805c42926b9399f36390e1a58a4081e902b0904adb818c1a360d5df572dfa893d6f79f5e35a WHIRLPOOL 0da9250e31242b55586c9138089e742aab5d414d5f3412ebf917ae8b9506f984c6134a932be93ec7e4c01c79f6c21d508cb0b2e0ec283419bd4ae4db745430ae
 DIST llvm-2.9.tgz 9574781 SHA256 661236cfa17428b48cfa9cbb9909f7569c64b8ecd219fd91dbc00e3b557b3779 SHA512 9cb0fa0bb8ac02661fd6f926001a15e0ad4a9660683421dc86b03f1cf5184142c5815f9f9283ee7cdf8d474e01177f83406122253342e0e95ddc878821660070 WHIRLPOOL f7b445b6b5d455f29ca68c342511b8b5e6eedec525af1cc60440c4de544df2332aa241bffca29eda5d2428a3f518e093a626bd45c7f8a9e0656d0f68aef5d9d1
 DIST llvm-3.0.tar.gz 10350539 SHA256 519eb11d3499ce99c6ffdb8718651fc91425ed7690eac91c8d6853474f7c0477 SHA512 602bb5590b70cb9138bc19d8c630c62bbabdcb2132215c921fe4bce4e3f74dfc66440b9dcd458ff55a86047cc9cc0417c6563715c133e0db222e4b88f07c13bb WHIRLPOOL 6f4ece3ec747352cd78b08d25c5b1cda91140eb6957d509161e45395e47c074f8d2102bfcaeabcdef8c1f6672f2cf06d88e290667666122da029391b3528d440
 DIST llvm-3.1.src.tar.gz 11077429 SHA256 1ea05135197b5400c1f88d00ff280d775ce778f8f9ea042e25a1e1e734a4b9ab SHA512 fb941094601043e405ccc57473414ef92437b09c200e71614f93d8e93b2a58cca8d78c385be037e064b0711cd6268802c774ce4a40fc0ea17bf576305304d2aa WHIRLPOOL c5c72e139296e1c186131f991010f52f958063a4fcfcb1f8527b53a2aaa7edcaca70ab6cf86c25d08640dcf6d720a865fda7dc7eb06cf1ce9c23fd37b5d597ef

diff --git a/sys-devel/llvm/files/llvm-2.8-alignof.patch b/sys-devel/llvm/files/llvm-2.8-alignof.patch
deleted file mode 100644
index ae7f314..0000000
--- a/sys-devel/llvm/files/llvm-2.8-alignof.patch
+++ /dev/null
@@ -1,59 +0,0 @@
-Index: include/llvm/ADT/StringMap.h
-===================================================================
---- include/llvm/ADT/StringMap.h	(révision 117773)
-+++ include/llvm/ADT/StringMap.h	(révision 117774)
-@@ -167,7 +167,7 @@
- 
-     unsigned AllocSize = static_cast<unsigned>(sizeof(StringMapEntry))+
-       KeyLength+1;
--    unsigned Alignment = alignof<StringMapEntry>();
-+    unsigned Alignment = alignOf<StringMapEntry>();
- 
-     StringMapEntry *NewItem =
-       static_cast<StringMapEntry*>(Allocator.Allocate(AllocSize,Alignment));
-Index: include/llvm/Support/AlignOf.h
-===================================================================
---- include/llvm/Support/AlignOf.h	(révision 117773)
-+++ include/llvm/Support/AlignOf.h	(révision 117774)
-@@ -49,12 +49,12 @@
- 
- };
- 
--/// alignof - A templated function that returns the mininum alignment of
-+/// alignOf - A templated function that returns the mininum alignment of
- ///  of a type.  This provides no extra functionality beyond the AlignOf
- ///  class besides some cosmetic cleanliness.  Example usage:
--///  alignof<int>() returns the alignment of an int.
-+///  alignOf<int>() returns the alignment of an int.
- template <typename T>
--static inline unsigned alignof() { return AlignOf<T>::Alignment; }
-+static inline unsigned alignOf() { return AlignOf<T>::Alignment; }
- 
- } // end namespace llvm
- #endif
-Index: include/llvm/Support/Allocator.h
-===================================================================
---- include/llvm/Support/Allocator.h	(révision 117773)
-+++ include/llvm/Support/Allocator.h	(révision 117774)
-@@ -201,7 +201,7 @@
-       char *End = Slab == Allocator.CurSlab ? Allocator.CurPtr :
-                                               (char *)Slab + Slab->Size;
-       for (char *Ptr = (char*)(Slab+1); Ptr < End; Ptr += sizeof(T)) {
--        Ptr = Allocator.AlignPtr(Ptr, alignof<T>());
-+        Ptr = Allocator.AlignPtr(Ptr, alignOf<T>());
-         if (Ptr + sizeof(T) <= End)
-           reinterpret_cast<T*>(Ptr)->~T();
-       }
-Index: include/llvm/CodeGen/SlotIndexes.h
-===================================================================
---- include/llvm/CodeGen/SlotIndexes.h	(révision 117773)
-+++ include/llvm/CodeGen/SlotIndexes.h	(révision 117774)
-@@ -393,7 +393,7 @@
-       IndexListEntry *entry =
-         static_cast<IndexListEntry*>(
-           ileAllocator.Allocate(sizeof(IndexListEntry),
--          alignof<IndexListEntry>()));
-+          alignOf<IndexListEntry>()));
- 
-       new (entry) IndexListEntry(mi, index);
- 

diff --git a/sys-devel/llvm/files/llvm-2.8-darwin8.patch b/sys-devel/llvm/files/llvm-2.8-darwin8.patch
deleted file mode 100644
index 284ab47..0000000
--- a/sys-devel/llvm/files/llvm-2.8-darwin8.patch
+++ /dev/null
@@ -1,15 +0,0 @@
-Avoid like in Makefile.rules
-ld: -rpath can only be used when targeting Mac OS X 10.5 or later
-
---- unittests/Makefile.unittest
-+++ unittests/Makefile.unittest
-@@ -37,7 +37,9 @@
- ifeq ($(ENABLE_SHARED), 1)
-   # Add the absolute path to the dynamic library.  This is ok because
-   # we'll never install unittests.
-+ifneq ($(DARWIN_MAJVERS),4)
-   LD.Flags += $(RPATH) -Wl,$(SharedLibDir)
-+endif
-   # Also set {DYLD,LD}_LIBRARY_PATH because OSX ignores the rpath most
-   # of the time.
-   Run.Shared := $(SHLIBPATH_VAR)="$(SharedLibDir)$${$(SHLIBPATH_VAR):+:}$$$(SHLIBPATH_VAR)"

diff --git a/sys-devel/llvm/llvm-2.8-r2.ebuild b/sys-devel/llvm/llvm-2.8-r2.ebuild
deleted file mode 100644
index ed5e542..0000000
--- a/sys-devel/llvm/llvm-2.8-r2.ebuild
+++ /dev/null
@@ -1,168 +0,0 @@
-# Copyright 1999-2015 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-# $Id$
-
-EAPI="4"
-inherit eutils multilib toolchain-funcs
-
-DESCRIPTION="Low Level Virtual Machine"
-HOMEPAGE="http://llvm.org/"
-# Upstream silently re-released the tarball...
-# drop the -> in 2.9
-SRC_URI="http://llvm.org/releases/${PV}/${P}.tgz -> ${P}-r1.tgz"
-
-LICENSE="UoI-NCSA"
-SLOT="0"
-KEYWORDS="amd64 ppc x86 ~amd64-linux ~x86-linux ~ppc-macos"
-IUSE="debug +libffi multitarget ocaml test udis86"
-
-DEPEND="dev-lang/perl
-	>=sys-devel/make-3.79
-	>=sys-devel/flex-2.5.4
-	>=sys-devel/bison-1.875d
-	|| ( >=sys-devel/gcc-3.0 >=sys-devel/gcc-apple-4.2.1 )
-	|| ( >=sys-devel/binutils-2.18 >=sys-devel/binutils-apple-3.2.3 )
-	libffi? ( virtual/libffi )
-	ocaml? ( dev-lang/ocaml )
-	udis86? ( dev-libs/udis86[pic(+)] )"
-RDEPEND="dev-lang/perl"
-
-S=${WORKDIR}/${PN}-${PV/_pre*}
-
-pkg_setup() {
-	# need to check if the active compiler is ok
-
-	broken_gcc=" 3.2.2 3.2.3 3.3.2 4.1.1 "
-	broken_gcc_x86=" 3.4.0 3.4.2 "
-	broken_gcc_amd64=" 3.4.6 "
-
-	gcc_vers=$(gcc-fullversion)
-
-	if [[ ${broken_gcc} == *" ${version} "* ]] ; then
-		elog "Your version of gcc is known to miscompile llvm."
-		elog "Check http://www.llvm.org/docs/GettingStarted.html for"
-		elog "possible solutions."
-		die "Your currently active version of gcc is known to miscompile llvm"
-	fi
-
-	if [[ ${CHOST} == i*86-* && ${broken_gcc_x86} == *" ${version} "* ]] ; then
-		elog "Your version of gcc is known to miscompile llvm on x86"
-		elog "architectures.  Check"
-		elog "http://www.llvm.org/docs/GettingStarted.html for possible"
-		elog "solutions."
-		die "Your currently active version of gcc is known to miscompile llvm"
-	fi
-
-	if [[ ${CHOST} == x86_64-* && ${broken_gcc_amd64} == *" ${version} "* ]];
-	then
-		 elog "Your version of gcc is known to miscompile llvm in amd64"
-		 elog "architectures.  Check"
-		 elog "http://www.llvm.org/docs/GettingStarted.html for possible"
-		 elog "solutions."
-		die "Your currently active version of gcc is known to miscompile llvm"
-	 fi
-}
-
-src_prepare() {
-	# unfortunately ./configure won't listen to --mandir and the-like, so take
-	# care of this.
-	einfo "Fixing install dirs"
-	sed -e 's,^PROJ_docsdir.*,PROJ_docsdir := $(PROJ_prefix)/share/doc/'${PF}, \
-		-e 's,^PROJ_etcdir.*,PROJ_etcdir := '"${EPREFIX}"'/etc/llvm,' \
-		-e 's,^PROJ_libdir.*,PROJ_libdir := $(PROJ_prefix)/'$(get_libdir)/${PN}, \
-		-i Makefile.config.in || die "Makefile.config sed failed"
-	sed -e 's,$ABS_RUN_DIR/lib,'"${EPREFIX}"/usr/$(get_libdir)/${PN}, \
-		-i tools/llvm-config/llvm-config.in.in || die "llvm-config sed failed"
-
-	einfo "Fixing rpath and CFLAGS"
-	sed -e 's,\$(RPATH) -Wl\,\$(\(ToolDir\|LibDir\)),$(RPATH) -Wl\,'"${EPREFIX}"/usr/$(get_libdir)/${PN}, \
-		-e '/OmitFramePointer/s/-fomit-frame-pointer//' \
-		-i Makefile.rules || die "rpath sed failed"
-
-	epatch "${FILESDIR}"/${PN}-2.7-nodoctargz.patch
-	epatch "${FILESDIR}"/${PN}-2.6-commandguide-nops.patch
-	epatch "${FILESDIR}"/${PN}-2.8-darwin8.patch
-	# Upstream backport, r117774
-	epatch "${FILESDIR}"/${P}-alignof.patch
-
-	# Additional unistd.h include for GCC 4.7
-	epatch "${FILESDIR}"/${PN}-2.9-gcc4.7.patch
-
-	# User patches
-	epatch_user
-}
-
-src_configure() {
-	local CONF_FLAGS="--enable-shared"
-
-	if use debug; then
-		CONF_FLAGS="${CONF_FLAGS} --disable-optimized"
-		einfo "Note: Compiling LLVM in debug mode will create huge and slow binaries"
-		# ...and you probably shouldn't use tmpfs, unless it can hold 900MB
-	else
-		CONF_FLAGS="${CONF_FLAGS} \
-			--enable-optimized \
-			--with-optimize-option= \
-			--disable-assertions \
-			--disable-expensive-checks"
-	fi
-
-	if use multitarget; then
-		CONF_FLAGS="${CONF_FLAGS} --enable-targets=all"
-	else
-		CONF_FLAGS="${CONF_FLAGS} --enable-targets=host-only"
-	fi
-
-	if use amd64; then
-		CONF_FLAGS="${CONF_FLAGS} --enable-pic"
-	fi
-
-	CONF_FLAGS="${CONF_FLAGS} \
-		--with-llvmgccdir=/dev/null \
-		--with-llvmgcc=nope \
-		--with-llvmgxx=nope"
-
-	if use ocaml; then
-		CONF_FLAGS="${CONF_FLAGS} --enable-bindings=ocaml"
-	else
-		CONF_FLAGS="${CONF_FLAGS} --enable-bindings=none"
-	fi
-
-	if use udis86; then
-		CONF_FLAGS="${CONF_FLAGS} --with-udis86"
-	fi
-	CONF_FLAGS="${CONF_FLAGS} $(use_enable libffi)"
-	econf ${CONF_FLAGS} || die "econf failed"
-}
-
-src_compile() {
-	emake VERBOSE=1 KEEP_SYMBOLS=1 REQUIRES_RTTI=1 || die "emake failed"
-}
-
-src_install() {
-	emake KEEP_SYMBOLS=1 DESTDIR="${D}" install || die "install failed"
-
-	# Fix install_names on Darwin.  The build system is too complicated
-	# to just fix this, so we correct it post-install
-	local lib= f= odylib=
-	if [[ ${CHOST} == *-darwin* ]] ; then
-		for lib in lib{EnhancedDisassembly,LLVM-${PV},BugpointPasses,LLVMHello,LTO,profile_rt}.dylib ; do
-			# libEnhancedDisassembly is Darwin10 only, so non-fatal
-			[[ -f ${ED}/usr/lib/${PN}/${lib} ]] || continue
-			ebegin "fixing install_name of $lib"
-			install_name_tool \
-				-id "${EPREFIX}"/usr/lib/${PN}/${lib} \
-				"${ED}"/usr/lib/${PN}/${lib}
-			eend $?
-		done
-		for f in "${ED}"/usr/bin/* "${ED}"/usr/lib/${PN}/libLTO.dylib ; do
-			odylib=$(scanmacho -BF'%n#f' "${f}" | tr ',' '\n' | grep libLLVM-${PV}.dylib)
-			ebegin "fixing install_name reference to ${odylib} of ${f##*/}"
-			install_name_tool \
-				-change "${odylib}" \
-					"${EPREFIX}"/usr/lib/${PN}/libLLVM-${PV}.dylib \
-				"${f}"
-			eend $?
-		done
-	fi
-}


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: sys-devel/llvm/files/, sys-devel/llvm/
@ 2016-03-09 13:35 Bernard Cafarelli
  0 siblings, 0 replies; 11+ messages in thread
From: Bernard Cafarelli @ 2016-03-09 13:35 UTC (permalink / raw
  To: gentoo-commits

commit:     e79d6cfde502f6421df457330a87a78e51fb5601
Author:     Bernard Cafarelli <voyageur <AT> gentoo <DOT> org>
AuthorDate: Wed Mar  9 13:31:31 2016 +0000
Commit:     Bernard Cafarelli <voyageur <AT> gentoo <DOT> org>
CommitDate: Wed Mar  9 13:35:48 2016 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=e79d6cfd

sys-devel/llvm: use system six for lldb

Package-Manager: portage-2.2.27

 sys-devel/llvm/files/llvm-3.8-lldb_six.patch | 13 +++++++++++++
 sys-devel/llvm/llvm-3.8.0.ebuild             |  3 +++
 2 files changed, 16 insertions(+)

diff --git a/sys-devel/llvm/files/llvm-3.8-lldb_six.patch b/sys-devel/llvm/files/llvm-3.8-lldb_six.patch
new file mode 100644
index 0000000..324f2b8
--- /dev/null
+++ b/sys-devel/llvm/files/llvm-3.8-lldb_six.patch
@@ -0,0 +1,13 @@
+diff -Naur llvm-3.8.0.src.orig/tools/lldb/scripts/Python/finishSwigPythonLLDB.py llvm-3.8.0.src/tools/lldb/scripts/Python/finishSwigPythonLLDB.py
+--- llvm-3.8.0.src.orig/tools/lldb/scripts/Python/finishSwigPythonLLDB.py	2015-12-11 16:43:36.000000000 +0100
++++ llvm-3.8.0.src/tools/lldb/scripts/Python/finishSwigPythonLLDB.py	2016-03-09 14:12:15.614483414 +0100
+@@ -720,9 +720,6 @@
+         bOk, strMsg = create_symlinks(vDictArgs, strFrameworkPythonDir)
+ 
+     if bOk:
+-        bOk, strMsg = copy_six(vDictArgs, strFrameworkPythonDir)
+-
+-    if bOk:
+         bOk, strMsg = copy_lldbpy_file_to_lldb_pkg_dir(vDictArgs,
+                                                        strFrameworkPythonDir,
+                                                        strCfgBldDir)

diff --git a/sys-devel/llvm/llvm-3.8.0.ebuild b/sys-devel/llvm/llvm-3.8.0.ebuild
index b2b1ec3..f8e26f5 100644
--- a/sys-devel/llvm/llvm-3.8.0.ebuild
+++ b/sys-devel/llvm/llvm-3.8.0.ebuild
@@ -39,6 +39,7 @@ COMMON_DEPEND="
 	gold? ( >=sys-devel/binutils-2.22:*[cxx] )
 	libedit? ( dev-libs/libedit:0=[${MULTILIB_USEDEP}] )
 	libffi? ( >=virtual/libffi-3.0.13-r1:0=[${MULTILIB_USEDEP}] )
+	lldb? ( dev-python/six[${PYTHON_USEDEP}] )
 	ncurses? ( >=sys-libs/ncurses-5.9-r3:0=[${MULTILIB_USEDEP}] )
 	ocaml? (
 		>=dev-lang/ocaml-4.00.0:0=
@@ -216,6 +217,8 @@ src_prepare() {
 		# https://llvm.org/bugs/show_bug.cgi?id=18841
 		sed -e 's/add_subdirectory(readline)/#&/' \
 			-i tools/lldb/scripts/Python/modules/CMakeLists.txt || die
+		# Do not install bundled six module
+		epatch "${FILESDIR}"/${PN}-3.8-lldb_six.patch
 	fi
 
 	# User patches


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: sys-devel/llvm/files/, sys-devel/llvm/
@ 2016-03-28 21:31 Michał Górny
  0 siblings, 0 replies; 11+ messages in thread
From: Michał Górny @ 2016-03-28 21:31 UTC (permalink / raw
  To: gentoo-commits

commit:     234e8985ace9589ec251d7020648b9c10e4c2d25
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Mon Mar 28 21:22:50 2016 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Mon Mar 28 21:31:31 2016 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=234e8985

sys-devel/llvm: Update patches for the live ebuild

 sys-devel/llvm/files/llvm-3.9-llvm-config.patch | 72 +++++++++++++++----------
 sys-devel/llvm/llvm-9999.ebuild                 |  6 ++-
 2 files changed, 48 insertions(+), 30 deletions(-)

diff --git a/sys-devel/llvm/files/llvm-3.9-llvm-config.patch b/sys-devel/llvm/files/llvm-3.9-llvm-config.patch
index dc63b70..d4363ad 100644
--- a/sys-devel/llvm/files/llvm-3.9-llvm-config.patch
+++ b/sys-devel/llvm/files/llvm-3.9-llvm-config.patch
@@ -1,37 +1,51 @@
-diff -Naur llvm-9999.orig/tools/llvm-config/CMakeLists.txt llvm-9999/tools/llvm-config/CMakeLists.txt
---- llvm-9999.orig/tools/llvm-config/CMakeLists.txt	2016-01-25 14:47:55.447301061 +0100
-+++ llvm-9999/tools/llvm-config/CMakeLists.txt	2016-01-25 14:54:03.897257098 +0100
-@@ -22,8 +22,12 @@
- set(LLVM_SRC_ROOT ${LLVM_MAIN_SRC_DIR})
- set(LLVM_OBJ_ROOT ${LLVM_BINARY_DIR})
- set(LLVM_CPPFLAGS "${CMAKE_CPP_FLAGS} ${CMAKE_CPP_FLAGS_${uppercase_CMAKE_BUILD_TYPE}} ${LLVM_DEFINITIONS}")
+From af798c5a6e4b2c6c98cce89b5d6fc8d33f9345cf Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= <mgorny@gentoo.org>
+Date: Wed, 2 Dec 2015 16:04:56 +0100
+Subject: [PATCH 1/2] llvm-config: Clean up exported values, update for shared
+ linking
+
+Gentoo-specific fixup for llvm-config, including:
+- wiping build-specific CFLAGS, CXXFLAGS,
+- updating library suffixes for shared libs,
+- wiping --system-libs for shared linking,
+- banning --obj-root and --src-root due to no sources installed,
+- making --build-mode return "Release" rather than "Gentoo".
+
+Thanks to Steven Newbury for the initial patch.
+
+Bug: https://bugs.gentoo.org/565358
+Bug: https://bugs.gentoo.org/501684
+---
+ tools/llvm-config/CMakeLists.txt  | 11 ++++++++---
+ tools/llvm-config/llvm-config.cpp | 20 +++++++++++++++-----
+ 2 files changed, 23 insertions(+), 8 deletions(-)
+
+diff --git a/tools/llvm-config/CMakeLists.txt b/tools/llvm-config/CMakeLists.txt
+index 32d0f4c..6e99832 100644
+--- a/tools/llvm-config/CMakeLists.txt
++++ b/tools/llvm-config/CMakeLists.txt
+@@ -29,2 +29,6 @@ set(LLVM_CPPFLAGS "${CMAKE_CPP_FLAGS} ${CMAKE_CPP_FLAGS_${uppercase_CMAKE_BUILD_
+-set(LLVM_CFLAGS "${CMAKE_C_FLAGS} ${CMAKE_C_FLAGS_${uppercase_CMAKE_BUILD_TYPE}} ${LLVM_DEFINITIONS}")
+-set(LLVM_CXXFLAGS "${CMAKE_CXX_FLAGS} ${CMAKE_CXX_FLAGS_${uppercase_CMAKE_BUILD_TYPE}} ${COMPILE_FLAGS} ${LLVM_DEFINITIONS}")
 +# Just use CMAKE_CPP_FLAGS for CFLAGS and CXXFLAGS, otherwise compiler
 +# specific flags will be set when we don't know what compiler will be used
 +# with external project utilising llvm-config.  C++ Standard is required.
 +# TODO: figure out if we can remove -std=c++11 and move it to revdeps.
- set(LLVM_CFLAGS "${CMAKE_C_FLAGS} ${CMAKE_C_FLAGS_${uppercase_CMAKE_BUILD_TYPE}} ${LLVM_DEFINITIONS}")
--set(LLVM_CXXFLAGS "${CMAKE_CXX_FLAGS} ${CMAKE_CXX_FLAGS_${uppercase_CMAKE_BUILD_TYPE}} ${COMPILE_FLAGS} ${LLVM_DEFINITIONS}")
++set(LLVM_CFLAGS "${CMAKE_CPP_FLAGS} ${CMAKE_C_FLAGS_${uppercase_CMAKE_BUILD_TYPE}} ${LLVM_DEFINITIONS}")
 +set(LLVM_CXXFLAGS "${CMAKE_CPP_FLAGS} -std=c++11 ${CMAKE_CXX_FLAGS_${uppercase_CMAKE_BUILD_TYPE}} ${LLVM_DEFINITIONS}")
- set(LLVM_BUILD_SYSTEM cmake)
- set(LLVM_HAS_RTTI ${LLVM_CONFIG_HAS_RTTI})
- set(LLVM_DYLIB_VERSION "${LLVM_VERSION_MAJOR}.${LLVM_VERSION_MINOR}${LLVM_VERSION_SUFFIX}")
-@@ -31,7 +35,8 @@
- # Use the C++ link flags, since they should be a superset of C link flags.
- set(LLVM_LDFLAGS "${CMAKE_CXX_LINK_FLAGS}")
- set(LLVM_BUILDMODE ${CMAKE_BUILD_TYPE})
+@@ -39 +43,2 @@ set(LLVM_BUILDMODE ${CMAKE_BUILD_TYPE})
 -set(LLVM_SYSTEM_LIBS ${SYSTEM_LIBS})
 +# We don't do static libs, so we don't need to supply any system-libs
 +set(LLVM_SYSTEM_LIBS "")
- if(BUILD_SHARED_LIBS)
-   set(LLVM_ENABLE_SHARED ON)
- else()
-diff -Naur llvm-9999.orig/tools/llvm-config/llvm-config.cpp llvm-9999/tools/llvm-config/llvm-config.cpp
---- llvm-9999.orig/tools/llvm-config/llvm-config.cpp	2016-01-25 14:47:55.447301061 +0100
-+++ llvm-9999/tools/llvm-config/llvm-config.cpp	2016-01-25 14:57:05.286236312 +0100
-@@ -532,10 +532,19 @@
-         OS << LLVM_HAS_RTTI << '\n';
-       } else if (Arg == "--shared-mode") {
-         PrintSharedMode = true;
+diff --git a/tools/llvm-config/llvm-config.cpp b/tools/llvm-config/llvm-config.cpp
+index 94d426b..fb1bdfa 100644
+--- a/tools/llvm-config/llvm-config.cpp
++++ b/tools/llvm-config/llvm-config.cpp
+@@ -525 +525,2 @@ int main(int argc, char **argv) {
+-        OS << build_mode << '\n';
++        // force Release since we force non-standard Gentoo build mode
++        OS << "Release" << '\n';
+@@ -540,4 +541,13 @@ int main(int argc, char **argv) {
 -      } else if (Arg == "--obj-root") {
 -        OS << ActivePrefix << '\n';
 -      } else if (Arg == "--src-root") {
@@ -49,6 +63,6 @@ diff -Naur llvm-9999.orig/tools/llvm-config/llvm-config.cpp llvm-9999/tools/llvm
 +                       << Arg << " not available\n";
 +          exit(1);
 +        }
-       } else if (Arg == "--link-shared") {
-         LinkMode = LinkModeShared;
-       } else if (Arg == "--link-static") {
+-- 
+2.7.4
+

diff --git a/sys-devel/llvm/llvm-9999.ebuild b/sys-devel/llvm/llvm-9999.ebuild
index 14c5da5..80eef1b 100644
--- a/sys-devel/llvm/llvm-9999.ebuild
+++ b/sys-devel/llvm/llvm-9999.ebuild
@@ -165,6 +165,10 @@ src_prepare() {
 	# https://bugs.gentoo.org/show_bug.cgi?id=565358
 	eapply "${FILESDIR}"/llvm-3.9-llvm-config.patch
 
+	# Restore SOVERSIONs for shared libraries
+	# https://bugs.gentoo.org/show_bug.cgi?id=578392
+	eapply "${FILESDIR}"/llvm-3.8-soversion.patch
+
 	# disable use of SDK on OSX, bug #568758
 	sed -i -e 's/xcrun/false/' utils/lit/lit/util.py || die
 
@@ -223,7 +227,7 @@ multilib_src_configure() {
 	local mycmakeargs=(
 		-DLLVM_LIBDIR_SUFFIX=${libdir#lib}
 
-		-DLLVM_LINK_LLVM_DYLIB=ON
+		-DBUILD_SHARED_LIBS=ON
 		-DLLVM_ENABLE_TIMESTAMPS=OFF
 		-DLLVM_TARGETS_TO_BUILD="${targets}"
 		-DLLVM_BUILD_TESTS=$(usex test)


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: sys-devel/llvm/files/, sys-devel/llvm/
@ 2016-05-12 11:49 Michał Górny
  0 siblings, 0 replies; 11+ messages in thread
From: Michał Górny @ 2016-05-12 11:49 UTC (permalink / raw
  To: gentoo-commits

commit:     0cb681567736f4f580e0d0a9aae65553566109c1
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Wed May 11 20:52:13 2016 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Thu May 12 11:48:41 2016 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=0cb68156

sys-devel/llvm: Backport upstream patch for gcc4.9 Gentoo header paths

 .../llvm/files/clang-3.8-gcc4.9-search-path.patch  | 70 ++++++++++++++++++++++
 .../{llvm-3.7.1-r1.ebuild => llvm-3.7.1-r2.ebuild} |  4 ++
 .../{llvm-3.8.0-r1.ebuild => llvm-3.8.0-r2.ebuild} |  4 ++
 3 files changed, 78 insertions(+)

diff --git a/sys-devel/llvm/files/clang-3.8-gcc4.9-search-path.patch b/sys-devel/llvm/files/clang-3.8-gcc4.9-search-path.patch
new file mode 100644
index 0000000..bafe218
--- /dev/null
+++ b/sys-devel/llvm/files/clang-3.8-gcc4.9-search-path.patch
@@ -0,0 +1,70 @@
+From af4db76e059c1a3f4a7f437001051ccebc8a50fe Mon Sep 17 00:00:00 2001
+From: Chandler Carruth <chandlerc@gmail.com>
+Date: Sun, 8 May 2016 07:59:56 +0000
+Subject: [PATCH] Teach header search about GCC 4.9 header search paths in
+ Gentoo, they now use the full GCC version in their weird suffix.
+
+git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@268874 91177308-0d34-0410-b5e6-96231b3b80d8
+---
+ lib/Driver/ToolChains.cpp                                 |  1 +
+ .../Inputs/gentoo_linux_gcc_4.9.3_tree/usr/include/.keep  |  0
+ .../usr/lib/gcc/x86_64-pc-linux-gnu/4.9.3/crtbegin.o      |  0
+ .../x86_64-pc-linux-gnu/4.9.3/include/g++-v4.9.3/.keep    |  0
+ .../usr/x86_64-pc-linux-gnu/lib/.keep                     |  0
+ test/Driver/linux-header-search.cpp                       | 15 +++++++++++++++
+ 6 files changed, 16 insertions(+)
+ create mode 100644 test/Driver/Inputs/gentoo_linux_gcc_4.9.3_tree/usr/include/.keep
+ create mode 100644 test/Driver/Inputs/gentoo_linux_gcc_4.9.3_tree/usr/lib/gcc/x86_64-pc-linux-gnu/4.9.3/crtbegin.o
+ create mode 100644 test/Driver/Inputs/gentoo_linux_gcc_4.9.3_tree/usr/lib/gcc/x86_64-pc-linux-gnu/4.9.3/include/g++-v4.9.3/.keep
+ create mode 100644 test/Driver/Inputs/gentoo_linux_gcc_4.9.3_tree/usr/x86_64-pc-linux-gnu/lib/.keep
+
+diff --git a/tools/clang/lib/Driver/ToolChains.cpp b/tools/clang/lib/Driver/ToolChains.cpp
+index f905b5d..1bf17e4 100644
+--- a/tools/clang/lib/Driver/ToolChains.cpp
++++ b/tools/clang/lib/Driver/ToolChains.cpp
+@@ -4134,6 +4134,7 @@ void Linux::AddClangCXXStdlibIncludeArgs(const ArgList &DriverArgs,
+   const std::string LibStdCXXIncludePathCandidates[] = {
+       // Gentoo is weird and places its headers inside the GCC install,
+       // so if the first attempt to find the headers fails, try these patterns.
++      InstallDir.str() + "/include/g++-v" + Version.Text,
+       InstallDir.str() + "/include/g++-v" + Version.MajorStr + "." +
+           Version.MinorStr,
+       InstallDir.str() + "/include/g++-v" + Version.MajorStr,
+diff --git a/tools/clang/test/Driver/Inputs/gentoo_linux_gcc_4.9.3_tree/usr/include/.keep b/tools/clang/test/Driver/Inputs/gentoo_linux_gcc_4.9.3_tree/usr/include/.keep
+new file mode 100644
+index 0000000..e69de29
+diff --git a/tools/clang/test/Driver/Inputs/gentoo_linux_gcc_4.9.3_tree/usr/lib/gcc/x86_64-pc-linux-gnu/4.9.3/crtbegin.o b/tools/clang/test/Driver/Inputs/gentoo_linux_gcc_4.9.3_tree/usr/lib/gcc/x86_64-pc-linux-gnu/4.9.3/crtbegin.o
+new file mode 100644
+index 0000000..e69de29
+diff --git a/tools/clang/test/Driver/Inputs/gentoo_linux_gcc_4.9.3_tree/usr/lib/gcc/x86_64-pc-linux-gnu/4.9.3/include/g++-v4.9.3/.keep b/tools/clang/test/Driver/Inputs/gentoo_linux_gcc_4.9.3_tree/usr/lib/gcc/x86_64-pc-linux-gnu/4.9.3/include/g++-v4.9.3/.keep
+new file mode 100644
+index 0000000..e69de29
+diff --git a/tools/clang/test/Driver/Inputs/gentoo_linux_gcc_4.9.3_tree/usr/x86_64-pc-linux-gnu/lib/.keep b/tools/clang/test/Driver/Inputs/gentoo_linux_gcc_4.9.3_tree/usr/x86_64-pc-linux-gnu/lib/.keep
+new file mode 100644
+index 0000000..e69de29
+diff --git a/tools/clang/test/Driver/linux-header-search.cpp b/tools/clang/test/Driver/linux-header-search.cpp
+index 9568bde..5f6ac50 100644
+--- a/tools/clang/test/Driver/linux-header-search.cpp
++++ b/tools/clang/test/Driver/linux-header-search.cpp
+@@ -285,6 +285,21 @@
+ // CHECK-GENTOO-4-6-4: "-internal-isystem" "[[RESOURCE_DIR]]{{/|\\\\}}include"
+ // CHECK-GENTOO-4-6-4: "-internal-externc-isystem" "[[SYSROOT]]/include"
+ // CHECK-GENTOO-4-6-4: "-internal-externc-isystem" "[[SYSROOT]]/usr/include"
++// RUN: %clang -no-canonical-prefixes %s -### -fsyntax-only 2>&1 \
++// RUN:     -target x86_64-unknown-linux-gnu -stdlib=libstdc++ \
++// RUN:     --sysroot=%S/Inputs/gentoo_linux_gcc_4.9.3_tree \
++// RUN:     --gcc-toolchain="" \
++// RUN:   | FileCheck --check-prefix=CHECK-GENTOO-4-9-3 %s
++// CHECK-GENTOO-4-9-3: "{{.*}}clang{{.*}}" "-cc1"
++// CHECK-GENTOO-4-9-3: "-resource-dir" "[[RESOURCE_DIR:[^"]+]]"
++// CHECK-GENTOO-4-9-3: "-isysroot" "[[SYSROOT:[^"]+]]"
++// CHECK-GENTOO-4-9-3: "-internal-isystem" "[[SYSROOT]]/usr/lib/gcc/x86_64-pc-linux-gnu/4.9.3/include/g++-v4.9.3"
++// CHECK-GENTOO-4-9-3: "-internal-isystem" "[[SYSROOT]]/usr/lib/gcc/x86_64-pc-linux-gnu/4.9.3/include/g++-v4.9.3/x86_64-pc-linux-gnu"
++// CHECK-GENTOO-4-9-3: "-internal-isystem" "[[SYSROOT]]/usr/lib/gcc/x86_64-pc-linux-gnu/4.9.3/include/g++-v4.9.3/backward"
++// CHECK-GENTOO-4-9-3: "-internal-isystem" "[[SYSROOT]]/usr/local/include"
++// CHECK-GENTOO-4-9-3: "-internal-isystem" "[[RESOURCE_DIR]]{{/|\\\\}}include"
++// CHECK-GENTOO-4-9-3: "-internal-externc-isystem" "[[SYSROOT]]/include"
++// CHECK-GENTOO-4-9-3: "-internal-externc-isystem" "[[SYSROOT]]/usr/include"
+ //
+ // Check header search on Debian 6 / MIPS64
+ // RUN: %clang -no-canonical-prefixes %s -### -fsyntax-only 2>&1 \

diff --git a/sys-devel/llvm/llvm-3.7.1-r1.ebuild b/sys-devel/llvm/llvm-3.7.1-r2.ebuild
similarity index 99%
rename from sys-devel/llvm/llvm-3.7.1-r1.ebuild
rename to sys-devel/llvm/llvm-3.7.1-r2.ebuild
index 7bd5432..10e5e16 100644
--- a/sys-devel/llvm/llvm-3.7.1-r1.ebuild
+++ b/sys-devel/llvm/llvm-3.7.1-r2.ebuild
@@ -178,6 +178,10 @@ src_prepare() {
 		# Automatically select active system GCC's libraries, bugs #406163 and #417913
 		eapply "${FILESDIR}"/clang-3.5-gentoo-runtime-gcc-detection-v3.patch
 
+		# Support gcc4.9 search paths
+		# https://github.com/llvm-mirror/clang/commit/af4db76e059c1a3
+		eapply "${FILESDIR}"/clang-3.8-gcc4.9-search-path.patch
+
 		eapply "${FILESDIR}"/clang-3.6-gentoo-install.patch
 
 		eapply "${FILESDIR}"/clang-3.4-darwin_prefix-include-paths.patch

diff --git a/sys-devel/llvm/llvm-3.8.0-r1.ebuild b/sys-devel/llvm/llvm-3.8.0-r2.ebuild
similarity index 98%
rename from sys-devel/llvm/llvm-3.8.0-r1.ebuild
rename to sys-devel/llvm/llvm-3.8.0-r2.ebuild
index fe8e3e7..71a927f 100644
--- a/sys-devel/llvm/llvm-3.8.0-r1.ebuild
+++ b/sys-devel/llvm/llvm-3.8.0-r2.ebuild
@@ -174,6 +174,10 @@ src_prepare() {
 		# Automatically select active system GCC's libraries, bugs #406163 and #417913
 		eapply "${FILESDIR}"/clang-3.5-gentoo-runtime-gcc-detection-v3.patch
 
+		# Support gcc4.9 search paths
+		# https://github.com/llvm-mirror/clang/commit/af4db76e059c1a3
+		eapply "${FILESDIR}"/clang-3.8-gcc4.9-search-path.patch
+
 		eapply "${FILESDIR}"/clang-3.4-darwin_prefix-include-paths.patch
 		eprefixify tools/clang/lib/Frontend/InitHeaderSearch.cpp
 


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: sys-devel/llvm/files/, sys-devel/llvm/
@ 2016-06-05 11:47 Michał Górny
  0 siblings, 0 replies; 11+ messages in thread
From: Michał Górny @ 2016-06-05 11:47 UTC (permalink / raw
  To: gentoo-commits

commit:     52df7e44c300fcc88fdf8dabe46c75387603715a
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Sat Jun  4 19:28:40 2016 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Sun Jun  5 11:47:40 2016 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=52df7e44

sys-devel/llvm: Drop 3.3

 sys-devel/llvm/Manifest                            |   4 -
 .../llvm/files/clang-3.3-gcc-header-path.patch     |  90 ----
 .../llvm/files/clang-3.3-gentoo-install.patch      |  71 ---
 sys-devel/llvm/files/llvm-3.3-R600_debug.patch     |  22 -
 .../llvm/files/llvm-3.3-r2-gentoo-install.patch    | 117 -----
 sys-devel/llvm/llvm-3.3-r3.ebuild                  | 500 ---------------------
 6 files changed, 804 deletions(-)

diff --git a/sys-devel/llvm/Manifest b/sys-devel/llvm/Manifest
index d1c47a0..be88838 100644
--- a/sys-devel/llvm/Manifest
+++ b/sys-devel/llvm/Manifest
@@ -1,4 +1,3 @@
-DIST cfe-3.3.src.tar.gz 9425539 SHA256 b1b55de4ab3a57d3e0331a83e0284610191c77d924e3446498d9113d08dfb996 SHA512 06773f43f7d3529f06edb029f7de398f06a700a0f2476e00c4727e70c291028221bfac23625dfd2c220d6ac91a21670848187a934b99a21801c695127371afcc WHIRLPOOL 8b97b527f19015dd3283b9e174615170e639793f64c635ccc4ee4d8216f8de759fd0121a8ef3513fa1c6ad19b31aa3529091ffb44a01ee858edfef400881596a
 DIST cfe-3.4.2.src.tar.gz 10612313 SHA256 5ba6f5772f8d00f445209356a7daf83c5bca2da5acd10de517ad2359ae95bc10 SHA512 e01fa8e312e9b3b7b3cb572ac21349161aaa50078ecfe7bded273b75db4a0c44acde524f8fdfcbeec54c61eeeb8339e9917d1f205a8fda18e34fe7ccbe89c36d WHIRLPOOL 153208b1a60bb5fbe92a7162cb26bbe70d591e7db9dcf06fcd54efc539bbff0403ec88e64236969c9f256e5586bc333840bd6178fd158577d6fe228d9edd4dcd
 DIST cfe-3.5.0.src.tar.xz 8233432 SHA256 fc80992e004b06f6c7afb612de1cdaa9ac9d25811c55f94fcf7331d9b81cdb8b SHA512 b26a5e2cd81c150607c23b22fafc0d9c7f12b83b45e476b8e75bf5e99d42be7c98ffeac7349df664f01b00900864a01429860b298e48961861377a4b2daf3e49 WHIRLPOOL 5dd8b6fe97933b74f1668b1d753c16cd3bcd05ccf72aac1283aa449caf93f5ba88ae79e7668f7e79b554e1421549a87af21c86cf92657c1b4d77744165718ce7
 DIST cfe-3.5.2.src.tar.xz 8268008 SHA256 4feb575f74fb3a74b6245400460230141bf610f235ef3a25008cfe6137828620 SHA512 2ad9a7daa8e62cdbf47b001aa6b937a06ae7e6396dcd1832797e2d98036522443ccfca9f1253e16d531a99d1edf237fcd2b457c55491ff68ca4534a2396ca52f WHIRLPOOL 51789ba2a3193d404b26d26b999fc47f1bc4b56b45048078cc51e4ff5c31d834d360ee0c2d16096c060f85acab6de9055dc375569348ae3307e4b280406f2d9e
@@ -11,7 +10,6 @@ DIST clang-tools-extra-3.5.2.src.tar.xz 215804 SHA256 f21a374d74b194d8c984546266
 DIST clang-tools-extra-3.6.2.src.tar.xz 248624 SHA256 6a0ec627d398f501ddf347060f7a2ccea4802b2494f1d4fd7bda3e0442d04feb SHA512 1b7710a7deee30cefb6a3b4edb026a96d8935a0c6f3056ccdb7a45564d10baf01a4f6722ae853ad9a3bad17e8de32a3c0ec99c5cf6144647a5e182809d403f7a WHIRLPOOL 3dc8888c302bac84f53b673784dec092a2c59ea2985d9983e87f057b9aa7b5d3e34cf13d2b0f1f60ea44f342b8167377204a510036872a087037cf02335c19cd
 DIST clang-tools-extra-3.7.1.src.tar.xz 277476 SHA256 4a91edaccad1ce984c7c49a4a87db186b7f7b21267b2b03bcf4bd7820715bc6b SHA512 06e2db8af75f1e6ee82da6ee723b5256b9e3f6ba196428f18944ec02d07df26d04329ca8824a083c5f25274ce7e3469aa75e3a29ccfbdb6375524841d65e3ad7 WHIRLPOOL 2c1a459d6aff6bc24d5c8d38120ab665adbef61394050781a9707d50e83dae1b4997ed19459086e9bd7f6dd38a09c295d135e33515c947d64a7f1ab714ad8beb
 DIST clang-tools-extra-3.8.0.src.tar.xz 334072 SHA256 afbda810106a6e64444bc164b921be928af46829117c95b996f2678ce4cb1ec4 SHA512 f0e593a76df5485f403079bd2fbb4e51c3d1c3fc4e63e2c2910894e8f2a7c14b47265435f3c52f035fb3fe2f595812d0f9869235296157a39c071a23e6a8b178 WHIRLPOOL 4928669a3c019eebe0a98ee72e25ef70ddf3c1d29e6a4aa18e408276b2a870069460c39e0e8fbe960d8d56127bb6951433d1fd89015d192951004e527b065ec9
-DIST compiler-rt-3.3.src.tar.gz 1568034 SHA256 0e2f3180d6316e6c43f064fdd406c5c6515e682c5f31c57c28335b68c7525423 SHA512 3e86aa8ab9810b4fbac54a40fc93a717a55c642520858c0db215a5324c1e495b4d8fcec9620251cca8e4e5f9afa34bc14364d7f785880a0700469d0201827929 WHIRLPOOL fcfd06bc860dfd901a7576cd4309f863e9d4363e36ab4c67e9e08fe3c8a37d627ee95eb96b9ed53eb6047dec06e73181b3c3e1555b1b49f1e893e6382f21ddc1
 DIST compiler-rt-3.4.src.tar.gz 1858593 SHA256 f37c89b1383ce462d47537a0245ac798600887a9be9f63073e16b79ed536ab5c SHA512 70efffaf12ff7c15befa87ce808489c6f6b6eb421d0ab5d8ecd525239efc8aab850c7ed34b31a993ff5e499657b72598619945cc4461fe3e5359e9a94aaac0c8 WHIRLPOOL ad558b5877a01e476d30d2757959ab04be0c385b2fe3442bcc578bf36c6f3214cd78b4adda24fcb1f3b2b84353db213b82e8d7d4c40e66c3f57aed3a49322dbc
 DIST compiler-rt-3.5.0.src.tar.xz 1088352 SHA256 a4b3e655832bf8d9a357ea2c771db347237460e131988cbb96cda40ff39a8136 SHA512 862cce2d6b398bd1a8399496a547e6ab976a31f676528beebfbea5fd7dc54aa72e1c25deefa12f6167096521eba74090565b0168806451da02ddac04e922fc48 WHIRLPOOL 248acf997d70d7904aa79bf83e0c02ba4e5f8c2812c03f44a8e1e31b845a654f250c09ec6a123f9245d0db8713e8cc5a4087b9ce785af4f5eb7e55d9dbd362a2
 DIST compiler-rt-3.5.2.src.tar.xz 1093000 SHA256 542d7aadd21e7fe35bea0a7912bc965f08a1a566746cebcca76f96dcfeb74dc3 SHA512 319a8a1dbe07eb4f1fcccfe79a1fa445f348fb854a441500e89fa0a128e45716b65d06347f19a63de32e9294cd2331e914ae0d5fe8224f0b2452c39b79ac96ff WHIRLPOOL 6e9286c56a60a515006c8232ca01622ae844185a5f31fb49bce632868862c5e560619f1c45da66878b5322a764f91a284cd296e9f13105d6f74e055a17321d93
@@ -20,8 +18,6 @@ DIST compiler-rt-3.7.1.src.tar.xz 1181772 SHA256 9d4769e4a927d3824bcb7a9c82b01e3
 DIST compiler-rt-3.8.0.src.tar.xz 1270128 SHA256 c8d3387e55f229543dac1941769120f24dc50183150bf19d1b070d53d29d56b0 SHA512 21ba548b6b35a79aa291adba7f83db14c33855fa3cf376f2ad75bd22bb454501b74f0ea4f71bc03a864135862c800b101d3cd790e54e687c2a3459c64218b9c3 WHIRLPOOL 63ceb498fbc4083afda4f4aa12e44b8a6d2b58408edacd7d578d3cd6a63f0c1074e453b950fae4fee51690b3f79700e7752b6ceb3e6980c88541314993ce71a5
 DIST lldb-3.7.1.src.tar.xz 10650524 SHA256 9a0bc315ef55f44c98cdf92d064df0847f453ed156dd0ef6a87e04f5fd6a0e01 SHA512 d2d3e1052026edd6ef9113ff5362acb4a32cef598098b4031c35e389301130ef2e1bda594f30de4d65c9fdc0beaecdd35afcf36676eb540baad34015aca294d1 WHIRLPOOL bba9c700788f0cf86ac1de51383a223e1c92f724719cdd327d83189cb77714c1e10fb78569aeed3b3c639062a3410bb114f646a271fd0d9e8c9a8e45d090330a
 DIST lldb-3.8.0.src.tar.xz 10929768 SHA256 e3f68f44147df0433e7989bf6ed1c58ff28d7c68b9c47553cb9915f744785a35 SHA512 a491209ae12b0c7d938ebd94362396a50922326ed24ed11f71b1f19b61274a34a92d2bd46857b44081e7fa3e6d0a641d148bd4022f8edf71f80ff2aa7a55ebef WHIRLPOOL c498c22acab867419143745ce0212c70bdfc141dbae19ab53221908eba7961aae6a029cbad01b8409e6fbc187550141ed87f32366dd847ac57754891fbbc4049
-DIST llvm-3.3-manpages.tar.bz2 27098 SHA256 46bb22d63d5fe7dd04e1a7bb7e16c03d93f2ed51d31540cfb9d97ed70059aa77 SHA512 6f24b66b13025d0606908f91ad9b4fc6de1b4aac2d97d261f6b989065476cf153d2f84792f8dd4972b95fb1a45a3931c328df3bcf8ce5ab21170a7a912a39783 WHIRLPOOL 31b9c3635b698f404b75b87c7891b4b6be9cbeb6062bcb6fba5476b0b3069a486ba60c27ab2b12b8a2da9404f666617162041860f023951050a9fc4c7d27748a
-DIST llvm-3.3.src.tar.gz 13602421 SHA256 68766b1e70d05a25e2f502e997a3cb3937187a3296595cf6e0977d5cd6727578 SHA512 1b7f7c5e907a68f642dcbe48fdff9585cb1504022bc9d386f310ebe5d25103d0d5f7cf0abf19e0e3fd666970160a98c90033754e2b79b2fac0cf866c984f8038 WHIRLPOOL a89c0b470fde562a3402e7878b91bc0573d433ca0a60e62c9c46946d7948a4fb657b116b6bac032555e29c70d82c751876adb398fe240f5c8d0a9a2378ce1866
 DIST llvm-3.4-manpages.tar.bz2 33753 SHA256 dc2616104cf333dd9ef56b2d31f9a36e81303e2c5756ff8bc221e05b46f7e1cb SHA512 8e438a9392c9b896ccb2b1460a8f57ffa01633e3a6bba61e2bf2f718d970ff96c17d63b0bc0d4da1162e1d1dc4cb9b2a9e9a14a722e8a5b5d2f205f037ae665d WHIRLPOOL 1c037a9972442937f84bc3147d77d4bbc6d6c0812c3025f3107c2ee5f6259afab990f6e1bca564237fdca8089e2372df4b7ca45cbdea686fbf891f92d1bfbbe6
 DIST llvm-3.4.2.src.tar.gz 15938155 SHA256 17038d47069ad0700c063caed76f0c7259628b0e79651ce2b540d506f2f1efd7 SHA512 6c1453f7d9d9110257db3574cc4f6227fed8938705cbb09851ac09a868089b48f1556a1b6e758aff6d97520b08b5605d3ed20411ad9dd22cdc573d62176905f0 WHIRLPOOL f8b4d5167469e6f350ec41aede04e7b756e18f3d8e78b3270beb5791310a7b9b13c69e57c8bcfefbd0a78efc0c40e3b75a9a158eac72c025b7c77146e8dfaf7c
 DIST llvm-3.5.0-manpages.tar.bz2 35314 SHA256 724e752a60016dce8cc536658906d3646c600e977374e0ea692a5d0fe2d4a021 SHA512 d99d6096d7f21a81923297584fe5eeb23e0d83d4538fe376615c92fffc8aff3189999f7ab3c537b5aa5d6bc2c22c53eb05717d48c7ab99c42315b8665bac62c3 WHIRLPOOL 68ced06ee6678c5333c662eb1cc0da744c5a184b12dd059c1b77ec200b1d3cc231f270b9d9b6e177d728776894277b3f9061338aa55620c90474eb97915b7819

diff --git a/sys-devel/llvm/files/clang-3.3-gcc-header-path.patch b/sys-devel/llvm/files/clang-3.3-gcc-header-path.patch
deleted file mode 100644
index dc9a4f7..0000000
--- a/sys-devel/llvm/files/clang-3.3-gcc-header-path.patch
+++ /dev/null
@@ -1,90 +0,0 @@
-Backport handling of 'g++-vX.Y' header location.
-
-Fixes: https://bugs.gentoo.org/show_bug.cgi?id=487584
----
- tools/clang/lib/Driver/ToolChains.cpp | 20 ++++++++++++--------
- tools/clang/lib/Driver/ToolChains.h   |  3 +++
- 2 files changed, 15 insertions(+), 8 deletions(-)
-
-diff --git a/tools/clang/lib/Driver/ToolChains.cpp b/tools/clang/lib/Driver/ToolChains.cpp
-index 7c9e9c0..e38d42d 100644
---- a/tools/clang/lib/Driver/ToolChains.cpp
-+++ b/tools/clang/lib/Driver/ToolChains.cpp
-@@ -917,17 +917,19 @@ Darwin_Generic_GCC::ComputeEffectiveClangTriple(const ArgList &Args,
- /// This is the primary means of forming GCCVersion objects.
- /*static*/
- Generic_GCC::GCCVersion Linux::GCCVersion::Parse(StringRef VersionText) {
--  const GCCVersion BadVersion = { VersionText.str(), -1, -1, -1, "" };
-+  const GCCVersion BadVersion = { VersionText.str(), -1, -1, -1, "", "", "" };
-   std::pair<StringRef, StringRef> First = VersionText.split('.');
-   std::pair<StringRef, StringRef> Second = First.second.split('.');
- 
--  GCCVersion GoodVersion = { VersionText.str(), -1, -1, -1, "" };
-+  GCCVersion GoodVersion = { VersionText.str(), -1, -1, -1, "", "", "" };
-   if (First.first.getAsInteger(10, GoodVersion.Major) ||
-       GoodVersion.Major < 0)
-     return BadVersion;
-+  GoodVersion.MajorStr = First.first.str();
-   if (Second.first.getAsInteger(10, GoodVersion.Minor) ||
-       GoodVersion.Minor < 0)
-     return BadVersion;
-+  GoodVersion.MinorStr = Second.first.str();
- 
-   // First look for a number prefix and parse that if present. Otherwise just
-   // stash the entire patch string in the suffix, and leave the number
-@@ -945,7 +947,7 @@ Generic_GCC::GCCVersion Linux::GCCVersion::Parse(StringRef VersionText) {
-       if (PatchText.slice(0, EndNumber).getAsInteger(10, GoodVersion.Patch) ||
-           GoodVersion.Patch < 0)
-         return BadVersion;
--      GoodVersion.PatchSuffix = PatchText.substr(EndNumber).str();
-+      GoodVersion.PatchSuffix = PatchText.substr(EndNumber);
-     }
-   }
- 
-@@ -2590,11 +2592,11 @@ void Linux::AddClangCXXStdlibIncludeArgs(const ArgList &DriverArgs,
-   // equivalent to '/usr/include/c++/X.Y' in almost all cases.
-   StringRef LibDir = GCCInstallation.getParentLibPath();
-   StringRef InstallDir = GCCInstallation.getInstallPath();
--  StringRef Version = GCCInstallation.getVersion().Text;
-   StringRef TripleStr = GCCInstallation.getTriple().str();
-+  const GCCVersion &Version = GCCInstallation.getVersion();
- 
-   if (addLibStdCXXIncludePaths(LibDir.str() + "/../include", 
--                               "/c++/" + Version.str(),
-+                               "/c++/" + Version.Text,
-                                TripleStr,
-                                GCCInstallation.getMultiarchSuffix(),
-                                DriverArgs, CC1Args))
-@@ -2602,10 +2604,12 @@ void Linux::AddClangCXXStdlibIncludeArgs(const ArgList &DriverArgs,
- 
-   const std::string IncludePathCandidates[] = {
-     // Gentoo is weird and places its headers inside the GCC install, so if the
--    // first attempt to find the headers fails, try this pattern.
--    InstallDir.str() + "/include/g++-v4",
-+    // first attempt to find the headers fails, try these patterns.
-+    InstallDir.str() + "/include/g++-v" + Version.MajorStr + "." +
-+        Version.MinorStr,
-+    InstallDir.str() + "/include/g++-v" + Version.MajorStr,
-     // Android standalone toolchain has C++ headers in yet another place.
--    LibDir.str() + "/../" + TripleStr.str() + "/include/c++/" + Version.str(),
-+    LibDir.str() + "/../" + TripleStr.str() + "/include/c++/" + Version.Text,
-     // Freescale SDK C++ headers are directly in <sysroot>/usr/include/c++,
-     // without a subdirectory corresponding to the gcc version.
-     LibDir.str() + "/../include/c++",
-diff --git a/tools/clang/lib/Driver/ToolChains.h b/tools/clang/lib/Driver/ToolChains.h
-index 3afd8dd..04cf467 100644
---- a/tools/clang/lib/Driver/ToolChains.h
-+++ b/tools/clang/lib/Driver/ToolChains.h
-@@ -48,6 +48,9 @@ protected:
-     /// \brief The parsed major, minor, and patch numbers.
-     int Major, Minor, Patch;
- 
-+    /// \brief The text of the parsed major, and major+minor versions.
-+    std::string MajorStr, MinorStr;
-+
-     /// \brief Any textual suffix on the patch number.
-     std::string PatchSuffix;
- 
--- 
-1.8.3.2
-

diff --git a/sys-devel/llvm/files/clang-3.3-gentoo-install.patch b/sys-devel/llvm/files/clang-3.3-gentoo-install.patch
deleted file mode 100644
index 5519fbc..0000000
--- a/sys-devel/llvm/files/clang-3.3-gentoo-install.patch
+++ /dev/null
@@ -1,71 +0,0 @@
-From 1a539a8868070e49966c6b5f5e4b9f1257acd7dc Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= <gentoo@mgorny.alt.pl>
-Date: Fri, 19 Jul 2013 10:23:57 +0200
-Subject: [PATCH] clang gentoo install
-
----
- tools/clang/lib/Driver/Tools.cpp        | 4 ++--
- tools/clang/tools/scan-build/scan-build | 4 ++--
- tools/clang/tools/scan-view/scan-view   | 2 +-
- 3 files changed, 5 insertions(+), 5 deletions(-)
-
-diff --git a/tools/clang/lib/Driver/Tools.cpp b/tools/clang/lib/Driver/Tools.cpp
-index e014980..6e60513 100644
---- a/tools/clang/lib/Driver/Tools.cpp
-+++ b/tools/clang/lib/Driver/Tools.cpp
-@@ -219,7 +219,7 @@ static void addProfileRT(const ToolChain &TC, const ArgList &Args,
-   // libprofile_rt.so. We used to use the -l:libprofile_rt.a syntax, but that is
-   // not supported by old linkers.
-   std::string ProfileRT =
--    std::string(TC.getDriver().Dir) + "/../lib/libprofile_rt.a";
-+    "-l:libprofile_rt.a";
- 
-   CmdArgs.push_back(Args.MakeArgString(ProfileRT));
- }
-@@ -6177,7 +6177,7 @@ void gnutools::Link::ConstructJob(Compilation &C, const JobAction &JA,
-   // forward.
-   if (D.IsUsingLTO(Args) || Args.hasArg(options::OPT_use_gold_plugin)) {
-     CmdArgs.push_back("-plugin");
--    std::string Plugin = ToolChain.getDriver().Dir + "/../lib/LLVMgold.so";
-+    std::string Plugin = ToolChain.getDriver().Dir + "/../@libdir@/LLVMgold.so";
-     CmdArgs.push_back(Args.MakeArgString(Plugin));
- 
-     // Try to pass driver level flags relevant to LTO code generation down to
-diff --git a/tools/clang/tools/scan-build/scan-build b/tools/clang/tools/scan-build/scan-build
-index 22d5289..dcb4822 100755
---- a/tools/clang/tools/scan-build/scan-build
-+++ b/tools/clang/tools/scan-build/scan-build
-@@ -410,7 +410,7 @@ sub CopyFiles {
- 
-   my $Dir = shift;
- 
--  my $JS = Cwd::realpath("$RealBin/sorttable.js");
-+  my $JS = Cwd::realpath("@EPREFIX@/usr/share/llvm/sorttable.js");
-   
-   DieDiag("Cannot find 'sorttable.js'.\n")
-     if (! -r $JS);  
-@@ -420,7 +420,7 @@ sub CopyFiles {
-   DieDiag("Could not copy 'sorttable.js' to '$Dir'.\n")
-     if (! -r "$Dir/sorttable.js");
-     
--  my $CSS = Cwd::realpath("$RealBin/scanview.css");
-+  my $CSS = Cwd::realpath("@EPREFIX@/usr/share/llvm/scanview.css");
-   
-   DieDiag("Cannot find 'scanview.css'.\n")
-     if (! -r $CSS);
-diff --git a/tools/clang/tools/scan-view/scan-view b/tools/clang/tools/scan-view/scan-view
-index fb27da6..1f8ddb8 100755
---- a/tools/clang/tools/scan-view/scan-view
-+++ b/tools/clang/tools/scan-view/scan-view
-@@ -54,7 +54,7 @@ def start_browser(port, options):
-     webbrowser.open(url)
- 
- def run(port, options, root):
--    import ScanView
-+    from clang import ScanView
-     try:
-         print 'Starting scan-view at: http://%s:%d'%(options.host,
-                                                      port)
--- 
-1.8.3.2
-

diff --git a/sys-devel/llvm/files/llvm-3.3-R600_debug.patch b/sys-devel/llvm/files/llvm-3.3-R600_debug.patch
deleted file mode 100644
index b104273..0000000
--- a/sys-devel/llvm/files/llvm-3.3-R600_debug.patch
+++ /dev/null
@@ -1,22 +0,0 @@
-Fixes compilation of llvm-3.3 on gcc-4.6 and 4.7 when VIDEO_CARDS=radeon
-
-This issue is caused because although Q is a multiset the original code tries to get
-a set iterator which can't be converted in a multiset one.
-
-The fix is as simple as just using a multiset iterator.
-
-Patch by Francisco Blas Izquierdo Riera (klondike)
-Consider the changes in the Public Domain
-https://bugs.gentoo.org/show_bug.cgi?id=474096
-
---- lib/Target/R600/R600MachineScheduler.cpp
-+++ lib/Target/R600/R600MachineScheduler.cpp
-@@ -290,7 +290,7 @@
- SUnit *R600SchedStrategy::PopInst(std::multiset<SUnit *, CompareSUnit> &Q) {
-   if (Q.empty())
-     return NULL;
--  for (std::set<SUnit *, CompareSUnit>::iterator It = Q.begin(), E = Q.end();
-+  for (std::multiset<SUnit *, CompareSUnit>::iterator It = Q.begin(), E = Q.end();
-       It != E; ++It) {
-     SUnit *SU = *It;
-     InstructionsGroupCandidate.push_back(SU->getInstr());

diff --git a/sys-devel/llvm/files/llvm-3.3-r2-gentoo-install.patch b/sys-devel/llvm/files/llvm-3.3-r2-gentoo-install.patch
deleted file mode 100644
index c5bd8b8..0000000
--- a/sys-devel/llvm/files/llvm-3.3-r2-gentoo-install.patch
+++ /dev/null
@@ -1,117 +0,0 @@
-From a554809b6bdbe29b1f775c89104c1088300685ef Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= <mgorny@gentoo.org>
-Date: Sat, 28 Dec 2013 10:30:28 +0100
-Subject: [PATCH] Update for gentoo install layout.
-
----
- Makefile.config.in                      | 6 +++---
- Makefile.rules                          | 8 ++++----
- tools/llvm-config/BuildVariables.inc.in | 1 +
- tools/llvm-config/Makefile              | 2 ++
- tools/llvm-config/llvm-config.cpp       | 2 +-
- utils/FileCheck/Makefile                | 2 +-
- 6 files changed, 12 insertions(+), 9 deletions(-)
-
-diff --git a/Makefile.config.in b/Makefile.config.in
-index fd4f6ef..b63786c 100644
---- a/Makefile.config.in
-+++ b/Makefile.config.in
-@@ -95,10 +95,10 @@ PROJ_internal_prefix := $(prefix)
- endif
- 
- PROJ_bindir     := $(PROJ_prefix)/bin
--PROJ_libdir     := $(PROJ_prefix)/lib
-+PROJ_libdir     := $(PROJ_prefix)/$(GENTOO_LIBDIR)
- PROJ_datadir    := $(PROJ_prefix)/share
--PROJ_docsdir    := $(PROJ_prefix)/docs/llvm
--PROJ_etcdir     := $(PROJ_prefix)/etc/llvm
-+PROJ_docsdir    := $(PROJ_prefix)/share/doc/@PF@
-+PROJ_etcdir     := @EPREFIX@/etc/llvm
- PROJ_includedir := $(PROJ_prefix)/include
- PROJ_infodir    := $(PROJ_prefix)/info
- PROJ_mandir     := $(PROJ_prefix)/share/man
-diff --git a/Makefile.rules b/Makefile.rules
-index f0c542b..6cc19fd 100644
---- a/Makefile.rules
-+++ b/Makefile.rules
-@@ -276,7 +276,7 @@ ifeq ($(ENABLE_OPTIMIZED),1)
-   # Don't use -fomit-frame-pointer on Darwin or FreeBSD.
-   ifneq ($(HOST_OS),FreeBSD)
-   ifneq ($(HOST_OS),Darwin)
--    OmitFramePointer := -fomit-frame-pointer
-+    OmitFramePointer :=
-   endif
-   endif
- 
-@@ -601,7 +601,7 @@ endif
- ifdef SHARED_LIBRARY
- ifneq ($(HOST_OS), $(filter $(HOST_OS), Cygwin MingW))
- ifneq ($(HOST_OS),Darwin)
--  LD.Flags += $(RPATH) -Wl,'$$ORIGIN'
-+  LD.Flags +=
- endif
- endif
- endif
-@@ -641,9 +641,9 @@ ifneq ($(HOST_OS), $(filter $(HOST_OS), Cygwin MingW))
-     ifdef TOOLNAME
-       LD.Flags += $(RPATH) -Wl,'$$ORIGIN/../lib'
-       ifdef EXAMPLE_TOOL
--        LD.Flags += $(RPATH) -Wl,$(ExmplDir) $(DynamicFlag)
-+        LD.Flags += $(DynamicFlag)
-       else
--        LD.Flags += $(RPATH) -Wl,$(ToolDir) $(DynamicFlag)
-+        LD.Flags += $(DynamicFlag)
-     endif
-   endif
- else
-diff --git a/tools/llvm-config/BuildVariables.inc.in b/tools/llvm-config/BuildVariables.inc.in
-index fe87afb..908acd4 100644
---- a/tools/llvm-config/BuildVariables.inc.in
-+++ b/tools/llvm-config/BuildVariables.inc.in
-@@ -25,3 +25,4 @@
- #define LLVM_BUILDMODE "@LLVM_BUILDMODE@"
- #define LLVM_TARGETS_BUILT "@LLVM_TARGETS_BUILT@"
- #define LLVM_SYSTEM_LIBS "@LLVM_SYSTEM_LIBS@"
-+#define LLVM_LIBDIR "@LLVM_LIBDIR@"
-diff --git a/tools/llvm-config/Makefile b/tools/llvm-config/Makefile
-index b20b6bf..0aeba45 100644
---- a/tools/llvm-config/Makefile
-+++ b/tools/llvm-config/Makefile
-@@ -55,6 +55,8 @@ $(ObjDir)/BuildVariables.inc: $(BUILDVARIABLES_SRCPATH) Makefile $(ObjDir)/.dir
- 	  >> temp.sed
- 	$(Verb) $(ECHO) 's/@LLVM_TARGETS_BUILT@/$(subst /,\/,$(TARGETS_TO_BUILD))/' \
- 	  >> temp.sed
-+	$(Verb) $(ECHO) 's/@LLVM_LIBDIR@/$(subst /,\/,$(GENTOO_LIBDIR))/' \
-+	  >> temp.sed
- 	$(Verb) $(SED) -f temp.sed < $< > $@
- 	$(Verb) $(RM) temp.sed
- 
-diff --git a/tools/llvm-config/llvm-config.cpp b/tools/llvm-config/llvm-config.cpp
-index 7edf5ec..c09b702 100644
---- a/tools/llvm-config/llvm-config.cpp
-+++ b/tools/llvm-config/llvm-config.cpp
-@@ -250,7 +250,7 @@ int main(int argc, char **argv) {
-     ActivePrefix = CurrentExecPrefix;
-     ActiveIncludeDir = ActivePrefix + "/include";
-     ActiveBinDir = ActivePrefix + "/bin";
--    ActiveLibDir = ActivePrefix + "/lib";
-+    ActiveLibDir = ActivePrefix + "/" LLVM_LIBDIR;
-     ActiveIncludeOption = "-I" + ActiveIncludeDir;
-   }
- 
-diff --git a/utils/FileCheck/Makefile b/utils/FileCheck/Makefile
-index 268b7bc..e7674f9 100644
---- a/utils/FileCheck/Makefile
-+++ b/utils/FileCheck/Makefile
-@@ -15,7 +15,7 @@ USEDLIBS = LLVMSupport.a
- TOOL_NO_EXPORTS = 1
- 
- # Don't install this utility
--NO_INSTALL = 1
-+#NO_INSTALL = 1
- 
- include $(LEVEL)/Makefile.common
- 
--- 
-1.8.5.2
-

diff --git a/sys-devel/llvm/llvm-3.3-r3.ebuild b/sys-devel/llvm/llvm-3.3-r3.ebuild
deleted file mode 100644
index d3b2aa8..0000000
--- a/sys-devel/llvm/llvm-3.3-r3.ebuild
+++ /dev/null
@@ -1,500 +0,0 @@
-# Copyright 1999-2015 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-# $Id$
-
-EAPI=5
-
-PYTHON_COMPAT=( python2_7 pypy )
-
-inherit cmake-utils eutils flag-o-matic multilib multilib-minimal \
-	python-r1 toolchain-funcs pax-utils check-reqs
-
-DESCRIPTION="Low Level Virtual Machine"
-HOMEPAGE="http://llvm.org/"
-SRC_URI="http://llvm.org/releases/${PV}/${P}.src.tar.gz
-	clang? ( http://llvm.org/releases/${PV}/compiler-rt-${PV}.src.tar.gz
-		http://llvm.org/releases/${PV}/cfe-${PV}.src.tar.gz )
-	!doc? ( https://dev.gentoo.org/~voyageur/distfiles/${P}-manpages.tar.bz2 )"
-
-LICENSE="UoI-NCSA"
-SLOT="0/${PV}"
-KEYWORDS="amd64 arm ppc ppc64 x86 ~amd64-fbsd ~x86-fbsd ~x64-freebsd ~amd64-linux ~arm-linux ~x86-linux ~ppc-macos ~x64-macos"
-IUSE="clang debug doc gold +libffi multitarget ocaml python
-	+static-analyzer test udis86 xml video_cards_radeon
-	kernel_Darwin kernel_FreeBSD"
-
-COMMON_DEPEND="
-	sys-libs/zlib:0=
-	clang? (
-		python? ( ${PYTHON_DEPS} )
-		static-analyzer? (
-			dev-lang/perl:*
-			${PYTHON_DEPS}
-		)
-		xml? ( dev-libs/libxml2:2= )
-	)
-	gold? ( >=sys-devel/binutils-2.22:*[cxx] )
-	libffi? ( >=virtual/libffi-3.0.13-r1:0=[${MULTILIB_USEDEP}] )
-	ocaml? ( dev-lang/ocaml:0= )
-	udis86? ( >=dev-libs/udis86-1.7-r2:0=[pic(+),${MULTILIB_USEDEP}] )"
-DEPEND="${COMMON_DEPEND}
-	dev-lang/perl
-	>=sys-devel/make-3.81
-	>=sys-devel/flex-2.5.4
-	>=sys-devel/bison-1.875d
-	|| ( >=sys-devel/gcc-3.0 >=sys-devel/gcc-apple-4.2.1
-		( >=sys-freebsd/freebsd-lib-9.1-r10 sys-libs/libcxx )
-	)
-	|| ( >=sys-devel/binutils-2.18 >=sys-devel/binutils-apple-3.2.3 )
-	clang? ( xml? ( virtual/pkgconfig ) )
-	doc? ( dev-python/sphinx )
-	libffi? ( virtual/pkgconfig )
-	${PYTHON_DEPS}"
-RDEPEND="${COMMON_DEPEND}
-	clang? ( !<=sys-devel/clang-3.3-r99
-		!>=sys-devel/clang-9999 )
-	abi_x86_32? ( !<=app-emulation/emul-linux-x86-baselibs-20130224-r2
-		!app-emulation/emul-linux-x86-baselibs[-abi_x86_32(-)] )"
-
-# pypy gives me around 1700 unresolved tests due to open file limit
-# being exceeded. probably GC does not close them fast enough.
-REQUIRED_USE="${PYTHON_REQUIRED_USE}
-	test? ( || ( $(python_gen_useflags 'python*') ) )"
-
-S=${WORKDIR}/${P}.src
-
-# Some people actually override that in make.conf. That sucks since
-# we need to run install per-directory, and ninja can't do that...
-# so why did it call itself ninja in the first place?
-CMAKE_MAKEFILE_GENERATOR=emake
-
-pkg_pretend() {
-	# in megs
-	# !clang !debug !multitarget -O2       400
-	# !clang !debug  multitarget -O2       550
-	#  clang !debug !multitarget -O2       950
-	#  clang !debug  multitarget -O2      1200
-	# !clang  debug  multitarget -O2      5G
-	#  clang !debug  multitarget -O0 -g  12G
-	#  clang  debug  multitarget -O2     16G
-	#  clang  debug  multitarget -O0 -g  14G
-
-	local build_size=550
-	use clang && build_size=1200
-
-	if use debug; then
-		ewarn "USE=debug is known to increase the size of package considerably"
-		ewarn "and cause the tests to fail."
-		ewarn
-
-		(( build_size *= 14 ))
-	elif is-flagq '-g?(gdb)?([1-9])'; then
-		ewarn "The C++ compiler -g option is known to increase the size of the package"
-		ewarn "considerably. If you run out of space, please consider removing it."
-		ewarn
-
-		(( build_size *= 10 ))
-	fi
-
-	# Multiply by number of ABIs :).
-	local abis=( $(multilib_get_enabled_abis) )
-	(( build_size *= ${#abis[@]} ))
-
-	local CHECKREQS_DISK_BUILD=${build_size}M
-	check-reqs_pkg_pretend
-}
-
-pkg_setup() {
-	pkg_pretend
-
-	# need to check if the active compiler is ok
-
-	broken_gcc=( 3.2.2 3.2.3 3.3.2 4.1.1 )
-	broken_gcc_x86=( 3.4.0 3.4.2 )
-	broken_gcc_amd64=( 3.4.6 )
-
-	gcc_vers=$(gcc-fullversion)
-
-	if has "${gcc_vers}" "${broken_gcc[@]}"; then
-		elog "Your version of gcc is known to miscompile llvm."
-		elog "Check http://www.llvm.org/docs/GettingStarted.html for"
-		elog "possible solutions."
-		die "Your currently active version of gcc is known to miscompile llvm"
-	fi
-
-	if use abi_x86_32 && has "${gcc_vers}" "${broken_gcc_x86[@]}"; then
-		elog "Your version of gcc is known to miscompile llvm on x86"
-		elog "architectures.  Check"
-		elog "http://www.llvm.org/docs/GettingStarted.html for possible"
-		elog "solutions."
-		die "Your currently active version of gcc is known to miscompile llvm"
-	fi
-
-	if use abi_x86_64 && has "${gcc_vers}" "${broken_gcc_amd64[@]}"; then
-		elog "Your version of gcc is known to miscompile llvm in amd64"
-		elog "architectures.  Check"
-		elog "http://www.llvm.org/docs/GettingStarted.html for possible"
-		elog "solutions."
-		die "Your currently active version of gcc is known to miscompile llvm"
-	fi
-}
-
-src_unpack() {
-	default
-
-	rm -f "${S}"/tools/clang "${S}"/projects/compiler-rt \
-		|| die "symlinks removal failed"
-
-	if use clang; then
-		mv "${WORKDIR}"/cfe-${PV}.src "${S}"/tools/clang \
-			|| die "clang source directory move failed"
-		mv "${WORKDIR}"/compiler-rt-${PV}.src "${S}"/projects/compiler-rt \
-			|| die "compiler-rt source directory move failed"
-	fi
-}
-
-src_prepare() {
-	epatch "${FILESDIR}"/${PN}-3.2-nodoctargz.patch
-	epatch "${FILESDIR}"/${P}-R600_debug.patch
-	epatch "${FILESDIR}"/${PN}-3.3-r2-gentoo-install.patch
-
-	# Hack cmake search path for Gentoo, bug #496480
-	epatch "${FILESDIR}"/${PN}-3.3-cmake-modulepath.patch
-
-	if use clang; then
-		# Automatically select active system GCC's libraries, bugs #406163 and #417913
-		epatch "${FILESDIR}"/clang-3.1-gentoo-runtime-gcc-detection-v3.patch
-
-		epatch "${FILESDIR}"/clang-3.3-gentoo-install.patch
-
-		# backport support for g++-X.Y header location
-		epatch "${FILESDIR}"/clang-3.3-gcc-header-path.patch
-	fi
-
-	local sub_files=(
-		Makefile.config.in
-		Makefile.rules
-		tools/llvm-config/llvm-config.cpp
-	)
-	use clang && sub_files+=(
-		tools/clang/lib/Driver/Tools.cpp
-		tools/clang/tools/scan-build/scan-build
-	)
-
-	# unfortunately ./configure won't listen to --mandir and the-like, so take
-	# care of this.
-	# note: we're setting the main libdir intentionally.
-	# where per-ABI is appropriate, we use $(GENTOO_LIBDIR) make.
-	einfo "Fixing install dirs"
-	sed -e "s,@libdir@,$(get_libdir),g" \
-		-e "s,@PF@,${PF},g" \
-		-e "s,@EPREFIX@,${EPREFIX},g" \
-		-i "${sub_files[@]}" \
-		|| die "install paths sed failed"
-
-	# User patches
-	epatch_user
-
-	python_setup
-}
-
-multilib_src_configure() {
-	# disable timestamps since they confuse ccache
-	local conf_flags=(
-		--disable-timestamps
-		--enable-keep-symbols
-		--enable-shared
-		--with-optimize-option=
-		$(use_enable !debug optimized)
-		$(use_enable debug assertions)
-		$(use_enable debug expensive-checks)
-		$(use_enable libffi)
-	)
-
-	if use clang; then
-		conf_flags+=( --with-clang-resource-dir=../lib/clang/${PV} )
-	fi
-	# well, it's used only by clang executable c-index-test
-	if multilib_is_native_abi && use clang && use xml; then
-		conf_flags+=( XML2CONFIG="$(tc-getPKG_CONFIG) libxml-2.0" )
-	else
-		conf_flags+=( ac_cv_prog_XML2CONFIG="" )
-	fi
-
-	local targets bindings
-	if use multitarget; then
-		targets='all'
-	else
-		targets='host,cpp'
-	fi
-	conf_flags+=( --enable-targets=${targets} )
-
-	if use video_cards_radeon; then
-		conf_flags+=( --enable-experimental-targets=R600 )
-	fi
-
-	if multilib_is_native_abi; then
-		use gold && conf_flags+=( --with-binutils-include="${EPREFIX}"/usr/include/ )
-		# extra commas don't hurt
-		use ocaml && bindings+=',ocaml'
-	fi
-
-	[[ ${bindings} ]] || bindings='none'
-	conf_flags+=( --enable-bindings=${bindings} )
-
-	if use udis86; then
-		conf_flags+=( --with-udis86 )
-	fi
-
-	if use libffi; then
-		local CPPFLAGS=${CPPFLAGS}
-		append-cppflags "$(pkg-config --cflags libffi)"
-	fi
-
-	# llvm prefers clang over gcc, so we may need to force that
-	tc-export CC CXX
-
-	ECONF_SOURCE=${S} \
-	econf "${conf_flags[@]}"
-
-	multilib_is_native_abi && cmake_configure
-}
-
-cmake_configure() {
-	# sadly, cmake doesn't seem to have host autodetection
-	# but it's fairly easy to steal this from configured autotools
-	local targets=$(sed -n -e 's/^TARGETS_TO_BUILD=//p' Makefile.config || die)
-	local libdir=$(get_libdir)
-
-	# cmake doesn't have R600 in 3.3
-	targets=${targets/R600 /}
-
-	local mycmakeargs=(
-		-DLLVM_TARGETS_TO_BUILD="${targets// /;}"
-		-DLLVM_LIBDIR_SUFFIX=${libdir#lib}
-	)
-
-	BUILD_DIR=${S%/}_cmake \
-	cmake-utils_src_configure
-}
-
-set_makeargs() {
-	MAKEARGS=(
-		VERBOSE=1
-		REQUIRES_RTTI=1
-		GENTOO_LIBDIR=$(get_libdir)
-	)
-
-	# for tests, we want it all! otherwise, we may use a little filtering...
-	# adding ONLY_TOOLS also disables unittest building...
-	if [[ ${EBUILD_PHASE_FUNC} != src_test ]]; then
-		local tools=( llvm-config )
-		use clang && tools+=( clang )
-
-		if multilib_is_native_abi; then
-			tools+=(
-				opt llvm-as llvm-dis llc llvm-ar llvm-nm llvm-link lli
-				llvm-extract llvm-mc llvm-bcanalyzer llvm-diff macho-dump
-				llvm-objdump llvm-readobj llvm-rtdyld llvm-dwarfdump llvm-cov
-				llvm-size llvm-stress llvm-mcmarkup llvm-symbolizer obj2yaml
-				yaml2obj lto llvm-prof llvm-ranlib bugpoint
-			)
-
-			# those tools require 'lto' built first, so we need to delay
-			# building them to a second run
-			if [[ ${1} != -1 ]]; then
-				use gold && tools+=( gold )
-			fi
-		fi
-
-		MAKEARGS+=(
-			# filter tools + disable unittests implicitly
-			ONLY_TOOLS="${tools[*]}"
-
-			# this disables unittests & docs from clang
-			BUILD_CLANG_ONLY=YES
-		)
-	fi
-}
-
-multilib_src_compile() {
-	local MAKEARGS
-	set_makeargs -1
-	emake "${MAKEARGS[@]}"
-
-	if multilib_is_native_abi; then
-		set_makeargs
-		emake -C tools "${MAKEARGS[@]}"
-
-		if use doc; then
-			emake -C "${S}"/docs -f Makefile.sphinx man
-			use clang && emake -C "${S}"/tools/clang/docs/tools \
-				BUILD_FOR_WEBSITE=1 DST_MAN_DIR="${T}"/ man
-			emake -C "${S}"/docs -f Makefile.sphinx html
-		fi
-	fi
-
-	if use debug; then
-		pax-mark m Debug+Asserts+Checks/bin/llvm-rtdyld
-		pax-mark m Debug+Asserts+Checks/bin/lli
-	else
-		pax-mark m Release/bin/llvm-rtdyld
-		pax-mark m Release/bin/lli
-	fi
-}
-
-multilib_src_test() {
-	local MAKEARGS
-	set_makeargs
-
-	# build the remaining tools & unittests
-	emake "${MAKEARGS[@]}"
-
-	pax-mark m unittests/ExecutionEngine/JIT/Release/JITTests
-	pax-mark m unittests/ExecutionEngine/MCJIT/Release/MCJITTests
-	pax-mark m unittests/Support/Release/SupportTests
-
-	emake "${MAKEARGS[@]}" check
-	use clang && emake "${MAKEARGS[@]}" -C tools/clang test
-}
-
-src_install() {
-	local MULTILIB_WRAPPED_HEADERS=(
-		/usr/include/llvm/Config/config.h
-		/usr/include/llvm/Config/llvm-config.h
-	)
-
-	use clang && MULTILIB_WRAPPED_HEADERS+=(
-		/usr/include/clang/Config/config.h
-	)
-
-	multilib-minimal_src_install
-
-	# Remove unnecessary headers on FreeBSD, bug #417171
-	use kernel_FreeBSD && use clang && rm "${ED}"usr/lib/clang/${PV}/include/{std,float,iso,limits,tgmath,varargs}*.h
-}
-
-multilib_src_install() {
-	local MAKEARGS
-	set_makeargs
-
-	emake "${MAKEARGS[@]}" DESTDIR="${D}" install
-
-	# Preserve ABI-variant of llvm-config.
-	dodir /tmp
-	mv "${ED}"/usr/bin/llvm-config "${ED}"/tmp/"${CHOST}"-llvm-config || die
-
-	if ! multilib_is_native_abi; then
-		# Drop all the executables since LLVM doesn't like to
-		# clobber when installing.
-		rm -r "${ED}"/usr/bin || die
-
-		# Backwards compat, will be happily removed someday.
-		dosym "${CHOST}"-llvm-config /tmp/llvm-config.${ABI}
-	else
-		# Move files back.
-		mv "${ED}"/tmp/*llvm-config* "${ED}"/usr/bin || die
-		# Create a symlink for host's llvm-config.
-		dosym "${CHOST}"-llvm-config /usr/bin/llvm-config
-
-		# Install docs.
-		if use doc; then
-			doman "${S}"/docs/_build/man/*.1
-			use clang && doman "${T}"/clang.1
-			dohtml -r "${S}"/docs/_build/html/
-		else
-			doman "${WORKDIR}"/${P}-manpages/*.1
-		fi
-
-		# Symlink the gold plugin.
-		if use gold; then
-			dodir /usr/${CHOST}/binutils-bin/lib/bfd-plugins
-			dosym ../../../../$(get_libdir)/LLVMgold.so \
-				/usr/${CHOST}/binutils-bin/lib/bfd-plugins/LLVMgold.so
-		fi
-
-		# install cmake modules
-		emake -C "${S%/}"_cmake/cmake/modules DESTDIR="${D}" install
-	fi
-
-	# Fix install_names on Darwin.  The build system is too complicated
-	# to just fix this, so we correct it post-install
-	local lib= f= odylib= libpv=${PV}
-	if [[ ${CHOST} == *-darwin* ]] ; then
-		eval $(grep PACKAGE_VERSION= configure)
-		[[ -n ${PACKAGE_VERSION} ]] && libpv=${PACKAGE_VERSION}
-		for lib in lib{EnhancedDisassembly,LLVM-${libpv},LTO,profile_rt,clang}.dylib LLVMHello.dylib ; do
-			# libEnhancedDisassembly is Darwin10 only, so non-fatal
-			# + omit clang libs if not enabled
-			[[ -f ${ED}/usr/lib/${lib} ]] || continue
-
-			ebegin "fixing install_name of $lib"
-			install_name_tool \
-				-id "${EPREFIX}"/usr/lib/${lib} \
-				"${ED}"/usr/lib/${lib}
-			eend $?
-		done
-		for f in "${ED}"/usr/bin/* "${ED}"/usr/lib/lib{LTO,clang}.dylib ; do
-			# omit clang libs if not enabled
-			[[ -f ${ED}/usr/lib/${lib} ]] || continue
-
-			odylib=$(scanmacho -BF'%n#f' "${f}" | tr ',' '\n' | grep libLLVM-${libpv}.dylib)
-			ebegin "fixing install_name reference to ${odylib} of ${f##*/}"
-			install_name_tool \
-				-change "${odylib}" \
-					"${EPREFIX}"/usr/lib/libLLVM-${libpv}.dylib \
-				-change "@rpath/libclang.dylib" \
-					"${EPREFIX}"/usr/lib/libclang.dylib \
-				-change "${S}"/Release/lib/libclang.dylib \
-					"${EPREFIX}"/usr/lib/libclang.dylib \
-				"${f}"
-			eend $?
-		done
-	fi
-}
-
-multilib_src_install_all() {
-	insinto /usr/share/vim/vimfiles/syntax
-	doins utils/vim/*.vim
-
-	if use clang; then
-		cd tools/clang || die
-
-		if use static-analyzer ; then
-			dobin tools/scan-build/ccc-analyzer
-			dosym ccc-analyzer /usr/bin/c++-analyzer
-			dobin tools/scan-build/scan-build
-
-			insinto /usr/share/${PN}
-			doins tools/scan-build/scanview.css
-			doins tools/scan-build/sorttable.js
-		fi
-
-		python_inst() {
-			if use static-analyzer ; then
-				pushd tools/scan-view >/dev/null || die
-
-				python_doscript scan-view
-
-				touch __init__.py || die
-				python_moduleinto clang
-				python_domodule __init__.py Reporter.py Resources ScanView.py startfile.py
-
-				popd >/dev/null || die
-			fi
-
-			if use python ; then
-				pushd bindings/python/clang >/dev/null || die
-
-				python_moduleinto clang
-				python_domodule __init__.py cindex.py enumerations.py
-
-				popd >/dev/null || die
-			fi
-
-			# AddressSanitizer symbolizer (currently separate)
-			python_doscript "${S}"/projects/compiler-rt/lib/asan/scripts/asan_symbolize.py
-		}
-		python_foreach_impl python_inst
-	fi
-}


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: sys-devel/llvm/files/, sys-devel/llvm/
@ 2016-06-23 15:57 Patrice Clement
  0 siblings, 0 replies; 11+ messages in thread
From: Patrice Clement @ 2016-06-23 15:57 UTC (permalink / raw
  To: gentoo-commits

commit:     12280fd5851883571f9e0f0ec44432d2bd17e187
Author:     Yuta Satoh <nigoro.dev <AT> gmail <DOT> com>
AuthorDate: Sat Jun 18 05:44:10 2016 +0000
Commit:     Patrice Clement <monsieurp <AT> gentoo <DOT> org>
CommitDate: Thu Jun 23 15:26:09 2016 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=12280fd5

sys-devel/llvm: Fix build fails on Gentoo/FreeBSD.

Gentoo-Bug: https://bugs.gentoo.org/578064
Closes: https://github.com/gentoo/gentoo/pull/1693

Signed-off-by: Patrice Clement <monsieurp <AT> gentoo.org>

 .../llvm/files/clang-3.8-compiler-rt-fbsd.patch      | 20 ++++++++++++++++++++
 sys-devel/llvm/llvm-3.8.0-r2.ebuild                  |  7 +++++++
 2 files changed, 27 insertions(+)

diff --git a/sys-devel/llvm/files/clang-3.8-compiler-rt-fbsd.patch b/sys-devel/llvm/files/clang-3.8-compiler-rt-fbsd.patch
new file mode 100644
index 0000000..297620b
--- /dev/null
+++ b/sys-devel/llvm/files/clang-3.8-compiler-rt-fbsd.patch
@@ -0,0 +1,20 @@
+https://llvm.org/bugs/show_bug.cgi?id=26651
+https://github.com/llvm-mirror/compiler-rt/commit/6606c7b50cbb4ec7eab4ecbebbbaaa049734bbd3
+
+diff --git a/projects/compiler-rt/lib/tsan/CMakeLists.txt b/projects/compiler-rt/lib/tsan/CMakeLists.txt
+index c185cfa..a151c6c 100644
+--- a/projects/compiler-rt/lib/tsan/CMakeLists.txt
++++ b/projects/compiler-rt/lib/tsan/CMakeLists.txt
+@@ -192,7 +192,11 @@ endif()
+ add_dependencies(compiler-rt tsan)
+ 
+ # Make sure that non-platform-specific files don't include any system headers.
+-if(COMPILER_RT_HAS_SYSROOT_FLAG)
++# FreeBSD does not install a number of Clang-provided headers for the compiler
++# in the base system due to incompatibilities between FreeBSD's and Clang's
++# versions. As a workaround do not use --sysroot=. on FreeBSD until this is
++# addressed.                                                        
++if(COMPILER_RT_HAS_SYSROOT_FLAG AND NOT CMAKE_SYSTEM_NAME MATCHES "FreeBSD")
+   file(GLOB _tsan_generic_sources rtl/tsan*)
+   file(GLOB _tsan_platform_sources rtl/tsan*posix* rtl/tsan*mac*
+                                    rtl/tsan*linux*)

diff --git a/sys-devel/llvm/llvm-3.8.0-r2.ebuild b/sys-devel/llvm/llvm-3.8.0-r2.ebuild
index 71a927f..2a11830 100644
--- a/sys-devel/llvm/llvm-3.8.0-r2.ebuild
+++ b/sys-devel/llvm/llvm-3.8.0-r2.ebuild
@@ -170,6 +170,9 @@ src_prepare() {
 	# disable use of SDK on OSX, bug #568758
 	sed -i -e 's/xcrun/false/' utils/lit/lit/util.py || die
 
+	# Workaround, can be compiled with gcc on Gentoo/FreeBSD, bug #578064
+	use kernel_FreeBSD && [[ $(tc-getCC) == *gcc* ]] && append-cppflags "-D_GLIBCXX_USE_C99"
+
 	if use clang; then
 		# Automatically select active system GCC's libraries, bugs #406163 and #417913
 		eapply "${FILESDIR}"/clang-3.5-gentoo-runtime-gcc-detection-v3.patch
@@ -198,6 +201,10 @@ src_prepare() {
 		# https://llvm.org/bugs/show_bug.cgi?id=23793
 		eapply "${FILESDIR}"/cmake/clang-0002-cmake-Make-CLANG_LIBDIR_SUFFIX-overridable.patch
 
+		# Fix 'stdarg.h' file not found on Gentoo/FreeBSD, bug #578064
+		# https://llvm.org/bugs/show_bug.cgi?id=26651
+		eapply "${FILESDIR}"/clang-3.8-compiler-rt-fbsd.patch
+
 		pushd projects/compiler-rt >/dev/null || die
 
 		# Fix WX sections, bug #421527


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: sys-devel/llvm/files/, sys-devel/llvm/
@ 2016-08-21 18:51 Michał Górny
  0 siblings, 0 replies; 11+ messages in thread
From: Michał Górny @ 2016-08-21 18:51 UTC (permalink / raw
  To: gentoo-commits

commit:     bf383aa2d04fcd952e797cb872eb08096061c307
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Sun Aug 21 18:34:41 2016 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Sun Aug 21 18:50:44 2016 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=bf383aa2

sys-devel/llvm: Improve llvm-config upstream compatibility, #591690

Improve the llvm-config installed by 3.8.1-r1 (masked) and the live
ebuild to match upstream behavior better, and be more compatible with
packages. Restore --obj-root to return prefix on installed package, and
make --src-root return invalid /dev/null path instead of failing.

Bug: https://bugs.gentoo.org/591690

 ...-config.patch => llvm-3.8-llvm-config-r1.patch} | 57 ++++++++++++----------
 sys-devel/llvm/files/llvm-3.9-llvm-config.patch    | 51 ++++++++++---------
 sys-devel/llvm/llvm-3.8.1-r1.ebuild                |  2 +-
 3 files changed, 57 insertions(+), 53 deletions(-)

diff --git a/sys-devel/llvm/files/llvm-3.9-llvm-config.patch b/sys-devel/llvm/files/llvm-3.8-llvm-config-r1.patch
similarity index 59%
copy from sys-devel/llvm/files/llvm-3.9-llvm-config.patch
copy to sys-devel/llvm/files/llvm-3.8-llvm-config-r1.patch
index d4363ad..38505f1 100644
--- a/sys-devel/llvm/files/llvm-3.9-llvm-config.patch
+++ b/sys-devel/llvm/files/llvm-3.8-llvm-config-r1.patch
@@ -1,14 +1,14 @@
-From af798c5a6e4b2c6c98cce89b5d6fc8d33f9345cf Mon Sep 17 00:00:00 2001
+From 7422ff662be0daeb3931fde397f1fed8ff86c50d Mon Sep 17 00:00:00 2001
 From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= <mgorny@gentoo.org>
-Date: Wed, 2 Dec 2015 16:04:56 +0100
-Subject: [PATCH 1/2] llvm-config: Clean up exported values, update for shared
+Date: Sat, 20 Aug 2016 23:47:41 +0200
+Subject: [PATCH] llvm-config: Clean up exported values, update for shared
  linking
 
 Gentoo-specific fixup for llvm-config, including:
 - wiping build-specific CFLAGS, CXXFLAGS,
 - updating library suffixes for shared libs,
 - wiping --system-libs for shared linking,
-- banning --obj-root and --src-root due to no sources installed,
+- making --src-root return invalid path (/dev/null),
 - making --build-mode return "Release" rather than "Gentoo".
 
 Thanks to Steven Newbury for the initial patch.
@@ -17,14 +17,16 @@ Bug: https://bugs.gentoo.org/565358
 Bug: https://bugs.gentoo.org/501684
 ---
  tools/llvm-config/CMakeLists.txt  | 11 ++++++++---
- tools/llvm-config/llvm-config.cpp | 20 +++++++++++++++-----
- 2 files changed, 23 insertions(+), 8 deletions(-)
+ tools/llvm-config/llvm-config.cpp |  9 +++++++--
+ 2 files changed, 15 insertions(+), 5 deletions(-)
 
 diff --git a/tools/llvm-config/CMakeLists.txt b/tools/llvm-config/CMakeLists.txt
-index 32d0f4c..6e99832 100644
+index 83794bb..eba6f45 100644
 --- a/tools/llvm-config/CMakeLists.txt
 +++ b/tools/llvm-config/CMakeLists.txt
-@@ -29,2 +29,6 @@ set(LLVM_CPPFLAGS "${CMAKE_CPP_FLAGS} ${CMAKE_CPP_FLAGS_${uppercase_CMAKE_BUILD_
+@@ -23,6 +23,10 @@ set(LLVM_SRC_ROOT ${LLVM_MAIN_SRC_DIR})
+ set(LLVM_OBJ_ROOT ${LLVM_BINARY_DIR})
+ set(LLVM_CPPFLAGS "${CMAKE_CPP_FLAGS} ${CMAKE_CPP_FLAGS_${uppercase_CMAKE_BUILD_TYPE}} ${LLVM_DEFINITIONS}")
 -set(LLVM_CFLAGS "${CMAKE_C_FLAGS} ${CMAKE_C_FLAGS_${uppercase_CMAKE_BUILD_TYPE}} ${LLVM_DEFINITIONS}")
 -set(LLVM_CXXFLAGS "${CMAKE_CXX_FLAGS} ${CMAKE_CXX_FLAGS_${uppercase_CMAKE_BUILD_TYPE}} ${COMPILE_FLAGS} ${LLVM_DEFINITIONS}")
 +# Just use CMAKE_CPP_FLAGS for CFLAGS and CXXFLAGS, otherwise compiler
@@ -33,36 +35,39 @@ index 32d0f4c..6e99832 100644
 +# TODO: figure out if we can remove -std=c++11 and move it to revdeps.
 +set(LLVM_CFLAGS "${CMAKE_CPP_FLAGS} ${CMAKE_C_FLAGS_${uppercase_CMAKE_BUILD_TYPE}} ${LLVM_DEFINITIONS}")
 +set(LLVM_CXXFLAGS "${CMAKE_CPP_FLAGS} -std=c++11 ${CMAKE_CXX_FLAGS_${uppercase_CMAKE_BUILD_TYPE}} ${LLVM_DEFINITIONS}")
-@@ -39 +43,2 @@ set(LLVM_BUILDMODE ${CMAKE_BUILD_TYPE})
+ set(LLVM_BUILD_SYSTEM cmake)
+ set(LLVM_HAS_RTTI ${LLVM_CONFIG_HAS_RTTI})
+@@ -31,5 +35,6 @@ set(LLVM_HAS_RTTI ${LLVM_CONFIG_HAS_RTTI})
+ set(LLVM_LDFLAGS "${CMAKE_CXX_LINK_FLAGS}")
+ set(LLVM_BUILDMODE ${CMAKE_BUILD_TYPE})
 -set(LLVM_SYSTEM_LIBS ${SYSTEM_LIBS})
 +# We don't do static libs, so we don't need to supply any system-libs
 +set(LLVM_SYSTEM_LIBS "")
+ if(BUILD_SHARED_LIBS)
+   set(LLVM_ENABLE_SHARED ON)
 diff --git a/tools/llvm-config/llvm-config.cpp b/tools/llvm-config/llvm-config.cpp
-index 94d426b..fb1bdfa 100644
+index 80f6279..309c5dc 100644
 --- a/tools/llvm-config/llvm-config.cpp
 +++ b/tools/llvm-config/llvm-config.cpp
-@@ -525 +525,2 @@ int main(int argc, char **argv) {
+@@ -485,5 +485,6 @@ int main(int argc, char **argv) {
+         OS << Triple::normalize(LLVM_DEFAULT_TARGET_TRIPLE) << '\n';
+       } else if (Arg == "--build-mode") {
 -        OS << build_mode << '\n';
 +        // force Release since we force non-standard Gentoo build mode
 +        OS << "Release" << '\n';
-@@ -540,4 +541,13 @@ int main(int argc, char **argv) {
--      } else if (Arg == "--obj-root") {
--        OS << ActivePrefix << '\n';
--      } else if (Arg == "--src-root") {
+       } else if (Arg == "--assertion-mode") {
+ #if defined(NDEBUG)
+@@ -501,5 +502,9 @@ int main(int argc, char **argv) {
+         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';
-+          }
++          OS << LLVM_SRC_ROOT << '\n';
 +        } else {
-+          // sources are not installed
-+          llvm::errs() << "llvm-config: sources not installed, "
-+                       << Arg << " not available\n";
-+          exit(1);
++          OS << "/dev/null\n";
 +        }
+       } else {
+         usage();
 -- 
-2.7.4
+2.9.3
 

diff --git a/sys-devel/llvm/files/llvm-3.9-llvm-config.patch b/sys-devel/llvm/files/llvm-3.9-llvm-config.patch
index d4363ad..a1b0be9 100644
--- a/sys-devel/llvm/files/llvm-3.9-llvm-config.patch
+++ b/sys-devel/llvm/files/llvm-3.9-llvm-config.patch
@@ -1,14 +1,14 @@
-From af798c5a6e4b2c6c98cce89b5d6fc8d33f9345cf Mon Sep 17 00:00:00 2001
+From 93133d777fd4c9d5e0f0cc563927f303f9527159 Mon Sep 17 00:00:00 2001
 From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= <mgorny@gentoo.org>
-Date: Wed, 2 Dec 2015 16:04:56 +0100
-Subject: [PATCH 1/2] llvm-config: Clean up exported values, update for shared
+Date: Sat, 20 Aug 2016 23:47:41 +0200
+Subject: [PATCH] llvm-config: Clean up exported values, update for shared
  linking
 
 Gentoo-specific fixup for llvm-config, including:
 - wiping build-specific CFLAGS, CXXFLAGS,
 - updating library suffixes for shared libs,
 - wiping --system-libs for shared linking,
-- banning --obj-root and --src-root due to no sources installed,
+- making --obj-root and --src-root return invalid path (/dev/null),
 - making --build-mode return "Release" rather than "Gentoo".
 
 Thanks to Steven Newbury for the initial patch.
@@ -17,14 +17,15 @@ Bug: https://bugs.gentoo.org/565358
 Bug: https://bugs.gentoo.org/501684
 ---
  tools/llvm-config/CMakeLists.txt  | 11 ++++++++---
- tools/llvm-config/llvm-config.cpp | 20 +++++++++++++++-----
- 2 files changed, 23 insertions(+), 8 deletions(-)
+ tools/llvm-config/llvm-config.cpp | 15 ++++++++++++---
+ 2 files changed, 20 insertions(+), 6 deletions(-)
 
 diff --git a/tools/llvm-config/CMakeLists.txt b/tools/llvm-config/CMakeLists.txt
-index 32d0f4c..6e99832 100644
+index 744fa4e..593788a 100644
 --- a/tools/llvm-config/CMakeLists.txt
 +++ b/tools/llvm-config/CMakeLists.txt
-@@ -29,2 +29,6 @@ set(LLVM_CPPFLAGS "${CMAKE_CPP_FLAGS} ${CMAKE_CPP_FLAGS_${uppercase_CMAKE_BUILD_
+@@ -34,4 +34,8 @@ set(LLVM_OBJ_ROOT ${LLVM_BINARY_DIR})
+ set(LLVM_CPPFLAGS "${CMAKE_CPP_FLAGS} ${CMAKE_CPP_FLAGS_${uppercase_CMAKE_BUILD_TYPE}} ${LLVM_DEFINITIONS}")
 -set(LLVM_CFLAGS "${CMAKE_C_FLAGS} ${CMAKE_C_FLAGS_${uppercase_CMAKE_BUILD_TYPE}} ${LLVM_DEFINITIONS}")
 -set(LLVM_CXXFLAGS "${CMAKE_CXX_FLAGS} ${CMAKE_CXX_FLAGS_${uppercase_CMAKE_BUILD_TYPE}} ${COMPILE_FLAGS} ${LLVM_DEFINITIONS}")
 +# Just use CMAKE_CPP_FLAGS for CFLAGS and CXXFLAGS, otherwise compiler
@@ -33,36 +34,34 @@ index 32d0f4c..6e99832 100644
 +# TODO: figure out if we can remove -std=c++11 and move it to revdeps.
 +set(LLVM_CFLAGS "${CMAKE_CPP_FLAGS} ${CMAKE_C_FLAGS_${uppercase_CMAKE_BUILD_TYPE}} ${LLVM_DEFINITIONS}")
 +set(LLVM_CXXFLAGS "${CMAKE_CPP_FLAGS} -std=c++11 ${CMAKE_CXX_FLAGS_${uppercase_CMAKE_BUILD_TYPE}} ${LLVM_DEFINITIONS}")
-@@ -39 +43,2 @@ set(LLVM_BUILDMODE ${CMAKE_BUILD_TYPE})
+ set(LLVM_BUILD_SYSTEM cmake)
+@@ -48,3 +52,4 @@ set(LLVM_LDFLAGS "${CMAKE_CXX_LINK_FLAGS}")
+ set(LLVM_BUILDMODE ${CMAKE_BUILD_TYPE})
 -set(LLVM_SYSTEM_LIBS ${SYSTEM_LIBS})
 +# We don't do static libs, so we don't need to supply any system-libs
 +set(LLVM_SYSTEM_LIBS "")
+ if(BUILD_SHARED_LIBS)
 diff --git a/tools/llvm-config/llvm-config.cpp b/tools/llvm-config/llvm-config.cpp
-index 94d426b..fb1bdfa 100644
+index c63733f..ead11b9 100644
 --- a/tools/llvm-config/llvm-config.cpp
 +++ b/tools/llvm-config/llvm-config.cpp
-@@ -525 +525,2 @@ int main(int argc, char **argv) {
+@@ -524,3 +524,4 @@ int main(int argc, char **argv) {
+       } else if (Arg == "--build-mode") {
 -        OS << build_mode << '\n';
 +        // force Release since we force non-standard Gentoo build mode
 +        OS << "Release" << '\n';
-@@ -540,4 +541,13 @@ int main(int argc, char **argv) {
--      } else if (Arg == "--obj-root") {
--        OS << ActivePrefix << '\n';
--      } else if (Arg == "--src-root") {
+       } else if (Arg == "--assertion-mode") {
+@@ -540,5 +540,9 @@ int main(int argc, char **argv) {
+       } 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';
-+          }
++          OS << LLVM_SRC_ROOT << '\n';
 +        } else {
-+          // sources are not installed
-+          llvm::errs() << "llvm-config: sources not installed, "
-+                       << Arg << " not available\n";
-+          exit(1);
++          OS << "/dev/null\n";
 +        }
+       } else if (Arg == "--link-shared") {
 -- 
-2.7.4
+2.9.3
 

diff --git a/sys-devel/llvm/llvm-3.8.1-r1.ebuild b/sys-devel/llvm/llvm-3.8.1-r1.ebuild
index 802911c..c2e88d9 100644
--- a/sys-devel/llvm/llvm-3.8.1-r1.ebuild
+++ b/sys-devel/llvm/llvm-3.8.1-r1.ebuild
@@ -164,7 +164,7 @@ src_prepare() {
 
 	# Fix llvm-config for shared linking and sane flags
 	# https://bugs.gentoo.org/show_bug.cgi?id=565358
-	eapply "${FILESDIR}"/llvm-3.8-llvm-config.patch
+	eapply "${FILESDIR}"/llvm-3.8-llvm-config-r1.patch
 
 	# Restore SOVERSIONs for shared libraries
 	# https://bugs.gentoo.org/show_bug.cgi?id=578392


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: sys-devel/llvm/files/, sys-devel/llvm/
@ 2016-09-10  8:55 Fabian Groffen
  0 siblings, 0 replies; 11+ messages in thread
From: Fabian Groffen @ 2016-09-10  8:55 UTC (permalink / raw
  To: gentoo-commits

commit:     29727ce6e434d8265350bbe7d1c47b13d17eb192
Author:     Fabian Groffen <grobian <AT> gentoo <DOT> org>
AuthorDate: Sat Sep 10 08:43:12 2016 +0000
Commit:     Fabian Groffen <grobian <AT> gentoo <DOT> org>
CommitDate: Sat Sep 10 08:43:12 2016 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=29727ce6

sys-devel/llvm: restore llvm-3.4.2 for Prefix bootstraps, bug #588132

Package-Manager: portage-2.2.28

 sys-devel/llvm/Manifest                            |   4 +
 ...clang-3.1-gentoo-runtime-gcc-detection-v3.patch |  29 +++
 .../llvm/files/clang-3.4-darwin_build_fix.patch    |  47 ++++
 .../llvm/files/clang-3.4-gentoo-install.patch      |  80 +++++++
 sys-devel/llvm/files/llvm-3.4-gentoo-install.patch |  96 ++++++++
 sys-devel/llvm/llvm-3.4.2-r100.ebuild              | 245 +++++++++++++++++++++
 6 files changed, 501 insertions(+)

diff --git a/sys-devel/llvm/Manifest b/sys-devel/llvm/Manifest
index 239bf72..37b5d6f 100644
--- a/sys-devel/llvm/Manifest
+++ b/sys-devel/llvm/Manifest
@@ -1,3 +1,4 @@
+DIST cfe-3.4.2.src.tar.gz 10612313 SHA256 5ba6f5772f8d00f445209356a7daf83c5bca2da5acd10de517ad2359ae95bc10 SHA512 e01fa8e312e9b3b7b3cb572ac21349161aaa50078ecfe7bded273b75db4a0c44acde524f8fdfcbeec54c61eeeb8339e9917d1f205a8fda18e34fe7ccbe89c36d WHIRLPOOL 153208b1a60bb5fbe92a7162cb26bbe70d591e7db9dcf06fcd54efc539bbff0403ec88e64236969c9f256e5586bc333840bd6178fd158577d6fe228d9edd4dcd
 DIST cfe-3.5.0.src.tar.xz 8233432 SHA256 fc80992e004b06f6c7afb612de1cdaa9ac9d25811c55f94fcf7331d9b81cdb8b SHA512 b26a5e2cd81c150607c23b22fafc0d9c7f12b83b45e476b8e75bf5e99d42be7c98ffeac7349df664f01b00900864a01429860b298e48961861377a4b2daf3e49 WHIRLPOOL 5dd8b6fe97933b74f1668b1d753c16cd3bcd05ccf72aac1283aa449caf93f5ba88ae79e7668f7e79b554e1421549a87af21c86cf92657c1b4d77744165718ce7
 DIST cfe-3.5.2.src.tar.xz 8268008 SHA256 4feb575f74fb3a74b6245400460230141bf610f235ef3a25008cfe6137828620 SHA512 2ad9a7daa8e62cdbf47b001aa6b937a06ae7e6396dcd1832797e2d98036522443ccfca9f1253e16d531a99d1edf237fcd2b457c55491ff68ca4534a2396ca52f WHIRLPOOL 51789ba2a3193d404b26d26b999fc47f1bc4b56b45048078cc51e4ff5c31d834d360ee0c2d16096c060f85acab6de9055dc375569348ae3307e4b280406f2d9e
 DIST cfe-3.6.2.src.tar.xz 8617576 SHA256 ae9180466a23acb426d12444d866b266ff2289b266064d362462e44f8d4699f3 SHA512 ed837c48f38d8998efd675b56477c8681dcedfcf3f71bba65930f145501289bebb6fe6a6d9de336548f94c381d016b99f10c58e046b885449755d44ac782de03 WHIRLPOOL a17419cea329999c8662c0008dbd0391ed5f52045d0175488979e7620f6a9a21b08e451a5e21d3bf944597bb37934a8228fa89c09d773882359822d59bd447a8
@@ -12,6 +13,7 @@ DIST clang-tools-extra-3.7.1.src.tar.xz 277476 SHA256 4a91edaccad1ce984c7c49a4a8
 DIST clang-tools-extra-3.8.0.src.tar.xz 334072 SHA256 afbda810106a6e64444bc164b921be928af46829117c95b996f2678ce4cb1ec4 SHA512 f0e593a76df5485f403079bd2fbb4e51c3d1c3fc4e63e2c2910894e8f2a7c14b47265435f3c52f035fb3fe2f595812d0f9869235296157a39c071a23e6a8b178 WHIRLPOOL 4928669a3c019eebe0a98ee72e25ef70ddf3c1d29e6a4aa18e408276b2a870069460c39e0e8fbe960d8d56127bb6951433d1fd89015d192951004e527b065ec9
 DIST clang-tools-extra-3.8.1.src.tar.xz 334768 SHA256 664a5c60220de9c290bf2a5b03d902ab731a4f95fe73a00856175ead494ec396 SHA512 ec8c4a6ac4fd1a0e24fc15e56ba00828e0d718c2f7bd477ea134ab094c67f4f4b2f603f128ec11a03b7f25f3e9b8fe75181e40730c56b7b683f54e3f37573137 WHIRLPOOL b05213cbe21b778e718233cecbf4d01b92c1f133eced6fdd3fa5059c4b10e5f0407549634f65032af177ba1614250f5c02e283c2b03563db3e227b1afcae424b
 DIST clang-tools-extra-3.9.0.src.tar.xz 455144 SHA256 5b7aec46ec8e999ec683c87ad744082e1133781ee4b01905b4bdae5d20785f14 SHA512 7d5f8d3b44e45022db65434f4d141f23706edf6aa9f3c28ded43e84e85c7c4878ffe98bf15f71e4c71fd176dfc49ce5180892d710bc5eccf95de1ed12f3c8074 WHIRLPOOL 44863889eaa33face00b9644f5c1465446bec39f88bc5ea32835dfa091a83161e292c2b3bcdcccb7cb34cdc3f1970bb3bbfbf6918c425b11a1465bedc3e0611f
+DIST compiler-rt-3.4.src.tar.gz 1858593 SHA256 f37c89b1383ce462d47537a0245ac798600887a9be9f63073e16b79ed536ab5c SHA512 70efffaf12ff7c15befa87ce808489c6f6b6eb421d0ab5d8ecd525239efc8aab850c7ed34b31a993ff5e499657b72598619945cc4461fe3e5359e9a94aaac0c8 WHIRLPOOL ad558b5877a01e476d30d2757959ab04be0c385b2fe3442bcc578bf36c6f3214cd78b4adda24fcb1f3b2b84353db213b82e8d7d4c40e66c3f57aed3a49322dbc
 DIST compiler-rt-3.5.0.src.tar.xz 1088352 SHA256 a4b3e655832bf8d9a357ea2c771db347237460e131988cbb96cda40ff39a8136 SHA512 862cce2d6b398bd1a8399496a547e6ab976a31f676528beebfbea5fd7dc54aa72e1c25deefa12f6167096521eba74090565b0168806451da02ddac04e922fc48 WHIRLPOOL 248acf997d70d7904aa79bf83e0c02ba4e5f8c2812c03f44a8e1e31b845a654f250c09ec6a123f9245d0db8713e8cc5a4087b9ce785af4f5eb7e55d9dbd362a2
 DIST compiler-rt-3.5.2.src.tar.xz 1093000 SHA256 542d7aadd21e7fe35bea0a7912bc965f08a1a566746cebcca76f96dcfeb74dc3 SHA512 319a8a1dbe07eb4f1fcccfe79a1fa445f348fb854a441500e89fa0a128e45716b65d06347f19a63de32e9294cd2331e914ae0d5fe8224f0b2452c39b79ac96ff WHIRLPOOL 6e9286c56a60a515006c8232ca01622ae844185a5f31fb49bce632868862c5e560619f1c45da66878b5322a764f91a284cd296e9f13105d6f74e055a17321d93
 DIST compiler-rt-3.6.2.src.tar.xz 1128080 SHA256 0f2ff37d80a64575fecd8cf0d5c50f7ac1f837ddf700d1855412bb7547431d87 SHA512 7dafcc5bd4822475de649d8a84ae51af3c4ed4d0958f76b1b55ba79219638f3e78eb94a1986c6e9ba0e7f1ccf3ec834d546b5ca60e8b08083fea5880ecdf17a3 WHIRLPOOL dd77e7df43c9028a6873ed903da67560fdb04968013016a7f0ad2d2e9a81b3a3d890b95e4f49a6bdef349806d6507defcd80a0a9fb50c1c9f778e7eff42dbc5d
@@ -23,6 +25,8 @@ DIST lldb-3.7.1.src.tar.xz 10650524 SHA256 9a0bc315ef55f44c98cdf92d064df0847f453
 DIST lldb-3.8.0.src.tar.xz 10929768 SHA256 e3f68f44147df0433e7989bf6ed1c58ff28d7c68b9c47553cb9915f744785a35 SHA512 a491209ae12b0c7d938ebd94362396a50922326ed24ed11f71b1f19b61274a34a92d2bd46857b44081e7fa3e6d0a641d148bd4022f8edf71f80ff2aa7a55ebef WHIRLPOOL c498c22acab867419143745ce0212c70bdfc141dbae19ab53221908eba7961aae6a029cbad01b8409e6fbc187550141ed87f32366dd847ac57754891fbbc4049
 DIST lldb-3.8.1.src.tar.xz 10928220 SHA256 349148116a47e39dcb5d5042f10d8a6357d2c865034563283ca512f81cdce8a3 SHA512 d73c55daed6ef5e5ca784c7010f2d75be26024b14fa61a2861a8a6cbe129e417fb7be2a3b532e17e9d7de98ae38ce6a689d8166049eff365fb04f4bd772758f3 WHIRLPOOL 78dd8161cd1411bd62cb3ffe1196fe95ccb73d78f2e141a58c63776eb6d91065fe1348b1b8e241630cdf954ab659b333ebbcdcaeba3e6df36af62aaf3a7c6634
 DIST lldb-3.9.0.src.tar.xz 13754516 SHA256 61280e07411e3f2b4cca0067412b39c16b0a9edd19d304d3fc90249899d12384 SHA512 b2d7f36b4462dba8e478022da19981e2d029bc4728efeed50600f0d03e3dd4573e7fb3cee773ec19b11ad3d8ba53b1aef9de1b21612e77d2888d0f6de433b24a WHIRLPOOL 6df1ea72ae76826e318a8602105203e6456a3dd7277a3080f3d5a32958c539e34922a178e0ea32440744a5b76029eb50032eb0de2288762490b67709da89dbf1
+DIST llvm-3.4-manpages.tar.bz2 33753 SHA256 dc2616104cf333dd9ef56b2d31f9a36e81303e2c5756ff8bc221e05b46f7e1cb SHA512 8e438a9392c9b896ccb2b1460a8f57ffa01633e3a6bba61e2bf2f718d970ff96c17d63b0bc0d4da1162e1d1dc4cb9b2a9e9a14a722e8a5b5d2f205f037ae665d WHIRLPOOL 1c037a9972442937f84bc3147d77d4bbc6d6c0812c3025f3107c2ee5f6259afab990f6e1bca564237fdca8089e2372df4b7ca45cbdea686fbf891f92d1bfbbe6
+DIST llvm-3.4.2.src.tar.gz 15938155 SHA256 17038d47069ad0700c063caed76f0c7259628b0e79651ce2b540d506f2f1efd7 SHA512 6c1453f7d9d9110257db3574cc4f6227fed8938705cbb09851ac09a868089b48f1556a1b6e758aff6d97520b08b5605d3ed20411ad9dd22cdc573d62176905f0 WHIRLPOOL f8b4d5167469e6f350ec41aede04e7b756e18f3d8e78b3270beb5791310a7b9b13c69e57c8bcfefbd0a78efc0c40e3b75a9a158eac72c025b7c77146e8dfaf7c
 DIST llvm-3.5.0-manpages.tar.bz2 35314 SHA256 724e752a60016dce8cc536658906d3646c600e977374e0ea692a5d0fe2d4a021 SHA512 d99d6096d7f21a81923297584fe5eeb23e0d83d4538fe376615c92fffc8aff3189999f7ab3c537b5aa5d6bc2c22c53eb05717d48c7ab99c42315b8665bac62c3 WHIRLPOOL 68ced06ee6678c5333c662eb1cc0da744c5a184b12dd059c1b77ec200b1d3cc231f270b9d9b6e177d728776894277b3f9061338aa55620c90474eb97915b7819
 DIST llvm-3.5.0.src.tar.xz 11735940 SHA256 28e199f368ef0a4666708f31c7991ad3bcc3a578342b0306526dd35f07595c03 SHA512 b4d0f325dbdb0a8f10e5fd031954ef4b1971d8f99f4e4b53834801a2b74a7acde3f77c655c8355b407424b363edfb10f71d85fc370356dc52af5c636a1bba197 WHIRLPOOL 561520823468b61c63df8e13f876b7ac586eb1e52c256e9a36370e5d46e8cef3937655c36fbb51eebd3680fab67412e7c777479477fc728e7a8f35420e573ef1
 DIST llvm-3.5.2.src.tar.xz 11876128 SHA256 44196156d5749eb4b4224fe471a29cc3984df92570a4a89fa859f7394fc0c575 SHA512 0f6a83cc61a385387e7baf8fb8f0d9f18e3fd00d2d389a3c7e2c3792be7d82ed095506cac52c24e65ae3c1f94456a441d39440feef6125e25ef18447ec9dd406 WHIRLPOOL b41de51907d6d2c2d04a4c498b44f0ed560cc710e6e2d8678f5ef93a9009d140bc7c2406f4b25d5b901fd026689d48edce77a2e435687b489b835156a512e256

diff --git a/sys-devel/llvm/files/clang-3.1-gentoo-runtime-gcc-detection-v3.patch b/sys-devel/llvm/files/clang-3.1-gentoo-runtime-gcc-detection-v3.patch
new file mode 100644
index 00000000..49f1085
--- /dev/null
+++ b/sys-devel/llvm/files/clang-3.1-gentoo-runtime-gcc-detection-v3.patch
@@ -0,0 +1,29 @@
+diff -upNr a/llvm-3.1.src/tools/clang/lib/Driver/ToolChains.cpp b/llvm-3.1.src/tools/clang/lib/Driver/ToolChains.cpp
+--- a/llvm-3.1.src/tools/clang/lib/Driver/ToolChains.cpp	2012-05-24 03:32:31.593191000 -0400
++++ b/llvm-3.1.src/tools/clang/lib/Driver/ToolChains.cpp	2012-05-24 03:38:31.733163513 -0400
+@@ -1145,6 +1145,25 @@ Generic_GCC::GCCInstallationDetector::GC
+     Prefixes.push_back(D.InstalledDir + "/..");
+   }
+ 
++  llvm::OwningPtr<llvm::MemoryBuffer> File;
++  for (unsigned k = 0, ke = CandidateTripleAliases.size(); k < ke; ++k) {
++    if (!llvm::MemoryBuffer::getFile(D.SysRoot + "/etc/env.d/gcc/config-" + CandidateTripleAliases[k].str(), File))
++    {
++      bool Exists;
++      const std::string VersionText = File.get()->getBuffer().rsplit('-').second.substr(0,5).str();
++      const std::string GentooPath = D.SysRoot + "/usr/lib/gcc/" + CandidateTripleAliases[k].str() + "/" + VersionText;
++      if (!llvm::sys::fs::exists(GentooPath + "/crtbegin.o", Exists) && Exists)
++      {
++        Version = GCCVersion::Parse(VersionText);
++        GCCInstallPath = GentooPath;
++        GCCParentLibPath = GCCInstallPath + "/../../..";
++        GCCTriple.setTriple(CandidateTripleAliases[k]);
++        IsValid = true;
++        return;
++      }
++    }
++  }
++
+   // Loop over the various components which exist and select the best GCC
+   // installation available. GCC installs are ranked by version number.
+   Version = GCCVersion::Parse("0.0.0");

diff --git a/sys-devel/llvm/files/clang-3.4-darwin_build_fix.patch b/sys-devel/llvm/files/clang-3.4-darwin_build_fix.patch
new file mode 100644
index 00000000..113b04b
--- /dev/null
+++ b/sys-devel/llvm/files/clang-3.4-darwin_build_fix.patch
@@ -0,0 +1,47 @@
+Our (gcc/binutils) toolchain doesn't do ARM targets, hence we will get
+"unable to interface with target machine" errors while building if we
+attempt to.  Disable those targets.
+
+Patch by Reza Jelveh from
+https://github.com/fishman/timebomb-gentoo-osx-overlay/blob/master/sys-devel/llvm/files/llvm-3.4-fix_darwin_build.patch
+
+--- a/projects/compiler-rt/make/platform/clang_darwin_embedded.mk
++++ b/projects/compiler-rt/make/platform/clang_darwin_embedded.mk
+@@ -27,20 +27,20 @@ UniversalArchs :=
+ # Soft-float version of the runtime. No floating-point instructions will be used
+ # and the ABI (out of necessity) passes floating values in normal registers:
+ # non-VFP variant of the AAPCS.
+-Configs += soft_static
+-UniversalArchs.soft_static := armv6m armv7m armv7em armv7
++# Configs += soft_static
++# UniversalArchs.soft_static := armv6m armv7m armv7em armv7
+ 
+ # Hard-float version of the runtime. On ARM VFP instructions and registers are
+ # allowed, and floating point values get passed in them. VFP variant of the
+ # AAPCS.
+ Configs += hard_static
+-UniversalArchs.hard_static := armv7em armv7 i386 x86_64
++UniversalArchs.hard_static := i386 x86_64
+ 
+-Configs += soft_pic
+-UniversalArchs.soft_pic := armv6m armv7m armv7em armv7
++# Configs += soft_pic
++# UniversalArchs.soft_pic := armv6m armv7m armv7em armv7
+ 
+ Configs += hard_pic
+-UniversalArchs.hard_pic := armv7em armv7 i386 x86_64
++UniversalArchs.hard_pic := i386 x86_64
+ 
+ CFLAGS := -Wall -Werror -Oz -fomit-frame-pointer -ffreestanding
+ 
+--- a/tools/clang/runtime/compiler-rt/Makefile
++++ b/tools/clang/runtime/compiler-rt/Makefile
+@@ -85,7 +85,7 @@ RuntimeLibrary.darwin.Configs := \
+ 	profile_osx.a profile_ios.a \
+ 	ubsan_osx.a
+ RuntimeLibrary.darwin_embedded.Configs := \
+-	soft_static.a hard_static.a soft_pic.a hard_pic.a
++	 hard_static.a  hard_pic.a
+ 
+ # Support building compiler-rt with relocatable SDKs.
+ #

diff --git a/sys-devel/llvm/files/clang-3.4-gentoo-install.patch b/sys-devel/llvm/files/clang-3.4-gentoo-install.patch
new file mode 100644
index 00000000..0a1d9eb
--- /dev/null
+++ b/sys-devel/llvm/files/clang-3.4-gentoo-install.patch
@@ -0,0 +1,80 @@
+From a12fc090b3b43fe25c7de50c09782611e3834aeb Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= <mgorny@gentoo.org>
+Date: Sat, 14 Jun 2014 19:35:33 +0200
+Subject: [PATCH] clang gentoo fixes
+
+---
+ tools/clang/lib/Driver/Tools.cpp        | 6 +++---
+ tools/clang/tools/scan-build/scan-build | 4 ++--
+ tools/clang/tools/scan-view/scan-view   | 2 +-
+ 3 files changed, 6 insertions(+), 6 deletions(-)
+
+diff --git a/tools/clang/lib/Driver/Tools.cpp b/tools/clang/lib/Driver/Tools.cpp
+index b013eb5..dbbcacb 100644
+--- a/tools/clang/lib/Driver/Tools.cpp
++++ b/tools/clang/lib/Driver/Tools.cpp
+@@ -222,7 +222,7 @@ static void addProfileRT(const ToolChain &TC, const ArgList &Args,
+   // libprofile_rt.so. We used to use the -l:libprofile_rt.a syntax, but that is
+   // not supported by old linkers.
+   std::string ProfileRT =
+-    std::string(TC.getDriver().Dir) + "/../lib/libprofile_rt.a";
++    "-l:libprofile_rt.a";
+ 
+   CmdArgs.push_back(Args.MakeArgString(ProfileRT));
+ }
+@@ -5911,7 +5911,7 @@ void freebsd::Link::ConstructJob(Compilation &C, const JobAction &JA,
+   // forward.
+   if (D.IsUsingLTO(Args)) {
+     CmdArgs.push_back("-plugin");
+-    std::string Plugin = ToolChain.getDriver().Dir + "/../lib/LLVMgold.so";
++    std::string Plugin = ToolChain.getDriver().Dir + "/../@libdir@/LLVMgold.so";
+     CmdArgs.push_back(Args.MakeArgString(Plugin));
+ 
+     // Try to pass driver level flags relevant to LTO code generation down to
+@@ -6534,7 +6534,7 @@ void gnutools::Link::ConstructJob(Compilation &C, const JobAction &JA,
+   // forward.
+   if (D.IsUsingLTO(Args)) {
+     CmdArgs.push_back("-plugin");
+-    std::string Plugin = ToolChain.getDriver().Dir + "/../lib/LLVMgold.so";
++    std::string Plugin = ToolChain.getDriver().Dir + "/../@libdir@/LLVMgold.so";
+     CmdArgs.push_back(Args.MakeArgString(Plugin));
+ 
+     // Try to pass driver level flags relevant to LTO code generation down to
+diff --git a/tools/clang/tools/scan-build/scan-build b/tools/clang/tools/scan-build/scan-build
+index 0f119f6..58f78d9 100755
+--- a/tools/clang/tools/scan-build/scan-build
++++ b/tools/clang/tools/scan-build/scan-build
+@@ -419,7 +419,7 @@ sub CopyFiles {
+ 
+   my $Dir = shift;
+ 
+-  my $JS = Cwd::realpath("$RealBin/sorttable.js");
++  my $JS = Cwd::realpath("@EPREFIX@/usr/share/llvm/sorttable.js");
+   
+   DieDiag("Cannot find 'sorttable.js'.\n")
+     if (! -r $JS);  
+@@ -429,7 +429,7 @@ sub CopyFiles {
+   DieDiag("Could not copy 'sorttable.js' to '$Dir'.\n")
+     if (! -r "$Dir/sorttable.js");
+     
+-  my $CSS = Cwd::realpath("$RealBin/scanview.css");
++  my $CSS = Cwd::realpath("@EPREFIX@/usr/share/llvm/scanview.css");
+   
+   DieDiag("Cannot find 'scanview.css'.\n")
+     if (! -r $CSS);
+diff --git a/tools/clang/tools/scan-view/scan-view b/tools/clang/tools/scan-view/scan-view
+index fb27da6..1f8ddb8 100755
+--- a/tools/clang/tools/scan-view/scan-view
++++ b/tools/clang/tools/scan-view/scan-view
+@@ -54,7 +54,7 @@ def start_browser(port, options):
+     webbrowser.open(url)
+ 
+ def run(port, options, root):
+-    import ScanView
++    from clang import ScanView
+     try:
+         print 'Starting scan-view at: http://%s:%d'%(options.host,
+                                                      port)
+-- 
+2.0.0
+

diff --git a/sys-devel/llvm/files/llvm-3.4-gentoo-install.patch b/sys-devel/llvm/files/llvm-3.4-gentoo-install.patch
new file mode 100644
index 00000000..a2ba7de
--- /dev/null
+++ b/sys-devel/llvm/files/llvm-3.4-gentoo-install.patch
@@ -0,0 +1,96 @@
+From b8846d389ff5e2b768a114f752cf39788accba26 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= <mgorny@gentoo.org>
+Date: Mon, 19 Aug 2013 13:22:46 +0200
+Subject: [PATCH] gentoo install fixes
+
+---
+ Makefile.config.in                      | 6 +++---
+ Makefile.rules                          | 6 +++---
+ tools/llvm-config/BuildVariables.inc.in | 2 ++
+ tools/llvm-config/Makefile              | 4 ++++
+ tools/llvm-config/llvm-config.cpp       | 5 +++--
+ utils/FileCheck/Makefile                | 2 +-
+ 7 files changed, 17 insertions(+), 10 deletions(-)
+
+diff --git a/Makefile.config.in b/Makefile.config.in
+index dcca45f..e75ae2e 100644
+--- a/Makefile.config.in
++++ b/Makefile.config.in
+@@ -95,10 +95,10 @@ PROJ_internal_prefix := $(prefix)
+ endif
+ 
+ PROJ_bindir     := $(PROJ_prefix)/bin
+-PROJ_libdir     := $(PROJ_prefix)/lib
++PROJ_libdir     := $(PROJ_prefix)/$(GENTOO_LIBDIR)
+ PROJ_datadir    := $(PROJ_prefix)/share
+-PROJ_docsdir    := $(PROJ_prefix)/docs/llvm
+-PROJ_etcdir     := $(PROJ_prefix)/etc/llvm
++PROJ_docsdir    := $(PROJ_prefix)/share/doc/@PF@
++PROJ_etcdir     := @EPREFIX@/etc/llvm
+ PROJ_includedir := $(PROJ_prefix)/include
+ PROJ_infodir    := $(PROJ_prefix)/info
+ PROJ_mandir     := $(PROJ_prefix)/share/man
+diff --git a/Makefile.rules b/Makefile.rules
+index e53598b..217f754 100644
+--- a/Makefile.rules
++++ b/Makefile.rules
+@@ -275,7 +275,7 @@ ifeq ($(ENABLE_OPTIMIZED),1)
+   BuildMode := Release
+   # Don't use -fomit-frame-pointer on Darwin or FreeBSD.
+   ifneq ($(HOST_OS), $(filter $(HOST_OS), Cygwin Darwin DragonFly FreeBSD GNU/kFreeBSD))
+-    OmitFramePointer := -fomit-frame-pointer
++    OmitFramePointer :=
+   endif
+ 
+   CXX.Flags += $(OPTIMIZE_OPTION) $(OmitFramePointer)
+diff --git a/tools/llvm-config/BuildVariables.inc.in b/tools/llvm-config/BuildVariables.inc.in
+index fe87afb..fd9f2c6 100644
+--- a/tools/llvm-config/BuildVariables.inc.in
++++ b/tools/llvm-config/BuildVariables.inc.in
+@@ -25,3 +25,4 @@
+ #define LLVM_BUILDMODE "@LLVM_BUILDMODE@"
+ #define LLVM_TARGETS_BUILT "@LLVM_TARGETS_BUILT@"
+ #define LLVM_SYSTEM_LIBS "@LLVM_SYSTEM_LIBS@"
++#define LLVM_LIBDIR "@LLVM_LIBDIR@"
+diff --git a/tools/llvm-config/Makefile b/tools/llvm-config/Makefile
+index b20b6bf..fc56781 100644
+--- a/tools/llvm-config/Makefile
++++ b/tools/llvm-config/Makefile
+@@ -55,6 +55,8 @@ $(ObjDir)/BuildVariables.inc: $(BUILDVARIABLES_SRCPATH) Makefile $(ObjDir)/.dir
+ 	  >> temp.sed
+ 	$(Verb) $(ECHO) 's/@LLVM_TARGETS_BUILT@/$(subst /,\/,$(TARGETS_TO_BUILD))/' \
+ 	  >> temp.sed
++	$(Verb) $(ECHO) 's/@LLVM_LIBDIR@/$(subst /,\/,$(GENTOO_LIBDIR))/' \
++	  >> temp.sed
+ 	$(Verb) $(SED) -f temp.sed < $< > $@
+ 	$(Verb) $(RM) temp.sed
+ 
+diff --git a/tools/llvm-config/llvm-config.cpp b/tools/llvm-config/llvm-config.cpp
+index 3924e2e..f439c60 100644
+--- a/tools/llvm-config/llvm-config.cpp
++++ b/tools/llvm-config/llvm-config.cpp
+@@ -250,7 +250,7 @@ int main(int argc, char **argv) {
+     ActivePrefix = CurrentExecPrefix;
+     ActiveIncludeDir = ActivePrefix + "/include";
+     ActiveBinDir = ActivePrefix + "/bin";
+-    ActiveLibDir = ActivePrefix + "/lib";
++    ActiveLibDir = ActivePrefix + "/" LLVM_LIBDIR;
+     ActiveIncludeOption = "-I" + ActiveIncludeDir;
+   }
+ 
+diff --git a/utils/FileCheck/Makefile b/utils/FileCheck/Makefile
+index 268b7bc..e7674f9 100644
+--- a/utils/FileCheck/Makefile
++++ b/utils/FileCheck/Makefile
+@@ -15,7 +15,7 @@ USEDLIBS = LLVMSupport.a
+ TOOL_NO_EXPORTS = 1
+ 
+ # Don't install this utility
+-NO_INSTALL = 1
++#NO_INSTALL = 1
+ 
+ include $(LEVEL)/Makefile.common
+ 
+-- 
+1.8.4.2
+

diff --git a/sys-devel/llvm/llvm-3.4.2-r100.ebuild b/sys-devel/llvm/llvm-3.4.2-r100.ebuild
new file mode 100644
index 00000000..5e73596
--- /dev/null
+++ b/sys-devel/llvm/llvm-3.4.2-r100.ebuild
@@ -0,0 +1,245 @@
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+PYTHON_COMPAT=( python2_7 )
+inherit eutils check-reqs flag-o-matic multilib pax-utils prefix \
+	python-any-r1 toolchain-funcs
+
+DESCRIPTION="Low Level Virtual Machine"
+HOMEPAGE="http://llvm.org/"
+SRC_URI="http://llvm.org/releases/${PV}/${P}.src.tar.gz
+	clang? ( http://llvm.org/releases/${PV}/compiler-rt-3.4.src.tar.gz
+		http://llvm.org/releases/${PV}/cfe-${PV}.src.tar.gz )
+	https://dev.gentoo.org/~mgorny/dist/${PN}-3.4-manpages.tar.bz2"
+
+LICENSE="UoI-NCSA"
+SLOT="0/3.4"
+KEYWORDS="~ppc-macos ~x64-macos ~x86-macos"
+IUSE="clang +libffi"
+
+COMMON_DEPEND="
+	sys-libs/zlib:0=
+	libffi? ( >=virtual/libffi-3.0.13-r1:0= )"
+DEPEND="${COMMON_DEPEND}
+	dev-lang/perl
+	>=sys-devel/make-3.81
+	>=sys-devel/flex-2.5.4
+	>=sys-devel/bison-1.875d
+	|| ( >=sys-devel/gcc-apple-4.2.1 >=sys-devel/llvm-3.3 )
+	>=sys-devel/binutils-apple-5.1
+	libffi? ( virtual/pkgconfig )
+	${PYTHON_DEPS}"
+RDEPEND="${COMMON_DEPEND}
+	clang? ( !<=sys-devel/clang-${PV}-r99
+		!>=sys-devel/clang-9999 )"
+PDEPEND="clang? ( =sys-devel/clang-${PV}-r100 )"
+
+S=${WORKDIR}/${P}.src
+
+pkg_pretend() {
+	# in megs
+	# !clang !debug !multitarget -O2       400
+	# !clang !debug  multitarget -O2       550
+	#  clang !debug !multitarget -O2       950
+	#  clang !debug  multitarget -O2      1200
+	# !clang  debug  multitarget -O2      5G
+	#  clang !debug  multitarget -O0 -g  12G
+	#  clang  debug  multitarget -O2     16G
+	#  clang  debug  multitarget -O0 -g  14G
+
+	local build_size=550
+	use clang && build_size=1200
+
+	if is-flagq '-g?(gdb)?([1-9])'; then
+		ewarn "The C++ compiler -g option is known to increase the size of the package"
+		ewarn "considerably. If you run out of space, please consider removing it."
+		ewarn
+
+		(( build_size *= 10 ))
+	fi
+
+	local CHECKREQS_DISK_BUILD=${build_size}M
+	check-reqs_pkg_pretend
+}
+
+pkg_setup() {
+	pkg_pretend
+}
+
+src_unpack() {
+	default
+
+	rm -f "${S}"/tools/clang "${S}"/projects/compiler-rt \
+		|| die "symlinks removal failed"
+
+	if use clang; then
+		mv "${WORKDIR}"/cfe-${PV}.src "${S}"/tools/clang \
+			|| die "clang source directory move failed"
+		mv "${WORKDIR}"/compiler-rt-3.4 "${S}"/projects/compiler-rt \
+			|| die "compiler-rt source directory move failed"
+	fi
+}
+
+src_prepare() {
+	epatch "${FILESDIR}"/${PN}-3.2-nodoctargz.patch
+	epatch "${FILESDIR}"/${PN}-3.4-gentoo-install.patch
+
+	if use clang; then
+		# Automatically select active system GCC's libraries, bugs #406163 and #417913
+		epatch "${FILESDIR}"/clang-3.1-gentoo-runtime-gcc-detection-v3.patch
+
+		epatch "${FILESDIR}"/clang-3.4-gentoo-install.patch
+		epatch "${FILESDIR}"/clang-3.4-darwin_build_fix.patch
+		epatch "${FILESDIR}"/clang-3.4-darwin_prefix-include-paths.patch
+		eprefixify tools/clang/lib/Frontend/InitHeaderSearch.cpp
+	fi
+
+	if use prefix && use clang; then
+		sed -i -e "/^CFLAGS /s@-Werror@-I${EPREFIX}/usr/include@" \
+			projects/compiler-rt/make/platform/clang_*.mk || die
+	fi
+
+	local sub_files=(
+		Makefile.config.in
+		Makefile.rules
+		tools/llvm-config/llvm-config.cpp
+	)
+	use clang && sub_files+=(
+		tools/clang/lib/Driver/Tools.cpp
+		tools/clang/tools/scan-build/scan-build
+	)
+
+	# unfortunately ./configure won't listen to --mandir and the-like, so take
+	# care of this.
+	# note: we're setting the main libdir intentionally.
+	# where per-ABI is appropriate, we use $(GENTOO_LIBDIR) make.
+	einfo "Fixing install dirs"
+	sed -e "s,@libdir@,$(get_libdir),g" \
+		-e "s,@PF@,${PF},g" \
+		-e "s,@EPREFIX@,${EPREFIX},g" \
+		-i "${sub_files[@]}" \
+		|| die "install paths sed failed"
+
+	if use clang; then
+		# constantly fails for a long time, likely due to our patches
+		rm tools/clang/test/Driver/cross-linux.c || die
+	fi
+
+	# User patches
+	epatch_user
+
+	python_setup
+}
+
+multilib_src_configure() {
+	# disable timestamps since they confuse ccache
+	local conf_flags=(
+		--disable-timestamps
+		--enable-keep-symbols
+		--enable-shared
+		--with-optimize-option=
+		--enableoptimized
+		--disable-assertions
+		--disable-expensive-checks
+		--disable-terminfo
+		$(use_enable libffi)
+
+		--enable-bindings=none
+		--enable-targets=host
+
+		ac_cv_prog_XML2CONFIG=""
+	)
+
+	if use clang; then
+		conf_flags+=(
+			--with-clang-resource-dir=../lib/clang/${PV}
+		)
+	fi
+
+	if use libffi; then
+		local CPPFLAGS=${CPPFLAGS}
+		append-cppflags "$(pkg-config --cflags libffi)"
+	fi
+
+	# llvm prefers clang over gcc, so we may need to force that
+	tc-export CC CXX
+
+	ECONF_SOURCE=${S} \
+	econf "${conf_flags[@]}"
+}
+
+src_compile() {
+	LLVM_MAKEARGS=(
+		VERBOSE=1
+		REQUIRES_RTTI=1
+		GENTOO_LIBDIR=$(get_libdir)
+	)
+
+	emake "${LLVM_MAKEARGS[@]}"
+
+	pax-mark m Release/bin/llvm-rtdyld
+	pax-mark m Release/bin/lli
+	pax-mark m Release/bin/lli-child-target
+}
+
+src_install() {
+	emake "${LLVM_MAKEARGS[@]}" DESTDIR="${D}" install
+
+	if ! use clang; then
+		rm "${WORKDIR}"/${PN}-3.4-manpages/clang.1 || die
+	fi
+	doman "${WORKDIR}"/${PN}-3.4-manpages/*.1
+
+	# Fix install_names on Darwin.  The build system is too complicated
+	# to just fix this, so we correct it post-install
+	local lib= f= odylib= ndylib= libpv=${PV}
+	if [[ ${CHOST} == *-darwin* ]] ; then
+		eval $(grep PACKAGE_VERSION= configure)
+		[[ -n ${PACKAGE_VERSION} ]] && libpv=${PACKAGE_VERSION}
+		libpvminor=${libpv%.[0-9]*}
+		for lib in lib{EnhancedDisassembly,LLVM-${libpv},LTO,profile_rt,clang}.dylib LLVMHello.dylib clang/${libpv}/lib/darwin/libclang_rt.asan_{osx,iossim}_dynamic.dylib; do
+			# libEnhancedDisassembly is Darwin10 only, so non-fatal
+			# + omit clang libs if not enabled
+			[[ -f ${ED}/usr/lib/${lib} ]] || continue
+
+			ebegin "fixing install_name of $lib"
+			install_name_tool \
+				-id "${EPREFIX}"/usr/lib/${lib} \
+				"${ED}"/usr/lib/${lib}
+			eend $?
+		done
+		for f in "${ED}"/usr/bin/* "${ED}"/usr/lib/lib*.dylib "${ED}"/usr/lib/clang/${libpv}/lib/darwin/*.dylib ; do
+			# omit clang libs if not enabled
+			[[ -f "${f}" ]] || continue
+
+			scanmacho -BF'%n#f' "${f}" | tr ',' '\n' | \
+			while read odylib ; do
+				ndylib=
+				case ${odylib} in
+					*/libclang.dylib)
+						ndylib="${EPREFIX}"/usr/lib/libclang.dylib
+						;;
+					*/libLLVM-${libpv}.dylib)
+						ndylib="${EPREFIX}"/usr/lib/libLLVM-${libpv}.dylib
+						;;
+					*/libLLVM-${libpvminor}.dylib)
+						ndylib="${EPREFIX}"/usr/lib/libLLVM-${libpvminor}.dylib
+						;;
+					*/libLTO.dylib)
+						ndylib="${EPREFIX}"/usr/lib/libLTO.dylib
+						;;
+				esac
+				if [[ -n ${ndylib} ]] ; then
+					ebegin "fixing install_name reference to ${odylib} of ${f##*/}"
+					install_name_tool \
+						-change "${odylib}" "${ndylib}" \
+						"${f}"
+					eend $?
+				fi
+			done
+		done
+	fi
+}


^ permalink raw reply related	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2016-09-10  8:55 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-05-12 11:49 [gentoo-commits] repo/gentoo:master commit in: sys-devel/llvm/files/, sys-devel/llvm/ Michał Górny
  -- strict thread matches above, loose matches on Subject: below --
2016-09-10  8:55 Fabian Groffen
2016-08-21 18:51 Michał Górny
2016-06-23 15:57 Patrice Clement
2016-06-05 11:47 Michał Górny
2016-03-28 21:31 Michał Górny
2016-03-09 13:35 Bernard Cafarelli
2016-01-07 22:10 Michał Górny
2015-12-27 22:52 Michał Górny
2015-12-05 15:50 Michał Górny
2015-10-11 18:41 Bernard Cafarelli

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox