[PATCH] [lld] Fix the ELF shared library build targets

Greg Fitzgerald garious at gmail.com
Fri Jan 23 14:57:31 PST 2015


This version constructs the LinkingContext with static methods and a class factory.  The previous version would blow up if a LinkingContext contained member variables.

Also, moved the triple test into their respective targets so that class factory registration could be generated from the configured targets.  The registration is currently done by hand because:

- PPCLinkingContext needs to be renamed to PowerPCLinkingContext
- X86LinkingContext should construct other X86 or X86_64 context objects
- Need to add 'create' methods for all the unimplemented architectures

These changes are all easy to make, but to keep this patch readable, is not done here.

Note: the "if elseif elseif" code I added to the driver is ugly, but after the above changes, will be deleted.  There's lots of ways to implement that bit of code and I'm hoping we can discuss none of them at this time.  :)


REPOSITORY
  rL LLVM

http://reviews.llvm.org/D7119

Files:
  include/lld/ReaderWriter/ELFLinkingContext.h
  include/lld/ReaderWriter/ELFTargets.h
  lib/Driver/CMakeLists.txt
  lib/Driver/GnuLdDriver.cpp
  lib/ReaderWriter/ELF/AArch64/AArch64DynamicLibraryWriter.h
  lib/ReaderWriter/ELF/AArch64/AArch64LinkingContext.cpp
  lib/ReaderWriter/ELF/AArch64/AArch64LinkingContext.h
  lib/ReaderWriter/ELF/AArch64/AArch64Target.h
  lib/ReaderWriter/ELF/AArch64/CMakeLists.txt
  lib/ReaderWriter/ELF/ARM/ARMExecutableWriter.h
  lib/ReaderWriter/ELF/ARM/ARMLinkingContext.cpp
  lib/ReaderWriter/ELF/ARM/ARMLinkingContext.h
  lib/ReaderWriter/ELF/ARM/ARMTarget.h
  lib/ReaderWriter/ELF/ARM/CMakeLists.txt
  lib/ReaderWriter/ELF/CMakeLists.txt
  lib/ReaderWriter/ELF/ELFLinkingContext.cpp
  lib/ReaderWriter/ELF/Hexagon/CMakeLists.txt
  lib/ReaderWriter/ELF/Hexagon/HexagonLinkingContext.cpp
  lib/ReaderWriter/ELF/Hexagon/HexagonLinkingContext.h
  lib/ReaderWriter/ELF/Hexagon/HexagonTarget.h
  lib/ReaderWriter/ELF/Makefile
  lib/ReaderWriter/ELF/Mips/CMakeLists.txt
  lib/ReaderWriter/ELF/Mips/MipsLinkingContext.cpp
  lib/ReaderWriter/ELF/Mips/MipsLinkingContext.h
  lib/ReaderWriter/ELF/Mips/MipsTarget.h
  lib/ReaderWriter/ELF/PPC/CMakeLists.txt
  lib/ReaderWriter/ELF/PPC/PPCLinkingContext.cpp
  lib/ReaderWriter/ELF/PPC/PPCLinkingContext.h
  lib/ReaderWriter/ELF/PPC/PPCTarget.h
  lib/ReaderWriter/ELF/Targets.h
  lib/ReaderWriter/ELF/X86/CMakeLists.txt
  lib/ReaderWriter/ELF/X86/X86LinkingContext.cpp
  lib/ReaderWriter/ELF/X86/X86LinkingContext.h
  lib/ReaderWriter/ELF/X86/X86Target.h
  lib/ReaderWriter/ELF/X86_64/CMakeLists.txt
  lib/ReaderWriter/ELF/X86_64/X86_64DynamicLibraryWriter.h
  lib/ReaderWriter/ELF/X86_64/X86_64LinkingContext.cpp
  lib/ReaderWriter/ELF/X86_64/X86_64LinkingContext.h
  lib/ReaderWriter/ELF/X86_64/X86_64Target.h
  lib/ReaderWriter/MachO/CMakeLists.txt
  lib/ReaderWriter/MachO/Makefile
  lib/ReaderWriter/PECOFF/CMakeLists.txt
  lib/ReaderWriter/PECOFF/Makefile

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D7119.18693.patch
Type: text/x-patch
Size: 29509 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150123/64b6bace/attachment.bin>


More information about the llvm-commits mailing list