Index: llvm/cmake/modules/AddLLVM.cmake =================================================================== --- llvm/cmake/modules/AddLLVM.cmake +++ llvm/cmake/modules/AddLLVM.cmake @@ -811,6 +811,7 @@ get_target_property(lib_type ${lib} TYPE) if("${lib_type}" STREQUAL "STATIC_LIBRARY") list(APPEND static_libs ${lib}) + list(APPEND static_lib_files $) else() list(APPEND other_libs ${lib}) endif() @@ -833,7 +834,7 @@ set(mangling itanium) endif() add_custom_command(OUTPUT ${exported_symbol_file} - COMMAND ${PYTHON_EXECUTABLE} ${LLVM_MAIN_SRC_DIR}/utils/extract_symbols.py --mangling=${mangling} ${static_libs} -o ${exported_symbol_file} + COMMAND ${PYTHON_EXECUTABLE} ${LLVM_MAIN_SRC_DIR}/utils/extract_symbols.py --mangling=${mangling} ${static_lib_files} -o ${exported_symbol_file} WORKING_DIRECTORY ${LLVM_LIBRARY_OUTPUT_INTDIR} DEPENDS ${LLVM_MAIN_SRC_DIR}/utils/extract_symbols.py ${static_libs} VERBATIM Index: llvm/utils/extract_symbols.py =================================================================== --- llvm/utils/extract_symbols.py +++ llvm/utils/extract_symbols.py @@ -393,19 +393,7 @@ # Get the list of libraries to extract symbols from libs = list() for lib in args.libs: - # When invoked by cmake the arguments are the cmake target names of the - # libraries, so we need to add .lib/.a to the end and maybe lib to the - # start to get the filename. Also allow objects. - suffixes = ['.lib','.a','.obj','.o'] - if not any([lib.endswith(s) for s in suffixes]): - for s in suffixes: - if os.path.exists(lib+s): - lib = lib+s - break - if os.path.exists('lib'+lib+s): - lib = 'lib'+lib+s - break - if not any([lib.endswith(s) for s in suffixes]): + if not os.path.exists(lib): print("Don't know what to do with argument "+lib, file=sys.stderr) exit(1) libs.append(lib)