pkgsrc-Changes archive

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

CVS commit: pkgsrc/devel/lld



Module Name:    pkgsrc
Committed By:   adam
Date:           Sat Apr 18 08:00:50 UTC 2020

Modified Files:
        pkgsrc/devel/lld: Makefile PLIST distinfo
        pkgsrc/devel/lld/patches: patch-ELF_Config.h patch-ELF_Driver.cpp
            patch-tools_lld_lld.cpp
Removed Files:
        pkgsrc/devel/lld/patches: patch-ELF_Writer.cpp patch-docs_ld.lld.1
            patch-test_ELF_gnustack.s

Log Message:
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


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 pkgsrc/devel/lld/Makefile
cvs rdiff -u -r1.3 -r1.4 pkgsrc/devel/lld/PLIST
cvs rdiff -u -r1.9 -r1.10 pkgsrc/devel/lld/distinfo
cvs rdiff -u -r1.6 -r1.7 pkgsrc/devel/lld/patches/patch-ELF_Config.h
cvs rdiff -u -r1.7 -r1.8 pkgsrc/devel/lld/patches/patch-ELF_Driver.cpp
cvs rdiff -u -r1.5 -r0 pkgsrc/devel/lld/patches/patch-ELF_Writer.cpp \
    pkgsrc/devel/lld/patches/patch-test_ELF_gnustack.s
cvs rdiff -u -r1.6 -r0 pkgsrc/devel/lld/patches/patch-docs_ld.lld.1
cvs rdiff -u -r1.1 -r1.2 pkgsrc/devel/lld/patches/patch-tools_lld_lld.cpp

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: pkgsrc/devel/lld/Makefile
diff -u pkgsrc/devel/lld/Makefile:1.14 pkgsrc/devel/lld/Makefile:1.15
--- pkgsrc/devel/lld/Makefile:1.14      Sun Jan 26 17:31:00 2020
+++ pkgsrc/devel/lld/Makefile   Sat Apr 18 08:00:49 2020
@@ -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 @@ HOMEPAGE=     https://lld.llvm.org/
 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
 

Index: pkgsrc/devel/lld/PLIST
diff -u pkgsrc/devel/lld/PLIST:1.3 pkgsrc/devel/lld/PLIST:1.4
--- pkgsrc/devel/lld/PLIST:1.3  Sun Nov  3 12:10:29 2019
+++ pkgsrc/devel/lld/PLIST      Sat Apr 18 08:00:49 2020
@@ -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/lld-link
 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

Index: pkgsrc/devel/lld/distinfo
diff -u pkgsrc/devel/lld/distinfo:1.9 pkgsrc/devel/lld/distinfo:1.10
--- pkgsrc/devel/lld/distinfo:1.9       Sun Dec 29 15:31:21 2019
+++ pkgsrc/devel/lld/distinfo   Sat Apr 18 08:00:49 2020
@@ -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

Index: pkgsrc/devel/lld/patches/patch-ELF_Config.h
diff -u pkgsrc/devel/lld/patches/patch-ELF_Config.h:1.6 pkgsrc/devel/lld/patches/patch-ELF_Config.h:1.7
--- pkgsrc/devel/lld/patches/patch-ELF_Config.h:1.6     Sun Nov  3 12:40:40 2019
+++ pkgsrc/devel/lld/patches/patch-ELF_Config.h Sat Apr 18 08:00:50 2020
@@ -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;

Index: pkgsrc/devel/lld/patches/patch-ELF_Driver.cpp
diff -u pkgsrc/devel/lld/patches/patch-ELF_Driver.cpp:1.7 pkgsrc/devel/lld/patches/patch-ELF_Driver.cpp:1.8
--- pkgsrc/devel/lld/patches/patch-ELF_Driver.cpp:1.7   Sun Nov  3 12:40:40 2019
+++ pkgsrc/devel/lld/patches/patch-ELF_Driver.cpp       Sat Apr 18 08:00:50 2020
@@ -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 @@ Add dummy option for an AArch64 erratum.
    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");

Index: pkgsrc/devel/lld/patches/patch-tools_lld_lld.cpp
diff -u pkgsrc/devel/lld/patches/patch-tools_lld_lld.cpp:1.1 pkgsrc/devel/lld/patches/patch-tools_lld_lld.cpp:1.2
--- pkgsrc/devel/lld/patches/patch-tools_lld_lld.cpp:1.1        Sun Nov  3 12:11:27 2019
+++ pkgsrc/devel/lld/patches/patch-tools_lld_lld.cpp    Sat Apr 18 08:00:50 2020
@@ -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 @@ https://reviews.llvm.org/D69755
  //  - 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 @@ https://reviews.llvm.org/D69755
  #include <cstdlib>
  
  using namespace lld;
-@@ -44,6 +48,7 @@ using namespace llvm::sys;
+@@ -45,6 +49,7 @@ using namespace llvm::sys;
  enum Flavor {
    Invalid,
    Gnu,     // -flavor gnu
@@ -40,7 +40,7 @@ https://reviews.llvm.org/D69755
    WinLink, // -flavor link
    Darwin,  // -flavor darwin
    Wasm,    // -flavor wasm
-@@ -57,6 +62,7 @@ LLVM_ATTRIBUTE_NORETURN static void die(
+@@ -58,6 +63,7 @@ LLVM_ATTRIBUTE_NORETURN static void die(
  static Flavor getFlavor(StringRef s) {
    return StringSwitch<Flavor>(s)
        .CasesLower("ld", "ld.lld", "gnu", Gnu)
@@ -48,7 +48,7 @@ https://reviews.llvm.org/D69755
        .CasesLower("wasm", "ld-wasm", Wasm)
        .CaseLower("link", WinLink)
        .CasesLower("ld64", "ld64.lld", "darwin", Darwin)
-@@ -99,10 +105,15 @@ static Flavor parseProgname(StringRef pr
+@@ -100,10 +106,15 @@ static Flavor parseProgname(StringRef pr
  #endif
  
  #if LLVM_ON_UNIX
@@ -66,7 +66,7 @@ https://reviews.llvm.org/D69755
  
    // Progname may be something like "lld-gnu". Parse it.
    SmallVector<StringRef, 3> v;
-@@ -132,6 +143,38 @@ static Flavor parseFlavor(std::vector<co
+@@ -133,6 +144,38 @@ static Flavor parseFlavor(std::vector<co
    return parseProgname(arg0);
  }
  
@@ -105,7 +105,7 @@ https://reviews.llvm.org/D69755
  // If this function returns true, lld calls _exit() so that it quickly
  // exits without invoking destructors of globally allocated objects.
  //
-@@ -140,7 +183,7 @@ static Flavor parseFlavor(std::vector<co
+@@ -141,7 +184,7 @@ static Flavor parseFlavor(std::vector<co
  // and we use it to detect whether we are running tests or not.
  static bool canExitEarly() { return StringRef(getenv("LLD_IN_TEST")) != "1"; }
  
@@ -114,17 +114,17 @@ https://reviews.llvm.org/D69755
  /// windows linker based on the argv[0] or -flavor option.
  int main(int argc, const char **argv) {
    InitLLVM x(argc, argv);
-@@ -151,6 +194,8 @@ int main(int argc, const char **argv) {
+@@ -152,6 +195,8 @@ int main(int argc, const char **argv) {
      if (isPETarget(args))
-       return !mingw::link(args);
-     return !elf::link(args, canExitEarly());
+       return !mingw::link(args, canExitEarly(), llvm::outs(), llvm::errs());
+     return !elf::link(args, canExitEarly(), llvm::outs(), llvm::errs());
 +  case NetBSD:
 +    return exec_nb_lld(argc - 1, argv + 1);
    case WinLink:
-     return !coff::link(args, canExitEarly());
+     return !coff::link(args, canExitEarly(), llvm::outs(), llvm::errs());
    case Darwin:
-@@ -159,7 +204,8 @@ int main(int argc, const char **argv) {
-     return !wasm::link(args, canExitEarly());
+@@ -160,7 +205,8 @@ int main(int argc, const char **argv) {
+     return !wasm::link(args, canExitEarly(), llvm::outs(), llvm::errs());
    default:
      die("lld is a generic driver.\n"
 -        "Invoke ld.lld (Unix), ld64.lld (macOS), lld-link (Windows), wasm-ld"



Home | Main Index | Thread Index | Old Index