Index: llvm/runtimes/CMakeLists.txt =================================================================== --- llvm/runtimes/CMakeLists.txt +++ llvm/runtimes/CMakeLists.txt @@ -407,6 +407,9 @@ add_dependencies(install-${component} install-${component}-${name}) add_dependencies(install-${component}-stripped install-${component}-${name}-stripped) endforeach() + if("$name" STREQUAL "openmp") + add_dependencies(runtimes-${name} opt llvm-link) + endif() endforeach() foreach(multilib ${LLVM_RUNTIME_MULTILIBS}) Index: openmp/libomptarget/deviceRTLs/amdgcn/CMakeLists.txt =================================================================== --- openmp/libomptarget/deviceRTLs/amdgcn/CMakeLists.txt +++ openmp/libomptarget/deviceRTLs/amdgcn/CMakeLists.txt @@ -157,7 +157,7 @@ add_custom_command( OUTPUT ${bc_libname} COMMAND ${LINK_TOOL} ${bc_files} | ${OPT_TOOL} --always-inline -o ${OUTPUTDIR}/${bc_libname} - DEPENDS ${bc_files} opt) + DEPENDS ${bc_files} llvm-link opt) add_custom_target(lib${libname}-${mcpu} ALL DEPENDS ${bc_libname})