Pass -object_path_lto <path> linker flag for LTO builds (#420)#428
Merged
keith merged 1 commit intobazelbuild:masterfrom Sep 2, 2025
Merged
Pass -object_path_lto <path> linker flag for LTO builds (#420)#428keith merged 1 commit intobazelbuild:masterfrom
keith merged 1 commit intobazelbuild:masterfrom
Conversation
The following commit (in 1.23.0) was reverted recently (in 1.23.1): * commit 61b44d1 * revert 4c51f10 This patch is a new attempt at getting that feature merged, but without the LTO related issues that came up in the first patch. The difference is that we're adding that feature unconditionally now, as it won't hurt linking actions when LTO is disabled anyway. And enabling the bazel lto features changes the linking workflow in a way that isn't necessary on Apple platforms. Initial commit log below. --- This is needed for LTO builds, this is the path to which linker writes one big object file after performing link time optimisations, and then this object file would be used during final linking to create the App binary, without this file binary would contain invalid debug symbols, more info - bazelbuild/rules_swift#1529 . Closes - bazelbuild/rules_swift#1529 Co-authored-by: Mathieu Olivari <[email protected]> Co-authored-by: Sanju Naik <[email protected]>
Contributor
Author
|
Cc: @sanju-naik |
keith
approved these changes
Sep 2, 2025
Member
keith
left a comment
There was a problem hiding this comment.
confirmed that this is a no-op unless LTO is actually produced in the build. seems harmless to me.
Contributor
|
Thank you @ma-oli @keith for adding this back 🙏 . So the issue was happening because of adding these features - https://github.com/bazelbuild/apple_support/pull/420/files#diff-f87c478e9c0e6197378202814ad77531a720f7f1553c522123ba85e12de5e45aR2636, which weren't compatible or needed more things when building on non-Apple platforms? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The following commit (in 1.23.0) was reverted recently (in 1.23.1):
This patch is a new attempt at getting that feature merged, but without the LTO related issues that came up in the first patch. The difference is that we're adding that feature unconditionally now, as it won't hurt linking actions when LTO is disabled anyway. And enabling the bazel lto features changes the linking workflow in a way that isn't necessary on Apple platforms.
Initial commit log below.
This is needed for LTO builds, this is the path to which linker writes one big object file after performing link time optimisations, and then this object file would be used during final linking to create the App binary, without this file binary would contain invalid debug symbols, more info - bazelbuild/rules_swift#1529 .
Closes - bazelbuild/rules_swift#1529