From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id CA970138330 for ; Sat, 1 Oct 2016 19:06:15 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 3034921C07B; Sat, 1 Oct 2016 19:06:10 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 170F621C07B for ; Sat, 1 Oct 2016 19:06:10 +0000 (UTC) Received: from oystercatcher.gentoo.org (unknown [IPv6:2a01:4f8:202:4333:225:90ff:fed9:fc84]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 946D83408F9 for ; Sat, 1 Oct 2016 19:06:03 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 5F75024A7 for ; Sat, 1 Oct 2016 19:06:01 +0000 (UTC) From: "Michał Górny" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Michał Górny" Message-ID: <1475348759.93a7dfc1e15d39ae382e56d6da1e775e08efbdd3.mgorny@gentoo> Subject: [gentoo-commits] repo/gentoo:master commit in: sys-libs/compiler-rt/ X-VCS-Repository: repo/gentoo X-VCS-Files: sys-libs/compiler-rt/compiler-rt-9999.ebuild X-VCS-Directories: sys-libs/compiler-rt/ X-VCS-Committer: mgorny X-VCS-Committer-Name: Michał Górny X-VCS-Revision: 93a7dfc1e15d39ae382e56d6da1e775e08efbdd3 X-VCS-Branch: master Date: Sat, 1 Oct 2016 19:06:01 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Archives-Salt: d93cca19-e4ef-4af1-9acb-436f6eedbc7f X-Archives-Hash: 5e3dfd23f691643cf1738de2944fc4f5 commit: 93a7dfc1e15d39ae382e56d6da1e775e08efbdd3 Author: Michał Górny gentoo org> AuthorDate: Sat Oct 1 18:58:18 2016 +0000 Commit: Michał Górny gentoo org> CommitDate: Sat Oct 1 19:05:59 2016 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=93a7dfc1 sys-libs/compiler-rt: Support bootstrapping with runtime-less clang sys-libs/compiler-rt/compiler-rt-9999.ebuild | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/sys-libs/compiler-rt/compiler-rt-9999.ebuild b/sys-libs/compiler-rt/compiler-rt-9999.ebuild index 751fac9..1f8d174 100644 --- a/sys-libs/compiler-rt/compiler-rt-9999.ebuild +++ b/sys-libs/compiler-rt/compiler-rt-9999.ebuild @@ -9,7 +9,7 @@ CMAKE_MIN_VERSION=3.4.3 PYTHON_COMPAT=( python2_7 ) # TODO: fix unnecessary dep on Python upstream -inherit cmake-utils flag-o-matic git-r3 python-any-r1 +inherit cmake-utils flag-o-matic git-r3 python-any-r1 toolchain-funcs DESCRIPTION="Compiler runtime library for clang (built-in part)" HOMEPAGE="http://llvm.org/" @@ -28,10 +28,23 @@ DEPEND="${RDEPEND} ~sys-devel/llvm-${PV} ${PYTHON_DEPS}" +test_compiler() { + $(tc-getCC) ${CFLAGS} ${LDFLAGS} "${@}" -o /dev/null -x c - \ + <<<'int main() { return 0; }' &>/dev/null +} + src_configure() { # pre-set since we need to pass it to cmake BUILD_DIR=${WORKDIR}/${P}_build + if ! test_compiler; then + local extra_flags=( -nodefaultlibs -lc ) + if test_compiler "${extra_flags[@]}"; then + local -x LDFLAGS="${LDFLAGS} ${extra_flags[*]}" + ewarn "${CC} seems to lack runtime, trying with ${extra_flags[*]}" + fi + fi + local clang_version=4.0.0 local libdir=$(get_libdir) local mycmakeargs=(