summaryrefslogtreecommitdiff
path: root/bin/find-can-be-private-symbols.py
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2020-07-07 09:28:32 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2020-07-07 17:44:23 +0200
commitca46feb2ff915c6842b87cd5799a83af8003f3cd (patch)
tree08a8775c2038655f12e9341f469e8e2404844045 /bin/find-can-be-private-symbols.py
parenta041cb54351326cd8beb39abac23f07f35de5463 (diff)
make some symbols private
Change-Id: I224831ad18e754fd67d9b16510cd286a5397f1f3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/98236 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'bin/find-can-be-private-symbols.py')
-rwxr-xr-xbin/find-can-be-private-symbols.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/bin/find-can-be-private-symbols.py b/bin/find-can-be-private-symbols.py
index f5ff83fd1757..d679dd2a24bf 100755
--- a/bin/find-can-be-private-symbols.py
+++ b/bin/find-can-be-private-symbols.py
@@ -30,14 +30,14 @@ classes_with_imported_symbols = set()
all_source_names = set()
-# look for imported symbols in executables
-subprocess_find_all_source_names = subprocess.Popen("git grep -oh -P '\\b\\w\\w\\w+\\b' -- '*.h*'", stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
+subprocess_find_all_source_names = subprocess.Popen("git grep -oh -P '\\b\\w\\w\\w+\\b' -- '*.h*' | sort -u", stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
with subprocess_find_all_source_names.stdout as txt:
for line in txt:
line = line.strip()
all_source_names.add(line)
subprocess_find_all_source_names.terminate()
+# find all our shared libs
subprocess_find = subprocess.Popen("find ./instdir -name *.so && find ./workdir/LinkTarget/CppunitTest -name *.so", stdout=subprocess.PIPE, shell=True)
with subprocess_find.stdout as txt:
for line in txt:
@@ -51,7 +51,8 @@ with subprocess_find.stdout as txt:
for line2 in txt2:
line2 = line2.strip()
if line_regex.match(line2):
- exported_symbols.add(line2.split(" ")[2])
+ sym = line2.split(" ")[2]
+ exported_symbols.add(sym)
# look for imported symbols
subprocess_objdump = subprocess.Popen("objdump -T " + sharedlib, stdout=subprocess.PIPE, shell=True)
with subprocess_objdump.stdout as txt2: