Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/devel/lld lld: updated to 10.0.0



details:   https://anonhg.NetBSD.org/pkgsrc/rev/180ad83b9e3a
branches:  trunk
changeset: 429264:180ad83b9e3a
user:      adam <adam%pkgsrc.org@localhost>
date:      Sat Apr 18 08:00:49 2020 +0000

description:
lld: updated to 10.0.0

Non-comprehensive list of changes in this release

ELF Improvements
Glob pattern, which you can use in linker scripts or version scripts, now supports ` and `[!…]. Except character classes
New elf32btsmipn32_fbsd and elf32ltsmipn32_fbsd emulations are supported.
Relax MIPS jalr and jr instructions marked by the R_MIPS_JALR relocation.
For certain “undefined symbol” errors, a definition with a close spelling will be suggested.
extern "C" is suggested if an undefined reference is mangled(unmangled) while there is a likely unmangled(mangled) definition.
New -z noseparate-code, -z separate-code and -z separate-loadable-segments. -z noseparate-code is the default, which can reduce sizes of linked binaries by up to 3 times maxpagesize.
-z force-bti and -z pac-plt are added for AArch64 Branch Target Identification and Pointer Authentication.
--fix-cortex-a8 is added to fix erratum 657417.
-z force-ibt and -z shstk are added for Intel Control-flow Enforcement Technology.
PT_GNU_PROPERTY is added to help loaders locate the .note.gnu.property section. It may be used by a future Linux kernel.
For --compress-debug-sections=zlib, -O0 and -O1 enable compression level 1 while -O2 enables compression level 6. -O1
Range extension thunks with addends are implemented for AArch64, PowerPC32 and PowerPC64.
R_RISCV_ALIGN will be errored because linker relaxation for RISC-V is not supported. Pass -mno-relax to disable R_RISCV_ALIGN.
The ARM port will no longer insert interworking thunks for non STT_FUNC symbols.
The quality of PowerPC32 port has been greatly improved
The PowerPC64 port supports non-preemptible IFUNC.
lld creates a RO PT_LOAD and a RX PT_LOAD without a linker script. lld creates a unified RX PT_LOAD with a linker script. A future release will eliminate this difference and use a RO PT_LOAD and a RX 
PT_LOAD by default. The linker script case will require --no-rosegment to restore the current behavior.
GNU style compressed debug sections .zdebug

Breaking changes
-Ttext=$base
-Ttext-segment is no longer supported. Its meaning was different from GNU ld’s and could cause subtle bugs.

MinGW Improvements
Allow using custom .edata sections from input object files
Don’t implicitly create import libraries unless requested
Support merging multiple resource object files
Demangle itanium symbol names in warnings/error messages
Print source locations for undefined references and duplicate symbols, if possible
Look for more filename patterns when resolving -l options
Don’t error out on duplicate absolute symbols with the same value

WebAssembly Improvements
__data_end and __heap_base are no longer exported by default, as it’s best to keep them internal when possible. They can be explicitly exported with –export=__data_end and –export=__heap_base, 
respectively.
wasm-ld now elides .bss sections when the memory is not imported

diffstat:

 devel/lld/Makefile                          |   4 +-
 devel/lld/PLIST                             |   3 +-
 devel/lld/distinfo                          |  19 ++++------
 devel/lld/patches/patch-ELF_Config.h        |  29 ++-------------
 devel/lld/patches/patch-ELF_Driver.cpp      |  52 +++-------------------------
 devel/lld/patches/patch-ELF_Writer.cpp      |  32 -----------------
 devel/lld/patches/patch-docs_ld.lld.1       |  19 ----------
 devel/lld/patches/patch-test_ELF_gnustack.s |  25 -------------
 devel/lld/patches/patch-tools_lld_lld.cpp   |  30 ++++++++--------
 9 files changed, 37 insertions(+), 176 deletions(-)

diffs (truncated from 362 to 300 lines):

