[lld] r226976 - Fix the ELF shared library build targets - take 2
Greg Fitzgerald
garious at gmail.com
Fri Jan 23 20:53:41 PST 2015
Sorry about that. Should be fixed now (r226989).
-Greg
On Fri, Jan 23, 2015 at 8:30 PM, Filipe Cabecinhas <filcab at gmail.com> wrote:
> Hi Greg.
>
> We're getting these errors on our internal buildbot, since your revision:
>
> [860/1047] Linking CXX static library lib\LLVMAnalysis.lib
> FAILED: C:\PROGRA~2\MICROS~1.0\VC\bin\amd64\cl.exe /nologo /TP -wd4530 /MD
> /O2 /Ob2 /D NDEBUG -Itools\lld\lib\Driver
> -IC:\Buildbot\Slave\builds\530.Slower.build.LLD.Windows\llvm.src\tools\lld\lib\Driver
> -IC:\Buildbot\Slave\builds\530.Slower.build.LLD.Windows\llvm.src\tools\lld\include
> -Itools\lld\include -Iinclude
> -IC:\Buildbot\Slave\builds\530.Slower.build.LLD.Windows\llvm.src\include
> -wd4146 -wd4180 -wd4244 -wd4258 -wd4267 -wd4291 -wd4345 -wd4351 -wd4355
> -wd4456 -wd4457 -wd4458 -wd4459 -wd4503 -wd4624 -wd4722 -wd4800 -w14062
> -we4238 -wd4530 /EHs-c- /GR- /showIncludes -DGTEST_HAS_RTTI=0
> -D_CRT_NONSTDC_NO_DEPRECATE -D_CRT_NONSTDC_NO_WARNINGS
> -D_CRT_SECURE_NO_DEPRECATE -D_CRT_SECURE_NO_WARNINGS -D_HAS_EXCEPTIONS=0
> -D_SCL_SECURE_NO_DEPRECATE -D_SCL_SECURE_NO_WARNINGS
> -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS
> /Fotools\lld\lib\Driver\CMakeFiles\lldDriver.dir\GnuLdDriver.cpp.obj
> /Fdtools\lld\lib\Driver\CMakeFiles\lldDriver.dir\ /FS -c
> C:\Buildbot\Slave\builds\530.Slower.build.LLD.Windows\llvm.src\tools\lld\lib\Driver\GnuLdDriver.cpp
> C:\Buildbot\Slave\builds\530.Slower.build.LLD.Windows\llvm.src\tools\lld\lib\Driver\GnuLdDriver.cpp(325)
> : error C3083: 'AArch64LinkingContext': the symbol to the left of a '::'
> must be a type
> C:\Buildbot\Slave\builds\530.Slower.build.LLD.Windows\llvm.src\tools\lld\lib\Driver\GnuLdDriver.cpp(325)
> : error C2039: 'create' : is not a member of 'lld::elf'
> C:\Buildbot\Slave\builds\530.Slower.build.LLD.Windows\llvm.src\tools\lld\lib\Driver\GnuLdDriver.cpp(325)
> : error C3861: 'create': identifier not found
> C:\Buildbot\Slave\builds\530.Slower.build.LLD.Windows\llvm.src\tools\lld\lib\Driver\GnuLdDriver.cpp(326)
> : error C3083: 'ARMLinkingContext': the symbol to the left of a '::' must be
> a type
> C:\Buildbot\Slave\builds\530.Slower.build.LLD.Windows\llvm.src\tools\lld\lib\Driver\GnuLdDriver.cpp(326)
> : error C2039: 'create' : is not a member of 'lld::elf'
> C:\Buildbot\Slave\builds\530.Slower.build.LLD.Windows\llvm.src\tools\lld\lib\Driver\GnuLdDriver.cpp(326)
> : error C3861: 'create': identifier not found
> C:\Buildbot\Slave\builds\530.Slower.build.LLD.Windows\llvm.src\tools\lld\lib\Driver\GnuLdDriver.cpp(327)
> : error C3083: 'HexagonLinkingContext': the symbol to the left of a '::'
> must be a type
> C:\Buildbot\Slave\builds\530.Slower.build.LLD.Windows\llvm.src\tools\lld\lib\Driver\GnuLdDriver.cpp(327)
> : error C2039: 'create' : is not a member of 'lld::elf'
> C:\Buildbot\Slave\builds\530.Slower.build.LLD.Windows\llvm.src\tools\lld\lib\Driver\GnuLdDriver.cpp(327)
> : error C3861: 'create': identifier not found
> C:\Buildbot\Slave\builds\530.Slower.build.LLD.Windows\llvm.src\tools\lld\lib\Driver\GnuLdDriver.cpp(328)
> : error C3083: 'MipsLinkingContext': the symbol to the left of a '::' must
> be a type
> C:\Buildbot\Slave\builds\530.Slower.build.LLD.Windows\llvm.src\tools\lld\lib\Driver\GnuLdDriver.cpp(328)
> : error C2039: 'create' : is not a member of 'lld::elf'
> C:\Buildbot\Slave\builds\530.Slower.build.LLD.Windows\llvm.src\tools\lld\lib\Driver\GnuLdDriver.cpp(328)
> : error C3861: 'create': identifier not found
> ninja: build stopped: subcommand failed.
>
> Did you try compiling lld without these backends? X86* are conspicuously
> missing from the error and that's the only llvm backend built by the bot.
> Can you fix it, please?
>
> Filipe
>
> On Fri, Jan 23, 2015 at 5:06 PM, Greg Fitzgerald <garious at gmail.com> wrote:
>>
>> Author: garious
>> Date: Fri Jan 23 19:06:07 2015
>> New Revision: 226976
>>
>> URL: http://llvm.org/viewvc/llvm-project?rev=226976&view=rev
>> Log:
>> Fix the ELF shared library build targets - take 2
>>
>> lldELF is used by each ELF backend. lldELF's ELFLinkingContext
>> also held a reference to each backend, creating a link-time
>> cycle. This patch moves the backend references to lldDriver.
>>
>> Differential Revision: http://reviews.llvm.org/D7119
>>
>> Added:
>> lld/trunk/include/lld/ReaderWriter/ELFTargets.h
>> Removed:
>> lld/trunk/lib/ReaderWriter/ELF/AArch64/AArch64Target.h
>> lld/trunk/lib/ReaderWriter/ELF/ARM/ARMTarget.h
>> lld/trunk/lib/ReaderWriter/ELF/Hexagon/HexagonTarget.h
>> lld/trunk/lib/ReaderWriter/ELF/Mips/MipsTarget.h
>> lld/trunk/lib/ReaderWriter/ELF/PPC/PPCTarget.h
>> lld/trunk/lib/ReaderWriter/ELF/Targets.h
>> lld/trunk/lib/ReaderWriter/ELF/X86/X86Target.h
>> lld/trunk/lib/ReaderWriter/ELF/X86_64/X86_64Target.h
>> Modified:
>> lld/trunk/include/lld/ReaderWriter/ELFLinkingContext.h
>> lld/trunk/lib/Driver/CMakeLists.txt
>> lld/trunk/lib/Driver/GnuLdDriver.cpp
>> lld/trunk/lib/ReaderWriter/ELF/AArch64/AArch64DynamicLibraryWriter.h
>> lld/trunk/lib/ReaderWriter/ELF/AArch64/AArch64LinkingContext.cpp
>> lld/trunk/lib/ReaderWriter/ELF/AArch64/AArch64LinkingContext.h
>> lld/trunk/lib/ReaderWriter/ELF/AArch64/CMakeLists.txt
>> lld/trunk/lib/ReaderWriter/ELF/ARM/ARMExecutableWriter.h
>> lld/trunk/lib/ReaderWriter/ELF/ARM/ARMLinkingContext.cpp
>> lld/trunk/lib/ReaderWriter/ELF/ARM/ARMLinkingContext.h
>> lld/trunk/lib/ReaderWriter/ELF/ARM/CMakeLists.txt
>> lld/trunk/lib/ReaderWriter/ELF/CMakeLists.txt
>> lld/trunk/lib/ReaderWriter/ELF/ELFLinkingContext.cpp
>> lld/trunk/lib/ReaderWriter/ELF/Hexagon/CMakeLists.txt
>> lld/trunk/lib/ReaderWriter/ELF/Hexagon/HexagonLinkingContext.cpp
>> lld/trunk/lib/ReaderWriter/ELF/Hexagon/HexagonLinkingContext.h
>> lld/trunk/lib/ReaderWriter/ELF/Makefile
>> lld/trunk/lib/ReaderWriter/ELF/Mips/CMakeLists.txt
>> lld/trunk/lib/ReaderWriter/ELF/Mips/MipsLinkingContext.cpp
>> lld/trunk/lib/ReaderWriter/ELF/Mips/MipsLinkingContext.h
>> lld/trunk/lib/ReaderWriter/ELF/PPC/CMakeLists.txt
>> lld/trunk/lib/ReaderWriter/ELF/PPC/PPCLinkingContext.cpp
>> lld/trunk/lib/ReaderWriter/ELF/PPC/PPCLinkingContext.h
>> lld/trunk/lib/ReaderWriter/ELF/X86/CMakeLists.txt
>> lld/trunk/lib/ReaderWriter/ELF/X86/X86LinkingContext.cpp
>> lld/trunk/lib/ReaderWriter/ELF/X86/X86LinkingContext.h
>> lld/trunk/lib/ReaderWriter/ELF/X86_64/CMakeLists.txt
>> lld/trunk/lib/ReaderWriter/ELF/X86_64/X86_64DynamicLibraryWriter.h
>> lld/trunk/lib/ReaderWriter/ELF/X86_64/X86_64LinkingContext.cpp
>> lld/trunk/lib/ReaderWriter/ELF/X86_64/X86_64LinkingContext.h
>> lld/trunk/lib/ReaderWriter/MachO/CMakeLists.txt
>> lld/trunk/lib/ReaderWriter/MachO/Makefile
>> lld/trunk/lib/ReaderWriter/PECOFF/CMakeLists.txt
>> lld/trunk/lib/ReaderWriter/PECOFF/Makefile
>>
>> Modified: lld/trunk/include/lld/ReaderWriter/ELFLinkingContext.h
>> URL:
>> http://llvm.org/viewvc/llvm-project/lld/trunk/include/lld/ReaderWriter/ELFLinkingContext.h?rev=226976&r1=226975&r2=226976&view=diff
>>
>> ==============================================================================
>> --- lld/trunk/include/lld/ReaderWriter/ELFLinkingContext.h (original)
>> +++ lld/trunk/include/lld/ReaderWriter/ELFLinkingContext.h Fri Jan 23
>> 19:06:07 2015
>> @@ -116,8 +116,6 @@ public:
>> return true;
>> }
>>
>> - static std::unique_ptr<ELFLinkingContext> create(llvm::Triple);
>> -
>> /// \brief Use Elf_Rela format to output relocation tables.
>> virtual bool isRelaOutputFormat() const { return true; }
>>
>>
>> Added: lld/trunk/include/lld/ReaderWriter/ELFTargets.h
>> URL:
>> http://llvm.org/viewvc/llvm-project/lld/trunk/include/lld/ReaderWriter/ELFTargets.h?rev=226976&view=auto
>>
>> ==============================================================================
>> --- lld/trunk/include/lld/ReaderWriter/ELFTargets.h (added)
>> +++ lld/trunk/include/lld/ReaderWriter/ELFTargets.h Fri Jan 23 19:06:07
>> 2015
>> @@ -0,0 +1,40 @@
>> +//===- lld/ReaderWriter/ELFTargets.h
>> --------------------------------------===//
>> +//
>> +// The LLVM Linker
>> +//
>> +// This file is distributed under the University of Illinois Open Source
>> +// License. See LICENSE.TXT for details.
>> +//
>>
>> +//===----------------------------------------------------------------------===//
>> +
>> +#ifndef LLD_READER_WRITER_ELF_TARGETS_H
>> +#define LLD_READER_WRITER_ELF_TARGETS_H
>> +
>> +#include "ELFLinkingContext.h"
>> +
>> +namespace lld {
>> +namespace elf {
>> +
>> +#define LLVM_TARGET(TargetName) \
>> + class TargetName##LinkingContext final : public ELFLinkingContext { \
>> + public: \
>> + static std::unique_ptr<ELFLinkingContext> create(llvm::Triple); \
>> + };
>> +#include "llvm/Config/Targets.def"
>> +
>> +// X86 => X86,X86_64
>> +class X86_64LinkingContext final : public ELFLinkingContext {
>> +public:
>> + static std::unique_ptr<ELFLinkingContext> create(llvm::Triple); \
>> +};
>> +
>> +// PowerPC => PPC
>> +class PPCLinkingContext final : public ELFLinkingContext {
>> +public:
>> + static std::unique_ptr<ELFLinkingContext> create(llvm::Triple); \
>> +};
>> +
>> +} // end namespace elf
>> +} // end namespace lld
>> +
>> +#endif
>>
>> Modified: lld/trunk/lib/Driver/CMakeLists.txt
>> URL:
>> http://llvm.org/viewvc/llvm-project/lld/trunk/lib/Driver/CMakeLists.txt?rev=226976&r1=226975&r2=226976&view=diff
>>
>> ==============================================================================
>> --- lld/trunk/lib/Driver/CMakeLists.txt (original)
>> +++ lld/trunk/lib/Driver/CMakeLists.txt Fri Jan 23 19:06:07 2015
>> @@ -24,6 +24,13 @@ add_llvm_library(lldDriver
>> lldMachO
>> lldPECOFF
>> lldELF
>> + lldAArch64ELFTarget
>> + lldARMELFTarget
>> + lldHexagonELFTarget
>> + lldMipsELFTarget
>> + lldPPCELFTarget
>> + lldX86ELFTarget
>> + lldX86_64ELFTarget
>> lldCore
>> lldNative
>> lldReaderWriter
>>
>> Modified: lld/trunk/lib/Driver/GnuLdDriver.cpp
>> URL:
>> http://llvm.org/viewvc/llvm-project/lld/trunk/lib/Driver/GnuLdDriver.cpp?rev=226976&r1=226975&r2=226976&view=diff
>>
>> ==============================================================================
>> --- lld/trunk/lib/Driver/GnuLdDriver.cpp (original)
>> +++ lld/trunk/lib/Driver/GnuLdDriver.cpp Fri Jan 23 19:06:07 2015
>> @@ -15,6 +15,7 @@
>>
>> #include "lld/Driver/Driver.h"
>> #include "lld/ReaderWriter/ELFLinkingContext.h"
>> +#include "lld/ReaderWriter/ELFTargets.h"
>> #include "lld/ReaderWriter/LinkerScript.h"
>> #include "llvm/ADT/ArrayRef.h"
>> #include "llvm/ADT/Optional.h"
>> @@ -314,6 +315,23 @@ void GnuLdDriver::addPlatformSearchDirs(
>> ctx.addSearchPath("=/usr/lib");
>> }
>>
>> +#define LLVM_TARGET(targetName) \
>> + if ((p = elf::targetName##LinkingContext::create(triple))) return p;
>> +
>> +std::unique_ptr<ELFLinkingContext>
>> +createELFLinkingContext(llvm::Triple triple) {
>> + std::unique_ptr<ELFLinkingContext> p;
>> + // FIXME: #include "llvm/Config/Targets.def"
>> + LLVM_TARGET(AArch64)
>> + LLVM_TARGET(ARM)
>> + LLVM_TARGET(Hexagon)
>> + LLVM_TARGET(Mips)
>> + LLVM_TARGET(PPC)
>> + LLVM_TARGET(X86)
>> + LLVM_TARGET(X86_64)
>> + return nullptr;
>> +}
>> +
>> bool GnuLdDriver::parse(int argc, const char *argv[],
>> std::unique_ptr<ELFLinkingContext> &context,
>> raw_ostream &diagnostics) {
>> @@ -349,7 +367,7 @@ bool GnuLdDriver::parse(int argc, const
>> if (!applyEmulation(triple, *parsedArgs, diagnostics))
>> return false;
>>
>> - std::unique_ptr<ELFLinkingContext>
>> ctx(ELFLinkingContext::create(triple));
>> + std::unique_ptr<ELFLinkingContext>
>> ctx(createELFLinkingContext(triple));
>>
>> if (!ctx) {
>> diagnostics << "unknown target triple\n";
>>
>> Modified:
>> lld/trunk/lib/ReaderWriter/ELF/AArch64/AArch64DynamicLibraryWriter.h
>> URL:
>> http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/ELF/AArch64/AArch64DynamicLibraryWriter.h?rev=226976&r1=226975&r2=226976&view=diff
>>
>> ==============================================================================
>> --- lld/trunk/lib/ReaderWriter/ELF/AArch64/AArch64DynamicLibraryWriter.h
>> (original)
>> +++ lld/trunk/lib/ReaderWriter/ELF/AArch64/AArch64DynamicLibraryWriter.h
>> Fri Jan 23 19:06:07 2015
>> @@ -10,6 +10,7 @@
>> #define AARCH64_DYNAMIC_LIBRARY_WRITER_H
>>
>> #include "AArch64LinkingContext.h"
>> +#include "AArch64TargetHandler.h"
>> #include "DynamicLibraryWriter.h"
>>
>> namespace lld {
>>
>> Modified: lld/trunk/lib/ReaderWriter/ELF/AArch64/AArch64LinkingContext.cpp
>> URL:
>> http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/ELF/AArch64/AArch64LinkingContext.cpp?rev=226976&r1=226975&r2=226976&view=diff
>>
>> ==============================================================================
>> --- lld/trunk/lib/ReaderWriter/ELF/AArch64/AArch64LinkingContext.cpp
>> (original)
>> +++ lld/trunk/lib/ReaderWriter/ELF/AArch64/AArch64LinkingContext.cpp Fri
>> Jan 23 19:06:07 2015
>> @@ -9,9 +9,22 @@
>>
>> #include "AArch64LinkingContext.h"
>> #include "AArch64RelocationPass.h"
>> +#include "AArch64TargetHandler.h"
>>
>> using namespace lld;
>>
>> +std::unique_ptr<ELFLinkingContext>
>> +elf::AArch64LinkingContext::create(llvm::Triple triple) {
>> + if (triple.getArch() == llvm::Triple::aarch64)
>> + return std::unique_ptr<ELFLinkingContext>(
>> + new elf::AArch64LinkingContext(triple));
>> + return nullptr;
>> +}
>> +
>> +elf::AArch64LinkingContext::AArch64LinkingContext(llvm::Triple triple)
>> + : ELFLinkingContext(triple, std::unique_ptr<TargetHandlerBase>(
>> + new AArch64TargetHandler(*this))) {}
>> +
>> void elf::AArch64LinkingContext::addPasses(PassManager &pm) {
>> auto pass = createAArch64RelocationPass(*this);
>> if (pass)
>>
>> Modified: lld/trunk/lib/ReaderWriter/ELF/AArch64/AArch64LinkingContext.h
>> URL:
>> http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/ELF/AArch64/AArch64LinkingContext.h?rev=226976&r1=226975&r2=226976&view=diff
>>
>> ==============================================================================
>> --- lld/trunk/lib/ReaderWriter/ELF/AArch64/AArch64LinkingContext.h
>> (original)
>> +++ lld/trunk/lib/ReaderWriter/ELF/AArch64/AArch64LinkingContext.h Fri Jan
>> 23 19:06:07 2015
>> @@ -10,7 +10,6 @@
>> #ifndef LLD_READER_WRITER_ELF_AARCH64_AARCH64_LINKING_CONTEXT_H
>> #define LLD_READER_WRITER_ELF_AARCH64_AARCH64_LINKING_CONTEXT_H
>>
>> -#include "AArch64TargetHandler.h"
>> #include "lld/ReaderWriter/ELFLinkingContext.h"
>> #include "llvm/Object/ELF.h"
>> #include "llvm/Support/ELF.h"
>> @@ -25,9 +24,8 @@ enum {
>>
>> class AArch64LinkingContext final : public ELFLinkingContext {
>> public:
>> - AArch64LinkingContext(llvm::Triple triple)
>> - : ELFLinkingContext(triple, std::unique_ptr<TargetHandlerBase>(
>> - new AArch64TargetHandler(*this)))
>> {}
>> + static std::unique_ptr<ELFLinkingContext> create(llvm::Triple);
>> + AArch64LinkingContext(llvm::Triple);
>>
>> void addPasses(PassManager &) override;
>>
>>
>> Removed: lld/trunk/lib/ReaderWriter/ELF/AArch64/AArch64Target.h
>> URL:
>> http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/ELF/AArch64/AArch64Target.h?rev=226975&view=auto
>>
>> ==============================================================================
>> --- lld/trunk/lib/ReaderWriter/ELF/AArch64/AArch64Target.h (original)
>> +++ lld/trunk/lib/ReaderWriter/ELF/AArch64/AArch64Target.h (removed)
>> @@ -1,10 +0,0 @@
>> -//===- lib/ReaderWriter/ELF/AArch64/AArch64Target.h
>> -----------------------===//
>> -//
>> -// The LLVM Linker
>> -//
>> -// This file is distributed under the University of Illinois Open Source
>> -// License. See LICENSE.TXT for details.
>> -//
>>
>> -//===----------------------------------------------------------------------===//
>> -
>> -#include "AArch64LinkingContext.h"
>>
>> Modified: lld/trunk/lib/ReaderWriter/ELF/AArch64/CMakeLists.txt
>> URL:
>> http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/ELF/AArch64/CMakeLists.txt?rev=226976&r1=226975&r2=226976&view=diff
>>
>> ==============================================================================
>> --- lld/trunk/lib/ReaderWriter/ELF/AArch64/CMakeLists.txt (original)
>> +++ lld/trunk/lib/ReaderWriter/ELF/AArch64/CMakeLists.txt Fri Jan 23
>> 19:06:07 2015
>> @@ -5,5 +5,7 @@ add_llvm_library(lldAArch64ELFTarget
>> AArch64RelocationPass.cpp
>> LINK_LIBS
>> lldCore
>> + lldELF
>> + LLVMObject
>> LLVMSupport
>> )
>>
>> Modified: lld/trunk/lib/ReaderWriter/ELF/ARM/ARMExecutableWriter.h
>> URL:
>> http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/ELF/ARM/ARMExecutableWriter.h?rev=226976&r1=226975&r2=226976&view=diff
>>
>> ==============================================================================
>> --- lld/trunk/lib/ReaderWriter/ELF/ARM/ARMExecutableWriter.h (original)
>> +++ lld/trunk/lib/ReaderWriter/ELF/ARM/ARMExecutableWriter.h Fri Jan 23
>> 19:06:07 2015
>> @@ -11,6 +11,7 @@
>>
>> #include "ExecutableWriter.h"
>> #include "ARMLinkingContext.h"
>> +#include "ARMTargetHandler.h"
>>
>> namespace lld {
>> namespace elf {
>>
>> Modified: lld/trunk/lib/ReaderWriter/ELF/ARM/ARMLinkingContext.cpp
>> URL:
>> http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/ELF/ARM/ARMLinkingContext.cpp?rev=226976&r1=226975&r2=226976&view=diff
>>
>> ==============================================================================
>> --- lld/trunk/lib/ReaderWriter/ELF/ARM/ARMLinkingContext.cpp (original)
>> +++ lld/trunk/lib/ReaderWriter/ELF/ARM/ARMLinkingContext.cpp Fri Jan 23
>> 19:06:07 2015
>> @@ -9,10 +9,23 @@
>>
>> #include "ARMLinkingContext.h"
>> #include "ARMRelocationPass.h"
>> +#include "ARMTargetHandler.h"
>>
>> using namespace lld;
>> using namespace lld::elf;
>>
>> +std::unique_ptr<ELFLinkingContext>
>> +elf::ARMLinkingContext::create(llvm::Triple triple) {
>> + if (triple.getArch() == llvm::Triple::arm)
>> + return std::unique_ptr<ELFLinkingContext>(
>> + new elf::ARMLinkingContext(triple));
>> + return nullptr;
>> +}
>> +
>> +elf::ARMLinkingContext::ARMLinkingContext(llvm::Triple triple)
>> + : ELFLinkingContext(triple, std::unique_ptr<TargetHandlerBase>(
>> + new ARMTargetHandler(*this))) {}
>> +
>> void elf::ARMLinkingContext::addPasses(PassManager &pm) {
>> auto pass = createARMRelocationPass(*this);
>> if (pass)
>>
>> Modified: lld/trunk/lib/ReaderWriter/ELF/ARM/ARMLinkingContext.h
>> URL:
>> http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/ELF/ARM/ARMLinkingContext.h?rev=226976&r1=226975&r2=226976&view=diff
>>
>> ==============================================================================
>> --- lld/trunk/lib/ReaderWriter/ELF/ARM/ARMLinkingContext.h (original)
>> +++ lld/trunk/lib/ReaderWriter/ELF/ARM/ARMLinkingContext.h Fri Jan 23
>> 19:06:07 2015
>> @@ -10,10 +10,7 @@
>> #ifndef LLD_READER_WRITER_ELF_ARM_ARM_LINKING_CONTEXT_H
>> #define LLD_READER_WRITER_ELF_ARM_ARM_LINKING_CONTEXT_H
>>
>> -#include "ARMTargetHandler.h"
>> -
>> #include "lld/ReaderWriter/ELFLinkingContext.h"
>> -
>> #include "llvm/Object/ELF.h"
>> #include "llvm/Support/ELF.h"
>>
>> @@ -22,9 +19,8 @@ namespace elf {
>>
>> class ARMLinkingContext final : public ELFLinkingContext {
>> public:
>> - ARMLinkingContext(llvm::Triple triple)
>> - : ELFLinkingContext(triple, std::unique_ptr<TargetHandlerBase>(
>> - new ARMTargetHandler(*this))) {}
>> + static std::unique_ptr<ELFLinkingContext> create(llvm::Triple);
>> + ARMLinkingContext(llvm::Triple);
>>
>> void addPasses(PassManager &) override;
>>
>>
>> Removed: lld/trunk/lib/ReaderWriter/ELF/ARM/ARMTarget.h
>> URL:
>> http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/ELF/ARM/ARMTarget.h?rev=226975&view=auto
>>
>> ==============================================================================
>> --- lld/trunk/lib/ReaderWriter/ELF/ARM/ARMTarget.h (original)
>> +++ lld/trunk/lib/ReaderWriter/ELF/ARM/ARMTarget.h (removed)
>> @@ -1,10 +0,0 @@
>> -//===--------- lib/ReaderWriter/ELF/ARM/ARMTarget.h
>> -----------------------===//
>> -//
>> -// The LLVM Linker
>> -//
>> -// This file is distributed under the University of Illinois Open Source
>> -// License. See LICENSE.TXT for details.
>> -//
>>
>> -//===----------------------------------------------------------------------===//
>> -
>> -#include "ARMLinkingContext.h"
>>
>> Modified: lld/trunk/lib/ReaderWriter/ELF/ARM/CMakeLists.txt
>> URL:
>> http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/ELF/ARM/CMakeLists.txt?rev=226976&r1=226975&r2=226976&view=diff
>>
>> ==============================================================================
>> --- lld/trunk/lib/ReaderWriter/ELF/ARM/CMakeLists.txt (original)
>> +++ lld/trunk/lib/ReaderWriter/ELF/ARM/CMakeLists.txt Fri Jan 23 19:06:07
>> 2015
>> @@ -5,4 +5,7 @@ add_llvm_library(lldARMELFTarget
>> ARMRelocationPass.cpp
>> LINK_LIBS
>> lldCore
>> + lldELF
>> + LLVMObject
>> + LLVMSupport
>> )
>>
>> Modified: lld/trunk/lib/ReaderWriter/ELF/CMakeLists.txt
>> URL:
>> http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/ELF/CMakeLists.txt?rev=226976&r1=226975&r2=226976&view=diff
>>
>> ==============================================================================
>> --- lld/trunk/lib/ReaderWriter/ELF/CMakeLists.txt (original)
>> +++ lld/trunk/lib/ReaderWriter/ELF/CMakeLists.txt Fri Jan 23 19:06:07 2015
>> @@ -4,15 +4,10 @@ add_llvm_library(lldELF
>> Reader.cpp
>> Writer.cpp
>> LINK_LIBS
>> - lldHexagonELFTarget
>> - lldMipsELFTarget
>> - lldPPCELFTarget
>> + lldCore
>> lldPasses
>> - lldReaderWriter
>> - lldX86ELFTarget
>> - lldX86_64ELFTarget
>> - lldAArch64ELFTarget
>> - lldARMELFTarget
>> + lldYAML
>> + LLVMSupport
>> )
>>
>> include_directories(.)
>>
>> Modified: lld/trunk/lib/ReaderWriter/ELF/ELFLinkingContext.cpp
>> URL:
>> http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/ELF/ELFLinkingContext.cpp?rev=226976&r1=226975&r2=226976&view=diff
>>
>> ==============================================================================
>> --- lld/trunk/lib/ReaderWriter/ELF/ELFLinkingContext.cpp (original)
>> +++ lld/trunk/lib/ReaderWriter/ELF/ELFLinkingContext.cpp Fri Jan 23
>> 19:06:07 2015
>> @@ -11,8 +11,8 @@
>> #include "ArrayOrderPass.h"
>> #include "ELFFile.h"
>> #include "TargetHandler.h"
>> -#include "Targets.h"
>> #include "lld/Core/Instrumentation.h"
>> +#include "lld/Core/SharedLibraryFile.h"
>> #include "lld/Passes/LayoutPass.h"
>> #include "lld/Passes/RoundTripYAMLPass.h"
>> #include "llvm/ADT/Triple.h"
>> @@ -56,7 +56,7 @@ public:
>>
>> ELFLinkingContext::ELFLinkingContext(
>> llvm::Triple triple, std::unique_ptr<TargetHandlerBase>
>> targetHandler)
>> - : _outputELFType(elf::ET_EXEC), _triple(triple),
>> + : _outputELFType(llvm::ELF::ET_EXEC), _triple(triple),
>> _targetHandler(std::move(targetHandler)), _baseAddress(0),
>> _isStaticExecutable(false), _noInhibitExec(false),
>> _exportDynamic(false),
>> _mergeCommonStrings(false), _runLayoutPass(true),
>> @@ -93,7 +93,7 @@ uint16_t ELFLinkingContext::getOutputMac
>> }
>>
>> StringRef ELFLinkingContext::entrySymbolName() const {
>> - if (_outputELFType == elf::ET_EXEC && _entrySymbolName.empty())
>> + if (_outputELFType == llvm::ELF::ET_EXEC && _entrySymbolName.empty())
>> return "_start";
>> return _entrySymbolName;
>> }
>> @@ -129,35 +129,6 @@ bool ELFLinkingContext::isRelativeReloc(
>>
>> Writer &ELFLinkingContext::writer() const { return *_writer; }
>>
>> -std::unique_ptr<ELFLinkingContext>
>> -ELFLinkingContext::create(llvm::Triple triple) {
>> - switch (triple.getArch()) {
>> - case llvm::Triple::x86:
>> - return std::unique_ptr<ELFLinkingContext>(
>> - new lld::elf::X86LinkingContext(triple));
>> - case llvm::Triple::x86_64:
>> - return std::unique_ptr<ELFLinkingContext>(
>> - new lld::elf::X86_64LinkingContext(triple));
>> - case llvm::Triple::hexagon:
>> - return std::unique_ptr<ELFLinkingContext>(
>> - new lld::elf::HexagonLinkingContext(triple));
>> - case llvm::Triple::mipsel:
>> - return std::unique_ptr<ELFLinkingContext>(
>> - new lld::elf::MipsLinkingContext(triple));
>> - case llvm::Triple::ppc:
>> - return std::unique_ptr<ELFLinkingContext>(
>> - new lld::elf::PPCLinkingContext(triple));
>> - case llvm::Triple::aarch64:
>> - return std::unique_ptr<ELFLinkingContext>(
>> - new lld::elf::AArch64LinkingContext(triple));
>> - case llvm::Triple::arm:
>> - return std::unique_ptr<ELFLinkingContext>(
>> - new lld::elf::ARMLinkingContext(triple));
>> - default:
>> - return nullptr;
>> - }
>> -}
>> -
>> static void buildSearchPath(SmallString<128> &path, StringRef dir,
>> StringRef sysRoot) {
>> if (!dir.startswith("=/"))
>>
>> Modified: lld/trunk/lib/ReaderWriter/ELF/Hexagon/CMakeLists.txt
>> URL:
>> http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/ELF/Hexagon/CMakeLists.txt?rev=226976&r1=226975&r2=226976&view=diff
>>
>> ==============================================================================
>> --- lld/trunk/lib/ReaderWriter/ELF/Hexagon/CMakeLists.txt (original)
>> +++ lld/trunk/lib/ReaderWriter/ELF/Hexagon/CMakeLists.txt Fri Jan 23
>> 19:06:07 2015
>> @@ -4,5 +4,7 @@ add_llvm_library(lldHexagonELFTarget
>> HexagonTargetHandler.cpp
>> LINK_LIBS
>> lldCore
>> + lldELF
>> + LLVMObject
>> LLVMSupport
>> )
>>
>> Modified: lld/trunk/lib/ReaderWriter/ELF/Hexagon/HexagonLinkingContext.cpp
>> URL:
>> http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/ELF/Hexagon/HexagonLinkingContext.cpp?rev=226976&r1=226975&r2=226976&view=diff
>>
>> ==============================================================================
>> --- lld/trunk/lib/ReaderWriter/ELF/Hexagon/HexagonLinkingContext.cpp
>> (original)
>> +++ lld/trunk/lib/ReaderWriter/ELF/Hexagon/HexagonLinkingContext.cpp Fri
>> Jan 23 19:06:07 2015
>> @@ -12,6 +12,14 @@
>>
>> using namespace lld::elf;
>>
>> +std::unique_ptr<lld::ELFLinkingContext>
>> +HexagonLinkingContext::create(llvm::Triple triple) {
>> + if (triple.getArch() == llvm::Triple::hexagon)
>> + return std::unique_ptr<lld::ELFLinkingContext>(
>> + new HexagonLinkingContext(triple));
>> + return nullptr;
>> +}
>> +
>> HexagonLinkingContext::HexagonLinkingContext(llvm::Triple triple)
>> : ELFLinkingContext(triple, std::unique_ptr<TargetHandlerBase>(
>> new HexagonTargetHandler(*this))) {}
>>
>> Modified: lld/trunk/lib/ReaderWriter/ELF/Hexagon/HexagonLinkingContext.h
>> URL:
>> http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/ELF/Hexagon/HexagonLinkingContext.h?rev=226976&r1=226975&r2=226976&view=diff
>>
>> ==============================================================================
>> --- lld/trunk/lib/ReaderWriter/ELF/Hexagon/HexagonLinkingContext.h
>> (original)
>> +++ lld/trunk/lib/ReaderWriter/ELF/Hexagon/HexagonLinkingContext.h Fri Jan
>> 23 19:06:07 2015
>> @@ -21,6 +21,7 @@ typedef llvm::object::ELFType<llvm::supp
>>
>> class HexagonLinkingContext final : public ELFLinkingContext {
>> public:
>> + static std::unique_ptr<ELFLinkingContext> create(llvm::Triple);
>> HexagonLinkingContext(llvm::Triple triple);
>>
>> void addPasses(PassManager &) override;
>>
>> Removed: lld/trunk/lib/ReaderWriter/ELF/Hexagon/HexagonTarget.h
>> URL:
>> http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/ELF/Hexagon/HexagonTarget.h?rev=226975&view=auto
>>
>> ==============================================================================
>> --- lld/trunk/lib/ReaderWriter/ELF/Hexagon/HexagonTarget.h (original)
>> +++ lld/trunk/lib/ReaderWriter/ELF/Hexagon/HexagonTarget.h (removed)
>> @@ -1,10 +0,0 @@
>> -//===- lib/ReaderWriter/ELF/Hexagon/HexagonTarget.h
>> -----------------------===//
>> -//
>> -// The LLVM Linker
>> -//
>> -// This file is distributed under the University of Illinois Open Source
>> -// License. See LICENSE.TXT for details.
>> -//
>>
>> -//===----------------------------------------------------------------------===//
>> -
>> -#include "HexagonLinkingContext.h"
>>
>> Modified: lld/trunk/lib/ReaderWriter/ELF/Makefile
>> URL:
>> http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/ELF/Makefile?rev=226976&r1=226975&r2=226976&view=diff
>>
>> ==============================================================================
>> --- lld/trunk/lib/ReaderWriter/ELF/Makefile (original)
>> +++ lld/trunk/lib/ReaderWriter/ELF/Makefile Fri Jan 23 19:06:07 2015
>> @@ -9,10 +9,7 @@
>>
>> LLD_LEVEL := ../../..
>> LIBRARYNAME := lldELF
>> -USEDLIBS = lldHexagonELFTarget.a lldPPCELFTarget.a lldMipsELFTarget.a \
>> - lldX86ELFTarget.a lldX86_64ELFTarget.a lldAArch64ELFTarget.a \
>> - lldARMELFTarget.a \
>> - lldReaderWriter.a lldPasses.a
>> +USEDLIBS = lldPasses.a
>>
>> CPP.Flags += -I$(PROJ_SRC_DIR)/$(LLD_LEVEL)/lib/ReaderWriter/ELF
>>
>>
>> Modified: lld/trunk/lib/ReaderWriter/ELF/Mips/CMakeLists.txt
>> URL:
>> http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/ELF/Mips/CMakeLists.txt?rev=226976&r1=226975&r2=226976&view=diff
>>
>> ==============================================================================
>> --- lld/trunk/lib/ReaderWriter/ELF/Mips/CMakeLists.txt (original)
>> +++ lld/trunk/lib/ReaderWriter/ELF/Mips/CMakeLists.txt Fri Jan 23 19:06:07
>> 2015
>> @@ -7,5 +7,7 @@ add_llvm_library(lldMipsELFTarget
>> MipsTargetHandler.cpp
>> LINK_LIBS
>> lldCore
>> + lldELF
>> + LLVMObject
>> LLVMSupport
>> )
>>
>> Modified: lld/trunk/lib/ReaderWriter/ELF/Mips/MipsLinkingContext.cpp
>> URL:
>> http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/ELF/Mips/MipsLinkingContext.cpp?rev=226976&r1=226975&r2=226976&view=diff
>>
>> ==============================================================================
>> --- lld/trunk/lib/ReaderWriter/ELF/Mips/MipsLinkingContext.cpp (original)
>> +++ lld/trunk/lib/ReaderWriter/ELF/Mips/MipsLinkingContext.cpp Fri Jan 23
>> 19:06:07 2015
>> @@ -16,6 +16,14 @@
>> using namespace lld;
>> using namespace lld::elf;
>>
>> +std::unique_ptr<ELFLinkingContext>
>> +MipsLinkingContext::create(llvm::Triple triple) {
>> + if (triple.getArch() == llvm::Triple::mipsel)
>> + return std::unique_ptr<ELFLinkingContext>(
>> + new MipsLinkingContext(triple));
>> + return nullptr;
>> +}
>> +
>> MipsLinkingContext::MipsLinkingContext(llvm::Triple triple)
>> : ELFLinkingContext(triple, std::unique_ptr<TargetHandlerBase>(
>> new MipsTargetHandler(*this))) {}
>>
>> Modified: lld/trunk/lib/ReaderWriter/ELF/Mips/MipsLinkingContext.h
>> URL:
>> http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/ELF/Mips/MipsLinkingContext.h?rev=226976&r1=226975&r2=226976&view=diff
>>
>> ==============================================================================
>> --- lld/trunk/lib/ReaderWriter/ELF/Mips/MipsLinkingContext.h (original)
>> +++ lld/trunk/lib/ReaderWriter/ELF/Mips/MipsLinkingContext.h Fri Jan 23
>> 19:06:07 2015
>> @@ -39,6 +39,7 @@ template <class ELFType> class MipsTarge
>>
>> class MipsLinkingContext final : public ELFLinkingContext {
>> public:
>> + static std::unique_ptr<ELFLinkingContext> create(llvm::Triple);
>> MipsLinkingContext(llvm::Triple triple);
>>
>> uint32_t getMergedELFFlags() const;
>>
>> Removed: lld/trunk/lib/ReaderWriter/ELF/Mips/MipsTarget.h
>> URL:
>> http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/ELF/Mips/MipsTarget.h?rev=226975&view=auto
>>
>> ==============================================================================
>> --- lld/trunk/lib/ReaderWriter/ELF/Mips/MipsTarget.h (original)
>> +++ lld/trunk/lib/ReaderWriter/ELF/Mips/MipsTarget.h (removed)
>> @@ -1,10 +0,0 @@
>> -//===- lib/ReaderWriter/ELF/Mips/MipsTarget.h
>> -----------------------------===//
>> -//
>> -// The LLVM Linker
>> -//
>> -// This file is distributed under the University of Illinois Open Source
>> -// License. See LICENSE.TXT for details.
>> -//
>>
>> -//===----------------------------------------------------------------------===//
>> -
>> -#include "MipsLinkingContext.h"
>>
>> Modified: lld/trunk/lib/ReaderWriter/ELF/PPC/CMakeLists.txt
>> URL:
>> http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/ELF/PPC/CMakeLists.txt?rev=226976&r1=226975&r2=226976&view=diff
>>
>> ==============================================================================
>> --- lld/trunk/lib/ReaderWriter/ELF/PPC/CMakeLists.txt (original)
>> +++ lld/trunk/lib/ReaderWriter/ELF/PPC/CMakeLists.txt Fri Jan 23 19:06:07
>> 2015
>> @@ -3,5 +3,7 @@ add_llvm_library(lldPPCELFTarget
>> PPCTargetHandler.cpp
>> LINK_LIBS
>> lldCore
>> + lldELF
>> + LLVMObject
>> LLVMSupport
>> )
>>
>> Modified: lld/trunk/lib/ReaderWriter/ELF/PPC/PPCLinkingContext.cpp
>> URL:
>> http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/ELF/PPC/PPCLinkingContext.cpp?rev=226976&r1=226975&r2=226976&view=diff
>>
>> ==============================================================================
>> --- lld/trunk/lib/ReaderWriter/ELF/PPC/PPCLinkingContext.cpp (original)
>> +++ lld/trunk/lib/ReaderWriter/ELF/PPC/PPCLinkingContext.cpp Fri Jan 23
>> 19:06:07 2015
>> @@ -8,9 +8,22 @@
>>
>> //===----------------------------------------------------------------------===//
>>
>> #include "PPCLinkingContext.h"
>> +#include "PPCTargetHandler.h"
>> #include "lld/Core/LLVM.h"
>> #include "llvm/ADT/StringSwitch.h"
>> #include "llvm/Support/ErrorOr.h"
>>
>> using namespace lld;
>>
>> +std::unique_ptr<ELFLinkingContext>
>> +elf::PPCLinkingContext::create(llvm::Triple triple) {
>> + if (triple.getArch() == llvm::Triple::ppc)
>> + return std::unique_ptr<ELFLinkingContext>(
>> + new elf::PPCLinkingContext(triple));
>> + return nullptr;
>> +}
>> +
>> +elf::PPCLinkingContext::PPCLinkingContext(llvm::Triple triple)
>> + : ELFLinkingContext(triple, std::unique_ptr<TargetHandlerBase>(
>> + new PPCTargetHandler(*this))) {}
>> +
>>
>> Modified: lld/trunk/lib/ReaderWriter/ELF/PPC/PPCLinkingContext.h
>> URL:
>> http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/ELF/PPC/PPCLinkingContext.h?rev=226976&r1=226975&r2=226976&view=diff
>>
>> ==============================================================================
>> --- lld/trunk/lib/ReaderWriter/ELF/PPC/PPCLinkingContext.h (original)
>> +++ lld/trunk/lib/ReaderWriter/ELF/PPC/PPCLinkingContext.h Fri Jan 23
>> 19:06:07 2015
>> @@ -10,7 +10,6 @@
>> #ifndef LLD_READER_WRITER_ELF_PPC_PPC_LINKING_CONTEXT_H
>> #define LLD_READER_WRITER_ELF_PPC_PPC_LINKING_CONTEXT_H
>>
>> -#include "PPCTargetHandler.h"
>> #include "lld/ReaderWriter/ELFLinkingContext.h"
>> #include "llvm/Object/ELF.h"
>> #include "llvm/Support/ELF.h"
>> @@ -20,9 +19,8 @@ namespace elf {
>>
>> class PPCLinkingContext final : public ELFLinkingContext {
>> public:
>> - PPCLinkingContext(llvm::Triple triple)
>> - : ELFLinkingContext(triple, std::unique_ptr<TargetHandlerBase>(
>> - new PPCTargetHandler(*this))) {}
>> + static std::unique_ptr<ELFLinkingContext> create(llvm::Triple);
>> + PPCLinkingContext(llvm::Triple triple);
>>
>> /// \brief PPC has no relative relocations defined
>> bool isRelativeReloc(const Reference &) const override { return false;
>> }
>>
>> Removed: lld/trunk/lib/ReaderWriter/ELF/PPC/PPCTarget.h
>> URL:
>> http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/ELF/PPC/PPCTarget.h?rev=226975&view=auto
>>
>> ==============================================================================
>> --- lld/trunk/lib/ReaderWriter/ELF/PPC/PPCTarget.h (original)
>> +++ lld/trunk/lib/ReaderWriter/ELF/PPC/PPCTarget.h (removed)
>> @@ -1,10 +0,0 @@
>> -//===- lib/ReaderWriter/ELF/PPC/PPCTarget.h
>> -------------------------------===//
>> -//
>> -// The LLVM Linker
>> -//
>> -// This file is distributed under the University of Illinois Open Source
>> -// License. See LICENSE.TXT for details.
>> -//
>>
>> -//===----------------------------------------------------------------------===//
>> -
>> -#include "PPCLinkingContext.h"
>>
>> Removed: lld/trunk/lib/ReaderWriter/ELF/Targets.h
>> URL:
>> http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/ELF/Targets.h?rev=226975&view=auto
>>
>> ==============================================================================
>> --- lld/trunk/lib/ReaderWriter/ELF/Targets.h (original)
>> +++ lld/trunk/lib/ReaderWriter/ELF/Targets.h (removed)
>> @@ -1,21 +0,0 @@
>> -//===- lib/ReaderWriter/ELF/Targets.h
>> -------------------------------------===//
>> -//
>> -// The LLVM Linker
>> -//
>> -// This file is distributed under the University of Illinois Open Source
>> -// License. See LICENSE.TXT for details.
>> -//
>>
>> -//===----------------------------------------------------------------------===//
>> -
>> -#ifndef LLD_READER_WRITER_ELF_TARGETS_H
>> -#define LLD_READER_WRITER_ELF_TARGETS_H
>> -
>> -#include "AArch64/AArch64Target.h"
>> -#include "ARM/ARMTarget.h"
>> -#include "Hexagon/HexagonTarget.h"
>> -#include "Mips/MipsTarget.h"
>> -#include "PPC/PPCTarget.h"
>> -#include "X86/X86Target.h"
>> -#include "X86_64/X86_64Target.h"
>> -
>> -#endif
>>
>> Modified: lld/trunk/lib/ReaderWriter/ELF/X86/CMakeLists.txt
>> URL:
>> http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/ELF/X86/CMakeLists.txt?rev=226976&r1=226975&r2=226976&view=diff
>>
>> ==============================================================================
>> --- lld/trunk/lib/ReaderWriter/ELF/X86/CMakeLists.txt (original)
>> +++ lld/trunk/lib/ReaderWriter/ELF/X86/CMakeLists.txt Fri Jan 23 19:06:07
>> 2015
>> @@ -4,5 +4,7 @@ add_llvm_library(lldX86ELFTarget
>> X86RelocationHandler.cpp
>> LINK_LIBS
>> lldCore
>> + lldELF
>> + LLVMObject
>> LLVMSupport
>> )
>>
>> Modified: lld/trunk/lib/ReaderWriter/ELF/X86/X86LinkingContext.cpp
>> URL:
>> http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/ELF/X86/X86LinkingContext.cpp?rev=226976&r1=226975&r2=226976&view=diff
>>
>> ==============================================================================
>> --- lld/trunk/lib/ReaderWriter/ELF/X86/X86LinkingContext.cpp (original)
>> +++ lld/trunk/lib/ReaderWriter/ELF/X86/X86LinkingContext.cpp Fri Jan 23
>> 19:06:07 2015
>> @@ -8,9 +8,21 @@
>>
>> //===----------------------------------------------------------------------===//
>>
>> #include "X86LinkingContext.h"
>> +#include "X86TargetHandler.h"
>> #include "lld/Core/LLVM.h"
>> #include "llvm/ADT/StringSwitch.h"
>> #include "llvm/Support/ErrorOr.h"
>>
>> using namespace lld;
>>
>> +std::unique_ptr<ELFLinkingContext>
>> +elf::X86LinkingContext::create(llvm::Triple triple) {
>> + if (triple.getArch() == llvm::Triple::x86)
>> + return std::unique_ptr<ELFLinkingContext>(
>> + new elf::X86LinkingContext(triple));
>> + return nullptr;
>> +}
>> +
>> +elf::X86LinkingContext::X86LinkingContext(llvm::Triple triple)
>> + : ELFLinkingContext(triple, std::unique_ptr<TargetHandlerBase>(
>> + new X86TargetHandler(*this))) {}
>>
>> Modified: lld/trunk/lib/ReaderWriter/ELF/X86/X86LinkingContext.h
>> URL:
>> http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/ELF/X86/X86LinkingContext.h?rev=226976&r1=226975&r2=226976&view=diff
>>
>> ==============================================================================
>> --- lld/trunk/lib/ReaderWriter/ELF/X86/X86LinkingContext.h (original)
>> +++ lld/trunk/lib/ReaderWriter/ELF/X86/X86LinkingContext.h Fri Jan 23
>> 19:06:07 2015
>> @@ -10,7 +10,6 @@
>> #ifndef LLD_READER_WRITER_ELF_X86_TARGETINFO_H
>> #define LLD_READER_WRITER_ELF_X86_TARGETINFO_H
>>
>> -#include "X86TargetHandler.h"
>> #include "lld/ReaderWriter/ELFLinkingContext.h"
>> #include "llvm/Object/ELF.h"
>> #include "llvm/Support/ELF.h"
>> @@ -19,9 +18,8 @@ namespace lld {
>> namespace elf {
>> class X86LinkingContext final : public ELFLinkingContext {
>> public:
>> - X86LinkingContext(llvm::Triple triple)
>> - : ELFLinkingContext(triple, std::unique_ptr<TargetHandlerBase>(
>> - new X86TargetHandler(*this))) {}
>> + static std::unique_ptr<ELFLinkingContext> create(llvm::Triple);
>> + X86LinkingContext(llvm::Triple);
>>
>> /// \brief X86 has only two relative relocation
>> /// a) for supporting IFUNC relocs - R_386_IRELATIVE
>>
>> Removed: lld/trunk/lib/ReaderWriter/ELF/X86/X86Target.h
>> URL:
>> http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/ELF/X86/X86Target.h?rev=226975&view=auto
>>
>> ==============================================================================
>> --- lld/trunk/lib/ReaderWriter/ELF/X86/X86Target.h (original)
>> +++ lld/trunk/lib/ReaderWriter/ELF/X86/X86Target.h (removed)
>> @@ -1,10 +0,0 @@
>> -//===- lib/ReaderWriter/ELF/X86/X86Target.h
>> -------------------------------===//
>> -//
>> -// The LLVM Linker
>> -//
>> -// This file is distributed under the University of Illinois Open Source
>> -// License. See LICENSE.TXT for details.
>> -//
>>
>> -//===----------------------------------------------------------------------===//
>> -
>> -#include "X86LinkingContext.h"
>>
>> Modified: lld/trunk/lib/ReaderWriter/ELF/X86_64/CMakeLists.txt
>> URL:
>> http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/ELF/X86_64/CMakeLists.txt?rev=226976&r1=226975&r2=226976&view=diff
>>
>> ==============================================================================
>> --- lld/trunk/lib/ReaderWriter/ELF/X86_64/CMakeLists.txt (original)
>> +++ lld/trunk/lib/ReaderWriter/ELF/X86_64/CMakeLists.txt Fri Jan 23
>> 19:06:07 2015
>> @@ -5,5 +5,7 @@ add_llvm_library(lldX86_64ELFTarget
>> X86_64RelocationPass.cpp
>> LINK_LIBS
>> lldCore
>> + lldELF
>> + LLVMObject
>> LLVMSupport
>> )
>>
>> Modified:
>> lld/trunk/lib/ReaderWriter/ELF/X86_64/X86_64DynamicLibraryWriter.h
>> URL:
>> http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/ELF/X86_64/X86_64DynamicLibraryWriter.h?rev=226976&r1=226975&r2=226976&view=diff
>>
>> ==============================================================================
>> --- lld/trunk/lib/ReaderWriter/ELF/X86_64/X86_64DynamicLibraryWriter.h
>> (original)
>> +++ lld/trunk/lib/ReaderWriter/ELF/X86_64/X86_64DynamicLibraryWriter.h Fri
>> Jan 23 19:06:07 2015
>> @@ -11,6 +11,7 @@
>>
>> #include "DynamicLibraryWriter.h"
>> #include "X86_64LinkingContext.h"
>> +#include "X86_64TargetHandler.h"
>>
>> namespace lld {
>> namespace elf {
>>
>> Modified: lld/trunk/lib/ReaderWriter/ELF/X86_64/X86_64LinkingContext.cpp
>> URL:
>> http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/ELF/X86_64/X86_64LinkingContext.cpp?rev=226976&r1=226975&r2=226976&view=diff
>>
>> ==============================================================================
>> --- lld/trunk/lib/ReaderWriter/ELF/X86_64/X86_64LinkingContext.cpp
>> (original)
>> +++ lld/trunk/lib/ReaderWriter/ELF/X86_64/X86_64LinkingContext.cpp Fri Jan
>> 23 19:06:07 2015
>> @@ -8,10 +8,23 @@
>>
>> //===----------------------------------------------------------------------===//
>>
>> #include "X86_64LinkingContext.h"
>> +#include "X86_64TargetHandler.h"
>> #include "X86_64RelocationPass.h"
>>
>> using namespace lld;
>>
>> +std::unique_ptr<ELFLinkingContext>
>> +elf::X86_64LinkingContext::create(llvm::Triple triple) {
>> + if (triple.getArch() == llvm::Triple::x86_64)
>> + return std::unique_ptr<ELFLinkingContext>(
>> + new elf::X86_64LinkingContext(triple));
>> + return nullptr;
>> +}
>> +
>> +elf::X86_64LinkingContext::X86_64LinkingContext(llvm::Triple triple)
>> + : ELFLinkingContext(triple, std::unique_ptr<TargetHandlerBase>(
>> + new X86_64TargetHandler(*this))) {}
>> +
>> void elf::X86_64LinkingContext::addPasses(PassManager &pm) {
>> auto pass = createX86_64RelocationPass(*this);
>> if (pass)
>>
>> Modified: lld/trunk/lib/ReaderWriter/ELF/X86_64/X86_64LinkingContext.h
>> URL:
>> http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/ELF/X86_64/X86_64LinkingContext.h?rev=226976&r1=226975&r2=226976&view=diff
>>
>> ==============================================================================
>> --- lld/trunk/lib/ReaderWriter/ELF/X86_64/X86_64LinkingContext.h
>> (original)
>> +++ lld/trunk/lib/ReaderWriter/ELF/X86_64/X86_64LinkingContext.h Fri Jan
>> 23 19:06:07 2015
>> @@ -10,7 +10,6 @@
>> #ifndef LLD_READER_WRITER_ELF_X86_64_X86_64_LINKING_CONTEXT_H
>> #define LLD_READER_WRITER_ELF_X86_64_X86_64_LINKING_CONTEXT_H
>>
>> -#include "X86_64TargetHandler.h"
>> #include "lld/ReaderWriter/ELFLinkingContext.h"
>> #include "llvm/Object/ELF.h"
>> #include "llvm/Support/ELF.h"
>> @@ -27,9 +26,8 @@ enum {
>>
>> class X86_64LinkingContext final : public ELFLinkingContext {
>> public:
>> - X86_64LinkingContext(llvm::Triple triple)
>> - : ELFLinkingContext(triple, std::unique_ptr<TargetHandlerBase>(
>> - new X86_64TargetHandler(*this))) {}
>> + static std::unique_ptr<ELFLinkingContext> create(llvm::Triple);
>> + X86_64LinkingContext(llvm::Triple);
>>
>> void addPasses(PassManager &) override;
>>
>>
>> Removed: lld/trunk/lib/ReaderWriter/ELF/X86_64/X86_64Target.h
>> URL:
>> http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/ELF/X86_64/X86_64Target.h?rev=226975&view=auto
>>
>> ==============================================================================
>> --- lld/trunk/lib/ReaderWriter/ELF/X86_64/X86_64Target.h (original)
>> +++ lld/trunk/lib/ReaderWriter/ELF/X86_64/X86_64Target.h (removed)
>> @@ -1,10 +0,0 @@
>> -//===- lib/ReaderWriter/ELF/X86_64/X86_64Target.h
>> -------------------------===//
>> -//
>> -// The LLVM Linker
>> -//
>> -// This file is distributed under the University of Illinois Open Source
>> -// License. See LICENSE.TXT for details.
>> -//
>>
>> -//===----------------------------------------------------------------------===//
>> -
>> -#include "X86_64LinkingContext.h"
>>
>> Modified: lld/trunk/lib/ReaderWriter/MachO/CMakeLists.txt
>> URL:
>> http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/MachO/CMakeLists.txt?rev=226976&r1=226975&r2=226976&view=diff
>>
>> ==============================================================================
>> --- lld/trunk/lib/ReaderWriter/MachO/CMakeLists.txt (original)
>> +++ lld/trunk/lib/ReaderWriter/MachO/CMakeLists.txt Fri Jan 23 19:06:07
>> 2015
>> @@ -16,8 +16,10 @@ add_llvm_library(lldMachO
>> StubsPass.cpp
>> WriterMachO.cpp
>> LINK_LIBS
>> - lldReaderWriter
>> + lldCore
>> lldPasses
>> + lldYAML
>> + LLVMObject
>> LLVMSupport
>> )
>>
>>
>> Modified: lld/trunk/lib/ReaderWriter/MachO/Makefile
>> URL:
>> http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/MachO/Makefile?rev=226976&r1=226975&r2=226976&view=diff
>>
>> ==============================================================================
>> --- lld/trunk/lib/ReaderWriter/MachO/Makefile (original)
>> +++ lld/trunk/lib/ReaderWriter/MachO/Makefile Fri Jan 23 19:06:07 2015
>> @@ -9,6 +9,6 @@
>>
>> LLD_LEVEL := ../../..
>> LIBRARYNAME := lldMachO
>> -USEDLIBS = lldReaderWriter.a lldCore.a
>> +USEDLIBS = lldCore.a
>>
>> include $(LLD_LEVEL)/Makefile
>>
>> Modified: lld/trunk/lib/ReaderWriter/PECOFF/CMakeLists.txt
>> URL:
>> http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/PECOFF/CMakeLists.txt?rev=226976&r1=226975&r2=226976&view=diff
>>
>> ==============================================================================
>> --- lld/trunk/lib/ReaderWriter/PECOFF/CMakeLists.txt (original)
>> +++ lld/trunk/lib/ReaderWriter/PECOFF/CMakeLists.txt Fri Jan 23 19:06:07
>> 2015
>> @@ -10,7 +10,8 @@ add_llvm_library(lldPECOFF
>> WriterImportLibrary.cpp
>> WriterPECOFF.cpp
>> LINK_LIBS
>> - lldReaderWriter
>> + lldCore
>> + lldPasses
>> LLVMObject
>> LLVMSupport
>> )
>>
>> Modified: lld/trunk/lib/ReaderWriter/PECOFF/Makefile
>> URL:
>> http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/PECOFF/Makefile?rev=226976&r1=226975&r2=226976&view=diff
>>
>> ==============================================================================
>> --- lld/trunk/lib/ReaderWriter/PECOFF/Makefile (original)
>> +++ lld/trunk/lib/ReaderWriter/PECOFF/Makefile Fri Jan 23 19:06:07 2015
>> @@ -9,6 +9,6 @@
>>
>> LLD_LEVEL := ../../..
>> LIBRARYNAME := lldPECOFF
>> -USEDLIBS = lldReaderWriter.a lldCore.a
>> +USEDLIBS = lldCore.a
>>
>> include $(LLD_LEVEL)/Makefile
>>
>>
>> _______________________________________________
>> llvm-commits mailing list
>> llvm-commits at cs.uiuc.edu
>> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
>
>
More information about the llvm-commits
mailing list