mirror of
https://github.com/MariaDB/server.git
synced 2025-02-02 12:01:42 +01:00
check for globals in the lib that are not prefixed with toku. addresses #74
git-svn-id: file:///svn/tokudb@844 c7de825b-a66e-492c-adef-691d508d4ae1
This commit is contained in:
parent
d71d3efc80
commit
0cb6474b8c
1 changed files with 43 additions and 0 deletions
43
src/tokuglobals.py
Normal file
43
src/tokuglobals.py
Normal file
|
@ -0,0 +1,43 @@
|
|||
#!/usr/bin/python
|
||||
|
||||
import sys
|
||||
import os
|
||||
import re
|
||||
|
||||
def checkglobals(libname, exceptsymbols, verbose):
|
||||
badglobals = 0
|
||||
nmcmd = "nm -g " + libname
|
||||
f = os.popen(nmcmd)
|
||||
b = f.readline()
|
||||
while b != "":
|
||||
match = re.match("^([0-9a-f]+)\s(.?)\s(.*)$", b)
|
||||
if match == None:
|
||||
match = re.match("^\s+(.*)$", b)
|
||||
if match == None:
|
||||
print "unknown", b
|
||||
badglobals = 1
|
||||
else:
|
||||
type = match.group(2)
|
||||
symbol = match.group(3)
|
||||
if verbose: print type, symbol
|
||||
match = re.match("^toku_", symbol)
|
||||
if match == None and not exceptsymbols.has_key(symbol):
|
||||
print "non toku symbol=", symbol
|
||||
badglobals = 1
|
||||
b = f.readline()
|
||||
f.close()
|
||||
return badglobals
|
||||
|
||||
def main():
|
||||
verbose = 0
|
||||
for arg in sys.argv[1:]:
|
||||
if arg == "-v":
|
||||
verbose += 1
|
||||
exceptsymbols = {}
|
||||
for n in [ "_init", "_fini", "_end", "_edata", "__bss_start" ]:
|
||||
exceptsymbols[n] = 1
|
||||
for n in [ "db_env_create", "db_create", "db_strerror", "db_version", "log_compare" ]:
|
||||
exceptsymbols[n] = 1
|
||||
return checkglobals("libdb.so", exceptsymbols, verbose)
|
||||
|
||||
sys.exit(main())
|
Loading…
Add table
Reference in a new issue