-
Notifications
You must be signed in to change notification settings - Fork 10.5k
[TBDGen] Capture segment symbols are defined in & emit tbd-v5 format #69779
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
I expect some tests that invoke the Xcode toolchain linker to fail as Xcode14 is too old to read tbdv5. They should be resolved by: #69485 I can temporarily disable them, but I figure its better to get feedback first. |
// RUN: %target-swift-frontend -typecheck %s -emit-tbd-path - -tbd-current-version 20.10 | %FileCheck %s --check-prefix TWENTYPOINTTEN | ||
// RUN: %target-swift-frontend -typecheck %s -tbd-install_name some_dylib -emit-tbd-path - -tbd-current-version 2.0 | %FileCheck %s --check-prefix TWOPOINTZERO | ||
// RUN: %target-swift-frontend -typecheck %s -tbd-install_name some_dylib -emit-tbd-path - -tbd-current-version 2 | %FileCheck %s --check-prefix TWOPOINTZERO | ||
// RUN: %target-swift-frontend -typecheck %s -tbd-install_name some_dylib -emit-tbd-path - -tbd-current-version 20.10 | %FileCheck %s --check-prefix TWENTYPOINTTEN |
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 notice you're adding many -tbd-install_name
to tests, is it a requirement to set it explicitly now?
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.
Yes! It is an assert check in LLVM now. https://github.com/llvm/llvm-project/blob/main/llvm/lib/TextAPI/TextStubV5.cpp#L370
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.
LGTM!
@swift-ci please test |
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.
Thank you, Cyndy!
@swift-ci please test |
* Fixup tests to handle new json based output. * Use llvm-nm & readtapi to verify tbd file outputs. resolves: rdar://117604275
d016c5f
to
3ccaaf5
Compare
@swift-ci please test |
TBD-v5 is the new json format for TBD files. One can view the format spec by running
man tapi-tbd
on any >=Xcode15 install. Because it captures the segment the symbols are defined in, to restore back information lost compared to binary dylibs, it is also now recorded for TBDGen in the compiler. This is a best effort, as there is no way to definitively know where the symbol ends up until after the linker has assembled the binary.This patch also updates tests to
Resolves: rdar://117604275