From patchwork Thu Oct 29 14:47:14 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Florian Weimer X-Patchwork-Id: 537899 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]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 21666140FDA for ; Fri, 30 Oct 2015 01:47:31 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.b=yxqTzxGG; dkim-atps=neutral DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:to:from:subject:message-id:date:mime-version :content-type; q=dns; s=default; b=Gb8ztdamkbNFtPMvOtV/j1bh5Kk9G lbb9ONXGDQLsRFF7A28hF8dLVFMby180PGeLA2gm+X7gG0ej3GCGwjsk3atEQsTz zpIS4LFMMR9GB5LNlnXFhpszUkDvuuoxk9DIYXlIwFcWJOhCjfACqjk9BYQiL8oM f15xeL6RKQzAfs= 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:to:from:subject:message-id:date:mime-version :content-type; s=default; bh=vIteHvvgunnMMG+kAwmSe6e3UEs=; b=yxq TzxGGrYi1TnbFN05LFMIjMIYo/okXIwWxojULhM4wsF65oaQFqoaqXwOCaVHakUn aTE65NEpXSR76+CwYtI72TEhf7o4WLYxPxqnaNCiAoxibT6gJUvHzS5BxzxmsvYz SHe0HWqWxgWZKYzfglivZD//vuQ2fiNVlt3cCY9s= Received: (qmail 726 invoked by alias); 29 Oct 2015 14:47:25 -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 712 invoked by uid 89); 29 Oct 2015 14:47:25 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.6 required=5.0 tests=AWL, BAYES_00, RP_MATCHES_RCVD, SPF_HELO_PASS autolearn=ham version=3.3.2 X-HELO: mx1.redhat.com To: GNU C Library From: Florian Weimer Subject: [PATCH] Simplify the abilist format X-Enigmail-Draft-Status: N1110 Message-ID: <56323172.2060800@redhat.com> Date: Thu, 29 Oct 2015 15:47:14 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 MIME-Version: 1.0 This picks up an old idea, which had some support at the time: The new format lists the version on each line, as in: VERSION SYMBOL TYPE [VALUE] This makes it easier to process the files with line-oriented tools. The abilist files were converted with this awk script: /^[^ ]/ { version = $1 } /^ / { print version, substr($0, 2) } And sorted under the "C" locale with sort. (The patch does not contain the automatically-generated part.) I checked that “make update-abi” still works. Florian 2015-10-29 Florian Weimer * scripts/abilist.awk: Collect descriptors in the descs variable. (emit): Write descs variable and sort it externally, with sort. * sysdeps/**/*.abilist: Convert to new format. diff --git a/scripts/abilist.awk b/scripts/abilist.awk index 52b5b32..bd740d4 100644 --- a/scripts/abilist.awk +++ b/scripts/abilist.awk @@ -100,17 +100,13 @@ $2 == "g" || $2 == "w" && (NF == 7 || NF == 8) { # Disabled -- weakness should not matter to shared library ABIs any more. #if (weak == "w") type = tolower(type); if (desc == "") - desc = " " symbol " " type size; + desc = symbol " " type size; if (combine) version = soname " " version (combine_fullname ? " " sofullname : ""); - if (version in versions) { - versions[version] = versions[version] "\n" desc; - } - else { - versions[version] = desc; - } + # Append to the string which collects the results. + descs = descs version " " desc "\n"; next; } @@ -126,65 +122,20 @@ function emit(end) { return; tofile = parse_names && !combine; - nverslist = 0; - for (version in versions) { - if (nverslist == 0) { - verslist = version; - nverslist = 1; - continue; - } - split(verslist, s, "\n"); - if (version < s[1]) { - verslist = version; - for (i = 1; i <= nverslist; ++i) { - verslist = verslist "\n" s[i]; - } - } - else { - verslist = s[1]; - for (i = 2; i <= nverslist; ++i) { - if (version < s[i]) break; - verslist = verslist "\n" s[i]; - } - verslist = verslist "\n" version; - for (; i <= nverslist; ++i) { - verslist = verslist "\n" s[i]; - } - } - ++nverslist; - } - if (tofile) { out = prefix soname ".symlist"; if (soname in outfiles) out = out "." ++outfiles[soname]; else outfiles[soname] = 1; - printf "" > out; + outpipe = "LC_ALL=C sort -u > " out; + } else { + outpipe = "LC_ALL=C sort -u"; } - split(verslist, order, "\n"); - for (i = 1; i <= nverslist; ++i) { - version = order[i]; - - if (tofile) { - print version >> out; - close(out); - outpipe = "sort >> " out; - } - else { - if (combine) - print ""; - print prefix version; - outpipe = "sort"; - } - print versions[version] | outpipe; - close(outpipe); - - delete versions[version]; - } - for (version in versions) - delete versions[version]; + printf "%s", descs | outpipe; + + descs = ""; if (tofile) print "wrote", out, "for", sofullname;