[PATCH] D120484: More explicit message when failing to find a mandatory cfi ressource file
serge via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Thu Feb 24 07:12:34 PST 2022
serge-sans-paille created this revision.
serge-sans-paille added a reviewer: thakis.
serge-sans-paille requested review of this revision.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.
Compiler-rt doesn't provide support file for cfi on s390x ad ppc64le (at least). When trying to use the flag, we get a file error.
This is an attempt at making the error more explicit, maybe we should also suggest passing `-fno-sanitize-ignorelist`?
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D120484
Files:
clang/include/clang/Basic/DiagnosticDriverKinds.td
clang/lib/Driver/SanitizerArgs.cpp
Index: clang/lib/Driver/SanitizerArgs.cpp
===================================================================
--- clang/lib/Driver/SanitizerArgs.cpp
+++ clang/lib/Driver/SanitizerArgs.cpp
@@ -168,7 +168,7 @@
else if (BL.Mask == SanitizerKind::CFI && DiagnoseErrors)
// If cfi_ignorelist.txt cannot be found in the resource dir, driver
// should fail.
- D.Diag(clang::diag::err_drv_no_such_file) << Path;
+ D.Diag(clang::diag::err_drv_missing_sanitizer_ignorelist) << Path;
}
validateSpecialCaseListFormat(
D, IgnorelistFiles, clang::diag::err_drv_malformed_sanitizer_ignorelist,
Index: clang/include/clang/Basic/DiagnosticDriverKinds.td
===================================================================
--- clang/include/clang/Basic/DiagnosticDriverKinds.td
+++ clang/include/clang/Basic/DiagnosticDriverKinds.td
@@ -205,6 +205,8 @@
"invalid deployment target for -stdlib=libc++ (requires %0 or later)">;
def err_drv_invalid_argument_to_option : Error<
"invalid argument '%0' to -%1">;
+def err_drv_missing_sanitizer_ignorelist : Error<
+ "missing required sanitizer ignorelist: '%0'">;
def err_drv_malformed_sanitizer_ignorelist : Error<
"malformed sanitizer ignorelist: '%0'">;
def err_drv_malformed_sanitizer_coverage_allowlist : Error<
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D120484.411117.patch
Type: text/x-patch
Size: 1297 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20220224/b0686824/attachment.bin>
More information about the cfe-commits
mailing list