Index: lib/Driver/Tools.cpp =================================================================== --- lib/Driver/Tools.cpp +++ lib/Driver/Tools.cpp @@ -4804,7 +4804,16 @@ if (Args.hasFlag(options::OPT_fxray_instrument, options::OPT_fnoxray_instrument, false)) { - CmdArgs.push_back("-fxray-instrument"); + const std::string XRayInstrumentOption("-fxray-instrument"); + if (Triple.getOS() == llvm::Triple::Linux && + (Triple.getArch() == llvm::Triple::arm || + Triple.getArch() == llvm::Triple::x86_64)) { + // Supported. + } else { + D.Diag(diag::err_drv_clang_unsupported) << (XRayInstrumentOption + " on " + + Triple.str()); + } + CmdArgs.push_back(XRayInstrumentOption.c_str()); if (const Arg *A = Args.getLastArg(options::OPT_fxray_instruction_threshold_, options::OPT_fxray_instruction_threshold_EQ)) {