components/llvm/patches/029-solaris-LLVM-libTarget-X86.patch
author Stefan Teleman <stefan.teleman@oracle.com>
Thu, 28 Jul 2016 16:25:34 -0700
changeset 6512 92717ce71105
permissions -rw-r--r--
24326140 upgrade LLVM to 3.8.1 24326159 upgrade clang to 3.8.1 22902339 memory corruption caused by undefined behavior in LLVM IR Module 22777179 implement [ -mtune= -march= -mcpu= ] in clang SPARC 22778085 LLVM is using %icc when it should be using %xcc 22778089 the SPARCV9 IS implementation is incomplete 22778098 LLVM should emit proc identifiers in SPARC assembler (capabilities) 22778650 clang should support OpenMP because it can 22859423 llvm CodeGen on Intel emits a bogus .ctors section 22902355 clang CodeGen is affected by 22902339 23701635 clang produces amd64 opcodes, but calls 32-bit assembler by default 23593143 lli JIT bitcode parsing creates a main function with wrong argc/argv 21759660 clang packages should include the scan-view and scan-build utilities 23854357 clang should check for GNU ld 17867434 clang crashed in LEXER 24306550 clang crashes in llvm::Twine::toStringRef 24311726 clang's Perl and Python utilities should not use #!/usr/bin/env 24312028 llvm::Twine needs copy constructors and assignment operators 24312221 classes must be CopyConstructible, CopyAssignable, MoveConstructible ... 24314621 LLVM should build using the new CMake based build system 24314638 LLVM CommandLine subsystem is busted 24314687 static initialization of optimization passes doesn't work as intended 21870069 clang makes incorrect assumptions about anonymous namespace instantiation order 22643565 llvm's Google test harness needs some attention 24314745 clang should support PIE executables in Solaris

# 22805043 implement the LLVM Intel Solaris native assembler
# 3.9.X for upstream.
--- lib/Target/X86/X86TargetMachine.cpp	2015-12-04 05:53:15.000000000 -0500
+++ lib/Target/X86/X86TargetMachine.cpp	2016-05-08 23:19:20.538430899 -0400
@@ -50,6 +50,8 @@
 
   if (TT.isOSLinux() || TT.isOSNaCl())
     return make_unique<X86LinuxNaClTargetObjectFile>();
+  if (TT.isOSSolaris())
+    return make_unique<X86SolarisTargetObjectFile>();
   if (TT.isOSBinFormatELF())
     return make_unique<X86ELFTargetObjectFile>();
   if (TT.isKnownWindowsMSVCEnvironment() || TT.isWindowsCoreCLREnvironment())
--- lib/Target/X86/X86TargetObjectFile.cpp	2015-09-03 12:41:50.000000000 -0400
+++ lib/Target/X86/X86TargetObjectFile.cpp	2016-05-08 23:19:20.538430899 -0400
@@ -67,6 +67,19 @@
 }
 
 void
+X86SolarisTargetObjectFile::Initialize(MCContext &Ctx,
+                                       const TargetMachine &TM) {
+  TargetLoweringObjectFileELF::Initialize(Ctx, TM);
+  InitializeELF(true);
+}
+
+const MCExpr *
+X86SolarisTargetObjectFile::getDebugThreadLocalSymbol(
+  const MCSymbol *Sym) const {
+  return MCSymbolRefExpr::create(Sym, MCSymbolRefExpr::VK_DTPOFF,
+                                 getContext());
+}
+void
 X86LinuxNaClTargetObjectFile::Initialize(MCContext &Ctx,
                                          const TargetMachine &TM) {
   TargetLoweringObjectFileELF::Initialize(Ctx, TM);
--- lib/Target/X86/X86TargetObjectFile.h	2015-07-16 02:04:17.000000000 -0400
+++ lib/Target/X86/X86TargetObjectFile.h	2016-05-08 23:19:20.538430899 -0400
@@ -50,6 +50,15 @@
     void Initialize(MCContext &Ctx, const TargetMachine &TM) override;
   };
 
+  /// X86SolarisTargetObjectFile - This implementation is used for Solaris
+  /// x86 and x86-64.
+  class X86SolarisTargetObjectFile : public TargetLoweringObjectFileELF {
+    void Initialize(MCContext &Ctx, const TargetMachine &TM) override;
+
+    /// \brief Describe a TLS variable address within debug info.
+    const MCExpr *getDebugThreadLocalSymbol(const MCSymbol *Sym) const override;
+  };
+
   /// \brief This implementation is used for Windows targets on x86 and x86-64.
   class X86WindowsTargetObjectFile : public TargetLoweringObjectFileCOFF {
     const MCExpr *