Skip to content

[Linux] Add build-id support. #1641

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

Merged
merged 2 commits into from
Jul 29, 2024
Merged

Conversation

al45tair
Copy link
Contributor

Add a -build-id option to the driver to let users control the build ID setting used by the linker. Pass --build-id to the linker by default, so that build IDs are enabled by default but using the linker's default type; if someone wishes to specify a particular option, they can do so using the new driver option.

Also turn on build IDs when building the driver.

rdar://116798309

@al45tair al45tair requested a review from artemcm June 26, 2024 12:50
@al45tair
Copy link
Contributor Author

@swift-ci Please test

@al45tair al45tair requested a review from etcwilde July 1, 2024 15:27
@@ -58,6 +58,8 @@ extension Option {
public static let bridgingHeaderDirectoryForPrint: Option = Option("-bridging-header-directory-for-print", .separate, attributes: [.helpHidden, .frontend, .noDriver], metaVar: "<path>", helpText: "Directory for bridging header to be printed in compatibility header")
public static let bridgingHeaderPchKey: Option = Option("-bridging-header-pch-key", .separate, attributes: [.helpHidden, .frontend, .noDriver], helpText: "Cache Key for bridging header pch")
public static let bsdk: Option = Option("-bsdk", .joinedOrSeparate, attributes: [.noDriver, .argumentIsPath], helpText: "path to the baseline SDK to import frameworks")
public static let buildIdEQ: Option = Option("-build-id=", .joined, alias: Option.buildId)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.
The usual reminder that these Options.swift are to be generated as follows:
https://github.com/swiftlang/swift-driver?tab=readme-ov-file#rebuilding-optionsswift
In case they were not, for this change.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, interesting. They were not. I will investigate that — thank you.

al45tair added 2 commits July 23, 2024 09:55
Add a `-build-id` option to the driver to let users control the build
ID setting used by the linker.  Pass `--build-id` to the linker by default,
so that build IDs are enabled by default but using the linker's default
type; if someone wishes to specify a particular option, they can do so
using the new driver option.

Also turn on build IDs when *building* the driver.

rdar://116798309
Options.swift needs to be generated from the one in the Swift repo,
not edited by hand.

Based on the Options.td from swiftlang/swift#75435.

rdar://116798309
@al45tair
Copy link
Contributor Author

al45tair commented Jul 24, 2024

@artemcm Hmmm. Looks like I'm not the only one that's edited Options.swift directly. Or maybe not updated it after changing Options.td.

@al45tair al45tair requested a review from artemcm July 24, 2024 11:02
@al45tair
Copy link
Contributor Author

@swift-ci Please test

@al45tair al45tair merged commit dafcec6 into swiftlang:main Jul 29, 2024
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants