Skip to content

Conversation

@kubamracek
Copy link
Contributor

The attached testcase shows the problem: With -Xcc -fno-builtin, or with -Xcc -ffreestanding, the compiler crashes during deserialization due to the "free" function not showing up in SwiftShims. This turns out to be caused by the declaration of free not being at the top level in LibcShims.h.

lib/swift/embedded/Swift.swiftmodule/arm64-apple-macos.swiftmodule:1:1: error: reference to top-level declaration 'free' broken by a context change; 'free' is not found, it was expected to be in 'SwiftShims'
SwiftShims.free
^
<unknown>:0: note: the declaration was expected to be found in module 'SwiftShims'
<unknown>:0: note: declarations in the  clang module 'SwiftShims' may be hidden by clang preprocessor macros
Stack dump:
3.	While evaluating request ExecuteSILPipelineRequest(Run pipelines { Mandatory Diagnostic Passes + Enabling Optimization Passes } on SIL for main)
4.	While running pass #51 SILModuleTransform "MandatorySILLinker".
5.	While deserializing SIL function "swift_deallocClassInstance"
6.	While deserializing SIL function "free"
7.	*** DESERIALIZATION FAILURE ***

@kubamracek
Copy link
Contributor Author

@swift-ci please test

@kubamracek kubamracek added the embedded Embedded Swift label Sep 28, 2023
Copy link
Contributor

@mikeash mikeash left a comment

Choose a reason for hiding this comment

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

🤨

@kubamracek
Copy link
Contributor Author

@swift-ci please test

@kubamracek
Copy link
Contributor Author

@swift-ci please test Linux platform

2 similar comments
@kubamracek
Copy link
Contributor Author

@swift-ci please test Linux platform

@kubamracek
Copy link
Contributor Author

@swift-ci please test Linux platform

@kubamracek kubamracek merged commit 95330bc into swiftlang:main Sep 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

embedded Embedded Swift

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants