diff --git a/libcxx/lib/abi/CMakeLists.txt b/libcxx/lib/abi/CMakeLists.txt --- a/libcxx/lib/abi/CMakeLists.txt +++ b/libcxx/lib/abi/CMakeLists.txt @@ -59,7 +59,7 @@ if (EXISTS "${abi_list_file}") add_custom_target(check-cxx-abilist - "${Python3_EXECUTABLE}" "${LIBCXX_SOURCE_DIR}/utils/sym_diff.py" + "${Python3_EXECUTABLE}" "${LIBCXX_SOURCE_DIR}/../utils/sym_diff.py" --only-stdlib-symbols --strict "${abi_list_file}" $ @@ -70,7 +70,7 @@ endif() add_custom_target(generate-cxx-abilist - COMMAND "${Python3_EXECUTABLE}" "${LIBCXX_SOURCE_DIR}/utils/generate_abi_list.py" + COMMAND "${Python3_EXECUTABLE}" "${LIBCXX_SOURCE_DIR}/../utils/generate_abi_list.py" --output "${abi_list_file}" "$" DEPENDS cxx_shared diff --git a/libcxx/utils/generate_abi_list.py b/runtimes/utils/generate_abi_list.py rename from libcxx/utils/generate_abi_list.py rename to runtimes/utils/generate_abi_list.py --- a/libcxx/utils/generate_abi_list.py +++ b/runtimes/utils/generate_abi_list.py @@ -9,8 +9,8 @@ import argparse import io -import libcxx.sym_check.extract -import libcxx.sym_check.util +import sym_check.extract +import sym_check.util import pprint import sys @@ -28,10 +28,15 @@ parser.add_argument('-o', '--output', dest='output', type=OutputFile, default=sys.stdout, help='The output file to write the symbols to. It is overwritten if it already exists. ' 'If no file is specified, the results are written to standard output.') + parser.add_argument('--only-stdlib-symbols', dest='only_stdlib', + help='Filter all symbols not related to the stdlib', + action='store_true', default=False) args = parser.parse_args(argv) - symbols = libcxx.sym_check.extract.extract_symbols(args.library) - symbols, _ = libcxx.sym_check.util.filter_stdlib_symbols(symbols) + symbols = sym_check.extract.extract_symbols(args.library) + + if args.only_stdlib: + symbols, _ = sym_check.util.filter_stdlib_symbols(symbols) lines = [pprint.pformat(sym, width=99999) for sym in symbols] args.output.writelines('\n'.join(sorted(lines))) diff --git a/libcxx/utils/libcxx/sym_check/__init__.py b/runtimes/utils/sym_check/__init__.py rename from libcxx/utils/libcxx/sym_check/__init__.py rename to runtimes/utils/sym_check/__init__.py --- a/libcxx/utils/libcxx/sym_check/__init__.py +++ b/runtimes/utils/sym_check/__init__.py @@ -6,7 +6,7 @@ # #===----------------------------------------------------------------------===## -"""libcxx abi symbol checker""" +"""abi symbol checker""" __author__ = 'Eric Fiselier' __email__ = 'eric@efcs.ca' diff --git a/libcxx/utils/libcxx/sym_check/diff.py b/runtimes/utils/sym_check/diff.py rename from libcxx/utils/libcxx/sym_check/diff.py rename to runtimes/utils/sym_check/diff.py --- a/libcxx/utils/libcxx/sym_check/diff.py +++ b/runtimes/utils/sym_check/diff.py @@ -10,7 +10,7 @@ diff - A set of functions for diff-ing two symbol lists. """ -from libcxx.sym_check import util +from sym_check import util def _symbol_difference(lhs, rhs): diff --git a/libcxx/utils/libcxx/sym_check/extract.py b/runtimes/utils/sym_check/extract.py rename from libcxx/utils/libcxx/sym_check/extract.py rename to runtimes/utils/sym_check/extract.py --- a/libcxx/utils/libcxx/sym_check/extract.py +++ b/runtimes/utils/sym_check/extract.py @@ -16,7 +16,7 @@ import subprocess import sys -from libcxx.sym_check import util +from sym_check import util extract_ignore_names = ['_init', '_fini'] diff --git a/libcxx/utils/libcxx/sym_check/match.py b/runtimes/utils/sym_check/match.py rename from libcxx/utils/libcxx/sym_check/match.py rename to runtimes/utils/sym_check/match.py diff --git a/libcxx/utils/libcxx/sym_check/util.py b/runtimes/utils/sym_check/util.py rename from libcxx/utils/libcxx/sym_check/util.py rename to runtimes/utils/sym_check/util.py --- a/libcxx/utils/libcxx/sym_check/util.py +++ b/runtimes/utils/sym_check/util.py @@ -108,9 +108,9 @@ def extract_or_load(filename): - import libcxx.sym_check.extract + import sym_check.extract if is_library_file(filename): - return libcxx.sym_check.extract.extract_symbols(filename) + return sym_check.extract.extract_symbols(filename) return read_syms_from_file(filename) def adjust_mangled_name(name): diff --git a/libcxx/utils/sym_diff.py b/runtimes/utils/sym_diff.py rename from libcxx/utils/sym_diff.py rename to runtimes/utils/sym_diff.py --- a/libcxx/utils/sym_diff.py +++ b/runtimes/utils/sym_diff.py @@ -12,7 +12,7 @@ from argparse import ArgumentParser import sys -from libcxx.sym_check import diff, util +from sym_check import diff, util def main():