diff -r f53a48130ba4 -r 180ad83b9e3a devel/lld/Makefile
--- a/devel/lld/Makefile        Sat Apr 18 08:00:10 2020 +0000
+++ b/devel/lld/Makefile        Sat Apr 18 08:00:49 2020 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.14 2020/01/26 17:31:00 rillig Exp $
+# $NetBSD: Makefile,v 1.15 2020/04/18 08:00:49 adam Exp $
 
 .include "../../lang/llvm/version.mk"
 
@@ -11,7 +11,7 @@
 COMMENT=       The LLVM Linker
 LICENSE=       apache-2.0
 
-USE_LANGUAGES=         c c++11
+USE_LANGUAGES=         c c++14
 USE_CMAKE=             yes
 GCC_REQD+=             4.8
 
diff -r f53a48130ba4 -r 180ad83b9e3a devel/lld/PLIST
--- a/devel/lld/PLIST   Sat Apr 18 08:00:10 2020 +0000
+++ b/devel/lld/PLIST   Sat Apr 18 08:00:49 2020 +0000
@@ -1,4 +1,4 @@
-@comment $NetBSD: PLIST,v 1.3 2019/11/03 12:10:29 kamil Exp $
+@comment $NetBSD: PLIST,v 1.4 2020/04/18 08:00:49 adam Exp $
 bin/ld.lld
 bin/ld64.lld
 bin/lld
@@ -6,6 +6,7 @@
 bin/nb.lld
 bin/wasm-ld
 include/lld/Common/Args.h
+include/lld/Common/DWARF.h
 include/lld/Common/Driver.h
 include/lld/Common/ErrorHandler.h
 include/lld/Common/Filesystem.h
diff -r f53a48130ba4 -r 180ad83b9e3a devel/lld/distinfo
--- a/devel/lld/distinfo        Sat Apr 18 08:00:10 2020 +0000
+++ b/devel/lld/distinfo        Sat Apr 18 08:00:49 2020 +0000
@@ -1,17 +1,14 @@
-$NetBSD: distinfo,v 1.9 2019/12/29 15:31:21 adam Exp $
+$NetBSD: distinfo,v 1.10 2020/04/18 08:00:49 adam Exp $
 
-SHA1 (lld-9.0.1.src.tar.xz) = ef5f529adfb9b57b33c394641d7d5e2d1f1b5ff6
-RMD160 (lld-9.0.1.src.tar.xz) = 541e85668c222755cb94f8f037b085d7ae9cb3e4
-SHA512 (lld-9.0.1.src.tar.xz) = ca57d1a5fc2e39c002e061dc8278a721df8493d4c05c2275fe32b626258362563b82113b51bbaa454815d8ac0440078803f866444a8788aaca4816d7463ed430
-Size (lld-9.0.1.src.tar.xz) = 1088260 bytes
+SHA1 (lld-10.0.0.src.tar.xz) = ed8dc4f73847e084b65f4ad5d2f6670f6f38a8eb
+RMD160 (lld-10.0.0.src.tar.xz) = d0cf312b30a8d726555a4aeb1a1ea822a600ca02
+SHA512 (lld-10.0.0.src.tar.xz) = 3457b4a4be2cc9f1e6f1a74dff74e142e7590f1aafffa9623f46af0e2e8822aea264a6cf79287849ae4944505ddbbfb99efa380ac860d5a7eb791984ac4ca59f
+Size (lld-10.0.0.src.tar.xz) = 1143340 bytes
 SHA1 (patch-CMakeLists.txt) = 87d32f66488541ba68e219f5fa83646b48bf9c71
-SHA1 (patch-ELF_Config.h) = f5663189adf47a13d2fa0a152ea5df04a3ed247d
-SHA1 (patch-ELF_Driver.cpp) = 4b08b50e75eb90a8703a331efaf4a950098d5a4d
+SHA1 (patch-ELF_Config.h) = 3f2a310bc2c8f625493b0b73702feaac22769c9c
+SHA1 (patch-ELF_Driver.cpp) = d1bd9821f2d952dfa86d4f0cf3afc4e7fb477001
 SHA1 (patch-ELF_Options.td) = 22a1f293681b86a9aac87624efcfeeb20a4ba51c
