When given a directory input `llvm-readtapi` traverses through the
directory to find dylibs or tbd files to operate on. TBD files will be
created with the same base file name as the dylib. Symlinks should be
created if the input is one.
This also introduces options to delete input files which are defined as
library files that existed before `readtapi -stubify` was invoked. Also
the ability to delete private libraries where private libraries are in a
predefined file system locations on darwin based platforms.
A distinction that doesn't _usually_ matter is that the
MachO::SymbolKind is really a mapping of entries in TBD files not
symbols. To better understand this, rename the enum so it represents an
encoding mapped to TBDs as opposed to symbols alone.
For example, it can be a bit confusing that "GlobalSymbol" is a enum
value when all of those values can represent a GlobalSymbol.
Stubify broadly takes either tbd files or binary dylibs and turns them
into tbd files. In future patches, stubify will also allow additional
information to be embedded into the final TBD output too.
Add Util APIs to TextAPI for common operations used by readtapi for now.
> Add support for reading binary Mach-o dynamic libraries. It uses
libObject APIs for extracting information relevant to TAPI and tbd
files. This includes but is not limited to load commands encode data
like install names, current/compat versions, and symbols.
This originally broke because DylibReader uses Object and Object depends
on TextAPI. Breaking this up in a nested library prevents this cycle.
Merge allows a user to merge different files (tbds for now or dylibs in
the future) to emit out a single tbd with all input contents. This does
require that all inputs represent the same library.
The Clang-AIX-Wyvern-Dev buildbot is currently failing at the set
directory permission due to a bad symlink caused by this
[commit](a54f31fabd).
This change is creating the additional symlink `readtapi ->
llvm-readtapi` which causes it to appear in
`/buildbot_worker/official-worker/clang-aix-dev/installdir`.
After some investigation, it looks like `readtapi` is the only tool that
is getting symlinked that is not guarded by the
`LLVM_INSTALL_BINUTILS_SYMLINKS` macro. For example:
1. `llvm/tools/llvm-objcopy/CMakeLists.txt`
```
if(LLVM_INSTALL_BINUTILS_SYMLINKS)
add_llvm_tool_symlink(objcopy llvm-objcopy)
endif()
```
2. `llvm/tools/llvm-dwp/CMakeLists.txt`
```
if(LLVM_INSTALL_BINUTILS_SYMLINKS)
add_llvm_tool_symlink(dwp llvm-dwp)
endif()
```
Second sorting was not following strict weak ordering as it
does not follow transitivity of equivalence property.
If you build llvm with libcxx at head as a standard library with -D_LIBCPP_DEBUG_STRICT_WEAK_ORDERING_CHECK and -D_LIBCPP_ENABLE_DEBUG_MODE, then tests like llvm/test/tools/llvm-readtapi/compare-right-single-inline.test.test will fail
I don't have commit rights. Danila Kutenin kudanila@yandex.ru
Reviewed By: cishida
Differential Revision: https://reviews.llvm.org/D157958
This adds a new optional flag sim_support which is the same as
MH_SIM_SUPPORT in the MachO header.
Reviewed By: ributzka
Differential Revision: https://reviews.llvm.org/D157433
This is the first of transition tapi-diff to be readtapi.
This tool will eventually replace functionality for Xcode's `xcrun tapi stubify` and
`xcrun tapi archive`.
This patch updates the tool name and is a minor refactor for the driver to handle more options.
Reviewed By: zixuw
Differential Revision: https://reviews.llvm.org/D153045