* scripts/versions.awk: Improve error message for missing version.

Each version inherits from the last one only if they have the same
	nonnumeric prefix, i.e. GLIBC_x.y and GLIBC_x.z or FOO_x and FOO_y
	but not GLIBC_x and FOO_y.

	* scripts/firstversions.awk: Handle libraries that don't have each
	particular version named in the third column of shlib-versions.
This commit is contained in:
Roland McGrath 2002-02-07 05:25:11 +00:00
parent 9813e10395
commit 48a5e01019
3 changed files with 28 additions and 7 deletions

View File

@ -1,5 +1,13 @@
2002-02-06 Roland McGrath <roland@frob.com>
* scripts/versions.awk: Improve error message for missing version.
Each version inherits from the last one only if they have the same
nonnumeric prefix, i.e. GLIBC_x.y and GLIBC_x.z or FOO_x and FOO_y
but not GLIBC_x and FOO_y.
* scripts/firstversions.awk: Handle libraries that don't have each
particular version named in the third column of shlib-versions.
* scripts/firstversions.awk: Don't mess with GLIBC_PRIVATE.
2002-02-06 Ulrich Drepper <drepper@redhat.com>

View File

@ -11,7 +11,7 @@ NF > 2 && $2 == ":" {
NF == 2 && $2 == "{" { thislib = $1; print; next }
$1 == "}" {
if (firstversion[thislib, idx[thislib]]) {
if ((thislib, idx[thislib]) in firstversion) {
# We haven't seen the stated version, but have produced
# others pointing to it, so we synthesize it now.
printf " %s\n", firstversion[thislib, idx[thislib]];
@ -25,12 +25,19 @@ $1 == "}" {
{
if ((thislib, idx[thislib]) in firstversion) {
# XXX relative string comparison loses if we ever have multiple digits
# between dots in GLIBC_x.y[.z] names.
v = firstversion[thislib, idx[thislib]];
if ($1 == v) {
print;
while ($1 >= v) {
firstversion[thislib, idx[thislib]] = 0;
idx[thislib]++;
if ((thislib, idx[thislib]) in firstversion)
v = firstversion[thislib, idx[thislib]];
else
break;
}
if ($1 >= v)
print;
else
print $1, "=", v;
}

View File

@ -1,5 +1,5 @@
# Combine version map fragments into version scripts for our shared objects.
# Copyright (C) 1998,99,2000 Free Software Foundation, Inc.
# Copyright (C) 1998,99,2000,02 Free Software Foundation, Inc.
# Written by Ulrich Drepper <drepper@cygnus.com>, 1998.
# This script expects the following variables to be defined:
@ -49,7 +49,7 @@ BEGIN {
if (renamed[actlib "::" $1])
actver = renamed[actlib "::" $1];
else if (!versions[$1]) {
printf("version %s not defined\n", $1) > "/dev/stderr";
printf("version %s not defined for %s\n", $1, actlib) > "/dev/stderr";
exit 1;
}
else
@ -73,7 +73,13 @@ function closeversion(name, oldname) {
printf(" local:\n *;\n") > outfile;
firstinfile = 0;
}
printf("}%s;\n", oldname) > outfile;
# This version inherits from the last one only if they
# have the same nonnumeric prefix, i.e. GLIBC_x.y and GLIBC_x.z
# or FOO_x and FOO_y but not GLIBC_x and FOO_y.
pfx = oldname;
sub(/[0-9.]+/,".+",pfx);
if (oldname == "" || name !~ pfx) print "};" > outfile;
else printf("} %s;\n", oldname) > outfile;
}
function close_and_move(name, real_name) {
@ -87,7 +93,7 @@ END {
oldlib = "";
oldver = "";
printf("version-maps =");
while(getline < tmpfile) {
while (getline < tmpfile) {
if ($1 != oldlib) {
if (oldlib != "") {
closeversion(oldver, veryoldver);