-
Notifications
You must be signed in to change notification settings - Fork 15.1k
Closed
Labels
clang:driver'clang' and 'clang++' user-facing binaries. Not 'clang-cl''clang' and 'clang++' user-facing binaries. Not 'clang-cl'
Description
When passing -fsanitize=function -mexecute-only
to Clang on an ARM target, it prints the following error:
error: invalid argument '-fsanitize=function' not allowed with 'arm-unknown-linux-gnueabi'
The error happens because -fsanitize=function
is incompatible with execute-only memory, but prints the target triple as the reason. I would expect the error message to be the following in this case:
error: invalid argument '-fsanitize=function' not allowed with '-mexecute-only'
The diagnostic is created here:
llvm-project/clang/lib/Driver/SanitizerArgs.cpp
Lines 416 to 423 in 69d66fa
if (isExecuteOnlyTarget(Triple, Args)) { | |
if (SanitizerMask KindsToDiagnose = | |
Add & NotAllowedWithExecuteOnly & ~DiagnosedKinds) { | |
if (DiagnoseErrors) { | |
std::string Desc = describeSanitizeArg(Arg, KindsToDiagnose); | |
D.Diag(diag::err_drv_argument_not_allowed_with) | |
<< Desc << Triple.str(); | |
} |
I think a good solution would be to print -mexecute-only
(or -mpure-code
) as the reason for the incompatibility if it was passed to the compiler driver, and print the target triple otherwise.
Metadata
Metadata
Assignees
Labels
clang:driver'clang' and 'clang++' user-facing binaries. Not 'clang-cl''clang' and 'clang++' user-facing binaries. Not 'clang-cl'