pkgsrc-WIP-changes archive

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

lld-netbsd: Eliminate



Module Name:	pkgsrc-wip
Committed By:	Kamil Rytarowski <n54%gmx.com@localhost>
Pushed By:	kamil
Date:		Wed Oct 23 22:27:40 2019 +0200
Changeset:	741d3c9fb63efce7647c1e6514384185c0f0c0aa

Removed Files:
	lld-netbsd/DESCR
	lld-netbsd/Makefile
	lld-netbsd/PLIST
	lld-netbsd/buildlink3.mk
	lld-netbsd/distinfo
	lld-netbsd/options.mk
	lld-netbsd/patches/patch-CMakeLists.txt
	lld-netbsd/patches/patch-ELF_Config.h
	lld-netbsd/patches/patch-ELF_Driver.cpp
	lld-netbsd/patches/patch-ELF_Driver.h
	lld-netbsd/patches/patch-ELF_Options.td
	lld-netbsd/patches/patch-ELF_Writer.cpp
	lld-netbsd/patches/patch-docs_ld.lld.1
	lld-netbsd/patches/patch-test_ELF_gnustack.s

Log Message:
lld-netbsd: Eliminate

Local patches will be kept in llvm-project-netbsd.

To see a diff of this commit:
https://wip.pkgsrc.org/cgi-bin/gitweb.cgi?p=pkgsrc-wip.git;a=commitdiff;h=741d3c9fb63efce7647c1e6514384185c0f0c0aa

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

diffstat:
 lld-netbsd/DESCR                             |  11 --
 lld-netbsd/Makefile                          |  40 -----
 lld-netbsd/PLIST                             |  49 -------
 lld-netbsd/buildlink3.mk                     |  14 --
 lld-netbsd/distinfo                          |  18 ---
 lld-netbsd/options.mk                        |  20 ---
 lld-netbsd/patches/patch-CMakeLists.txt      |  12 --
 lld-netbsd/patches/patch-ELF_Config.h        |  31 ----
 lld-netbsd/patches/patch-ELF_Driver.cpp      | 212 ---------------------------
 lld-netbsd/patches/patch-ELF_Driver.h        |  14 --
 lld-netbsd/patches/patch-ELF_Options.td      |  13 --
 lld-netbsd/patches/patch-ELF_Writer.cpp      |  29 ----
 lld-netbsd/patches/patch-docs_ld.lld.1       |  15 --
 lld-netbsd/patches/patch-test_ELF_gnustack.s |  22 ---
 14 files changed, 500 deletions(-)

