Skip to content
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

[SR-14968] Swift 5.5: symbol is in generated IR file, but not in TBD file #57310

Open
theMomax opened this issue Jul 23, 2021 · 3 comments
Open
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. compiler The Swift compiler in itself

Comments

@theMomax
Copy link
Contributor

Previous ID SR-14968
Radar rdar://problem/81019912
Original Reporter @theMomax
Type Bug
Environment

macOS: 12.0 Beta (21A5284e)

Xcode:
Version 13.0 beta 3 (13A5192i)

Swift (Xcode default):
swift-driver version: 1.26.5 Apple Swift version 5.5 (swiftlang-1300.0.24.13 clang-1300.0.25.10)
Target: x86_64-apple-macosx12.0

Swift (latest 5.5):
Apple Swift version 5.5-dev (LLVM 2bc7fec1f3d924f, Swift b059298)
Target: x86_64-apple-macosx12.0

Additional Detail from JIRA
Votes 4
Component/s Compiler
Labels Bug
Assignee None
Priority Medium

md5: f2f3bc0d78e1b7aa721a3bbbcace353a

Issue Description:

Compiling CwlPreconditionTesting (2.0.0) with the latest Swift 5.5 toolchain fails. The package worked fine with Swift 5.4.

When compiling with the latest Swift 5.5 toolchain in DEBUG mode, I get the following error:

<unknown>:0: error: symbol 'NDR_record' (NDR_record) is in generated IR file, but not in TBD file
<unknown>:0: error: please submit a bug report (https://swift.org/contributing/#reporting-bugs) and include the project, and add '-Xfrontend -validate-tbd-against-ir=none' to squash the errors

When compiling it in production mode, the error is different:

duplicate symbol '_NDR_record' in:
    /Users/themomax/Library/Developer/Xcode/DerivedData/CwlPreconditionTesting-awsfsfrjovdaubdxvaccstnqbvju/Build/Intermediates.noindex/CwlPreconditionTesting.build/Release/CwlPreconditionTesting.build/Objects-normal/x86_64/CwlBadInstructionException.o
    /Users/themomax/Library/Developer/Xcode/DerivedData/CwlPreconditionTesting-awsfsfrjovdaubdxvaccstnqbvju/Build/Intermediates.noindex/CwlPreconditionTesting.build/Release/CwlPreconditionTesting.build/Objects-normal/x86_64/CwlCatchBadInstruction.o
ld: 1 duplicate symbol for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

When using the Xcode beta 3 toolchain, the project compiles (and runs) fine in DEBUG mode, but compiling crashes with the same error as above in production mode.

@typesanitizer
Copy link

@swift-ci create

@swift-ci
Copy link
Collaborator

Comment by Ben Thomas (JIRA)

This is a blocker for us to adopt Xcode 13. Is there any update on a fix? Thanks!

@theMomax
Copy link
Contributor Author

iosdevben (JIRA User) In case you're also having this issue in the context of CwlPreconditionTesting: For my project I was able to switch over to https://github.com/norio-nomura/XCTAssertCrash quite easily. It compiles and is quite similar in terms of features.

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. compiler The Swift compiler in itself
Projects
None yet
Development

No branches or pull requests

3 participants