Update prebuilt Clang to match Android kernel.
Bug: 132428451
Change-Id: I8f6e2cb23f381fc0c02ddea99b867e58e925e5be
diff --git a/linux-x64/clang/lib64/cmake/llvm/TableGen.cmake b/linux-x64/clang/lib64/cmake/llvm/TableGen.cmake
index d1afcb4..3c84ae7 100644
--- a/linux-x64/clang/lib64/cmake/llvm/TableGen.cmake
+++ b/linux-x64/clang/lib64/cmake/llvm/TableGen.cmake
@@ -25,7 +25,7 @@
file(RELATIVE_PATH ofn_rel
${CMAKE_BINARY_DIR} ${CMAKE_CURRENT_BINARY_DIR}/${ofn})
set(additional_cmdline
- -o ${ofn_rel}.tmp
+ -o ${ofn_rel}
-d ${ofn_rel}.d
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
DEPFILE ${CMAKE_CURRENT_BINARY_DIR}/${ofn}.d
@@ -36,7 +36,7 @@
file(GLOB local_tds "*.td")
file(GLOB_RECURSE global_tds "${LLVM_MAIN_INCLUDE_DIR}/llvm/*.td")
set(additional_cmdline
- -o ${CMAKE_CURRENT_BINARY_DIR}/${ofn}.tmp
+ -o ${CMAKE_CURRENT_BINARY_DIR}/${ofn}
)
endif()
@@ -69,8 +69,7 @@
# dependency twice in the result file when
# ("${${project}_TABLEGEN_TARGET}" STREQUAL "${${project}_TABLEGEN_EXE}")
# but lets us having smaller and cleaner code here.
- add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${ofn}.tmp
- # Generate tablegen output in a temporary file.
+ add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${ofn}
COMMAND ${${project}_TABLEGEN_EXE} ${ARGN} -I ${CMAKE_CURRENT_SOURCE_DIR}
${LLVM_TABLEGEN_FLAGS}
${LLVM_TARGET_DEFINITIONS_ABSOLUTE}
@@ -83,20 +82,9 @@
${LLVM_TARGET_DEFINITIONS_ABSOLUTE}
COMMENT "Building ${ofn}..."
)
- add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${ofn}
- # Only update the real output file if there are any differences.
- # This prevents recompilation of all the files depending on it if there
- # aren't any.
- COMMAND ${CMAKE_COMMAND} -E copy_if_different
- ${CMAKE_CURRENT_BINARY_DIR}/${ofn}.tmp
- ${CMAKE_CURRENT_BINARY_DIR}/${ofn}
- DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/${ofn}.tmp
- COMMENT "Updating ${ofn}..."
- )
# `make clean' must remove all those generated files:
- set_property(DIRECTORY APPEND
- PROPERTY ADDITIONAL_MAKE_CLEAN_FILES ${ofn}.tmp ${ofn})
+ set_property(DIRECTORY APPEND PROPERTY ADDITIONAL_MAKE_CLEAN_FILES ${ofn})
set(TABLEGEN_OUTPUT ${TABLEGEN_OUTPUT} ${CMAKE_CURRENT_BINARY_DIR}/${ofn} PARENT_SCOPE)
set_source_files_properties(${CMAKE_CURRENT_BINARY_DIR}/${ofn} PROPERTIES
@@ -158,6 +146,12 @@
llvm_ExternalProject_BuildCmd(tblgen_build_cmd ${target}
${LLVM_NATIVE_BUILD}
CONFIGURATION Release)
+ # Create an artificial dependency between tablegen projects, because they
+ # compile the same dependencies, thus using the same build folders.
+ # FIXME: A proper fix requires sequentially chaining tablegens.
+ if (NOT ${project} STREQUAL LLVM AND TARGET ${project}-tablegen-host)
+ add_dependencies(${project}-tablegen-host LLVM-tablegen-host)
+ endif()
add_custom_command(OUTPUT ${${project}_TABLEGEN_EXE}
COMMAND ${tblgen_build_cmd}
DEPENDS CONFIGURE_LLVM_NATIVE ${target}