[cmake] Explicitly mark libraries defined in lib/ as "Component Libraries"
Summary:
Most libraries are defined in the lib/ directory but there are also a
few libraries defined in tools/ e.g. libLLVM, libLTO. I'm defining
"Component Libraries" as libraries defined in lib/ that may be included in
libLLVM.so. Explicitly marking the libraries in lib/ as component
libraries allows us to remove some fragile checks that attempt to
differentiate between lib/ libraries and tools/ libraires:
1. In tools/llvm-shlib, because
llvm_map_components_to_libnames(LIB_NAMES "all") returned a list of
all libraries defined in the whole project, there was custom code
needed to filter out libraries defined in tools/, none of which should
be included in libLLVM.so. This code assumed that any library
defined as static was from lib/ and everything else should be
excluded.
With this change, llvm_map_components_to_libnames(LIB_NAMES, "all")
only returns libraries that have been added to the LLVM_COMPONENT_LIBS
global cmake property, so this custom filtering logic can be removed.
Doing this also fixes the build with BUILD_SHARED_LIBS=ON
and LLVM_BUILD_LLVM_DYLIB=ON.
2. There was some code in llvm_add_library that assumed that
libraries defined in lib/ would not have LLVM_LINK_COMPONENTS or
ARG_LINK_COMPONENTS set. This is only true because libraries
defined lib lib/ use LLVMBuild.txt and don't set these values.
This code has been fixed now to check if the library has been
explicitly marked as a component library, which should now make it
easier to remove LLVMBuild at some point in the future.
I have tested this patch on Windows, MacOS and Linux with release builds
and the following combinations of CMake options:
- "" (No options)
- -DLLVM_BUILD_LLVM_DYLIB=ON
- -DLLVM_LINK_LLVM_DYLIB=ON
- -DBUILD_SHARED_LIBS=ON
- -DBUILD_SHARED_LIBS=ON -DLLVM_BUILD_LLVM_DYLIB=ON
- -DBUILD_SHARED_LIBS=ON -DLLVM_LINK_LLVM_DYLIB=ON
Reviewers: beanz, smeenai, compnerd, phosek
Reviewed By: beanz
Subscribers: wuzish, jholewinski, arsenm, dschuff, jyknight, dylanmckay, sdardis, nemanjai, jvesely, nhaehnle, mgorny, mehdi_amini, sbc100, jgravelle-google, hiraditya, aheejin, fedor.sergeev, asb, rbar, johnrusso, simoncook, apazos, sabuasal, niosHD, jrtc27, MaskRay, zzheng, edward-jones, atanasyan, steven_wu, rogfer01, MartinMosbeck, brucehoult, the_o, dexonsmith, PkmX, jocewei, jsji, dang, Jim, lenary, s.egerton, pzheng, sameer.abuasal, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D70179
2019-11-14 06:39:58 +01:00
|
|
|
add_llvm_component_library(LLVMObject
|
2011-09-27 21:36:55 +02:00
|
|
|
Archive.cpp
|
2015-06-08 04:32:01 +02:00
|
|
|
ArchiveWriter.cpp
|
2011-06-25 19:54:29 +02:00
|
|
|
Binary.cpp
|
2017-06-02 19:53:06 +02:00
|
|
|
COFFImportFile.cpp
|
|
|
|
COFFModuleDefinition.cpp
|
2011-06-13 13:11:39 +02:00
|
|
|
COFFObjectFile.cpp
|
2017-01-11 16:26:41 +01:00
|
|
|
Decompressor.cpp
|
2013-08-09 00:27:13 +02:00
|
|
|
ELF.cpp
|
2011-06-13 13:11:39 +02:00
|
|
|
ELFObjectFile.cpp
|
2011-06-25 19:42:56 +02:00
|
|
|
Error.cpp
|
2021-01-27 19:21:47 +01:00
|
|
|
FaultMapParser.cpp
|
2014-02-21 21:10:59 +01:00
|
|
|
IRObjectFile.cpp
|
2017-03-31 06:47:07 +02:00
|
|
|
IRSymtab.cpp
|
2011-04-22 06:06:24 +02:00
|
|
|
MachOObjectFile.cpp
|
2013-06-18 17:03:28 +02:00
|
|
|
MachOUniversal.cpp
|
[Object] Add basic minidump support
Summary:
This patch adds basic support for reading minidump files. It contains
the definitions of various important minidump data structures (header,
stream directory), and of one minidump stream (SystemInfo). The ability
to read other streams will be added in follow-up patches. However, all
streams can be read even now as raw data, which means lldb's minidump
support (where this code is taken from) can be immediately rebased on
top of this patch as soon as it lands.
As we don't have any support for generating minidump files (yet), this
tests the code via unit tests with some small handcrafted binaries in
the form of c char arrays.
Reviewers: Bigcheese, jhenderson, zturner
Subscribers: srhines, dschuff, mgorny, fedor.sergeev, lemo, clayborg, JDevlieghere, aprantl, lldb-commits, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D59291
llvm-svn: 356652
2019-03-21 10:18:59 +01:00
|
|
|
Minidump.cpp
|
2016-12-01 07:51:47 +01:00
|
|
|
ModuleSymbolTable.cpp
|
2011-04-04 01:07:51 +02:00
|
|
|
Object.cpp
|
2010-11-15 04:21:41 +01:00
|
|
|
ObjectFile.cpp
|
2014-07-03 20:59:23 +02:00
|
|
|
RecordStreamer.cpp
|
[DWARF] Refactor RelocVisitor and fix computation of SHT_RELA-typed relocation entries
Summary:
getRelocatedValue may compute incorrect value for SHT_RELA-typed relocation entries.
// DWARFDataExtractor.cpp
uint64_t DWARFDataExtractor::getRelocatedValue(uint32_t Size, uint32_t *Off,
...
// This formula is correct for REL, but may be incorrect for RELA if the value
// stored in the location (getUnsigned(Off, Size)) is not zero.
return getUnsigned(Off, Size) + Rel->Value;
In this patch, we
* refactor these visit* functions to include a new parameter `uint64_t A`.
Since these visit* functions are no longer used as visitors, rename them to resolve*.
+ REL: A is used as the addend. A is the value stored in the location where the
relocation applies: getUnsigned(Off, Size)
+ RELA: The addend encoded in RelocationRef is used, e.g. getELFAddend(R)
* and add another set of supports* functions to check if a given relocation type is handled.
DWARFObjInMemory uses them to fail early.
Reviewers: echristo, dblaikie
Reviewed By: echristo
Subscribers: mgorny, aprantl, aheejin, fedor.sergeev, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D57939
llvm-svn: 356729
2019-03-22 03:43:11 +01:00
|
|
|
RelocationResolver.cpp
|
2014-02-21 21:10:59 +01:00
|
|
|
SymbolicFile.cpp
|
2015-06-23 04:08:48 +02:00
|
|
|
SymbolSize.cpp
|
2019-08-22 01:30:53 +02:00
|
|
|
TapiFile.cpp
|
|
|
|
TapiUniversal.cpp
|
2020-07-24 01:26:42 +02:00
|
|
|
MachOUniversalWriter.cpp
|
2016-11-30 17:49:11 +01:00
|
|
|
WasmObjectFile.cpp
|
2019-06-12 13:32:43 +02:00
|
|
|
WindowsMachineFlag.cpp
|
2017-05-20 03:49:19 +02:00
|
|
|
WindowsResource.cpp
|
[XCOFF] Add functionality for parsing AIX XCOFF object file headers
Summary:
1. Add functionality for parsing AIX XCOFF object files headers.
2. Only support 32-bit AIX XCOFF object files in this patch.
3. Print out the AIX XCOFF object file header in YAML format.
Reviewers: sfertile, hubert.reinterpretcast, jasonliu, mstorsjo, zturner, rnk
Reviewed By: sfertile, hubert.reinterpretcast
Subscribers: jsji, mgorny, hiraditya, jdoerfert, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D59419
Patch by Digger Lin
llvm-svn: 357663
2019-04-04 02:53:21 +02:00
|
|
|
XCOFFObjectFile.cpp
|
2015-02-11 04:28:02 +01:00
|
|
|
|
|
|
|
ADDITIONAL_HEADER_DIRS
|
|
|
|
${LLVM_MAIN_INCLUDE_DIR}/llvm/Object
|
2015-06-16 02:44:12 +02:00
|
|
|
|
|
|
|
DEPENDS
|
|
|
|
intrinsics_gen
|
2017-06-28 01:50:11 +02:00
|
|
|
llvm_vcsrevision_h
|
2020-10-09 18:41:21 +02:00
|
|
|
|
|
|
|
LINK_COMPONENTS
|
|
|
|
BitReader
|
|
|
|
Core
|
|
|
|
MC
|
|
|
|
BinaryFormat
|
|
|
|
MCParser
|
|
|
|
Support
|
|
|
|
TextAPI
|
2010-11-15 04:21:41 +01:00
|
|
|
)
|