diff --git a/openmp/libomptarget/src/omptarget.cpp b/openmp/libomptarget/src/omptarget.cpp --- a/openmp/libomptarget/src/omptarget.cpp +++ b/openmp/libomptarget/src/omptarget.cpp @@ -266,14 +266,27 @@ "for debugging options.\n"); SourceInfo Info(Loc); + + if (PM->RTLs.UsedRTLs.empty()) { + if (Info.isAvailible()) + fprintf(stderr, "%s:%d:%d: ", Info.getFilename(), Info.getLine(), + Info.getColumn()); + FAILURE_MESSAGE("None of the images found are compatible: "); + for (auto &[Image, Info] : PM->Images) + fprintf(stderr, "%s ", Info.Arch); + fprintf(stderr, "\n"); + } + if (Info.isAvailible()) fprintf(stderr, "%s:%d:%d: ", Info.getFilename(), Info.getLine(), Info.getColumn()); else FAILURE_MESSAGE("Source location information not present. Compile with " "-g or -gline-tables-only.\n"); + FATAL_MESSAGE0( 1, "failure of target construct while offloading is mandatory"); + } else { if (getInfoLevel() & OMP_INFOTYPE_DUMP_TABLE) for (auto &Device : PM->Devices)