mirror of
https://sourceware.org/git/glibc.git
synced 2025-10-12 19:04:54 +03:00
* shlib-versions [USE_IN_LIBIO] (.*-.*-gnu-gnu*): Set earliest
supported version for libc 0.2.90.libio to GLIBC_2.2. * Makeconfig (soversions.mk): Grok new third column in shlib-versions, and use it to emit new variable `map-firstversions'. * scripts/firstversions.awk: New file. * Makerules (Versions.all): Use scripts/firstversions.awk and the $(map-firstversions) value to generate a modified versions list that includes renames in "A = B" syntax for each version set earlier than the "earliest symbol version" named in shlib-versions. * scripts/versions.awk: Recognize "A = B" lines in the input to mean rename version set A to B in the output to the intermediate file. * scripts/abi-versions.awk: New file. * Makerules (abi-versions.h): New target, generated by that script. [$(versioning) = yes] (before-compile): Prepend abi-versions.h. * include/shlib-compat.h: New file, uses that generated header.
This commit is contained in:
39
scripts/abi-versions.awk
Normal file
39
scripts/abi-versions.awk
Normal file
@@ -0,0 +1,39 @@
|
||||
# Script to generate <abi-versions.h> header file from Versions.all list.
|
||||
# See include/shlib-compat.h comments for explanation.
|
||||
|
||||
BEGIN {
|
||||
print "/* This file is automatically generated by abi-versions.awk.";
|
||||
print " It defines symbols used by shlib-compat.h, which see. */";
|
||||
print "\n#ifndef _ABI_VERSIONS_H\n#define _ABI_VERSIONS_H";
|
||||
}
|
||||
|
||||
NF == 2 && $2 == "{" {
|
||||
thislib = $1;
|
||||
gsub(/[^A-Za-z0-9_ ]/, "_"); libid = $1;
|
||||
printf "\n/* start %s */\n", thislib;
|
||||
next;
|
||||
}
|
||||
$1 == "}" {
|
||||
printf "/* end %s */\n", thislib;
|
||||
next;
|
||||
}
|
||||
|
||||
$2 == "=" {
|
||||
new = $3;
|
||||
gsub(/[^A-Za-z0-9_ ]/, "_"); id = $1;
|
||||
printf "#define ABI_%s_%s\t0\t/* earliest supported %s */\n", libid, id, new;
|
||||
printf "#define VERSION_%s_%s\t%s\n", libid, id, new;
|
||||
next;
|
||||
}
|
||||
|
||||
{
|
||||
vers = $1;
|
||||
gsub(/[^A-Za-z0-9_ ]/, "_"); id = $1;
|
||||
printf "#define ABI_%s_%s\t1\t/* support %s */\n", libid, id, vers;
|
||||
printf "#define VERSION_%s_%s\t%s\n", libid, id, vers;
|
||||
next;
|
||||
}
|
||||
|
||||
END {
|
||||
print "\n#endif /* abi-versions.h */";
|
||||
}
|
27
scripts/firstversions.awk
Normal file
27
scripts/firstversions.awk
Normal file
@@ -0,0 +1,27 @@
|
||||
# Script to preprocess Versions.all lists based on "earliest version"
|
||||
# specifications in the shlib-versions file.
|
||||
|
||||
NF == 3 && $2 == ":" { firstversion[$1] = $3; next }
|
||||
|
||||
NF == 2 && $2 == "{" { thislib = $1; print; next }
|
||||
|
||||
$1 == "}" {
|
||||
if (firstversion[thislib]) {
|
||||
# We haven't seen the stated version, but have produced
|
||||
# others pointing to it, so we synthesize it now.
|
||||
printf " %s\n", firstversion[thislib];
|
||||
}
|
||||
print;
|
||||
next;
|
||||
}
|
||||
|
||||
{
|
||||
if (! firstversion[thislib])
|
||||
print;
|
||||
else if ($1 == firstversion[thislib]) {
|
||||
print;
|
||||
firstversion[thislib] = 0;
|
||||
}
|
||||
else
|
||||
print $1, "=", firstversion[thislib];
|
||||
}
|
@@ -16,7 +16,10 @@ BEGIN {
|
||||
libs[$1] = 1;
|
||||
curlib = $1;
|
||||
while (getline < defsfile && ! /^}/) {
|
||||
versions[$1] = 1;
|
||||
if ($2 == "=")
|
||||
renamed[$1] = $3;
|
||||
else
|
||||
versions[$1] = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -33,6 +36,7 @@ BEGIN {
|
||||
|
||||
# This matches the beginning of the version information for a new library.
|
||||
/^[a-zA-Z0-9_.]+/ {
|
||||
delete renamed;
|
||||
actlib = $1;
|
||||
if (!libs[$1]) {
|
||||
printf("no versions defined for %s\n", $1) > "/dev/stderr";
|
||||
@@ -43,11 +47,14 @@ BEGIN {
|
||||
|
||||
# This matches the beginning of a new version for the current library.
|
||||
/^ [A-Za-z_]/ {
|
||||
actver = $1;
|
||||
if (!versions[$1]) {
|
||||
if (renamed[$1])
|
||||
actver = renamed[$1];
|
||||
else if (!versions[$1]) {
|
||||
printf("version %s not defined\n", $1) > "/dev/stderr";
|
||||
exit 1;
|
||||
}
|
||||
else
|
||||
actver = $1;
|
||||
next;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user