-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Fix/Cleanup some unnecessary build setting #9228
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
daveinglis
commented
Oct 8, 2025
- fix adding -lc++ to OTHER_LDFLAGS to match native build system.
- remove OTHER_LDRFLAGS setting
@swift-ci test |
// darwin & freebsd | ||
if [.macOS, .macCatalyst, .iOS, .watchOS, .tvOS, .xrOS, .driverKit, .freebsd].contains(platform) { | ||
settings[.OTHER_LDFLAGS, platform] = ["-lc++", "$(inherited)"] | ||
} else if platform != .windows { // all others except windows |
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 wonder if we should warn or emit a debug log if we encounter a totally unknown platform here so we know we need to go fix it up
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 made the new test fail of it finds a unknown platform.
It might be nice to see if we can put in a test in SwiftBuildSupportTests/PIFBuilderTests for this |
- fix adding -lc++ to OTHER_LDFLAGS to match native build system. - remove OTHER_LDRFLAGS setting
@swift-ci test |
@swift-ci test windows |
@swift-ci test linux |
// We currently deliberately do not support Swift ObjC interface headers. | ||
settings[.SWIFT_INSTALL_OBJC_HEADER] = "NO" | ||
settings[.SWIFT_OBJC_INTERFACE_HEADER_NAME] = "" | ||
settings[.OTHER_LDRFLAGS] = [] |
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.
Do we know why this was set? Could be a default value that this is explicitly wanting to clear out.
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 it came over from the old PIF builder, not sure the history here.
) | ||
|
||
if sourceModule.isCxx { | ||
for platform in ProjectModel.BuildSettings.Platform.allCases { |
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.
On Windows, clang uses the MSVC C++ runtime, not libc++, right?
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.
looks like it, -lc++ was not found, and it look like the linker is adding the MSVC libraries as c++ packages seem to be building now
something weird happened with the PR where I could not update it anymore... here (#9234) is the new one and will close this one |