Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lld: copy unwind only when building from source #210

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 0 additions & 6 deletions external/llvm/llvm_deps.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,6 @@ include(llvm_spirv_source_hook)
# LLD source hook.
if(IGC_OPTION__LLVM_LLD)
include(llvm_lld_source_hook)
if(NOT EXISTS "${IGC_LLVM_WORKSPACE_SRC}/libunwind/include/mach-o" AND ${IGC_OPTION__LLVM_PREFERRED_VERSION} GREATER_EQUAL "12.0.0")
# Need to copy one header from unwind package for LLD (only for building from sources)
file(MAKE_DIRECTORY ${IGC_LLVM_WORKSPACE_SRC}/libunwind/include/mach-o)
file(COPY ${DEFAULT_IGC_LLVM_SOURCES_DIR}/libunwind/include/mach-o/compact_unwind_encoding.h
DESTINATION ${IGC_LLVM_WORKSPACE_SRC}/libunwind/include/mach-o/)
endif()
endif()

# Process LLVM.
Expand Down
7 changes: 7 additions & 0 deletions external/llvm/llvm_lld_source_hook.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -47,5 +47,12 @@ if(NOT EXISTS "${IGC_COPIED_LLD_DIR}")
execute_process(COMMAND ${CMAKE_COMMAND} -E copy_directory ${IGC_OPTION__lld_SOURCES_DIR} ${IGC_COPIED_LLD_DIR})
endif()

if(NOT EXISTS "${IGC_LLVM_WORKSPACE_SRC}/libunwind/include/mach-o" AND ${IGC_OPTION__LLVM_PREFERRED_VERSION} GREATER_EQUAL "12.0.0")
# Need to copy one header from unwind package for LLD (only for building from sources)
file(MAKE_DIRECTORY ${IGC_LLVM_WORKSPACE_SRC}/libunwind/include/mach-o)
file(COPY ${DEFAULT_IGC_LLVM_SOURCES_DIR}/libunwind/include/mach-o/compact_unwind_encoding.h
DESTINATION ${IGC_LLVM_WORKSPACE_SRC}/libunwind/include/mach-o/)
endif()

# Just register lld as external llvm project.
register_llvm_external_project(lld ${IGC_COPIED_LLD_DIR})