From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id 6AA2C138202 for ; Mon, 19 Nov 2012 01:11:37 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 6085721C038; Mon, 19 Nov 2012 01:11:29 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id A3EF121C038 for ; Mon, 19 Nov 2012 01:11:28 +0000 (UTC) Received: from hornbill.gentoo.org (hornbill.gentoo.org [94.100.119.163]) (using TLSv1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 5845033D78F for ; Mon, 19 Nov 2012 01:11:27 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by hornbill.gentoo.org (Postfix) with ESMTP id B274CE5436 for ; Mon, 19 Nov 2012 01:11:25 +0000 (UTC) From: "Mike Frysinger" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Mike Frysinger" Message-ID: <1353284826.9021391c1b8aca00b3b09b03766bd0d09f7ed339.vapier@gentoo> Subject: [gentoo-commits] proj/gcc-config:master commit in: / X-VCS-Repository: proj/gcc-config X-VCS-Files: gcc-config X-VCS-Directories: / X-VCS-Committer: vapier X-VCS-Committer-Name: Mike Frysinger X-VCS-Revision: 9021391c1b8aca00b3b09b03766bd0d09f7ed339 X-VCS-Branch: master Date: Mon, 19 Nov 2012 01:11:25 +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: 218470cf-5bd9-456c-8f5a-82e59b605bd3 X-Archives-Hash: a5f2b2c8135d3db83e35e258e6be6499 commit: 9021391c1b8aca00b3b09b03766bd0d09f7ed339 Author: Mike Frysinger gentoo org> AuthorDate: Sat Sep 29 06:32:45 2012 +0000 Commit: Mike Frysinger gentoo org> CommitDate: Mon Nov 19 00:27:06 2012 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=proj/gcc-config.git;a=commit;h=9021391c gcc-config: only handle default ABI libgcc_s with split /usr Since a split /usr system should only be running the default ABI before mounting /usr, there's no need to walk and setup all the other ABIs. This might break very weird systems, but they shouldn't be doing that in the first place. And this makes the code much simpler. Signed-off-by: Mike Frysinger gentoo.org> --- gcc-config | 70 ++++++++++++++++++----------------------------------------- 1 files changed, 22 insertions(+), 48 deletions(-) diff --git a/gcc-config b/gcc-config index 9cf69fb..0445335 100755 --- a/gcc-config +++ b/gcc-config @@ -294,32 +294,15 @@ handle_split_usr() { # # The funky move magic is required for proper updating of in-use files. # - # XXX: This fails when configuring the native target in a cross-compiled - # ROOT. Only way around that is to store the multilib configuration - # in the gcc profile when we compiled it and then read that instead - # of executing the gcc. Some day. - # # We use the same ordering logic as mentioned in the MY_LDPATH setup. # We get the libs from the latest version available. - local LATEST_GCC_PATH gcc LATEST_GCC_LDPATH - - eval $(gawk -F= ' - { - if ($1 == "GCC_PATH") { - p = gensub("\"","","g",$2) - } else if ($1 == "LDPATH") { - l = gensub("\"","","g",$2) - } - } - END { - print "LATEST_GCC_PATH=\"" p "\"" - print "LATEST_GCC_LDPATH=\"" l "\"" - } - ' "${GCC_ENV_D}"/${CHOST}-* - ) + local LDPATH + + eval $(grep -h '^LDPATH=' "${GCC_ENV_D}"/${CHOST}-* | tail -1) + LDPATH=${LDPATH%%:*} # If /usr isn't a sep mount, then don't bother with linking stuff. - if ln "${ROOT}/${LATEST_GCC_LDPATH%%:*}/libgcc.a" "${ROOT}"/lib/.gcc.config.$$ 2>/dev/null ; then + if ln "${ROOT}/${LDPATH}/libgcc.a" "${ROOT}"/lib/.gcc.config.$$ 2>/dev/null ; then rm -f "${ROOT}"/lib/.gcc.config.$$ if [[ -n $(find "${ROOT}"/lib*/lib{gcc_s,unwind}.so* 2>/dev/null) ]] ; then # If we previously had stuff in /, make sure ldconfig gets re-run. @@ -329,34 +312,25 @@ handle_split_usr() { return 0 fi - gcc="${ROOT}${LATEST_GCC_PATH}/gcc" - - local multilib - for multilib in $("${gcc}" -print-multi-lib); do - local multiarg=${multilib#*;} - multiarg=${multiarg/@/-} - local multilibdir=${multilib%;*} - local libdir="${ROOT}lib/"$("${gcc}" ${multiarg} -print-multi-os-directory) - - mkdir -p "${libdir}"/.gcc.config.new || continue # !?!?! - - local gcclib - for gcclib in gcc_s unwind ; do - # This assumes that we always have the .so symlink, - # but for now, that should be safe ... - gcclib=$("${gcc}" -print-file-name="lib${gcclib}.so") - if [[ ${gcclib} == */* ]] ; then - cp -pP "${ROOT}${gcclib}".* "${libdir}"/.gcc.config.new/ - # no need to sanity remove this as the `mv` should take - # care of it. we also need this step to be completly atomic - # for systems that have even `mv` linked against libgcc_s.so. - # http://bugs.gentoo.org/150257 - #rm -f "${libdir}"/lib${gcclib}.so* - mv -f "${libdir}"/.gcc.config.new/* "${libdir}"/ - fi + # Only bother with this stuff for the native ABI. We assume the user + # doesn't have critical binaries for non-native ABIs which is fair. + local gcclib + local libdir="${ROOT}${GENTOO_LIBDIR}" + mkdir -p "${libdir}"/.gcc.config.new || return 0 # !?!?! + for gcclib in gcc_s unwind ; do + # This assumes that we always have the .so symlink, + # but for now, that should be safe ... + for gcclib in "${ROOT}${LDPATH}"/lib${gcclib}.so.* ; do + [[ -e ${gcclib} ]] || continue + cp -pP "${gcclib}" "${libdir}"/.gcc.config.new/ + # no need to sanity `rm` this as the `mv` should take care + # of it. we also need this step to be completely atomic + # for systems that have even `mv` linked against libgcc_s.so. + # http://bugs.gentoo.org/150257 + mv -f "${libdir}"/.gcc.config.new/* "${libdir}"/ done - rmdir "${libdir}"/.gcc.config.new done + rmdir "${libdir}"/.gcc.config.new return 0 }