From owner-svn-ports-head@freebsd.org Fri Apr 12 17:23:49 2019 Return-Path: Delivered-To: svn-ports-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 898181581E8C; Fri, 12 Apr 2019 17:23:49 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id EE3A184887; Fri, 12 Apr 2019 17:23:48 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C643924899; Fri, 12 Apr 2019 17:23:48 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3CHNmXw080644; Fri, 12 Apr 2019 17:23:48 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3CHNmCu080642; Fri, 12 Apr 2019 17:23:48 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201904121723.x3CHNmCu080642@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Fri, 12 Apr 2019 17:23:48 +0000 (UTC) To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r498732 - in head/devel/llvm80: . files/lld X-SVN-Group: ports-head X-SVN-Commit-Author: brooks X-SVN-Commit-Paths: in head/devel/llvm80: . files/lld X-SVN-Commit-Revision: 498732 X-SVN-Commit-Repository: ports MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: EE3A184887 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.95)[-0.953,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-ports-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the ports tree for head List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Apr 2019 17:23:49 -0000 Author: brooks Date: Fri Apr 12 17:23:48 2019 New Revision: 498732 URL: https://svnweb.freebsd.org/changeset/ports/498732 Log: Apply a manually updated version of FreeBSD HEAD r338297 as required to build recent amd64 kernel. Reported by: tijl Sponsored by: DARPA, AFRL Added: head/devel/llvm80/files/lld/patch-head-r338297.diff - copied, changed from r498478, head/devel/llvm70/files/lld/patch-head-r338297.diff Modified: head/devel/llvm80/Makefile Modified: head/devel/llvm80/Makefile ============================================================================== --- head/devel/llvm80/Makefile Fri Apr 12 17:11:38 2019 (r498731) +++ head/devel/llvm80/Makefile Fri Apr 12 17:23:48 2019 (r498732) @@ -2,7 +2,7 @@ PORTNAME= llvm DISTVERSION= 8.0.0 -PORTREVISION= 0 +PORTREVISION= 1 CATEGORIES= devel lang MASTER_SITES= http://${PRE_}releases.llvm.org/${LLVM_RELEASE}/${RCDIR} PKGNAMESUFFIX= ${LLVM_SUFFIX} Copied and modified: head/devel/llvm80/files/lld/patch-head-r338297.diff (from r498478, head/devel/llvm70/files/lld/patch-head-r338297.diff) ============================================================================== --- head/devel/llvm70/files/lld/patch-head-r338297.diff Tue Apr 9 15:44:52 2019 (r498478, copy source) +++ head/devel/llvm80/files/lld/patch-head-r338297.diff Fri Apr 12 17:23:48 2019 (r498732) @@ -18,34 +18,28 @@ Index: tools/lld/ELF/Config.h bool ZInitfirst; bool ZKeepTextSectionPrefix; bool ZNodelete; -Index: tools/lld/ELF/Driver.cpp -=================================================================== ---- tools/lld/ELF/Driver.cpp (revision 338296) -+++ tools/lld/ELF/Driver.cpp (revision 338297) -@@ -338,7 +338,8 @@ static bool getZFlag(opt::InputArgList &Args, Stri - - static bool isKnown(StringRef S) { +--- tools/lld/ELF/Driver.cpp.orig 2019-02-14 10:49:15.000000000 +0000 ++++ tools/lld/ELF/Driver.cpp 2019-04-09 17:24:01.029238000 +0100 +@@ -348,6 +348,7 @@ static bool getZFlag(opt::InputArgList & + static bool isKnownZFlag(StringRef S) { return S == "combreloc" || S == "copyreloc" || S == "defs" || -- S == "execstack" || S == "hazardplt" || S == "initfirst" || -+ S == "execstack" || S == "hazardplt" || S == "ifunc-noplt" || -+ S == "initfirst" || + S == "execstack" || S == "global" || S == "hazardplt" || ++ S == "ifunc-noplt" || + S == "initfirst" || S == "interpose" || S == "keep-text-section-prefix" || S == "lazy" || S == "muldefs" || - S == "nocombreloc" || S == "nocopyreloc" || S == "nodelete" || - S == "nodlopen" || S == "noexecstack" || -@@ -843,6 +844,7 @@ void LinkerDriver::readConfigs(opt::InputArgList & - Config->ZCopyreloc = getZFlag(Args, "copyreloc", "nocopyreloc", true); + S == "nocombreloc" || S == "nocopyreloc" || S == "nodefaultlib" || +@@ -871,6 +872,7 @@ void LinkerDriver::readConfigs(opt::Inpu Config->ZExecstack = getZFlag(Args, "execstack", "noexecstack", false); + Config->ZGlobal = hasZOption(Args, "global"); Config->ZHazardplt = hasZOption(Args, "hazardplt"); + Config->ZIfuncnoplt = hasZOption(Args, "ifunc-noplt"); Config->ZInitfirst = hasZOption(Args, "initfirst"); + Config->ZInterpose = hasZOption(Args, "interpose"); Config->ZKeepTextSectionPrefix = getZFlag( - Args, "keep-text-section-prefix", "nokeep-text-section-prefix", false); -Index: tools/lld/ELF/Relocations.cpp -=================================================================== ---- tools/lld/ELF/Relocations.cpp (revision 338296) -+++ tools/lld/ELF/Relocations.cpp (revision 338297) -@@ -366,6 +366,10 @@ static bool isStaticLinkTimeConstant(RelExpr E, Re - R_TLSLD_HINT>(E)) +--- tools/lld/ELF/Relocations.cpp.orig 2019-01-17 13:47:57.000000000 +0000 ++++ tools/lld/ELF/Relocations.cpp 2019-04-09 17:38:19.651286000 +0100 +@@ -381,6 +381,10 @@ static bool isStaticLinkTimeConstant(Rel + R_TLSLD_HINT, R_TLSIE_HINT>(E)) return true; + // The computation involves output from the ifunc resolver. @@ -54,38 +48,37 @@ Index: tools/lld/ELF/Relocations.cpp + // These never do, except if the entire file is position dependent or if // only the low bits are used. - if (E == R_GOT || E == R_PLT || E == R_TLSDESC) -@@ -816,6 +820,10 @@ static void processRelocAux(InputSectionBase &Sec, + if (E == R_GOT || E == R_GOT_PLT || E == R_PLT || E == R_TLSDESC) +@@ -844,6 +848,10 @@ static void processRelocAux(InputSection Sec.Relocations.push_back({Expr, Type, Offset, Addend, &Sym}); return; } + if (Sym.isGnuIFunc() && Config->ZIfuncnoplt) { -+ InX::RelaDyn->addReloc(Type, &Sec, Offset, &Sym, Addend, R_ADDEND, Type); ++ In.RelaDyn->addReloc(Type, &Sec, Offset, &Sym, Addend, R_ADDEND, Type); + return; + } bool CanWrite = (Sec.Flags & SHF_WRITE) || !Config->ZText; if (CanWrite) { // R_GOT refers to a position in the got, even if the symbol is preemptible. -@@ -985,7 +993,7 @@ static void scanReloc(InputSectionBase &Sec, Offse +@@ -1012,7 +1020,7 @@ static void scanReloc(InputSectionBase & // all dynamic symbols that can be resolved within the executable will // actually be resolved that way at runtime, because the main exectuable // is always at the beginning of a search list. We can leverage that fact. -- if (Sym.isGnuIFunc()) -+ if (Sym.isGnuIFunc() && !Config->ZIfuncnoplt) - Expr = toPlt(Expr); - else if (!Sym.IsPreemptible && Expr == R_GOT_PC && !isAbsoluteValue(Sym)) - Expr = Target->adjustRelaxExpr(Type, RelocatedAddr, Expr); -Index: tools/lld/ELF/Writer.cpp -=================================================================== ---- tools/lld/ELF/Writer.cpp (revision 338296) -+++ tools/lld/ELF/Writer.cpp (revision 338297) -@@ -1561,8 +1561,11 @@ template void Writer::finalizeS - applySynthetic({InX::EhFrame}, - [](SyntheticSection *SS) { SS->finalizeContents(); }); +- if (Sym.isGnuIFunc()) { ++ if (Sym.isGnuIFunc() && !Config->ZIfuncnoplt) { + if (!Config->ZText && Config->WarnIfuncTextrel) { + warn("using ifunc symbols when text relocations are allowed may produce " + "a binary that will segfault, if the object file is linked with " +--- tools/lld/ELF/Writer.cpp.orig 2019-01-15 18:30:23.000000000 +0000 ++++ tools/lld/ELF/Writer.cpp 2019-04-09 17:45:06.700098000 +0100 +@@ -1651,9 +1651,12 @@ template void Writer: + // earlier. + finalizeSynthetic(In.EhFrame); - for (Symbol *S : Symtab->getSymbols()) + for (Symbol *S : Symtab->getSymbols()) { - S->IsPreemptible |= computeIsPreemptible(*S); + if (!S->IsPreemptible) + S->IsPreemptible = computeIsPreemptible(*S); + if (S->isGnuIFunc() && Config->ZIfuncnoplt) + S->ExportDynamic = true; + }