lld-netbsd: rebase to svn r356117
This commit is contained in:
parent
b0d8a90501
commit
36d65c57b0
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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<const char *> ArgsArr) {
|
||||
ELFOptTable Parser;
|
||||
opt::InputArgList Args = Parser.parse(ArgsArr.slice(1));
|
||||
@@ -378,6 +432,29 @@ void LinkerDriver::main(ArrayRef<const c
|
||||
@@ -378,6 +433,25 @@ void LinkerDriver::main(ArrayRef<const c
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -96,27 +95,23 @@ $NetBSD$
|
|||
+ Expected<std::unique_ptr<TarWriter>> 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::unique_ptr<TarWriter>>(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(ArrayRef<const c
|
||||
@@ -393,25 +467,11 @@ void LinkerDriver::main(ArrayRef<const c
|
||||
// lot of "configure" scripts out there that are generated by old version
|
||||
// of Libtool. We cannot convince every software developer to migrate to
|
||||
// the latest version and re-generate scripts. So we have this hack.
|
||||
|
@ -144,7 +139,7 @@ $NetBSD$
|
|||
// The behavior of -v or --version is a bit strange, but this is
|
||||
// needed for compatibility with GNU linkers.
|
||||
if (Args.hasArg(OPT_v) && !Args.hasArg(OPT_INPUT))
|
||||
@@ -419,7 +482,6 @@ void LinkerDriver::main(ArrayRef<const c
|
||||
@@ -419,7 +479,6 @@ void LinkerDriver::main(ArrayRef<const c
|
||||
if (Args.hasArg(OPT_version))
|
||||
return;
|
||||
|
||||
|
@ -152,7 +147,7 @@ $NetBSD$
|
|||
createFiles(Args);
|
||||
if (errorCount())
|
||||
return;
|
||||
@@ -745,6 +807,34 @@ static void parseClangOption(StringRef O
|
||||
@@ -745,6 +804,34 @@ static void parseClangOption(StringRef O
|
||||
error(Msg + ": " + StringRef(Err).trim());
|
||||
}
|
||||
|
||||
|
@ -187,24 +182,26 @@ $NetBSD$
|
|||
// Initializes Config members by the command line options.
|
||||
void LinkerDriver::readConfigs(opt::InputArgList &Args) {
|
||||
errorHandler().Verbose = Args.hasArg(OPT_verbose);
|
||||
@@ -781,7 +871,7 @@ void LinkerDriver::readConfigs(opt::Inpu
|
||||
@@ -781,7 +868,8 @@ void LinkerDriver::readConfigs(opt::Inpu
|
||||
Config->CallGraphProfileSort = 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",
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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:
|
||||
|
||||
|
|
|
@ -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 <class ELFT> std::vector<PhdrEn
|
||||
@@ -2019,14 +2019,16 @@ template <class ELFT> std::vector<PhdrEn
|
||||
if (OutputSection *Cmd = findSection(".openbsd.randomdata"))
|
||||
AddHdr(PT_OPENBSD_RANDOMIZE, Cmd->getPhdrFlags())->add(Cmd);
|
||||
|
||||
|
|
|
@ -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 .
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue