Skip to content

Commit

Permalink
cleanup implementation
Browse files Browse the repository at this point in the history
* remove commented out line
* remove 'format' references that are no longer possible
  • Loading branch information
ParkMyCar committed Dec 18, 2024
1 parent 07793a6 commit 7e293d9
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions rust/private/lto.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,6 @@ def _determine_lto_object_format(ctx, toolchain, crate_info):
return "only_object"

perform_linking = crate_info.type in ["bin", "staticlib", "cdylib"]

# is_linkable = crate_info.type in ["lib", "rlib", "dylib", "proc-macro"]
is_dynamic = crate_info.type in ["dylib", "cdylib", "proc-macro"]
needs_object = perform_linking or is_dynamic

Expand Down Expand Up @@ -107,10 +105,10 @@ def construct_lto_arguments(ctx, toolchain, crate_info):
if mode in ["thin", "fat", "off"] and not is_exec_configuration(ctx):
args.append("lto={}".format(mode))

if format in ["unspecified", "object_and_bitcode"]:
if format == "object_and_bitcode":
# Embedding LLVM bitcode in object files is `rustc's` default.
args.extend([])
elif format in ["off", "only_object"]:
elif format == "only_object":
args.extend(["embed-bitcode=no"])
elif format == "only_bitcode":
args.extend(["linker-plugin-lto"])
Expand Down

0 comments on commit 7e293d9

Please sign in to comment.