This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH roland/Versions.def] Get rid of Versions.def source file
- From: Roland McGrath <roland at hack dot frob dot com>
- To: "Joseph S. Myers" <joseph at codesourcery dot com>
- Cc: "GNU C. Library" <libc-alpha at sourceware dot org>, Carlos O'Donell <carlos at redhat dot com>
- Date: Tue, 25 Mar 2014 11:22:16 -0700 (PDT)
- Subject: Re: [PATCH roland/Versions.def] Get rid of Versions.def source file
- Authentication-results: sourceware.org; auth=none
- References: <20140228214559 dot BD8BF744B6 at topped-with-meat dot com> <Pine dot LNX dot 4 dot 64 dot 1403211805400 dot 4557 at digraph dot polyomino dot org dot uk> <20140321201830 dot 3221874477 at topped-with-meat dot com> <Pine dot LNX dot 4 dot 64 dot 1403212238150 dot 19717 at digraph dot polyomino dot org dot uk> <20140321225348 dot 142A8744AA at topped-with-meat dot com> <Pine dot LNX dot 4 dot 64 dot 1403220011340 dot 19717 at digraph dot polyomino dot org dot uk> <Pine dot LNX dot 4 dot 64 dot 1403220031230 dot 19717 at digraph dot polyomino dot org dot uk>
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 <roland@hack.frob.com>
* 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 "}";
}
}