diffs:
diff --git a/lld-netbsd/DESCR b/lld-netbsd/DESCR
deleted file mode 100644
index 4b5b6daa5b..0000000000
--- a/lld-netbsd/DESCR
+++ /dev/null
@@ -1,11 +0,0 @@
-LLD is a linker from the LLVM project that is a drop-in replacement for system
-linkers and runs much faster than them. It also provides features that are
-useful for toolchain developers.
-
-The linker supports ELF (Unix), PE/COFF (Windows), Mach-O (macOS) and
-WebAssembly in descending order of completeness. Internally, LLD consists of
-several different linkers. The ELF port is the one that will be described in
-this document. The PE/COFF port is complete, including Windows debug info (PDB)
-support. The WebAssembly port is still a work in progress (See WebAssembly lld
-port). The Mach-O port is built based on a different architecture than
-the others. For the details about Mach-O, please read ATOM-based lld.
diff --git a/lld-netbsd/Makefile b/lld-netbsd/Makefile
deleted file mode 100644
index 287208c9c8..0000000000
--- a/lld-netbsd/Makefile
+++ /dev/null
@@ -1,40 +0,0 @@
-# $NetBSD: Makefile,v 1.1 2019/02/01 16:30:00 mgorny Exp $
-
-SVN_REPOSITORIES=	lld
-SVN_REPO.lld=		http://llvm.org/svn/llvm-project/lld/trunk
-SVN_REVISION.lld=	356117
-
-PKGNAME=		lld-9.0.0
-#DISTNAME=		${PKGNAME}.src
-CATEGORIES=		devel
-#MASTER_SITES=		http://llvm.org/releases/${PKGVERSION_NOREV}/
-#EXTRACT_SUFX=		.tar.xz
-#DISTFILES=		${DEFAULT_DISTFILES}
-
-MAINTAINER=		pkgsrc-users%NetBSD.org@localhost
-HOMEPAGE=		http://lld.llvm.org/
-COMMENT=		The LLVM Linker
-LICENSE=		modified-bsd
-
-USE_LANGUAGES=		c c++11
-USE_CMAKE=		yes
-GCC_REQD+=		4.8
-
-WRKSRC=			${WRKDIR}/${PKGBASE}
-CONFIGURE_DIRS=		${WRKDIR}/build
-CMAKE_ARG_PATH=		${WRKSRC}
-
-CMAKE_ARGS+=		-DCMAKE_BUILD_TYPE=Release
-CMAKE_ARGS+=		-DCMAKE_C_COMPILER=${CC:Q}
-CMAKE_ARGS+=		-DCMAKE_CXX_COMPILER=${CXX:Q}
-
-PYTHON_FOR_BUILD_ONLY=	yes
-
-post-extract:
-	${MKDIR} ${WRKDIR}/build
-
-.include "options.mk"
-.include "../../wip/mk/svn-package.mk"
-.include "../../lang/python/tool.mk"
-#.include "../../lang/llvm/buildlink3.mk"
-.include "../../mk/bsd.pkg.mk"
diff --git a/lld-netbsd/PLIST b/lld-netbsd/PLIST
deleted file mode 100644
index 5b294f225a..0000000000
--- a/lld-netbsd/PLIST
+++ /dev/null
@@ -1,49 +0,0 @@
-@comment $NetBSD: PLIST,v 1.1 2019/02/01 16:30:00 mgorny Exp $
-bin/ld.lld
-bin/ld64.lld
-bin/lld
-bin/lld-link
-bin/wasm-ld
-include/lld/Common/Args.h
-include/lld/Common/Driver.h
-include/lld/Common/ErrorHandler.h
-include/lld/Common/LLVM.h
-include/lld/Common/Memory.h
-include/lld/Common/Reproduce.h
-include/lld/Common/Strings.h
-include/lld/Common/TargetOptionsCommandFlags.h
-include/lld/Common/Threads.h
-include/lld/Common/Timer.h
-include/lld/Common/Version.h
-include/lld/Core/AbsoluteAtom.h
-include/lld/Core/ArchiveLibraryFile.h
-include/lld/Core/Atom.h
-include/lld/Core/DefinedAtom.h
-include/lld/Core/Error.h
-include/lld/Core/File.h
-include/lld/Core/Instrumentation.h
-include/lld/Core/LinkingContext.h
-include/lld/Core/Node.h
-include/lld/Core/Pass.h
-include/lld/Core/PassManager.h
-include/lld/Core/Reader.h
-include/lld/Core/Reference.h
-include/lld/Core/Resolver.h
-include/lld/Core/SharedLibraryAtom.h
-include/lld/Core/SharedLibraryFile.h
-include/lld/Core/Simple.h
-include/lld/Core/SymbolTable.h
-include/lld/Core/UndefinedAtom.h
-include/lld/Core/Writer.h
-include/lld/ReaderWriter/MachOLinkingContext.h
-include/lld/ReaderWriter/YamlContext.h
-lib/liblldCOFF.a
-lib/liblldCommon.a
-lib/liblldCore.a
-lib/liblldDriver.a
-lib/liblldELF.a
-lib/liblldMachO.a
-lib/liblldMinGW.a
-lib/liblldReaderWriter.a
-lib/liblldWasm.a
-lib/liblldYAML.a
diff --git a/lld-netbsd/buildlink3.mk b/lld-netbsd/buildlink3.mk
deleted file mode 100644
index 7cb1f29bb0..0000000000
--- a/lld-netbsd/buildlink3.mk
+++ /dev/null
@@ -1,14 +0,0 @@
-# $NetBSD: buildlink3.mk,v 1.1 2019/02/01 16:30:00 mgorny Exp $
-
-BUILDLINK_TREE+=	lld
-
-.if !defined(LLD_BUILDLINK3_MK)
-LLD_BUILDLINK3_MK:=
-
-BUILDLINK_API_DEPENDS.lld+=	lld>=7.0.0
-BUILDLINK_PKGSRCDIR.lld?=	../../devel/lld
-
-.include "../../lang/llvm/buildlink3.mk"
-.endif	# LLD_BUILDLINK3_MK
-
-BUILDLINK_TREE+=	-lld
diff --git a/lld-netbsd/distinfo b/lld-netbsd/distinfo
deleted file mode 100644
index 7419c97fb1..0000000000
--- a/lld-netbsd/distinfo
+++ /dev/null
@@ -1,18 +0,0 @@
-$NetBSD: distinfo,v 1.1 2019/02/01 16:30:00 mgorny Exp $
-
-SHA1 (lld-7.0.1.src.tar.xz) = 3b69e107f27d466488838d5fa65bdfd77b885007
-RMD160 (lld-7.0.1.src.tar.xz) = 44e0e851b957fef86352ebe6c2a37096f8595dcb
-SHA512 (lld-7.0.1.src.tar.xz) = e5d3ed280d8ac6014cd6bbe080b11e2c4ebbae81dc14b637e779ec027d818dbae91c6f0de9e94bcecd6bdaa37f12c35141b5d81f0a15251d27932aa9bebd4047
-Size (lld-7.0.1.src.tar.xz) = 912812 bytes
-SHA1 (llvm-7.0.1.src.tar.xz) = f97632fcc3186eb0d396492ef8acfc807648580f
-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) = 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/options.mk b/lld-netbsd/options.mk
deleted file mode 100644
index ceaf154539..0000000000
--- a/lld-netbsd/options.mk
+++ /dev/null
@@ -1,20 +0,0 @@
-# $NetBSD: options.mk,v 1.1 2019/02/01 16:30:00 mgorny Exp $
-
-PKG_OPTIONS_VAR=	PKG_OPTIONS.lld
-PKG_SUPPORTED_OPTIONS=	tests
-
-.include "../../mk/bsd.options.mk"
-
-.if !empty(PKG_OPTIONS:Mtests)
-DISTFILES+=		llvm-${PKGVERSION_NOREV}.src${EXTRACT_SUFX}
-CMAKE_ARGS+=		-DLLVM_CONFIG_PATH=${LLVM_CONFIG_PATH:Q}
-CMAKE_ARGS+=		-DLLVM_INCLUDE_TESTS=ON
-CMAKE_ARGS+=		-DLLVM_BUILD_TESTS=ON
-CMAKE_ARGS+=		-DLLVM_MAIN_SRC_DIR=${WRKDIR}/llvm-${PKGVERSION_NOREV}.src
-CMAKE_ARGS+=		-DLLVM_EXTERNAL_LIT=${WRKDIR}/llvm-${PKGVERSION_NOREV}.src/utils/lit/lit.py
-REPLACE_PYTHON+=	${WRKDIR}/llvm-${PKGVERSION_NOREV}.src/utils/lit/lit.py
-TEST_TARGET=		check-lld  # failing tests fixed in 8.0
-TEST_ENV+=		LD_LIBRARY_PATH=${WRKDIR}/build/lib
-.else
-CMAKE_ARGS+=		-DLLVM_INCLUDE_TESTS=OFF
-.endif
diff --git a/lld-netbsd/patches/patch-CMakeLists.txt b/lld-netbsd/patches/patch-CMakeLists.txt
deleted file mode 100644
index 4e83268c98..0000000000
--- a/lld-netbsd/patches/patch-CMakeLists.txt
+++ /dev/null
@@ -1,12 +0,0 @@
-$NetBSD$
-
---- CMakeLists.txt.orig	2019-02-01 23:06:35.000000000 +0000
-+++ CMakeLists.txt
-@@ -86,7 +86,6 @@ Please install Python or specify the PYT
-       endif()
-       set(UNITTEST_DIR ${LLVM_MAIN_SRC_DIR}/utils/unittest)
-       if(EXISTS ${UNITTEST_DIR}/googletest/include/gtest/gtest.h
--          AND NOT EXISTS ${LLVM_LIBRARY_DIR}/${CMAKE_STATIC_LIBRARY_PREFIX}gtest${CMAKE_STATIC_LIBRARY_SUFFIX}
-           AND EXISTS ${UNITTEST_DIR}/CMakeLists.txt)
-         add_subdirectory(${UNITTEST_DIR} utils/unittest)
-       endif()
diff --git a/lld-netbsd/patches/patch-ELF_Config.h b/lld-netbsd/patches/patch-ELF_Config.h
deleted file mode 100644
index 5d1972cef4..0000000000
--- a/lld-netbsd/patches/patch-ELF_Config.h
+++ /dev/null
@@ -1,31 +0,0 @@
-$NetBSD$
-
---- ELF/Config.h.orig	2019-03-14 17:35:11.000000000 +0000
-+++ ELF/Config.h
-@@ -13,6 +13,7 @@
- #include "llvm/ADT/MapVector.h"
- #include "llvm/ADT/StringRef.h"
- #include "llvm/ADT/StringSet.h"
-+#include "llvm/ADT/Triple.h"
- #include "llvm/BinaryFormat/ELF.h"
- #include "llvm/Support/CachePruning.h"
- #include "llvm/Support/CodeGen.h"
-@@ -198,6 +199,7 @@ struct Configuration {
-   bool ZNodefaultlib;
-   bool ZNodelete;
-   bool ZNodlopen;
-+  bool ZNognustack;
-   bool ZNow;
-   bool ZOrigin;
-   bool ZRelro;
-@@ -295,6 +297,10 @@ struct Configuration {
- 
-   // 4 for ELF32, 8 for ELF64.
-   int Wordsize;
-+
-+  // Target triple, inferred from program name or defaulted to LLVM
-+  // default target.
-+  llvm::Triple TargetTriple;
- };
- 
- // The only instance of Configuration struct.
diff --git a/lld-netbsd/patches/patch-ELF_Driver.cpp b/lld-netbsd/patches/patch-ELF_Driver.cpp
deleted file mode 100644
index 609c176295..0000000000
--- a/lld-netbsd/patches/patch-ELF_Driver.cpp
+++ /dev/null
@@ -1,212 +0,0 @@
-$NetBSD$
-
---- ELF/Driver.cpp.orig	2019-03-14 17:35:11.000000000 +0000
-+++ ELF/Driver.cpp
-@@ -53,6 +53,7 @@
- #include "llvm/Support/LEB128.h"
- #include "llvm/Support/Path.h"
- #include "llvm/Support/TarWriter.h"
-+#include "llvm/Support/TargetRegistry.h"
- #include "llvm/Support/TargetSelect.h"
- #include "llvm/Support/raw_ostream.h"
- #include <cstdlib>
-@@ -317,6 +318,9 @@ static void checkOptions() {
- 
-     if (Config->SingleRoRx && !Script->HasSectionsCommand)
-       error("-execute-only and -no-rosegment cannot be used together");
-+  } else if (Config->TargetTriple.isOSNetBSD()) {
-+    // force-disable RO segment on NetBSD due to ld.elf_so limitations
-+    Config->SingleRoRx = true;
-   }
- }
- 
-@@ -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 == "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 +369,56 @@ static void checkZOptions(opt::InputArgL
-       error("unknown -z value: " + StringRef(Arg->getValue()));
- }
- 
-+void LinkerDriver::appendDefaultSearchPaths() {
-+  if (Config->TargetTriple.isOSNetBSD()) {
-+    // NetBSD driver relies on the linker knowing the default search paths.
-+    // Please keep this in sync with clang/lib/Driver/ToolChains/NetBSD.cpp
-+    // (NetBSD::NetBSD constructor)
-+    switch (Config->TargetTriple.getArch()) {
-+    case llvm::Triple::x86:
-+      Config->SearchPaths.push_back("=/usr/lib/i386");
-+      break;
-+    case llvm::Triple::arm:
-+    case llvm::Triple::armeb:
-+    case llvm::Triple::thumb:
-+    case llvm::Triple::thumbeb:
-+      switch (Config->TargetTriple.getEnvironment()) {
-+      case llvm::Triple::EABI:
-+      case llvm::Triple::GNUEABI:
-+        Config->SearchPaths.push_back("=/usr/lib/eabi");
-+        break;
-+      case llvm::Triple::EABIHF:
-+      case llvm::Triple::GNUEABIHF:
-+        Config->SearchPaths.push_back("=/usr/lib/eabihf");
-+        break;
-+      default:
-+        Config->SearchPaths.push_back("=/usr/lib/oabi");
-+        break;
-+      }
-+      break;
-+#if 0 // TODO
-+    case llvm::Triple::mips64:
-+    case llvm::Triple::mips64el:
-+      if (tools::mips::hasMipsAbiArg(Args, "o32"))
-+        Config->SearchPaths.push_back("=/usr/lib/o32");
-+      else if (tools::mips::hasMipsAbiArg(Args, "64"))
-+        Config->SearchPaths.push_back("=/usr/lib/64");
-+      break;
-+#endif
-+    case llvm::Triple::ppc:
-+      Config->SearchPaths.push_back("=/usr/lib/powerpc");
-+      break;
-+    case llvm::Triple::sparc:
-+      Config->SearchPaths.push_back("=/usr/lib/sparc");
-+      break;
-+    default:
-+      break;
-+    }
-+
-+    Config->SearchPaths.push_back("=/usr/lib");
-+  }
-+}
-+
- void LinkerDriver::main(ArrayRef<const char *> ArgsArr) {
-   ELFOptTable Parser;
-   opt::InputArgList Args = Parser.parse(ArgsArr.slice(1));
-@@ -378,6 +433,25 @@ void LinkerDriver::main(ArrayRef<const c
-     return;
-   }
- 
-+  if (const char *Path = getReproduceOption(Args)) {
-+    // Note that --reproduce is a debug option so you can ignore it
-+    // if you are trying to understand the whole picture of the code.
-+    Expected<std::unique_ptr<TarWriter>> ErrOrWriter =
-+        TarWriter::create(Path, path::stem(Path));
-+    if (ErrOrWriter) {
-+      Tar = std::move(*ErrOrWriter);
-+      Tar->append("response.txt", createResponseFile(Args));
-+      Tar->append("version.txt", getLLDVersion() + "\n");
-+    } else {
-+      error("--reproduce: " + toString(ErrOrWriter.takeError()));
-+    }
-+  }
-+
-+  initLLVM();
-+  setTargetTriple(ArgsArr[0], Args);
-+  readConfigs(Args);
-+  appendDefaultSearchPaths();
-+
-   // Handle -v or -version.
-   //
-   // A note about "compatible with GNU linkers" message: this is a hack for
-@@ -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.
--  if (Args.hasArg(OPT_v) || Args.hasArg(OPT_version))
-+  if (Args.hasArg(OPT_v) || Args.hasArg(OPT_version)) {
-     message(getLLDVersion() + " (compatible with GNU linkers)");
--
--  if (const char *Path = getReproduceOption(Args)) {
--    // Note that --reproduce is a debug option so you can ignore it
--    // if you are trying to understand the whole picture of the code.
--    Expected<std::unique_ptr<TarWriter>> ErrOrWriter =
--        TarWriter::create(Path, path::stem(Path));
--    if (ErrOrWriter) {
--      Tar = std::move(*ErrOrWriter);
--      Tar->append("response.txt", createResponseFile(Args));
--      Tar->append("version.txt", getLLDVersion() + "\n");
--    } else {
--      error("--reproduce: " + toString(ErrOrWriter.takeError()));
--    }
-+    message("Target: " + Config->TargetTriple.str());
-   }
- 
--  readConfigs(Args);
--
-   // 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 +479,6 @@ void LinkerDriver::main(ArrayRef<const c
-   if (Args.hasArg(OPT_version))
-     return;
- 
--  initLLVM();
-   createFiles(Args);
-   if (errorCount())
-     return;
-@@ -745,6 +804,34 @@ static void parseClangOption(StringRef O
-   error(Msg + ": " + StringRef(Err).trim());
- }
- 
-+void LinkerDriver::setTargetTriple(StringRef argv0, opt::InputArgList &Args) {
-+  std::string TargetError;
-+
-+  // Firstly, see if user specified explicit --target
-+  StringRef TargetOpt = Args.getLastArgValue(OPT_target);
-+  if (!TargetOpt.empty()) {
-+    if (llvm::TargetRegistry::lookupTarget(TargetOpt, TargetError)) {
-+      Config->TargetTriple = llvm::Triple(TargetOpt);
-+      return;
-+    } else
-+      error("Unsupported --target=" + TargetOpt + ": " + TargetError);
-+  }
-+
-+  // Secondly, try to get it from program name prefix
-+  std::string ProgName = llvm::sys::path::stem(argv0);
-+  size_t LastComponent = ProgName.rfind('-');
-+  if (LastComponent != std::string::npos) {
-+    std::string Prefix = ProgName.substr(0, LastComponent);
-+    if (llvm::TargetRegistry::lookupTarget(Prefix, TargetError)) {
-+      Config->TargetTriple = llvm::Triple(Prefix);
-+      return;
-+    }
-+  }
-+
-+  // Finally, use the default target triple
-+  Config->TargetTriple = llvm::Triple(getDefaultTargetTriple());
-+}
-+
- // Initializes Config members by the command line options.
- void LinkerDriver::readConfigs(opt::InputArgList &Args) {
-   errorHandler().Verbose = Args.hasArg(OPT_verbose);
-@@ -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());
-   Config->Entry = Args.getLastArgValue(OPT_entry);
-   Config->ExecuteOnly =
-       Args.hasFlag(OPT_execute_only, OPT_no_execute_only, false);
-@@ -875,6 +963,8 @@ void LinkerDriver::readConfigs(opt::Inpu
-   Config->ZCopyreloc = getZFlag(Args, "copyreloc", "nocopyreloc", true);
-   Config->ZExecstack = getZFlag(Args, "execstack", "noexecstack", false);
-   Config->ZGlobal = hasZOption(Args, "global");
-+  Config->ZNognustack = hasZOption(Args, "nognustack") ||
-+    Config->TargetTriple.isOSNetBSD();
-   Config->ZHazardplt = hasZOption(Args, "hazardplt");
-   Config->ZInitfirst = hasZOption(Args, "initfirst");
-   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",
--                                       Target->DefaultMaxPageSize);
-+                                       lld::elf::Target->DefaultMaxPageSize);
-   if (!isPowerOf2_64(Val))
-     error("max-page-size: value isn't a power of 2");
-   return Val;
diff --git a/lld-netbsd/patches/patch-ELF_Driver.h b/lld-netbsd/patches/patch-ELF_Driver.h
deleted file mode 100644
index ac46f37117..0000000000
--- a/lld-netbsd/patches/patch-ELF_Driver.h
+++ /dev/null
@@ -1,14 +0,0 @@
-$NetBSD$
-
---- ELF/Driver.h.orig	2019-03-14 17:33:43.000000000 +0000
-+++ ELF/Driver.h
-@@ -30,7 +30,9 @@ public:
-   void addLibrary(StringRef Name);
- 
- private:
-+  void setTargetTriple(StringRef argv0, llvm::opt::InputArgList &Args);
-   void readConfigs(llvm::opt::InputArgList &Args);
-+  void appendDefaultSearchPaths();
-   void createFiles(llvm::opt::InputArgList &Args);
-   void inferMachineType();
-   template <class ELFT> void link(llvm::opt::InputArgList &Args);
diff --git a/lld-netbsd/patches/patch-ELF_Options.td b/lld-netbsd/patches/patch-ELF_Options.td
deleted file mode 100644
index 18888d1a48..0000000000
--- a/lld-netbsd/patches/patch-ELF_Options.td
+++ /dev/null
@@ -1,13 +0,0 @@
-$NetBSD$
-
---- ELF/Options.td.orig	2019-03-14 17:35:11.000000000 +0000
-+++ ELF/Options.td
-@@ -320,6 +320,8 @@ defm symbol_ordering_file:
- 
- defm sysroot: Eq<"sysroot", "Set the system root">;
- 
-+defm target: Eq<"target", "Apply configuration defaults for a given target">;
-+
- def target1_rel: F<"target1-rel">, HelpText<"Interpret R_ARM_TARGET1 as R_ARM_REL32">;
- 
- def target1_abs: F<"target1-abs">, HelpText<"Interpret R_ARM_TARGET1 as R_ARM_ABS32 (default)">;
diff --git a/lld-netbsd/patches/patch-ELF_Writer.cpp b/lld-netbsd/patches/patch-ELF_Writer.cpp
deleted file mode 100644
index d735560820..0000000000
--- a/lld-netbsd/patches/patch-ELF_Writer.cpp
+++ /dev/null
@@ -1,29 +0,0 @@
-$NetBSD$
-
---- ELF/Writer.cpp.orig	2019-03-14 17:35:11.000000000 +0000
-+++ ELF/Writer.cpp
-@@ -2019,14 +2019,16 @@ template <class ELFT> std::vector<PhdrEn
-   if (OutputSection *Cmd = findSection(".openbsd.randomdata"))
-     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->ZNognustack) {
-+    // 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;
-+  }
- 
-   // 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 --git a/lld-netbsd/patches/patch-docs_ld.lld.1 b/lld-netbsd/patches/patch-docs_ld.lld.1
deleted file mode 100644
index 0d0c7c5a44..0000000000
--- a/lld-netbsd/patches/patch-docs_ld.lld.1
+++ /dev/null
@@ -1,15 +0,0 @@
-$NetBSD$
-
---- docs/ld.lld.1.orig	2019-03-14 17:35:10.000000000 +0000
-+++ docs/ld.lld.1
-@@ -578,6 +578,10 @@ 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.
- .It Cm norelro
- Do not indicate that portions of the object shold be mapped read-only
- after initial relocation processing.
diff --git a/lld-netbsd/patches/patch-test_ELF_gnustack.s b/lld-netbsd/patches/patch-test_ELF_gnustack.s
deleted file mode 100644
index 0f23227043..0000000000
--- a/lld-netbsd/patches/patch-test_ELF_gnustack.s
+++ /dev/null
@@ -1,22 +0,0 @@
-$NetBSD$
-
---- 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
- # 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:


Home | Main Index | Thread Index | Old Index