Index: llvm/trunk/tools/llvm-shlib/CMakeLists.txt =================================================================== --- llvm/trunk/tools/llvm-shlib/CMakeLists.txt +++ llvm/trunk/tools/llvm-shlib/CMakeLists.txt @@ -164,9 +164,17 @@ set(LLVM_EXPORTED_SYMBOL_FILE ${CMAKE_BINARY_DIR}/${CMAKE_CFG_INTDIR}/libllvm-c.exports) + if(CMAKE_CROSSCOMPILING) + build_native_tool(llvm-nm llvm_nm) + set(llvm_nm_target "${llvm_nm}") + else() + set(llvm_nm $) + set(llvm_nm_target llvm-nm) + endif() + add_custom_command(OUTPUT ${LLVM_EXPORTED_SYMBOL_FILE} - COMMAND ${PYTHON_EXECUTABLE} ${GEN_SCRIPT} --libsfile ${LIBSFILE} ${GEN_UNDERSCORE} --nm ${LLVM_TOOLS_BINARY_DIR}/llvm-nm -o ${LLVM_EXPORTED_SYMBOL_FILE} - DEPENDS ${LIB_NAMES} llvm-nm + COMMAND ${PYTHON_EXECUTABLE} ${GEN_SCRIPT} --libsfile ${LIBSFILE} ${GEN_UNDERSCORE} --nm "${llvm_nm}" -o ${LLVM_EXPORTED_SYMBOL_FILE} + DEPENDS ${LIB_NAMES} ${llvm_nm_target} COMMENT "Generating export list for LLVM-C" VERBATIM )