Open mrkkrp opened 2 years ago
I think this is just an oversight, FWIW as a short term workaround passing --copt=-flto=thin
(and similar flags if you are building other languages) should "just work" (maybe you want --linkopt=-flto=thin
as well)
This was my first attempt. --copt=-flto=thin
seems to add -flto=thin
to the invocations of compile actions, however --linkopt=-flto=thin
has no effect on the linking actions. Is this normal? Are these two flags really enough (there is quite a bit going on is that feature definition)?
What failures do you see with that? Technically the linkopt might not matter since if the linker gets lto'd inputs it probably handles them regardless of the flags. I think if we were to add it to the crosstool we would have something that looked a bit more like https://github.com/bazelbuild/bazel/blob/fdcaaf4af3296bf544589810ad46b438bfe5e1fb/tools/cpp/unix_cc_toolchain_config.bzl?rgh-link-date=2022-09-13T18%3A20%3A59Z#L1136-L1197, but at least some flags like the linker plugin options are not available with ld64. I don't know the story behind the other flags, but I wouldn't be surprised if they were mostly nice, but not required, optimizations
Thank you for contributing to the Bazel repository! This issue has been marked as stale since it has not had any activity in the last 1+ years. It will be closed in the next 90 days unless any other activity occurs or one of the following labels is added: "not stale", "awaiting-bazeler". Please reach out to the triage team (@bazelbuild/triage
) if you think this issue is still relevant or you are interested in getting the issue resolved.
@bazelbuild/triage
Description of the bug:
In
unix_cc_toolchain_config.bzl
thethin_lto
feature is in the config for Linux but not for MacOS. The result is that thin LTO cannot be used on MacOS with Bazel. AFAIU thin lto is supported on MacOS as well. Is this an oversight or there is a reason for exclusion of this feature on MacOS?What's the simplest, easiest way to reproduce this bug? Please provide a minimal example if possible.
No response
Which operating system are you running Bazel on?
MacOS Monterey 12.5.1
What is the output of
bazel info release
?release 5.1.1
If
bazel info release
returnsdevelopment version
or(@non-git)
, tell us how you built Bazel.No response
What's the output of
git remote get-url origin; git rev-parse master; git rev-parse HEAD
?No response
Have you found anything relevant by searching the web?
No response
Any other information, logs, or outputs that you want to share?
No response