Skip to content

[LLDB Test] Add '-link-objc-runtime' to 'swiftc' invocations when ObjC interop is required by the test. #5629

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

artemcm
Copy link

@artemcm artemcm commented Nov 16, 2022

This ensures the Swift Driver will formulate a linker driver invocation that will pick up the ObjC runtime.

…C interop is required by the test.

This ensures the Swift Driver will formulate a linker driver invocation that will pick up the ObjC runtime.
@artemcm
Copy link
Author

artemcm commented Nov 16, 2022

swiftlang/swift-driver#1227
@swift-ci test macOS Platform

@artemcm
Copy link
Author

artemcm commented Nov 28, 2022

@swift-ci smoke test

@kastiglione
Copy link

kastiglione commented Nov 29, 2022

When can the driver self-determine that the objc runtime is needed? In other words, why do the tests require explicit opt-in?

@felipepiovezan
Copy link

Deferring to others here, as they are more familiar with the Swift components of LLDB

@artemcm
Copy link
Author

artemcm commented Nov 29, 2022

When can the driver self-determine that the objc runtime is needed? In other words, why do the tests require explicit opt-in?

Linking ObjC runtime is a pretty heavyweight thing, as when we ask the linker driver (clang) to do so, it also will bring in Foundation. Which is not a reasonable default because it causes trivial programs to be very large. And there are cases where we want ObjC support, but no ObjC runtime linked, for example: if you're in a binary which Foundation itself links.

We already have many other Swift test cases specifying this, so it seems reasonable to expect this on tests that know they require it.

A little more context in swiftlang/swift-driver#1224.

@artemcm
Copy link
Author

artemcm commented Nov 29, 2022

@swift-ci smoke test Linux platform

@artemcm
Copy link
Author

artemcm commented Dec 1, 2022

@swift-ci test Linux platform

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.

3 participants