-SHA1 (patch-ELF_Writer.cpp) = b5b995b2566999579a35146a271d099908eb44c3
-SHA1 (patch-docs_ld.lld.1) = 8492f459425a6774d4b3e21c6f0f5d40d7044a1b
-SHA1 (patch-test_ELF_gnustack.s) = d2619221f09d6b40daa9c2206c993cd8342982a5
-SHA1 (patch-tools_lld_lld.cpp) = bc3662191bf6e50c808d188707c9abfdb4786dbf
+SHA1 (patch-tools_lld_lld.cpp) = c8b0c166cb15b045fc1651985004fc9694264d0f
 SHA1 (patch-tools_nb.lld_CMakeLists.txt) = 231ed112512d23001a8e9d1d1821838a483c2e37
 SHA1 (patch-tools_nb.lld_Options.td) = d56ff977f24d97eda30f10aae5818c618b3c7915
 SHA1 (patch-tools_nb.lld_nb.lld.cpp) = 2425426beb2f4d80f96781977e3a4019eed601fc
diff -r f53a48130ba4 -r 180ad83b9e3a devel/lld/patches/patch-ELF_Config.h
--- a/devel/lld/patches/patch-ELF_Config.h      Sat Apr 18 08:00:10 2020 +0000
+++ b/devel/lld/patches/patch-ELF_Config.h      Sat Apr 18 08:00:49 2020 +0000
@@ -1,35 +1,14 @@
-$NetBSD: patch-ELF_Config.h,v 1.6 2019/11/03 12:40:40 kamil Exp $
-
-Cherry-pick upstream patch commit 2a0fcae3d4d1fd85d6ae8378d7c6f12430c0087d
-[lld] [ELF] Add '-z nognustack' opt to suppress emitting PT_GNU_STACK
+$NetBSD: patch-ELF_Config.h,v 1.7 2020/04/18 08:00:50 adam Exp $
 
 Add dummy option for an AArch64 erratum.
 
---- ELF/Config.h.orig  2019-07-16 05:50:45.000000000 +0000
+--- ELF/Config.h.orig  2020-03-23 15:01:02.000000000 +0000
 +++ ELF/Config.h
