diff --git a/pkgs/development/compilers/llvm/14/openmp/fix-find-tool.patch b/pkgs/development/compilers/llvm/14/openmp/fix-find-tool.patch index b5d0e7b417757..7cdb74121377b 100644 --- a/pkgs/development/compilers/llvm/14/openmp/fix-find-tool.patch +++ b/pkgs/development/compilers/llvm/14/openmp/fix-find-tool.patch @@ -1,8 +1,8 @@ diff --git a/libomptarget/DeviceRTL/CMakeLists.txt b/libomptarget/DeviceRTL/CMakeLists.txt -index 242df638f80d..a4654e96371f 100644 +index d8b9e40802b8..3a8d76ab370f 100644 --- a/libomptarget/DeviceRTL/CMakeLists.txt +++ b/libomptarget/DeviceRTL/CMakeLists.txt -@@ -25,16 +25,16 @@ endif() +@@ -25,10 +25,10 @@ endif() if (LLVM_DIR) # Builds that use pre-installed LLVM have LLVM_DIR set. @@ -13,42 +13,23 @@ index 242df638f80d..a4654e96371f 100644 - find_program(OPT_TOOL opt PATHS ${LLVM_TOOLS_BINARY_DIR} NO_DEFAULT_PATH) + REQUIRED) + find_program(OPT_TOOL opt PATHS ${LLVM_TOOLS_BINARY_DIR} REQUIRED) - libomptarget_say("Building DeviceRTL. Using clang: ${CLANG_TOOL}") - elseif (LLVM_TOOL_CLANG_BUILD AND NOT CMAKE_CROSSCOMPILING AND NOT OPENMP_STANDALONE_BUILD) - # LLVM in-tree builds may use CMake target names to discover the tools. -- set(CLANG_TOOL $) -- set(LINK_TOOL $) -- set(OPT_TOOL $) -+ set(CLANG_TOOL $ REQUIRED) -+ set(LINK_TOOL $ REQUIRED) -+ set(OPT_TOOL $ REQUIRED) - libomptarget_say("Building DeviceRTL. Using clang from in-tree build") - else() - libomptarget_say("Not building DeviceRTL. No appropriate clang found") + if ((NOT CLANG_TOOL) OR (NOT LINK_TOOL) OR (NOT OPT_TOOL)) + libomptarget_say("Not building DeviceRTL. Missing clang: ${CLANG_TOOL}, llvm-link: ${LINK_TOOL} or opt: ${OPT_TOOL}") + return() diff --git a/libomptarget/deviceRTLs/amdgcn/CMakeLists.txt b/libomptarget/deviceRTLs/amdgcn/CMakeLists.txt -index 3f4c02671aeb..be9f4677d7b5 100644 +index 406013073024..7402ab1ea292 100644 --- a/libomptarget/deviceRTLs/amdgcn/CMakeLists.txt +++ b/libomptarget/deviceRTLs/amdgcn/CMakeLists.txt -@@ -38,16 +38,16 @@ endif() +@@ -38,9 +38,9 @@ endif() if (LLVM_DIR) # Builds that use pre-installed LLVM have LLVM_DIR set. - find_program(CLANG_TOOL clang PATHS ${LLVM_TOOLS_BINARY_DIR} NO_DEFAULT_PATH) -+ find_program(CLANG_TOOL clang PATHS ${LLVM_TOOLS_BINARY_DIR} REQUIRED) - find_program(LINK_TOOL llvm-link PATHS ${LLVM_TOOLS_BINARY_DIR} -- NO_DEFAULT_PATH) +- find_program(LINK_TOOL llvm-link PATHS ${LLVM_TOOLS_BINARY_DIR} NO_DEFAULT_PATH) - find_program(OPT_TOOL opt PATHS ${LLVM_TOOLS_BINARY_DIR} NO_DEFAULT_PATH) -+ REQUIRED) ++ find_program(CLANG_TOOL clang PATHS ${LLVM_TOOLS_BINARY_DIR} REQUIRED) ++ find_program(LINK_TOOL llvm-link PATHS ${LLVM_TOOLS_BINARY_DIR} REQUIRED) + find_program(OPT_TOOL opt PATHS ${LLVM_TOOLS_BINARY_DIR} REQUIRED) - libomptarget_say("Building AMDGCN device RTL. Using clang: ${CLANG_TOOL}") - elseif (LLVM_TOOL_CLANG_BUILD AND NOT CMAKE_CROSSCOMPILING AND NOT OPENMP_STANDALONE_BUILD) - # LLVM in-tree builds may use CMake target names to discover the tools. -- set(CLANG_TOOL $) -- set(LINK_TOOL $) -- set(OPT_TOOL $) -+ set(CLANG_TOOL $ REQUIRED) -+ set(LINK_TOOL $ REQUIRED) -+ set(OPT_TOOL $ REQUIRED) - libomptarget_say("Building AMDGCN device RTL. Using clang from in-tree build") - else() - libomptarget_say("Not building AMDGCN device RTL. No appropriate clang found") + if ((NOT CLANG_TOOL) OR (NOT LINK_TOOL) OR (NOT OPT_TOOL)) + libomptarget_say("Not building AMDGCN device RTL. Missing clang: ${CLANG_TOOL}, llvm-link: ${LINK_TOOL} or opt: ${OPT_TOOL}") + return()