Closed swift-ci closed 5 years ago
This is probably a Clang issue more than a Swift issue. The fastest way to work around it might just be to include the header that it's complaining about (whichever header corresponds to SwiftGlibc.C.pty).
@swift-ci create
Comment by Rogiel Sulzbach (JIRA)
Thanks @belkadan, will try this tonight.
I am now facing a another, but maybe related, issue when compiling libdispatch. In this case, I get the same assertion claiming "Declaration not emitted!" but no include error. I will try to investigate further and create another issue about it.
A year later: our Clang folks think this is fixed in the swift-5.0-branch. Mind trying again with a development snapshot from https://swift.org/download ?
Rogiel (JIRA User), Could you verify if the problem is fixed and if so move the JIRA to "Closed"?
Thank you!
Additional Detail from JIRA
| | | |------------------|-----------------| |Votes | 0 | |Component/s | Compiler | |Labels | Bug, ClangImporter, FreeBSD | |Assignee | None | |Priority | Medium | md5: db94691cb055495db7eb13025b3708eeIssue Description:
While trying to build Swift Foundation master branch, I am hitting a issue when importing \<stdint.h> from CoreFoundation header files. The Swift compiler is complaining about having to import first from the SwiftGlibc.C.pty module and then crashes with a assertion error.
NOTE: I have redacted the log a little bit for readability (see the full log below).
It seems that if I replace \<stdint.h> with these 4 headers, the compiler stops complaining about the UInt needing the module, but the assertion still triggers and crashes the compiler.
Simple hello world programs are working fine.
Error output
Some context of the changes I have currently to make the compiler, stdlib and Foundation to (not) build:
On swift/lib/Runtime/Config.h I have enabled SWIFT_USE_SWIFTCALL for FreeBSD systems (it looks like __has_attribute(swiftcall) is evaluating to false even though the intrinsic is available).
On swift/stdlib/CMakeLists.txt (for SR-5779)
On swift/stdlib/public/SwiftShims/SwiftStdint.h & swift/stdlib/public/SwiftShims/SwiftStddef.h:
I have added a extra !defined(FreeBSD). This did not seem to make any difference on the error.
swift-corelibs-foundation/lib/target.py made the changes as per the patch included in the FreeBSD ports repository. The other patches no longer seem necessary.
On all swift-corelibs-foundation/Foundation/.swift* I have added a #if os(FreeBSD) where appropriate.