pkgsrc-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[pkgsrc/trunk]: pkgsrc/devel/lld lld: Sync local patches with merged and pend...
details: https://anonhg.NetBSD.org/pkgsrc/rev/9fad84188c55
branches: trunk
changeset: 403930:9fad84188c55
user: kamil <kamil%pkgsrc.org@localhost>
date: Sun Nov 03 12:10:29 2019 +0000
description:
lld: Sync local patches with merged and pending patches upstream
Cherry-pick upstream patch commit 2a0fcae3d4d1fd85d6ae8378d7c6f12430c0087d
[lld] [ELF] Add '-z nognustack' opt to suppress emitting PT_GNU_STAC dummy option for an AArch64 erratum.
[LLD] Add NetBSD support as a new flavor of LLD (nb.lld)
https://reviews.llvm.org/D69755
Clang >=clang-9.0.0nb3 is required.
diffstat:
devel/lld/Makefile | 4 +-
devel/lld/PLIST | 3 +-
devel/lld/distinfo | 21 +-
devel/lld/patches/patch-CMakeLists.txt | 17 +-
devel/lld/patches/patch-ELF_Arch_AArch64.cpp | 22 --
devel/lld/patches/patch-ELF_Config.h | 42 +----
devel/lld/patches/patch-ELF_Driver.cpp | 201 +-------------------------
devel/lld/patches/patch-ELF_Options.td | 20 +--
devel/lld/patches/patch-ELF_Writer.cpp | 6 +-
devel/lld/patches/patch-docs_ld.lld.1 | 11 +-
devel/lld/patches/patch-test_ELF_gnustack.s | 10 +-
11 files changed, 66 insertions(+), 291 deletions(-)
diffs (truncated from 543 to 300 lines):
diff -r dff41f94d73b -r 9fad84188c55 devel/lld/Makefile
--- a/devel/lld/Makefile Sun Nov 03 12:04:12 2019 +0000
+++ b/devel/lld/Makefile Sun Nov 03 12:10:29 2019 +0000
@@ -1,8 +1,8 @@
-# $NetBSD: Makefile,v 1.10 2019/10/24 11:52:21 tnn Exp $
+# $NetBSD: Makefile,v 1.11 2019/11/03 12:10:29 kamil Exp $
DISTNAME= lld-9.0.0.src
PKGNAME= ${DISTNAME:S/.src//}
-PKGREVISION= 2
+PKGREVISION= 3
CATEGORIES= devel
MASTER_SITES= http://releases.llvm.org/${PKGVERSION_NOREV}/
EXTRACT_SUFX= .tar.xz
diff -r dff41f94d73b -r 9fad84188c55 devel/lld/PLIST
--- a/devel/lld/PLIST Sun Nov 03 12:04:12 2019 +0000
+++ b/devel/lld/PLIST Sun Nov 03 12:10:29 2019 +0000
@@ -1,8 +1,9 @@
-@comment $NetBSD: PLIST,v 1.2 2019/10/19 14:01:36 adam Exp $
+@comment $NetBSD: PLIST,v 1.3 2019/11/03 12:10:29 kamil Exp $
bin/ld.lld
bin/ld64.lld
bin/lld
bin/lld-link
+bin/nb.lld
bin/wasm-ld
include/lld/Common/Args.h
include/lld/Common/Driver.h
diff -r dff41f94d73b -r 9fad84188c55 devel/lld/distinfo
--- a/devel/lld/distinfo Sun Nov 03 12:04:12 2019 +0000
+++ b/devel/lld/distinfo Sun Nov 03 12:10:29 2019 +0000
@@ -1,14 +1,17 @@
-$NetBSD: distinfo,v 1.6 2019/10/21 22:07:58 rjs Exp $
+$NetBSD: distinfo,v 1.7 2019/11/03 12:10:29 kamil Exp $
SHA1 (lld-9.0.0.src.tar.xz) = 021a8c38cf27d63db37d939c7cdec46ffd627be2
RMD160 (lld-9.0.0.src.tar.xz) = d46b068f4de55d174be71e061aa38f7d4d1499dc
SHA512 (lld-9.0.0.src.tar.xz) = bc4812232840ef5edbd8edf1d1a329e85a4bfd3a7859fe322e11dd053435e722c6f1140a718fd2b3524ee9783a357178d2ba30d12519847bd3acc294698007f3
Size (lld-9.0.0.src.tar.xz) = 1100608 bytes
-SHA1 (patch-CMakeLists.txt) = df8e32f5f23bf2f2615a891177f61dc65359e955
-SHA1 (patch-ELF_Arch_AArch64.cpp) = 45eb8f69b92f8ba764372993363dbce88b50a310
-SHA1 (patch-ELF_Config.h) = 760658ef2d90e8d44ae6c1ef76a183613f445264
-SHA1 (patch-ELF_Driver.cpp) = eaf5a3cd01a82421205831dce86db92bfb4001bc
-SHA1 (patch-ELF_Options.td) = 8e228dee43511efc7fd6107e817288067c393145
-SHA1 (patch-ELF_Writer.cpp) = 210b0a8b60885456cb037d9925c504874efd0e35
-SHA1 (patch-docs_ld.lld.1) = a6865d0099216094422aede3d65f43ee6fee22fe
-SHA1 (patch-test_ELF_gnustack.s) = 22f5eb19e588cc0c1055fd932d7a7b22ecd70e20
+SHA1 (patch-CMakeLists.txt) = 87d32f66488541ba68e219f5fa83646b48bf9c71
+SHA1 (patch-ELF_Config.h) = 6ad0642b602f1bdfead45e3e3d71e9718fdd80b5
+SHA1 (patch-ELF_Driver.cpp) = 113705d763af35635ee69e127c9c757c9d0c2597
+SHA1 (patch-ELF_Options.td) = 22a1f293681b86a9aac87624efcfeeb20a4ba51c
+SHA1 (patch-ELF_Writer.cpp) = 8c2d794885826a153b3ec6fa3149093036b98750
+SHA1 (patch-docs_ld.lld.1) = c2d156d3d7af6de195f9c2f3eceb978d65c8d883
+SHA1 (patch-test_ELF_gnustack.s) = 58eb43e952a85bb8f2cb7a665a625164ee564dd2
+SHA1 (patch-tools_lld_lld.cpp) = bc3662191bf6e50c808d188707c9abfdb4786dbf
+SHA1 (patch-tools_nb.lld_CMakeLists.txt) = 231ed112512d23001a8e9d1d1821838a483c2e37
+SHA1 (patch-tools_nb.lld_Options.td) = d56ff977f24d97eda30f10aae5818c618b3c7915
+SHA1 (patch-tools_nb.lld_nb.lld.cpp) = 11a69572b0ec28b9de576249bf3217acdcebee22
diff -r dff41f94d73b -r 9fad84188c55 devel/lld/patches/patch-CMakeLists.txt
--- a/devel/lld/patches/patch-CMakeLists.txt Sun Nov 03 12:04:12 2019 +0000
+++ b/devel/lld/patches/patch-CMakeLists.txt Sun Nov 03 12:10:29 2019 +0000
@@ -1,12 +1,15 @@
-$NetBSD: patch-CMakeLists.txt,v 1.1 2019/02/01 16:30:00 mgorny Exp $
+$NetBSD: patch-CMakeLists.txt,v 1.2 2019/11/03 12:10:29 kamil Exp $
LLD 7.0.1 is incompatible with gtest version in pkgsrc. Remove
the condition that prevents it from building its own copy when system
version is installed.
---- CMakeLists.txt.orig 2017-11-17 18:14:09.000000000 +0000
+[LLD] Add NetBSD support as a new flavor of LLD (nb.lld)
+https://reviews.llvm.org/D69755
+
+--- CMakeLists.txt.orig 2019-08-26 12:32:18.000000000 +0000
+++ CMakeLists.txt
-@@ -86,7 +86,6 @@ Please install Python or specify the PYT
+@@ -85,7 +85,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
@@ -14,3 +17,11 @@
AND EXISTS ${UNITTEST_DIR}/CMakeLists.txt)
add_subdirectory(${UNITTEST_DIR} utils/unittest)
endif()
+@@ -212,6 +211,7 @@ endif()
+ add_subdirectory(Common)
+ add_subdirectory(lib)
+ add_subdirectory(tools/lld)
++add_subdirectory(tools/nb.lld)
+
+ if (LLVM_INCLUDE_TESTS)
+ add_subdirectory(test)
diff -r dff41f94d73b -r 9fad84188c55 devel/lld/patches/patch-ELF_Arch_AArch64.cpp
--- a/devel/lld/patches/patch-ELF_Arch_AArch64.cpp Sun Nov 03 12:04:12 2019 +0000
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,22 +0,0 @@
-$NetBSD: patch-ELF_Arch_AArch64.cpp,v 1.1 2019/10/21 22:07:58 rjs Exp $
-
-Set correct base address on NetBSD.
-
---- ELF/Arch/AArch64.cpp.orig 2019-07-16 05:50:45.000000000 +0000
-+++ ELF/Arch/AArch64.cpp
-@@ -66,9 +66,12 @@ AArch64::AArch64() {
- pltHeaderSize = 32;
- defaultMaxPageSize = 65536;
-
-- // Align to the 2 MiB page size (known as a superpage or huge page).
-- // FreeBSD automatically promotes 2 MiB-aligned allocations.
-- defaultImageBase = 0x200000;
-+ if (config->targetTriple.isOSNetBSD())
-+ defaultImageBase = 0x200100000;
-+ else
-+ // Align to the 2 MiB page size (known as a superpage or huge page).
-+ // FreeBSD automatically promotes 2 MiB-aligned allocations.
-+ defaultImageBase = 0x200000;
-
- needsThunks = true;
- }
diff -r dff41f94d73b -r 9fad84188c55 devel/lld/patches/patch-ELF_Config.h
--- a/devel/lld/patches/patch-ELF_Config.h Sun Nov 03 12:04:12 2019 +0000
+++ b/devel/lld/patches/patch-ELF_Config.h Sun Nov 03 12:10:29 2019 +0000
@@ -1,24 +1,13 @@
-$NetBSD: patch-ELF_Config.h,v 1.4 2019/10/21 22:07:58 rjs Exp $
+$NetBSD: patch-ELF_Config.h,v 1.5 2019/11/03 12:10:29 kamil Exp $
-Add support for customizing LLD behavior on target triple.
-https://reviews.llvm.org/D56650
-
-Add '-z nognustack' option to disable emitting PT_GNU_STACK.
-https://reviews.llvm.org/D56554
+Cherry-pick upstream patch commit 2a0fcae3d4d1fd85d6ae8378d7c6f12430c0087d
+[lld] [ELF] Add '-z nognustack' opt to suppress emitting PT_GNU_STAC dummy option for an AArch64 erratum.
Add dummy option for an AArch64 erratum.
--- ELF/Config.h.orig 2019-07-16 05:50:45.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"
-@@ -61,6 +62,9 @@ enum class Target2Policy { Abs, Rel, Got
+@@ -61,6 +61,9 @@ enum class Target2Policy { Abs, Rel, Got
// For tracking ARM Float Argument PCS
enum class ARMVFPArgKind { Default, Base, VFP, ToolChain };
@@ -28,7 +17,7 @@
struct SymbolVersion {
llvm::StringRef name;
bool isExternCpp;
-@@ -146,6 +150,7 @@ struct Configuration {
+@@ -146,6 +149,7 @@ struct Configuration {
bool enableNewDtags;
bool executeOnly;
bool exportDynamic;
@@ -36,15 +25,7 @@
bool fixCortexA53Errata843419;
bool forceBTI;
bool formatBinary = false;
-@@ -206,6 +211,7 @@ struct Configuration {
- bool zNodefaultlib;
- bool zNodelete;
- bool zNodlopen;
-+ bool zNognustack;
- bool zNow;
- bool zOrigin;
- bool zRelro;
-@@ -214,6 +220,7 @@ struct Configuration {
+@@ -214,6 +218,7 @@ struct Configuration {
bool zRetpolineplt;
bool zWxneeded;
DiscardPolicy discard;
@@ -52,14 +33,3 @@
ICFLevel icf;
OrphanHandlingPolicy orphanHandling;
SortSectionPolicy sortSection;
-@@ -304,6 +311,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 -r dff41f94d73b -r 9fad84188c55 devel/lld/patches/patch-ELF_Driver.cpp
--- a/devel/lld/patches/patch-ELF_Driver.cpp Sun Nov 03 12:04:12 2019 +0000
+++ b/devel/lld/patches/patch-ELF_Driver.cpp Sun Nov 03 12:10:29 2019 +0000
@@ -1,48 +1,22 @@
-$NetBSD: patch-ELF_Driver.cpp,v 1.5 2019/10/21 22:07:58 rjs Exp $
-
-Add support for customizing LLD behavior on target triple.
-https://reviews.llvm.org/D56650
-
-Add '-z nognustack' option to disable emitting PT_GNU_STACK.
-https://reviews.llvm.org/D56554
+$NetBSD: patch-ELF_Driver.cpp,v 1.6 2019/11/03 12:10:29 kamil Exp $
-Alter defaults for NetBSD targets:
-* add default library search paths
-* force combined RO+RW segment due to ld.elf_so limitations
-* disable PT_GNU_STACK (meaningless on NetBSD)
-* disable 'new dtags', i.e. force RPATH instead of RUNPATH
+Cherry-pick upstream patch commit 2a0fcae3d4d1fd85d6ae8378d7c6f12430c0087d
+[lld] [ELF] Add '-z nognustack' opt to suppress emitting PT_GNU_STAC dummy option for an AArch64 erratum.
-Add dummy handler for an AArch64 erratum.
+Add dummy option for an AArch64 erratum.
--- ELF/Driver.cpp.orig 2019-07-17 14:54:02.000000000 +0000
+++ ELF/Driver.cpp
-@@ -54,6 +54,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>
-@@ -73,6 +74,8 @@ LinkerDriver *elf::driver;
-
- static void setConfigs(opt::InputArgList &args);
- static void readConfigs(opt::InputArgList &args);
-+static void appendDefaultSearchPaths(void);
-+static void setTargetTriple(StringRef argv0, opt::InputArgList &args);
-
- bool elf::link(ArrayRef<const char *> args, bool canExitEarly,
- raw_ostream &error) {
-@@ -129,7 +132,7 @@ static std::tuple<ELFKind, uint16_t, uin
+@@ -129,7 +129,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",
- {ELF64LEKind, EM_AARCH64})
-+ "aarch64nbsd", {ELF64LEKind, EM_AARCH64})
++ "aarch64nbsd", {ELF64LEKind, EM_AARCH64})
.Cases("armelf", "armelf_linux_eabi", {ELF32LEKind, EM_ARM})
.Case("elf32_x86_64", {ELF32LEKind, EM_X86_64})
.Cases("elf32btsmip", "elf32btsmipn32", {ELF32BEKind, EM_MIPS})
-@@ -296,6 +299,9 @@ static void checkOptions() {
+@@ -296,6 +296,9 @@ static void checkOptions() {
if (config->emachine == EM_MIPS && config->gnuHash)
error("the .gnu.hash section is not compatible with the MIPS target");
@@ -52,17 +26,7 @@
if (config->fixCortexA53Errata843419 && config->emachine != EM_AARCH64)
error("--fix-cortex-a53-843419 is only supported on AArch64 targets");
-@@ -336,6 +342,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;
- }
-
- if (config->zRetpolineplt && config->requireCET)
-@@ -373,6 +382,20 @@ static bool getZFlag(opt::InputArgList &
+@@ -373,6 +376,20 @@ static bool getZFlag(opt::InputArgList &
return Default;
}
@@ -83,147 +47,15 @@
static bool isKnownZFlag(StringRef s) {
return s == "combreloc" || s == "copyreloc" || s == "defs" ||
s == "execstack" || s == "global" || s == "hazardplt" ||
-@@ -380,6 +403,7 @@ static bool isKnownZFlag(StringRef s) {
+@@ -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 == "nognustack" ||
s == "nokeep-text-section-prefix" || s == "norelro" || s == "notext" ||
s == "now" || s == "origin" || s == "relro" || s == "retpolineplt" ||
s == "rodynamic" || s == "text" || s == "wxneeded" ||
-@@ -394,6 +418,56 @@ static void checkZOptions(opt::InputArgL
- error("unknown -z value: " + StringRef(arg->getValue()));
- }
-
-+static void 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:
Home |
Main Index |
Thread Index |
Old Index