The thin_lto feature is not enabled for MacOS
- Dominant language
- Java
- Stars
- 25.8k
- Forks
- 4.6k
- Avg merge
- 2d 20h
- Merged PRs (30d)
- 72
Description
### Description of the bug:
In [`unix_cc_toolchain_config.bzl`](https://github.com/bazelbuild/bazel/blob/master/tools/cpp/unix_cc_toolchain_config.bzl#L1225-L1294) the `thin_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` returns `development 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_
Contributor guide
Research direction
Start in tools/cpp/unix_cc_toolchain_config.bzl at the referenced lines and compare the Linux thin_lto feature configuration with the MacOS configuration. Verify whether thin LTO is supported on MacOS, then validate the change with a minimal Bazel build using thin LTO on MacOS.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp, macos
- Domain
- build-system
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 55/100