From owner-dev-commits-src-all@freebsd.org Mon Jun 28 16:30:11 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2A705658B10; Mon, 28 Jun 2021 16:30:11 +0000 (UTC) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: from gndrsh.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4GDCkp5fT8z3jL9; Mon, 28 Jun 2021 16:30:10 +0000 (UTC) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: from gndrsh.dnsmgr.net (localhost [127.0.0.1]) by gndrsh.dnsmgr.net (8.13.3/8.13.3) with ESMTP id 15SGU2pX097042; Mon, 28 Jun 2021 09:30:02 -0700 (PDT) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: (from freebsd@localhost) by gndrsh.dnsmgr.net (8.13.3/8.13.3/Submit) id 15SGU2j0097041; Mon, 28 Jun 2021 09:30:02 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <202106281630.15SGU2j0097041@gndrsh.dnsmgr.net> Subject: Re: git: b762974cf4b9 - main - clang: stop linking _p libs for -pg as of FreeBSD 14 In-Reply-To: <202106271712.15RHConb019042@gitrepo.freebsd.org> To: Ed Maste Date: Mon, 28 Jun 2021 09:30:02 -0700 (PDT) CC: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-Rspamd-Queue-Id: 4GDCkp5fT8z3jL9 X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Jun 2021 16:30:11 -0000 > The branch main has been updated by emaste: > > URL: https://cgit.FreeBSD.org/src/commit/?id=b762974cf4b9ea77f1decf4a6d829372f0a97f75 > > commit b762974cf4b9ea77f1decf4a6d829372f0a97f75 > Author: Ed Maste > AuthorDate: 2021-06-26 23:58:16 +0000 > Commit: Ed Maste > CommitDate: 2021-06-27 17:12:12 +0000 > > clang: stop linking _p libs for -pg as of FreeBSD 14 > > In FreeBSD 14 we will stop providing _p libraries (compiled with -pg). So if this is being done in 14 only, why is there a MFC marker? Should that of been MFC: never? > Reviewed by: dim (upstream) > Obtained from: LLVM 699d47472c3f > MFC after: 2 weeks > Sponsored by: The FreeBSD Foundation > Differential Revision: https://reviews.freebsd.org/D30861 > --- > .../clang/lib/Driver/ToolChains/FreeBSD.cpp | 17 ++++++++++------- > 1 file changed, 10 insertions(+), 7 deletions(-) > > diff --git a/contrib/llvm-project/clang/lib/Driver/ToolChains/FreeBSD.cpp b/contrib/llvm-project/clang/lib/Driver/ToolChains/FreeBSD.cpp > index 37c0a68234ed..652e5c4cb9e6 100644 > --- a/contrib/llvm-project/clang/lib/Driver/ToolChains/FreeBSD.cpp > +++ b/contrib/llvm-project/clang/lib/Driver/ToolChains/FreeBSD.cpp > @@ -293,6 +293,8 @@ void freebsd::Linker::ConstructJob(Compilation &C, const JobAction &JA, > addLinkerCompressDebugSectionsOption(ToolChain, Args, CmdArgs); > AddLinkerInputs(ToolChain, Inputs, Args, CmdArgs, JA); > > + bool Profiling = Args.hasArg(options::OPT_pg) && > + ToolChain.getTriple().getOSMajorVersion() < 14; > if (!Args.hasArg(options::OPT_nostdlib, options::OPT_nodefaultlibs)) { > // Use the static OpenMP runtime with -static-openmp > bool StaticOpenMP = Args.hasArg(options::OPT_static_openmp) && > @@ -302,7 +304,7 @@ void freebsd::Linker::ConstructJob(Compilation &C, const JobAction &JA, > if (D.CCCIsCXX()) { > if (ToolChain.ShouldLinkCXXStdlib(Args)) > ToolChain.AddCXXStdlibLibArgs(Args, CmdArgs); > - if (Args.hasArg(options::OPT_pg)) > + if (Profiling) > CmdArgs.push_back("-lm_p"); > else > CmdArgs.push_back("-lm"); > @@ -313,13 +315,13 @@ void freebsd::Linker::ConstructJob(Compilation &C, const JobAction &JA, > linkXRayRuntimeDeps(ToolChain, CmdArgs); > // FIXME: For some reason GCC passes -lgcc and -lgcc_s before adding > // the default system libraries. Just mimic this for now. > - if (Args.hasArg(options::OPT_pg)) > + if (Profiling) > CmdArgs.push_back("-lgcc_p"); > else > CmdArgs.push_back("-lgcc"); > if (Args.hasArg(options::OPT_static)) { > CmdArgs.push_back("-lgcc_eh"); > - } else if (Args.hasArg(options::OPT_pg)) { > + } else if (Profiling) { > CmdArgs.push_back("-lgcc_eh_p"); > } else { > CmdArgs.push_back("--as-needed"); > @@ -328,13 +330,13 @@ void freebsd::Linker::ConstructJob(Compilation &C, const JobAction &JA, > } > > if (Args.hasArg(options::OPT_pthread)) { > - if (Args.hasArg(options::OPT_pg)) > + if (Profiling) > CmdArgs.push_back("-lpthread_p"); > else > CmdArgs.push_back("-lpthread"); > } > > - if (Args.hasArg(options::OPT_pg)) { > + if (Profiling) { > if (Args.hasArg(options::OPT_shared)) > CmdArgs.push_back("-lc"); > else > @@ -347,7 +349,7 @@ void freebsd::Linker::ConstructJob(Compilation &C, const JobAction &JA, > > if (Args.hasArg(options::OPT_static)) { > CmdArgs.push_back("-lgcc_eh"); > - } else if (Args.hasArg(options::OPT_pg)) { > + } else if (Profiling) { > CmdArgs.push_back("-lgcc_eh_p"); > } else { > CmdArgs.push_back("--as-needed"); > @@ -416,7 +418,8 @@ void FreeBSD::addLibStdCxxIncludePaths( > void FreeBSD::AddCXXStdlibLibArgs(const ArgList &Args, > ArgStringList &CmdArgs) const { > CXXStdlibType Type = GetCXXStdlibType(Args); > - bool Profiling = Args.hasArg(options::OPT_pg); > + bool Profiling = > + Args.hasArg(options::OPT_pg) && getTriple().getOSMajorVersion() < 14; > > switch (Type) { > case ToolChain::CST_Libcxx: > -- Rod Grimes rgrimes@freebsd.org