mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-02-01 05:01:59 +01:00
[llvm-shlib] Fix cross-compilation for LLVM-C
When we're cross-compiling, build and use a native llvm-nm instead of attempting to use the one from the target's build tree. A nice follow-up would be to add a cache variable to allow specifying a path to an external native llvm-nm instead of building one ourselves, similar to LLVM_TABLEGEN and LLVM_CONFIG_PATH. Differential Revision: https://reviews.llvm.org/D60025 llvm-svn: 357487
This commit is contained in:
parent
ed8d685665
commit
16077c1bdc
@ -164,9 +164,17 @@ if(MSVC)
|
||||
|
||||
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 $<TARGET_FILE: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 )
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user