From 36d65c57b0f8c614d8fd8e6b8f8c3196ffc672b4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= Date: Thu, 14 Mar 2019 19:21:29 +0100 Subject: [PATCH] lld-netbsd: rebase to svn r356117 --- lld-netbsd/Makefile | 2 +- lld-netbsd/distinfo | 14 +++---- lld-netbsd/patches/patch-ELF_Config.h | 6 +-- lld-netbsd/patches/patch-ELF_Driver.cpp | 41 +++++++++----------- lld-netbsd/patches/patch-ELF_Driver.h | 2 +- lld-netbsd/patches/patch-ELF_Options.td | 2 +- lld-netbsd/patches/patch-ELF_Writer.cpp | 4 +- lld-netbsd/patches/patch-docs_ld.lld.1 | 4 +- lld-netbsd/patches/patch-test_ELF_gnustack.s | 2 +- 9 files changed, 37 insertions(+), 40 deletions(-) diff --git a/lld-netbsd/Makefile b/lld-netbsd/Makefile index 06d8c98282..7e56477bb2 100644 --- a/lld-netbsd/Makefile +++ b/lld-netbsd/Makefile @@ -2,7 +2,7 @@ SVN_REPOSITORIES= lld SVN_REPO.lld= http://llvm.org/svn/llvm-project/lld/trunk -SVN_REVISION.lld= 354151 +SVN_REVISION.lld= 356117 PKGNAME= lld-9.0.0 #DISTNAME= ${PKGNAME}.src diff --git a/lld-netbsd/distinfo b/lld-netbsd/distinfo index cf1cd6510b..7419c97fb1 100644 --- a/lld-netbsd/distinfo +++ b/lld-netbsd/distinfo @@ -9,10 +9,10 @@ RMD160 (llvm-7.0.1.src.tar.xz) = dae96c6f85afb60e73564dc40d02171d01ffdb8f SHA512 (llvm-7.0.1.src.tar.xz) = ac43a3cb71a53deb55e3693653847cf20bf6f5d9056f224e6956c96d63bc59ebee9404f088eec9cabe65337b4607a905ef931354b373cf64e0004c6905a6b5df Size (llvm-7.0.1.src.tar.xz) = 28311056 bytes SHA1 (patch-CMakeLists.txt) = 723f9cbc55f7b94e584ca44f61b4d800be496318 -SHA1 (patch-ELF_Config.h) = 51a7bcd6ce475a23726d06a3133d747e4116b490 -SHA1 (patch-ELF_Driver.cpp) = bb78b6c4137990d41c8586137c2ff792ad1ee684 -SHA1 (patch-ELF_Driver.h) = cf2278adc6ab0b18d95876d554cf88dcd16732b5 -SHA1 (patch-ELF_Options.td) = 04b115a03368cf81a14ed2e136bf1a7d40578135 -SHA1 (patch-ELF_Writer.cpp) = 900537f010b6392f1f9ef3bb0e413950ee06b17d -SHA1 (patch-docs_ld.lld.1) = c4bbd07322c1dec8dae36cd9e1c8b89ea2bb4ea9 -SHA1 (patch-test_ELF_gnustack.s) = 11189af40f1bddd8d04ae3126e6b14fd03879b30 +SHA1 (patch-ELF_Config.h) = 8382fea7ec57733016db13b909bdf7a4f2f1da95 +SHA1 (patch-ELF_Driver.cpp) = 6cabdc19cb6e9982ae3066e9fda928e06ae8bd4d +SHA1 (patch-ELF_Driver.h) = 47c2788fa4091ce4a07e073cb9298e2340c5754f +SHA1 (patch-ELF_Options.td) = 8657c3b6a4e01bd203ddf3918b1528670532ed78 +SHA1 (patch-ELF_Writer.cpp) = d3f0fadcfe9f02cae17b89b006f07c488daa050c +SHA1 (patch-docs_ld.lld.1) = 390f6f77ccb8db26a11fde166d7d06e01d4002b1 +SHA1 (patch-test_ELF_gnustack.s) = b2ea8e7146d6a42d09ca6e0a2f5b434d0cea3d1a diff --git a/lld-netbsd/patches/patch-ELF_Config.h b/lld-netbsd/patches/patch-ELF_Config.h index 007f4c6289..5d1972cef4 100644 --- a/lld-netbsd/patches/patch-ELF_Config.h +++ b/lld-netbsd/patches/patch-ELF_Config.h @@ -1,6 +1,6 @@ $NetBSD$ ---- ELF/Config.h.orig 2019-02-15 21:11:17.982194121 +0000 +--- ELF/Config.h.orig 2019-03-14 17:35:11.000000000 +0000 +++ ELF/Config.h @@ -13,6 +13,7 @@ #include "llvm/ADT/MapVector.h" @@ -10,7 +10,7 @@ $NetBSD$ #include "llvm/BinaryFormat/ELF.h" #include "llvm/Support/CachePruning.h" #include "llvm/Support/CodeGen.h" -@@ -195,6 +196,7 @@ struct Configuration { +@@ -198,6 +199,7 @@ struct Configuration { bool ZNodefaultlib; bool ZNodelete; bool ZNodlopen; @@ -18,7 +18,7 @@ $NetBSD$ bool ZNow; bool ZOrigin; bool ZRelro; -@@ -292,6 +294,10 @@ struct Configuration { +@@ -295,6 +297,10 @@ struct Configuration { // 4 for ELF32, 8 for ELF64. int Wordsize; diff --git a/lld-netbsd/patches/patch-ELF_Driver.cpp b/lld-netbsd/patches/patch-ELF_Driver.cpp index 43caa08472..609c176295 100644 --- a/lld-netbsd/patches/patch-ELF_Driver.cpp +++ b/lld-netbsd/patches/patch-ELF_Driver.cpp @@ -1,6 +1,6 @@ $NetBSD$ ---- ELF/Driver.cpp.orig 2019-02-15 21:11:17.981035137 +0000 +--- ELF/Driver.cpp.orig 2019-03-14 17:35:11.000000000 +0000 +++ ELF/Driver.cpp @@ -53,6 +53,7 @@ #include "llvm/Support/LEB128.h" @@ -20,16 +20,15 @@ $NetBSD$ } } -@@ -350,7 +354,7 @@ static bool isKnownZFlag(StringRef S) { - S == "initfirst" || S == "interpose" || +@@ -351,6 +355,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 == "nodelete" || S == "nodlopen" || S == "noexecstack" || S == "nognustack" || + 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" || -@@ -364,6 +368,56 @@ static void checkZOptions(opt::InputArgL +@@ -364,6 +369,56 @@ static void checkZOptions(opt::InputArgL error("unknown -z value: " + StringRef(Arg->getValue())); } @@ -86,7 +85,7 @@ $NetBSD$ void LinkerDriver::main(ArrayRef ArgsArr) { ELFOptTable Parser; opt::InputArgList Args = Parser.parse(ArgsArr.slice(1)); -@@ -378,6 +432,29 @@ void LinkerDriver::main(ArrayRef> ErrOrWriter = + TarWriter::create(Path, path::stem(Path)); + if (ErrOrWriter) { -+ Tar = ErrOrWriter->get(); ++ Tar = std::move(*ErrOrWriter); + Tar->append("response.txt", createResponseFile(Args)); + Tar->append("version.txt", getLLDVersion() + "\n"); -+ make>(std::move(*ErrOrWriter)); + } else { -+ error(Twine("--reproduce: failed to open ") + Path + ": " + -+ toString(ErrOrWriter.takeError())); ++ error("--reproduce: " + toString(ErrOrWriter.takeError())); + } + } + -+ + initLLVM(); + setTargetTriple(ArgsArr[0], Args); + readConfigs(Args); -+ checkZOptions(Args); + appendDefaultSearchPaths(); + // Handle -v or -version. // // A note about "compatible with GNU linkers" message: this is a hack for -@@ -393,25 +470,11 @@ void LinkerDriver::main(ArrayRefCallGraphProfileSort = Args.hasFlag( OPT_call_graph_profile_sort, OPT_no_call_graph_profile_sort, true); Config->EnableNewDtags = - Args.hasFlag(OPT_enable_new_dtags, OPT_disable_new_dtags, true); -+ Args.hasFlag(OPT_enable_new_dtags, OPT_disable_new_dtags, !Config->TargetTriple.isOSNetBSD()); ++ Args.hasFlag(OPT_enable_new_dtags, OPT_disable_new_dtags, ++ !Config->TargetTriple.isOSNetBSD()); Config->Entry = Args.getLastArgValue(OPT_entry); Config->ExecuteOnly = Args.hasFlag(OPT_execute_only, OPT_no_execute_only, false); -@@ -871,6 +961,7 @@ void LinkerDriver::readConfigs(opt::Inpu - Config->ZCombreloc = getZFlag(Args, "combreloc", "nocombreloc", true); +@@ -875,6 +963,8 @@ void LinkerDriver::readConfigs(opt::Inpu Config->ZCopyreloc = getZFlag(Args, "copyreloc", "nocopyreloc", true); Config->ZExecstack = getZFlag(Args, "execstack", "noexecstack", false); -+ Config->ZNognustack = hasZOption(Args, "nognustack") || Config->TargetTriple.isOSNetBSD(); Config->ZGlobal = hasZOption(Args, "global"); ++ Config->ZNognustack = hasZOption(Args, "nognustack") || ++ Config->TargetTriple.isOSNetBSD(); Config->ZHazardplt = hasZOption(Args, "hazardplt"); Config->ZInitfirst = hasZOption(Args, "initfirst"); -@@ -1175,7 +1266,7 @@ void LinkerDriver::inferMachineType() { + Config->ZInterpose = hasZOption(Args, "interpose"); +@@ -1178,7 +1268,7 @@ void LinkerDriver::inferMachineType() { // each target. static uint64_t getMaxPageSize(opt::InputArgList &Args) { uint64_t Val = args::getZOptionValue(Args, OPT_z, "max-page-size", diff --git a/lld-netbsd/patches/patch-ELF_Driver.h b/lld-netbsd/patches/patch-ELF_Driver.h index 1613949e21..ac46f37117 100644 --- a/lld-netbsd/patches/patch-ELF_Driver.h +++ b/lld-netbsd/patches/patch-ELF_Driver.h @@ -1,6 +1,6 @@ $NetBSD$ ---- ELF/Driver.h.orig 2019-02-01 23:06:35.000000000 +0000 +--- ELF/Driver.h.orig 2019-03-14 17:33:43.000000000 +0000 +++ ELF/Driver.h @@ -30,7 +30,9 @@ public: void addLibrary(StringRef Name); diff --git a/lld-netbsd/patches/patch-ELF_Options.td b/lld-netbsd/patches/patch-ELF_Options.td index 82138b76b9..18888d1a48 100644 --- a/lld-netbsd/patches/patch-ELF_Options.td +++ b/lld-netbsd/patches/patch-ELF_Options.td @@ -1,6 +1,6 @@ $NetBSD$ ---- ELF/Options.td.orig 2019-02-15 21:11:17.386739124 +0000 +--- ELF/Options.td.orig 2019-03-14 17:35:11.000000000 +0000 +++ ELF/Options.td @@ -320,6 +320,8 @@ defm symbol_ordering_file: diff --git a/lld-netbsd/patches/patch-ELF_Writer.cpp b/lld-netbsd/patches/patch-ELF_Writer.cpp index 55c663167b..d735560820 100644 --- a/lld-netbsd/patches/patch-ELF_Writer.cpp +++ b/lld-netbsd/patches/patch-ELF_Writer.cpp @@ -1,8 +1,8 @@ $NetBSD$ ---- ELF/Writer.cpp.orig 2019-02-15 21:11:17.385984659 +0000 +--- ELF/Writer.cpp.orig 2019-03-14 17:35:11.000000000 +0000 +++ ELF/Writer.cpp -@@ -2026,14 +2026,16 @@ template std::vector std::vectorgetPhdrFlags())->add(Cmd); diff --git a/lld-netbsd/patches/patch-docs_ld.lld.1 b/lld-netbsd/patches/patch-docs_ld.lld.1 index 5d73102f74..0d0c7c5a44 100644 --- a/lld-netbsd/patches/patch-docs_ld.lld.1 +++ b/lld-netbsd/patches/patch-docs_ld.lld.1 @@ -1,8 +1,8 @@ $NetBSD$ ---- docs/ld.lld.1.orig 2019-02-15 21:11:16.950831955 +0000 +--- docs/ld.lld.1.orig 2019-03-14 17:35:10.000000000 +0000 +++ docs/ld.lld.1 -@@ -518,6 +518,10 @@ Set the +@@ -578,6 +578,10 @@ Set the .Dv DF_1_NOOPEN flag to indicate that the object may not be opened by .Xr dlopen 3 . diff --git a/lld-netbsd/patches/patch-test_ELF_gnustack.s b/lld-netbsd/patches/patch-test_ELF_gnustack.s index 2148d9a5ca..0f23227043 100644 --- a/lld-netbsd/patches/patch-test_ELF_gnustack.s +++ b/lld-netbsd/patches/patch-test_ELF_gnustack.s @@ -1,6 +1,6 @@ $NetBSD$ ---- test/ELF/gnustack.s.orig 2019-02-01 23:06:36.000000000 +0000 +--- test/ELF/gnustack.s.orig 2019-03-14 17:33:28.000000000 +0000 +++ test/ELF/gnustack.s @@ -10,6 +10,9 @@ # RUN: ld.lld %t1 -o %t -z noexecstack