From patchwork Tue Mar 25 18:22:16 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Roland McGrath X-Patchwork-Id: 279 Return-Path: X-Original-To: siddhesh@wilcox.dreamhost.com Delivered-To: siddhesh@wilcox.dreamhost.com Received: from homiemail-mx22.g.dreamhost.com (caibbdcaabij.dreamhost.com [208.113.200.189]) by wilcox.dreamhost.com (Postfix) with ESMTP id D84A1360158 for ; Tue, 25 Mar 2014 11:22:22 -0700 (PDT) Received: by homiemail-mx22.g.dreamhost.com (Postfix, from userid 14307373) id 8605742F6B0C; Tue, 25 Mar 2014 11:22:22 -0700 (PDT) X-Original-To: glibc@patchwork.siddhesh.in Delivered-To: x14307373@homiemail-mx22.g.dreamhost.com Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by homiemail-mx22.g.dreamhost.com (Postfix) with ESMTPS id 5857B4319E37 for ; Tue, 25 Mar 2014 11:22:22 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:mime-version:content-type :content-transfer-encoding:from:to:cc:subject:in-reply-to :references:message-id:date; q=dns; s=default; b=kMPSyFA2g3ef+DX ryLqLkmOm/2mPjAkGV7tpjikz6dNZHMB1Sj0r4C1+VNegwGgJ95Ln+WCWpTSk0Va YQFP5rPmRmn6y8PgJf2yqBymUUORgJb3hpv3ieeBUcfcBVZ1JiSa5H0JMmcqg+mn LKrp+cHdPOaq0Api9niXJXvc/qpM= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:mime-version:content-type :content-transfer-encoding:from:to:cc:subject:in-reply-to :references:message-id:date; s=default; bh=DJxM/btF4XeRpLqF3Xlbd KQWkbY=; b=VIItWCS/PPc9pZhacVK4Q7umy4uq+OKPvY81XKq2NP/fau0+jClIm Qbx0CQyyhcDBFKEULEkvwCGpcYrdms+d6cKn/KpthXaI6+ebEj40gd77V0bv3xfK 9cv5BObVRY0dGeexpyMpmzVzTCjzsrcLj6bi1EtR7Eejru2H3mpwZY= Received: (qmail 2870 invoked by alias); 25 Mar 2014 18:22:20 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 2859 invoked by uid 89); 25 Mar 2014 18:22:19 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.3 required=5.0 tests=AWL, BAYES_00 autolearn=ham version=3.3.2 X-HELO: topped-with-meat.com MIME-Version: 1.0 From: Roland McGrath To: "Joseph S. Myers" Cc: "GNU C. Library" , Carlos O'Donell Subject: Re: [PATCH roland/Versions.def] Get rid of Versions.def source file In-Reply-To: Joseph S. Myers's message of Saturday, 22 March 2014 00:33:39 +0000 References: <20140228214559.BD8BF744B6@topped-with-meat.com> <20140321201830.3221874477@topped-with-meat.com> <20140321225348.142A8744AA@topped-with-meat.com> Message-Id: <20140325182216.960597445E@topped-with-meat.com> Date: Tue, 25 Mar 2014 11:22:16 -0700 (PDT) X-CMAE-Score: 0 X-CMAE-Analysis: v=2.1 cv=Rt9WckWK c=1 sm=1 tr=0 a=WkljmVdYkabdwxfqvArNOQ==:117 a=14OXPxybAAAA:8 a=B08KqwHghHcA:10 a=Z6MIti7PxpgA:10 a=kj9zAlcOel0A:10 a=hOe2yjtxAAAA:8 a=TKvwx5arEhCM4CZq4jcA:9 a=CjuIK1q_8ugA:10 X-DH-Original-To: glibc@patchwork.siddhesh.in This was the quickest fix that seems like it works, but it's a kludge (also on branch roland/Versions.def-sort). Please test it for the mips case. I think the really proper approach is to preserve the order sets appeared in Versions files. I'll look into implementing that now. Thanks, Roland 2014-03-25 Roland McGrath * scripts/versionlist.awk: Partition the version sets and emit all GLIBC_* (sorted) before all others (sorted). --- a/scripts/versionlist.awk +++ b/scripts/versionlist.awk @@ -3,14 +3,25 @@ BEGIN { in_lib = ""; in_version = 0 } -!in_lib && NF == 2 && $2 == "{" { in_lib = $1; next } +!in_lib && NF == 2 && $2 == "{" { + in_lib = $1; + all_libs[in_lib] = 1; + next +} !in_lib { next } NF == 2 && $2 == "{" { in_version = 1; - libs[in_lib] = libs[in_lib] " " $1 "\n"; lib_versions[in_lib, $1] = 1; - all_versions[$1] = 1; + # Partition the version sets into GLIBC_* and others. + if ($1 ~ /GLIBC_/) { + libs[in_lib] = libs[in_lib] " " $1 "\n"; + all_versions[$1] = 1; + } + else { + others_libs[in_lib] = others_libs[in_lib] " " $1 "\n"; + others_all_versions[$1] = 1; + } next } @@ -20,20 +31,37 @@ in_version { next } $1 == "}" { in_lib = ""; next } END { - nlibs = asorti(libs, libs_order); + nlibs = asorti(all_libs, libs_order); for (i = 1; i <= nlibs; ++i) { lib = libs_order[i]; for (v in all_versions) { - if (!((in_lib, v) in lib_versions)) { + if (!((lib, v) in lib_versions)) { libs[lib] = libs[lib] " " v "\n"; } } + for (v in others_all_versions) { + if (!((lib, v) in lib_versions)) { + others_libs[lib] = others_libs[lib] " " v "\n"; + } + } + print lib, "{"; + + # Sort and print all the GLIBC_* sets first, then all the others. + # This is not really generically right, but it suffices + # for the cases we have so far. e.g. GCC_3.0 is "later than" + # all GLIBC_* sets that matter for purposes of Versions files. + sort = "sort -u -t. -k 1,1 -k 2n,2n -k 3"; printf "%s", libs[lib] | sort; close(sort); + + sort = "sort -u -t. -k 1,1 -k 2n,2n -k 3"; + printf "%s", others_libs[lib] | sort; + close(sort); + print "}"; } }