Skip to content

Commit

Permalink
Rollup merge of rust-lang#73346 - aszenz:patch-1, r=cuviper
Browse files Browse the repository at this point in the history
Add rust specific features to print target features

Fixes rust-lang#71583

`crt-static` is a rust specific target feature that's absent from llvm feature table, adding it there so that it shows under `rustc --print target-features`.

Probably the most native implementation I could think of, would love to get feedback.
  • Loading branch information
Manishearth authored Jun 19, 2020
2 parents 2faa2a2 + caffb28 commit 1dfba21
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/rustllvm/PassWrapper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -424,6 +424,12 @@ extern "C" void LLVMRustPrintTargetFeatures(LLVMTargetMachineRef TM) {
printf("Available features for this target:\n");
for (auto &Feature : FeatTable)
printf(" %-*s - %s.\n", MaxFeatLen, Feature.Key, Feature.Desc);
printf("\nRust-specific features:\n");
printf(" %-*s - %s.\n",
MaxFeatLen,
"crt-static",
"Enables libraries with C Run-time Libraries(CRT) to be statically linked"
);
printf("\n");

printf("Use +feature to enable a feature, or -feature to disable it.\n"
Expand Down

0 comments on commit 1dfba21

Please sign in to comment.