Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix typos with calculating flags for lto setting #3119

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions rust/private/lto.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -101,10 +101,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 mode == "unspecified" or format == "object_and_bitcode":
# Embedding LLVM bitcode in object files is `rustc's` default.
args.extend([])
elif format in ["off", "only_object"]:
elif mode == "off" or format == "only_object":
args.extend(["embed-bitcode=no"])
elif format == "only_bitcode":
args.extend(["linker-plugin-lto"])
Expand Down
2 changes: 1 addition & 1 deletion test/unit/lto/lto_test_suite.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ def _lto_test_impl(ctx, lto_setting, embed_bitcode, linker_plugin):
return analysistest.end(env)

def _lto_level_default(ctx):
return _lto_test_impl(ctx, None, "no", False)
return _lto_test_impl(ctx, None, None, False)

_lto_level_default_test = analysistest.make(
_lto_level_default,
Expand Down
Loading