This library is linked into libc-hdrgen, which is compiled with
DISABLE_LLVM_LINK_LLVM_DYLIB. This option avoids linking with
libLLVM.so when LLVM_LINK_LLVM_DYLIB is specified. Unfortunately,
this can cause wierd linkage errors where symbols are defined
multiple times, with one definition coming from static linkage
and another definition coming from libLLVM.so. This is usually
apparent as a link error with options defined multiple times.
This patch adds DISABLE_LLVM_LINK_LLVM_DYLIB to this library, to
get consistent linkage of libc-hdrgen.
Differential Revision: https://reviews.llvm.org/D145839
When using `LLVM_ENABLE_RUNTIMES=libc` we need to perform a few extra
steps to include LLVM utilities similar to if we were performing a
standalone build. Libc depends on the tablegen utilities and the LLVM
libraries when performing a full build. When using an
`LLVM_ENABLE_PROJECTS=libc` build these are included as a part of the
greater LLVM build, but here we need to perform it maunally. This patch
should allow using `LLVM_LIBC_FULL_BUILD=ON` when building with
runtimes.
Reviewed By: lntue
Differential Revision: https://reviews.llvm.org/D138040
They are added as entrypoint object targets. The header-gen
infrastructure has been extended to enable handling standard required
global objects. The libc-api-test has also been extended to verify the
global object declarations.
Reviewed By: lntue
Differential Revision: https://reviews.llvm.org/D126329
This tool will be used to generate C wrappers for the C++ LLVM libc
implementations. This change does not hook this tool up to anything yet.
However, it can be useful for cases where one does not want to run the
objcopy step (to insert the C symbol in the object file) but can make use
of LTO to eliminate the cost of the additional wrapper call. This can be
relevant for certain downstream platforms. If this tool can benefit other
libc platforms in general, then it can be integrated into the build system
with options to use or not use the wrappers. An example of such a
platform is CUDA.
Reviewed By: abrachet
Differential Revision: https://reviews.llvm.org/D84848
This class is currently used by two tools: HdrGen and PrototypeTestGen.
We will be adding more tools based on this class so it is convenient to
keep it in a util library of its own.