summaryrefslogtreecommitdiff
path: root/buildtools
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2011-02-28 17:13:07 +0100
committerJelmer Vernooij <jelmer@samba.org>2011-02-28 21:11:21 +0100
commit0bd390e706135fca80ce82e8b3cf3841d7f142fb (patch)
tree973177f8331032ceaeb741508f6b3283f0b3641d /buildtools
parent31d09b13d3dc3aa204cf416bdf87eb39b7fe5de2 (diff)
downloadsamba-0bd390e706135fca80ce82e8b3cf3841d7f142fb.tar.gz
samba-0bd390e706135fca80ce82e8b3cf3841d7f142fb.tar.bz2
samba-0bd390e706135fca80ce82e8b3cf3841d7f142fb.zip
samba_abi: Generate vscript entries even for ABI versions that didn't introduce
any new symbols. The version entries also appear in the symbol table and removing them (we always add an entry for the current version) breaks the ABI.
Diffstat (limited to 'buildtools')
-rw-r--r--buildtools/wafsamba/samba_abi.py31
1 files changed, 21 insertions, 10 deletions
diff --git a/buildtools/wafsamba/samba_abi.py b/buildtools/wafsamba/samba_abi.py
index ebd5210317..396a7fc906 100644
--- a/buildtools/wafsamba/samba_abi.py
+++ b/buildtools/wafsamba/samba_abi.py
@@ -145,8 +145,16 @@ def abi_process_file(fname, version, symmap):
symmap[symname] = version
f.close()
-def abi_write_vscript(vscript, libname, version, symmap, abi_match):
- '''write a vscript file for a library in --version-script format'''
+def abi_write_vscript(vscript, libname, current_version, versions, symmap, abi_match):
+ '''write a vscript file for a library in --version-script format
+
+ :param vscript: Path to the vscript file
+ :param libname: Name of the library, uppercased
+ :param current_version: Current version
+ :param versions: Versions to consider
+ :param symmap: Dictionary mapping symbols -> version
+ :param abi_match: List of symbols considered to be public in the current version
+ '''
invmap = {}
for s in symmap:
@@ -154,16 +162,18 @@ def abi_write_vscript(vscript, libname, version, symmap, abi_match):
f = open(vscript, mode='w')
last_key = ""
- for k in sorted(invmap):
+ for k in sorted(versions):
symver = "%s_%s" % (libname, k)
- if symver == version:
+ if symver == current_version:
break
- f.write("%s {\n\tglobal: \n" % symver)
- for s in invmap[k]:
- f.write("\t\t%s;\n" % s);
+ f.write("%s {\n" % symver)
+ if k in invmap:
+ f.write("\tglobal: \n")
+ for s in invmap.get(k, []):
+ f.write("\t\t%s;\n" % s);
f.write("}%s;\n\n" % last_key)
last_key = " %s" % symver
- f.write("%s {\n" % version)
+ f.write("%s {\n" % current_version)
f.write("\tglobal:\n")
for x in abi_match:
f.write("\t\t%s;\n" % x)
@@ -179,13 +189,14 @@ def abi_build_vscript(task):
tgt = task.outputs[0].bldpath(task.env)
symmap = {}
-
+ versions = []
for f in task.inputs:
fname = f.abspath(task.env)
basename = os.path.basename(fname)
version = basename[len(task.env.LIBNAME)+1:-len(".sigs")]
+ versions.append(version)
abi_process_file(fname, version, symmap)
- abi_write_vscript(tgt, task.env.LIBNAME, task.env.VERSION, symmap,
+ abi_write_vscript(tgt, task.env.LIBNAME, task.env.VERSION, versions, symmap,
task.env.ABI_MATCH)