-
Notifications
You must be signed in to change notification settings - Fork 1.4k
BuildDescription: Set output path for bc files #6611
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
Conversation
@swift-ci please smoke test |
@swift-ci please smoke test windows |
So I'm assuming this is always a strict either/or? Or is there a situation where the compiler would try to emit both and fail because we're using the same path? |
+1 to that question, it's unclear what happens when both of these paths are used at once by different tools. |
You both are right, I'm talking to artem about this now and will hopefully find a better solution... |
The only time an issue can arise is if you pass
|
I'm not sure if the assertion error message is helpful enough. In what cases can that happen? Would it make sense to just write to a file with a different extension? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can this new behavior be tested?
@swift-ci please smoke test |
@swift-ci please smoke test windows |
- Updates spm to pass the object file path as the output path for bitcode files for use when building with lto. A more ideal solution may be to use a different path for bitcode files, however using the `.o` extension is also a common pattern and requires a significantly less invasive diff.
@swift-ci please smoke test |
@swift-ci please smoke test windows |
1 similar comment
@swift-ci please smoke test windows |
name: .customLong("experimental-lto-mode"), | ||
help: .hidden | ||
) | ||
public var linkTimeOptimizationMode: LinkTimeOptimizationMode? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could this use that enum directly instead of creating a proxy enum, as they seem identical to each other?
public var linkTimeOptimizationMode: LinkTimeOptimizationMode? | |
public var linkTimeOptimizationMode: BuildParameters.LinkTimeOptimizationMode? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@neonichu suggested discrete enums, I'm happy to go either way.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think they should be separate because one is for argument parsing and one is for the build. They just happen to be the same right now, but that's coincidental not inherent.
@swift-ci please smoke test windows |
@swift-ci please smoke test windows |
@tomerd I wonder if we need to mention this in |
good point, we can add and make sure its mentioned as experimental |
-experimental-lto-mode
option which canbe set to either "full" or "thin" enabling the use of llvm LTO for
both swift and c targets. Updates BuildParameters with a matching
linkTimeOptimizationMode and updates SwiftTargetBuildDescription to
use the proper file extension for bitcode objects as well as place
them in the proper output location.