From 0792ef72564071f21b727d0de3a14d565950290f Mon Sep 17 00:00:00 2001 From: Fangrui Song Date: Sat, 21 Dec 2019 22:22:59 -0800 Subject: [Driver] Verify -mrecord-mcount in Driver, instead of CodeGen after D71627 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit GCC's x86 and s390 ports support -mrecord-mcount. Other ports reject the option. aarch64-linux-gnu-gcc: error: unrecognized command line option ‘-mrecord-mcount’ Allowing this option can cause failures when building Linux kernel for aarch64, powerpc64, etc, which will think the feature is available if the clang command returns 0. --- clang/lib/CodeGen/CodeGenFunction.cpp | 8 -------- 1 file changed, 8 deletions(-) (limited to 'clang/lib/CodeGen/CodeGenFunction.cpp') diff --git a/clang/lib/CodeGen/CodeGenFunction.cpp b/clang/lib/CodeGen/CodeGenFunction.cpp index 6f7e06b773d..0f90f6ecf5b 100644 --- a/clang/lib/CodeGen/CodeGenFunction.cpp +++ b/clang/lib/CodeGen/CodeGenFunction.cpp @@ -959,10 +959,6 @@ void CodeGenFunction::StartFunction(GlobalDecl GD, QualType RetTy, getTarget().getMCountName()); } if (CGM.getCodeGenOpts().MNopMCount) { - if (getContext().getTargetInfo().getTriple().getArch() != - llvm::Triple::systemz) - CGM.getDiags().Report(diag::err_opt_not_valid_on_target) - << "-mnop-mcount"; if (!CGM.getCodeGenOpts().CallFEntry) CGM.getDiags().Report(diag::err_opt_not_valid_without_opt) << "-mnop-mcount" << "-mfentry"; @@ -970,10 +966,6 @@ void CodeGenFunction::StartFunction(GlobalDecl GD, QualType RetTy, } if (CGM.getCodeGenOpts().RecordMCount) { - if (getContext().getTargetInfo().getTriple().getArch() != - llvm::Triple::systemz) - CGM.getDiags().Report(diag::err_opt_not_valid_on_target) - << "-mrecord-mcount"; if (!CGM.getCodeGenOpts().CallFEntry) CGM.getDiags().Report(diag::err_opt_not_valid_without_opt) << "-mrecord-mcount" << "-mfentry"; -- cgit v1.2.3