-
Notifications
You must be signed in to change notification settings - Fork 1.4k
[5.9] Improve handling of tool build flags #6709
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
Conversation
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
Refactors the various compilerArguments and linkerArgument functions slightly to ensure flags from a user's sdk and cli properly propagate to the expected subcommand invocations. Adds a fairly comprehensive test to cover the toolset and cli flag passing end result. --- Fixes a bug where clang targets didn't respect the `isCXX` override. Fixes a bug where cxxCompiler extraCLIFlags where not passed to clang when building cxx targets. Future work: #6491. cxxCompiler extraCLIFlags should also be passed to `swiftc` when compiling swift modules to ensure the clang importer has the same interpretation of the module as the initial compile. Fixes a bug where linker extraCLIFlags were not passed to `swiftc` prefixed by `-Xlinker`. The previous workaround to pass these flags in swiftCompiler extraCLIFlags is no longer necessary. Fixes a bug where a user could pass `-whole-module-optimization` or `-wmo` to swiftc when linking causing the driver to either attempt to compile the object files when using the legacy driver: rdar://27578292 or crash when using the new driver: rdar://108057797. Fixes a bug where cCompiler extraCLIFlags were not passed to `swiftc` prefixed by `-Xcc`. The previous workaround to pass these flags in swiftCompiler extraCLIFlags is no longer necessary. Fixes a bug where extraCLIFlags from an SDKs toolset.json files would be repeated multiple times in child process invocations. The repeated flags could cause issues with some downstream tools, such as repeated `-segaddr` flags to ld64 for the same segment. Fixes a bug where extra toolchain flags would be added to an xcode build parameters file without escaping. Fixes a bug where extra toolchain linker flags would not be added to an xcode build parameters file. (cherry picked from commit 151343e) # Conflicts: # Sources/Build/BuildPlan.swift # Tests/BuildTests/MockBuildTestHelper.swift
@swift-ci smoke test |
rauhul
approved these changes
Jul 14, 2023
👍 once CI is green |
@swift-ci smoke test |
@swift-ci test windows |
@swift-ci smoke test |
@swift-ci smoke test |
@swift-ci test windows |
tomerd
approved these changes
Jul 18, 2023
@swift-ci smoke test macos |
@swift-ci test windows |
tomerd
approved these changes
Jul 18, 2023
MaxDesiatov
added a commit
to swiftlang/sourcekit-lsp
that referenced
this pull request
Jul 19, 2023
Cherry-pick of #742 required to unblock swiftlang/swift-package-manager#6709. Updates tests to allow compile arguments with multiple `-F` options such as `-F <foo> -Xcc -F -Xcc <foo>`. This change is required to support SwiftPM changes which forward C compiler flags to the Swift compiler in more cases. Co-authored-by: Rauhul Varma <rauhul@users.noreply.github.com>
@swift-ci smoke test macos |
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.
Cherry-pick of #6475.
Refactors the various compilerArguments and linkerArgument functions slightly to ensure flags from a user's sdk and cli properly propagate to the expected subcommand invocations.
Adds a fairly comprehensive test to cover the toolset and cli flag passing end result.
Fixes a bug where clang targets didn't respect the
isCXX
override.Fixes a bug where cxxCompiler extraCLIFlags where not passed to clang when building cxx targets. Future work: #6491. cxxCompiler extraCLIFlags should also be passed to
swiftc
when compiling swift modules to ensure the clang importer has the same interpretation of the module as the initial compile.Fixes a bug where linker extraCLIFlags were not passed to
swiftc
prefixed by-Xlinker
. The previous workaround to pass these flags in swiftCompiler extraCLIFlags is no longer necessary.Fixes a bug where a user could pass
-whole-module-optimization
or-wmo
to swiftc when linking causing the driver to either attempt to compile the object files when using the legacy driver: rdar://27578292 or crash when using the new driver: rdar://108057797.Fixes a bug where cCompiler extraCLIFlags were not passed to
swiftc
prefixed by-Xcc
. The previous workaround to pass these flags in swiftCompiler extraCLIFlags is no longer necessary.Fixes a bug where extraCLIFlags from an SDKs toolset.json files would be repeated multiple times in child process invocations. The repeated flags could cause issues with some downstream tools, such as repeated
-segaddr
flags to ld64 for the same segment.Fixes a bug where extra toolchain flags would be added to an xcode build parameters file without escaping.
Fixes a bug where extra toolchain linker flags would not be added to an xcode build parameters file.
(cherry picked from commit 151343e)