From patchwork Fri Sep 21 04:42:38 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Holsgrove X-Patchwork-Id: 185571 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) by ozlabs.org (Postfix) with SMTP id BEFC42C0085 for ; Fri, 21 Sep 2012 14:43:01 +1000 (EST) Comment: DKIM? See http://www.dkim.org DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=sourceware.org; s=default; x=1348807382; h=Comment: DomainKey-Signature:Received:Received:Received:Received:Received: Received:Content-Type:MIME-Version:Content-Transfer-Encoding: Subject:Message-Id:User-Agent:Date:From:To:Cc:Mailing-List: Precedence:List-Id:List-Unsubscribe:List-Subscribe:List-Archive: List-Post:List-Help:Sender:Delivered-To; bh=5G5XhAPW5e3pgh2PRK1c Igpe5vw=; b=HbS1919WgViNnGxAyyUQVq8uvddSbZpIS7QW9PK+BTUpSKiRXZLF nI/FECV4m8qOlS3BbP7nZ92GtT/tvmJo/ehoS8yjRdDiZIRfeFvKs8g1k9W6zxLj alau7ubXmS/SICUh1A2YY3B05sagSbHxCahqnApLkQZs96NlOBzcrOw= Comment: DomainKeys? See http://antispam.yahoo.com/domainkeys DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=default; d=sourceware.org; h=Received:Received:X-SWARE-Spam-Status:X-Spam-Check-By:Received:Received:X-Google-DKIM-Signature:Received:Received:Content-Type:MIME-Version:Content-Transfer-Encoding:Subject:X-Mercurial-Node:Message-Id:User-Agent:Date:From:To:Cc:X-Gm-Message-State:X-IsSubscribed:Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Subscribe:List-Archive:List-Post:List-Help:Sender:Delivered-To; b=jCxquRa/gzr2BWbfbcuttURL2U2Xpy/V7sYEiYC59yfzWXU1KlzX695AtWLZAQ Uuq0lsHV0cFub32EJlzSklvE7RH3nt4FTpg7dze/zK4JDU73AmtjM31a+euum+R6 d1K9ePFeld7avsSdm1r0CZ3fgLAEbnQnsiix6HSWxAChs=; Received: (qmail 10348 invoked by alias); 21 Sep 2012 04:42:57 -0000 Received: (qmail 10339 invoked by uid 22791); 21 Sep 2012 04:42:56 -0000 X-SWARE-Spam-Status: No, hits=-2.2 required=5.0 tests=AWL, BAYES_00, KHOP_RCVD_UNTRUST, RCVD_IN_DNSWL_LOW, RCVD_IN_HOSTKARMA_YE, TW_MX X-Spam-Check-By: sourceware.org Received: from mail-pb0-f41.google.com (HELO mail-pb0-f41.google.com) (209.85.160.41) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 21 Sep 2012 04:42:43 +0000 Received: by pbbro12 with SMTP id ro12so7439206pbb.0 for ; Thu, 20 Sep 2012 21:42:43 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=sender:content-type:mime-version:content-transfer-encoding:subject :x-mercurial-node:message-id:user-agent:date:from:to:cc :x-gm-message-state; bh=mb1/GIfsdzzg6/UWe9JPzQ9aHqIsM/78JSIP9arODH4=; b=iPxw1A5D7HJru+zhYSTaxx9lMKDtjYIl8ZdVnt/MG3penqv6MZOGkzMP5hB/ppUyw0 OTHMgypAxxg7bd4ni6OJ3PC9D+qcl4k8Lr1+bN6mK+djdgjK8QRpkPFomcGvc/nOn+H7 nmdN8qe4+YiFGRZEAe2fsd7Lo+ADF356lVDcFhkBELgPS9RYF4kkyUt9zojucB5bkvbH GXT75Q4gKngkQdhJJ5SkOcb4NG8XVRrUijKag6rNdtCBX5ithAOV6E7WuI23jedFJn46 kPcpB+UvrdGl8Lg70jbHsz/JgatG6OOgI/4Zv8ODN0dpmkDNCG+7yNU2WaycR7ZV5ul+ 7mOw== Received: by 10.66.88.3 with SMTP id bc3mr10274720pab.51.1348202563067; Thu, 20 Sep 2012 21:42:43 -0700 (PDT) Received: from localhost ([124.148.20.9]) by mx.google.com with ESMTPS id ou1sm4536212pbb.24.2012.09.20.21.42.41 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 20 Sep 2012 21:42:42 -0700 (PDT) MIME-Version: 1.0 Subject: [PATCH] scripts/glibc-eglibc.sh-common: broken symlinks created for nested multilib X-Mercurial-Node: 886f1bbadce3c2a5ea07a4a46ce140a5a04dc555 Message-Id: <886f1bbadce3c2a5ea07.1348202558@localhost.localdomain> User-Agent: Mercurial-patchbomb/2.3.1 Date: Fri, 21 Sep 2012 14:42:38 +1000 From: David Holsgrove To: yann.morin.1998@free.fr Cc: crossgcc@sourceware.org X-Gm-Message-State: ALoCoQm1GfA4B6Y+3YM61ED+fwe5iRDotVl4iS7FVfFGfwOY4i94rzmlufr+8gY+/ORMOlp98y7v X-IsSubscribed: yes Mailing-List: contact crossgcc-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: crossgcc-owner@sourceware.org Delivered-To: mailing list crossgcc@sourceware.org # HG changeset patch # User David Holsgrove # Date 1348202094 -36000 # Node ID 886f1bbadce3c2a5ea07a4a46ce140a5a04dc555 # Parent d9ae5974b0bd4f111c00b38a4edd6656bd1f0226 scripts/glibc-eglibc.sh-common: broken symlinks created for nested multilib dirs glibc-eglibc.sh-common prepares a number of symlinks for use in building C Library, which is iterated through for each multilib combo, however there is a hardcoded number of backsteps in the symlink command which assumes the multi_dir is only 1 directory deep. This means we are creating broken symlinks for nested multilib dirs, eg; gcc configured with these multilibs (besides the default): -mxl-barrel-shift --> bs/ -mxl-barrel-shift -mno-xl-soft-mul --> bs/m/ -mxl-barrel-shift -mno-xl-soft-mul -mxl-multiply-high --> bs/m/mh/ multi_dir=bs; ln -sf "../lib/bs" "bs/lib" <- Ok multi_dir=bs/m; ln -sf "../lib/bs/m" "bs/m/lib" <- Broken multi_dir=bs/m/mh; ln -sf "../lib/bs/m/mh" "bs/m/mh/lib" <- Broken In the Final C Library step, we perform a "Fixing up multilib location" stage, which in each loop removes its temporary multi_dir - a problem with nested multilib dirs, as the first loop may be for 'bs' say, which will remove the 'bs' directory, and the nested dirs for bs/m, bs/m/mh along with it, before they have gone through their own do_libc_backend_once iteration. The solution I propose is similar to how the build-libc-${libc_mode} directories are created - replacing '/' with '_' and having a flat structure for these temp multi_dirs Signed-off-by: "David Holsgrove" --- For unsubscribe information see http://sourceware.org/lists.html#faq diff -r d9ae5974b0bd -r 886f1bbadce3 scripts/build/libc/glibc-eglibc.sh-common --- a/scripts/build/libc/glibc-eglibc.sh-common Thu Sep 20 15:21:40 2012 +1000 +++ b/scripts/build/libc/glibc-eglibc.sh-common Fri Sep 21 14:34:54 2012 +1000 @@ -77,6 +77,7 @@ local multi_dir local multi_flags local extra_dir + local flat_dir local libc_headers libc_startfiles libc_full local hdr local arg @@ -112,10 +113,11 @@ extra_flags="$( echo "${multilib#*;}" \ |${sed} -r -e 's/@/ -/g;' \ )" - extra_dir="/${multi_dir}" + flat_dir="libc_${multi_dir//\//_}" + extra_dir="/${flat_dir}" - # glibc install its files in ${extra_dir}/{usr/,}lib - # while gcc expects them in {,usr/}lib/${extra_dir}. + # glibc install its files in /${flat_dir}/{usr/,}lib + # while gcc expects them in {,usr/}lib/${multi_dir}. # Prepare some symlinks so glibc installs in fact in # the proper place # We do it in the start-files step, so it is not needed @@ -125,10 +127,10 @@ CT_Pushd "${CT_SYSROOT_DIR}" CT_DoExecLog ALL mkdir -p "lib/${multi_dir}" \ "usr/lib/${multi_dir}" \ - "${multi_dir}" \ - "${multi_dir}/usr" - CT_DoExecLog ALL ln -sf "../lib/${multi_dir}" "${multi_dir}/lib" - CT_DoExecLog ALL ln -sf "../../usr/lib/${multi_dir}" "${multi_dir}/usr/lib" + "${flat_dir}" \ + "${flat_dir}/usr" + CT_DoExecLog ALL ln -sf "../lib/${multi_dir}" "${flat_dir}/lib" + CT_DoExecLog ALL ln -sf "../../usr/lib/${multi_dir}" "${flat_dir}/usr/lib" CT_Popd fi libc_headers= @@ -164,8 +166,8 @@ fi done done - # Remove the multi_dir now it is no longer useful - CT_DoExecLog DEBUG rm -rf "${CT_SYSROOT_DIR}/${multi_dir}" + # Remove the flat_dir now it is no longer useful + CT_DoExecLog DEBUG rm -rf "${CT_SYSROOT_DIR}/${flat_dir}" fi # libc_mode == final CT_EndStep