7 Commits

Author SHA1 Message Date
Cyndy Ishida
f2794ccede
[InstallAPI] Introduce Basic Verifier (#85106)
This adds basic support for calling the verifier on global declarations
that are expected to represent symbol exports. The driver now
exclusively uses this for knowing what symbols make up a TBD file.
Future patches will check against the dylib's symbol table.
2024-03-16 10:37:52 -07:00
Cyndy Ishida
bcc6ca7ff8 [InstallAPI] Add missing link to clangLex 2024-03-01 15:02:57 -08:00
Cyndy Ishida
c6cbf81c84
[InstallAPI] Hookup Input files & basic ASTVisitor (#82552)
This patch takes in json files as input to determine that header files
to process, and in which order, to pass along for CC1 invocations. This
patch also includes an ASTVisitor to collect simple global variables.
2024-02-28 09:47:45 -08:00
Cyndy Ishida
0a518db99e
[InstallAPI] Set InstallAPI as a standalone tool instead of CC1 action (#82293)
Installapi has important distinctions when compared to the clang driver,
so much that, it doesn't make much sense to try to integrate into it.

This patch partially reverts the CC1 action & driver support to replace
with its own driver as a clang tool.

For distribution, we could use `LLVM_TOOL_LLVM_DRIVER_BUILD` mechanism
for integrating the functionality into clang such that the toolchain
size is less impacted.
2024-02-21 09:39:31 -08:00
Cyndy Ishida
4c6043de0b
[clang][InstallAPI] Add input file support to library (#81701)
This patch adds support for expected InstallAPI inputs. InstallAPI
accepts a well defined filelist of headers and how those headers
represent a single library.

InstallAPI captures header files to determine linkable symbols to then
compare against what was compiled in a binary dylib and generate TBD
files.
2024-02-20 09:39:00 -08:00
Cyndy Ishida
ec5f4a4bc6 [InstallAPI] Add missing link to clangBasic
Fixes CI.
2024-02-13 18:59:18 -08:00
Cyndy Ishida
09e98950bf
[clang][InstallAPI] Introduce basic driver to write out tbd files (#81571)
This introduces a basic outline of installapi as a clang driver option.
It captures relevant information as cc1 args, which are common arguments
already passed to the linker to encode into TBD file outputs. This is
effectively an upstream for what already exists as `tapi installapi` in
Xcode toolchains, but directly in Clang. This patch does not handle any
AST traversing on input yet.

InstallAPI is broadly an operation that takes a series of header files
that represent a single dynamic library and generates a TBD file out of
it which represents all the linkable symbols and necessary attributes
for statically linking in clients. It is the linkable object in all
Apple SDKs and when building dylibs in Xcode. `clang -installapi` also
will support verification where it compares all the information recorded
for the TBD files against the already built binary, to catch possible
mismatches like when a declaration is missing a definition for an
exported symbol.
2024-02-13 18:52:11 -08:00