File tree 1 file changed +3
-1
lines changed
compiler/rustc_llvm/llvm-wrapper
1 file changed +3
-1
lines changed Original file line number Diff line number Diff line change @@ -310,12 +310,14 @@ static size_t getLongestEntryLength(ArrayRef<KV> Table) {
310
310
extern " C" void LLVMRustPrintTargetCPUs (LLVMTargetMachineRef TM) {
311
311
const TargetMachine *Target = unwrap (TM);
312
312
const MCSubtargetInfo *MCInfo = Target->getMCSubtargetInfo ();
313
- const Triple::ArchType HostArch = Triple (sys::getProcessTriple ()).getArch ();
313
+ const Triple::ArchType HostArch = Triple (sys::getDefaultTargetTriple ()).getArch ();
314
314
const Triple::ArchType TargetArch = Target->getTargetTriple ().getArch ();
315
315
const ArrayRef<SubtargetSubTypeKV> CPUTable = MCInfo->getCPUTable ();
316
316
unsigned MaxCPULen = getLongestEntryLength (CPUTable);
317
317
318
318
printf (" Available CPUs for this target:\n " );
319
+ // Don't print the "native" entry when the user specifies --target with a
320
+ // different arch since that could be wrong or misleading.
319
321
if (HostArch == TargetArch) {
320
322
const StringRef HostCPU = sys::getHostCPUName ();
321
323
printf (" %-*s - Select the CPU of the current host (currently %.*s).\n " ,
You can’t perform that action at this time.
0 commit comments