-@@ -61,6 +61,9 @@ enum class Target2Policy { Abs, Rel, Got
- // For tracking ARM Float Argument PCS
- enum class ARMVFPArgKind { Default, Base, VFP, ToolChain };
- 
-+// For -z *stack
-+enum class GnuStackKind { None, Exec, NoExec };
-+
- struct SymbolVersion {
-   llvm::StringRef name;
-   bool isExternCpp;
-@@ -146,6 +149,7 @@ struct Configuration {
+@@ -150,6 +150,7 @@ struct Configuration {
    bool enableNewDtags;
    bool executeOnly;
    bool exportDynamic;
 +  bool fixCortexA53Errata835769;
    bool fixCortexA53Errata843419;
+   bool fixCortexA8;
    bool forceBTI;
-   bool formatBinary = false;
-@@ -214,6 +218,7 @@ struct Configuration {
-   bool zRetpolineplt;
-   bool zWxneeded;
-   DiscardPolicy discard;
-+  GnuStackKind zGnustack;
-   ICFLevel icf;
-   OrphanHandlingPolicy orphanHandling;
-   SortSectionPolicy sortSection;
diff -r f53a48130ba4 -r 180ad83b9e3a devel/lld/patches/patch-ELF_Driver.cpp
--- a/devel/lld/patches/patch-ELF_Driver.cpp    Sat Apr 18 08:00:10 2020 +0000
+++ b/devel/lld/patches/patch-ELF_Driver.cpp    Sat Apr 18 08:00:49 2020 +0000
@@ -1,13 +1,10 @@
-$NetBSD: patch-ELF_Driver.cpp,v 1.7 2019/11/03 12:40:40 kamil Exp $
-
-Cherry-pick upstream patch commit 2a0fcae3d4d1fd85d6ae8378d7c6f12430c0087d
-[lld] [ELF] Add '-z nognustack' opt to suppress emitting PT_GNU_STACK
+$NetBSD: patch-ELF_Driver.cpp,v 1.8 2020/04/18 08:00:50 adam Exp $
 
 Add dummy option for an AArch64 erratum.
 
---- ELF/Driver.cpp.orig        2019-07-17 14:54:02.000000000 +0000
+--- ELF/Driver.cpp.orig        2020-03-23 15:01:02.000000000 +0000
 +++ ELF/Driver.cpp
-@@ -129,7 +129,7 @@ static std::tuple<ELFKind, uint16_t, uin
+@@ -132,7 +132,7 @@ static std::tuple<ELFKind, uint16_t, uin
    std::pair<ELFKind, uint16_t> ret =
        StringSwitch<std::pair<ELFKind, uint16_t>>(s)
            .Cases("aarch64elf", "aarch64linux", "aarch64_elf64_le_vec",
@@ -26,48 +23,11 @@
    if (config->fixCortexA53Errata843419 && config->emachine != EM_AARCH64)
      error("--fix-cortex-a53-843419 is only supported on AArch64 targets");
  
-@@ -373,6 +376,20 @@ static bool getZFlag(opt::InputArgList &
-   return Default;
- }
- 
-+static GnuStackKind getZGnuStack(opt::InputArgList &args) {
-+  for (auto *arg : args.filtered_reverse(OPT_z)) {
-+    if (StringRef("execstack") == arg->getValue())
-+      return GnuStackKind::Exec;
-+    if (StringRef("noexecstack") == arg->getValue())
-+      return GnuStackKind::NoExec;
-+    if (StringRef("nognustack") == arg->getValue())
-+      return GnuStackKind::None;
-+  }
-+
-+  // default
-+  return GnuStackKind::NoExec;
-+}
-+
- static bool isKnownZFlag(StringRef s) {
-   return s == "combreloc" || s == "copyreloc" || s == "defs" ||
-          s == "execstack" || s == "global" || s == "hazardplt" ||
-@@ -380,6 +397,7 @@ static bool isKnownZFlag(StringRef s) {
-          s == "keep-text-section-prefix" || s == "lazy" || s == "muldefs" ||
-          s == "nocombreloc" || s == "nocopyreloc" || s == "nodefaultlib" ||
-          s == "nodelete" || s == "nodlopen" || s == "noexecstack" ||
-+         s == "nognustack" ||
-          s == "nokeep-text-section-prefix" || s == "norelro" || s == "notext" ||
-          s == "now" || s == "origin" || s == "relro" || s == "retpolineplt" ||
-          s == "rodynamic" || s == "text" || s == "wxneeded" ||
-@@ -828,6 +846,7 @@ static void readConfigs(opt::InputArgLis
+@@ -879,6 +882,7 @@ static void readConfigs(opt::InputArgLis
        args.hasFlag(OPT_export_dynamic, OPT_no_export_dynamic, false);
    config->filterList = args::getStrings(args, OPT_filter);
    config->fini = args.getLastArgValue(OPT_fini, "_fini");
 +  config->fixCortexA53Errata835769 = args.hasArg(OPT_fix_cortex_a53_843419);
    config->fixCortexA53Errata843419 = args.hasArg(OPT_fix_cortex_a53_843419);
-   config->forceBTI = args.hasArg(OPT_force_bti);
-   config->requireCET = args.hasArg(OPT_require_cet);
-@@ -921,6 +940,7 @@ static void readConfigs(opt::InputArgLis
-   config->zCopyreloc = getZFlag(args, "copyreloc", "nocopyreloc", true);
-   config->zExecstack = getZFlag(args, "execstack", "noexecstack", false);
-   config->zGlobal = hasZOption(args, "global");
-+  config->zGnustack = getZGnuStack(args);
-   config->zHazardplt = hasZOption(args, "hazardplt");
-   config->zIfuncNoplt = hasZOption(args, "ifunc-noplt");
-   config->zInitfirst = hasZOption(args, "initfirst");
+   config->fixCortexA8 = args.hasArg(OPT_fix_cortex_a8);
+   config->forceBTI = hasZOption(args, "force-bti");
diff -r f53a48130ba4 -r 180ad83b9e3a devel/lld/patches/patch-ELF_Writer.cpp
--- a/devel/lld/patches/patch-ELF_Writer.cpp    Sat Apr 18 08:00:10 2020 +0000
+++ /dev/null   Thu Jan 01 00:00:00 1970 +0000
@@ -1,32 +0,0 @@
-$NetBSD: patch-ELF_Writer.cpp,v 1.5 2019/11/03 12:40:40 kamil Exp $
-
-Cherry-pick upstream patch commit 2a0fcae3d4d1fd85d6ae8378d7c6f12430c0087d
-[lld] [ELF] Add '-z nognustack' opt to suppress emitting PT_GNU_STACK
-
---- ELF/Writer.cpp.orig        2019-09-06 11:20:15.000000000 +0000
-+++ ELF/Writer.cpp
-@@ -2160,14 +2160,16 @@ std::vector<PhdrEntry *> Writer<ELFT>::c
-   if (OutputSection *cmd = findSection(".openbsd.randomdata", partNo))
-     addHdr(PT_OPENBSD_RANDOMIZE, cmd->getPhdrFlags())->add(cmd);
- 
--  // PT_GNU_STACK is a special section to tell the loader to make the
--  // pages for the stack non-executable. If you really want an executable
--  // stack, you can pass -z execstack, but that's not recommended for
--  // security reasons.
--  unsigned perm = PF_R | PF_W;
--  if (config->zExecstack)
--    perm |= PF_X;
--  addHdr(PT_GNU_STACK, perm)->p_memsz = config->zStackSize;
-+  if (config->zGnustack != GnuStackKind::None) {
-+    // PT_GNU_STACK is a special section to tell the loader to make the
-+    // pages for the stack non-executable. If you really want an executable
-+    // stack, you can pass -z execstack, but that's not recommended for
-+    // security reasons.
-+    unsigned perm = PF_R | PF_W;
-+    if (config->zGnustack == GnuStackKind::Exec)
-+      perm |= PF_X;
-+    addHdr(PT_GNU_STACK, perm)->p_memsz = config->zStackSize;
-+  }
- 
-   // PT_OPENBSD_WXNEEDED is a OpenBSD-specific header to mark the executable
-   // is expected to perform W^X violations, such as calling mprotect(2) or
diff -r f53a48130ba4 -r 180ad83b9e3a devel/lld/patches/patch-docs_ld.lld.1
--- a/devel/lld/patches/patch-docs_ld.lld.1     Sat Apr 18 08:00:10 2020 +0000
+++ /dev/null   Thu Jan 01 00:00:00 1970 +0000
@@ -1,19 +0,0 @@
-$NetBSD: patch-docs_ld.lld.1,v 1.6 2019/11/03 12:40:40 kamil Exp $
-
-Cherry-pick upstream patch commit 2a0fcae3d4d1fd85d6ae8378d7c6f12430c0087d
-[lld] [ELF] Add '-z nognustack' opt to suppress emitting PT_GNU_STACK
-
---- docs/ld.lld.1.orig 2019-11-03 11:37:33.105878671 +0000
-+++ docs/ld.lld.1
-@@ -612,6 +612,11 @@ Set the
- .Dv DF_1_NOOPEN
- flag to indicate that the object may not be opened by
- .Xr dlopen 3 .
-+.It Cm nognustack
-+Do not emit the
-+.Dv PT_GNU_STACK
-+segment.
-+.Pp
- .It Cm norelro
- Do not indicate that portions of the object shold be mapped read-only
- after initial relocation processing.
diff -r f53a48130ba4 -r 180ad83b9e3a devel/lld/patches/patch-test_ELF_gnustack.s
--- a/devel/lld/patches/patch-test_ELF_gnustack.s       Sat Apr 18 08:00:10 2020 +0000
+++ /dev/null   Thu Jan 01 00:00:00 1970 +0000
@@ -1,25 +0,0 @@
-$NetBSD: patch-test_ELF_gnustack.s,v 1.5 2019/11/03 12:40:40 kamil Exp $
-
-Cherry-pick upstream patch commit 2a0fcae3d4d1fd85d6ae8378d7c6f12430c0087d
-[lld] [ELF] Add '-z nognustack' opt to suppress emitting PT_GNU_STACK
-
---- test/ELF/gnustack.s.orig   2019-05-01 05:49:01.000000000 +0000
-+++ test/ELF/gnustack.s
-@@ -10,6 +10,9 @@
- # RUN: ld.lld %t1 -o %t -z noexecstack
- # RUN: llvm-readobj --program-headers -S %t | FileCheck --check-prefix=RW %s
- 
-+# RUN: ld.lld %t1 -o %t -z nognustack
-+# RUN: llvm-readobj --program-headers -s %t | FileCheck --check-prefix=NOGNUSTACK %s
-+
- # RW:      Type: PT_GNU_STACK
- # RW-NEXT: Offset: 0x0
- # RW-NEXT: VirtualAddress: 0x0
-@@ -35,5 +38,7 @@
- # RWX-NEXT: ]
- # RWX-NEXT: Alignment: 0
- 
-+# NOGNUSTACK-NOT: Type: PT_GNU_STACK
-+
- .globl _start
- _start:
diff -r f53a48130ba4 -r 180ad83b9e3a devel/lld/patches/patch-tools_lld_lld.cpp
--- a/devel/lld/patches/patch-tools_lld_lld.cpp Sat Apr 18 08:00:10 2020 +0000
+++ b/devel/lld/patches/patch-tools_lld_lld.cpp Sat Apr 18 08:00:49 2020 +0000
@@ -1,9 +1,9 @@
-$NetBSD: patch-tools_lld_lld.cpp,v 1.1 2019/11/03 12:11:27 kamil Exp $
+$NetBSD: patch-tools_lld_lld.cpp,v 1.2 2020/04/18 08:00:50 adam Exp $
 
 [LLD] Add NetBSD support as a new flavor of LLD (nb.lld)
 https://reviews.llvm.org/D69755
 
---- tools/lld/lld.cpp.orig     2019-07-11 06:12:18.000000000 +0000
+--- tools/lld/lld.cpp.orig     2020-03-23 15:01:02.000000000 +0000
 +++ tools/lld/lld.cpp
 @@ -10,12 +10,13 @@
  // function is a thin wrapper which dispatches to the platform specific
@@ -22,8 +22,8 @@
  //  - ld64:      Mach-O (macOS)
  //  - lld-link:  COFF (Windows)
  //  - ld-wasm:   WebAssembly
-@@ -35,6 +36,9 @@
- #include "llvm/Support/CommandLine.h"
+@@ -36,6 +37,9 @@
+ #include "llvm/Support/Host.h"
  #include "llvm/Support/InitLLVM.h"
  #include "llvm/Support/Path.h"
 +#include "llvm/Support/Program.h"
@@ -32,7 +32,7 @@
  #include <cstdlib>
  
  using namespace lld;
-@@ -44,6 +48,7 @@ using namespace llvm::sys;
+@@ -45,6 +49,7 @@ using namespace llvm::sys;
  enum Flavor {


Home | Main Index | Thread Index | Old Index