From nobody Fri Mar 08 08:19:26 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TrfGR1ncsz5D8NG; Fri, 8 Mar 2024 08:19:27 +0000 (UTC) (envelope-from git@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) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4TrfGR1FPFz4rZQ; Fri, 8 Mar 2024 08:19:27 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1709885967; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=S6hYSw9nS5LeAmaopmJ2rHev9gSl7Is2iBLfuNwCB1Y=; b=tvvepLVP6WNNrYzUjeYWdLwWjiulHtwS6C42eHV0puqIXEdw76nmpaaTnqhT+Q5dibC5TT Snjp/AyGsF0M5SH0GRLqQRWvAmNC4KehqDHNL3dE9vhCVrNzDYhLVMwIPGWDgCzFrGvW6I tvtu00kyOSThwbMsit9Qw1vPiUdT8NcOWtNR7JH0xXLn/iRrYCr1BXcEbxQY2IrxeA3u1I zxPQpzW3E5Q9ecmm/oWbNg9jXgxu5gWWli5MOTz+Kqw0/YksPEPEajwBveNUTfkO1ib/vu /s7ItkBHMcPeaiBB/ivR/I+1jLKCwtSTeaLx1F35V+8G81hVrmdjodgJChNP7Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1709885967; a=rsa-sha256; cv=none; b=bPYSKg+DGsRgK5QIZ5r2n4xWBIQPSKdIdgVQ0fEd1nyeMpN0S++5srRoMUkwPX3TMnB3Qu Lv3/16OIO5KldXnW7875jk+ejB1leXUJOgAwdzKz0LWgr8zpxS09zymm2F7Z6wvvjH1CeF mhNnScbcIqSRsNm96k4uE3kOdxKG47+mVhZlU123x3z31Bo09H5t31DWgP4Ywv9YhkcmKX jHxWtpV5gH0aj8hEJ/wS/jDu8SU2W8SdXdUbbSQwU2MSfv3xLTS+rELxWtcw2lNqy72jjK M20d91r5RamW2YisO6GSGLBi//kMV8yZ4vjzu7h8hEv1mjP8GIrZbREZuxZ9bQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1709885967; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=S6hYSw9nS5LeAmaopmJ2rHev9gSl7Is2iBLfuNwCB1Y=; b=BCbsPOuq0JbeKGZeknxnBQLlk8LPuuYa1GkA2Rui8ltuqnz8YPS+ArsTcsbg60x6taMjRN 0WRrtObvhIw5iaHdn1YLTBaXELxNMhdOj+Skotv4/POoAcgoG1CT6s/5x0WX+7lsFZNfkW g0HuIR1H4/7ycj0a//iSp9ExwqX2+8n9wi7221GGC+lgHmgfUem1o6baboTGva6TFky3xQ rc2QT7Dh/xgtWzrmQCl8T7V4/az5CLhVRLfjLqItKOAME8Mp7Z+aIpxo2KT/YChbr7qOER lj6ftRQSbfP0/jX0ACxORlkfce4oQ1cVT+NQ9wr3wCRCx9AIW8inEglVABCjYQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TrfGR0Xqrz19N1; Fri, 8 Mar 2024 08:19:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 4288JQex061544; Fri, 8 Mar 2024 08:19:26 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 4288JQuA061541; Fri, 8 Mar 2024 08:19:26 GMT (envelope-from git) Date: Fri, 8 Mar 2024 08:19:26 GMT Message-Id: <202403080819.4288JQuA061541@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dimitry Andric Subject: git: c4149abc5d0e - stable/14 - Optionally create full debuginfo for llvm-related executables List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dim X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: c4149abc5d0ea1cd7ecf3b39c0b881483edab2d0 Auto-Submitted: auto-generated The branch stable/14 has been updated by dim: URL: https://cgit.FreeBSD.org/src/commit/?id=c4149abc5d0ea1cd7ecf3b39c0b881483edab2d0 commit c4149abc5d0ea1cd7ecf3b39c0b881483edab2d0 Author: Dimitry Andric AuthorDate: 2024-02-11 19:02:51 +0000 Commit: Dimitry Andric CommitDate: 2024-03-08 08:15:34 +0000 Optionally create full debuginfo for llvm-related executables Commit de6feefdb7cfd limited the amount of debuginfo generated for clang and other llvm-related executables. This was done to save disk space and memory during building, but it makes debugging any of these executables much harder. Add a new src.conf(5) setting, WITH_LLVM_FULL_DEBUGINFO, to generate full debuginfo instead. This is off by default, but could for example be enabled for release builds or snapshots, so llvm executables are easier to debug. Reviewed by: emaste MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D43839 (cherry picked from commit 73ff7384e025033abc98fd5437a48beb8077a90b) --- lib/clang/Makefile.inc | 4 +++- lib/clang/headers/Makefile | 1 + lib/clang/libclang/Makefile | 2 +- lib/clang/libclangminimal/Makefile | 1 + lib/clang/liblldb/Makefile | 1 + lib/clang/libllvm/Makefile | 2 +- lib/clang/libllvmminimal/Makefile | 1 + share/man/man5/src.conf.5 | 5 ++++- share/mk/src.opts.mk | 1 + tools/build/options/WITH_LLVM_FULL_DEBUGINFO | 2 ++ usr.bin/clang/Makefile.inc | 8 +++++--- 11 files changed, 21 insertions(+), 7 deletions(-) diff --git a/lib/clang/Makefile.inc b/lib/clang/Makefile.inc index 2dfc966726b0..37da7ac759b1 100644 --- a/lib/clang/Makefile.inc +++ b/lib/clang/Makefile.inc @@ -1,13 +1,15 @@ -.include +.include PACKAGE= clang MK_PIE:= no # Explicit libXXX.a references +.if ${MK_LLVM_FULL_DEBUGINFO} == "no" .if ${COMPILER_TYPE} == "clang" DEBUG_FILES_CFLAGS= -gline-tables-only .else DEBUG_FILES_CFLAGS= -g1 .endif +.endif WARNS?= 0 diff --git a/lib/clang/headers/Makefile b/lib/clang/headers/Makefile index 49f78b0a4d97..f72567514f20 100644 --- a/lib/clang/headers/Makefile +++ b/lib/clang/headers/Makefile @@ -1,4 +1,5 @@ +.include .include "../clang.pre.mk" .PATH: ${CLANG_SRCS}/lib/Headers diff --git a/lib/clang/libclang/Makefile b/lib/clang/libclang/Makefile index 51c209d879f1..8d911905808d 100644 --- a/lib/clang/libclang/Makefile +++ b/lib/clang/libclang/Makefile @@ -1,5 +1,5 @@ -.include +.include .include "../clang.pre.mk" LIB= clang diff --git a/lib/clang/libclangminimal/Makefile b/lib/clang/libclangminimal/Makefile index 744e1a835f90..22faa7b98aeb 100644 --- a/lib/clang/libclangminimal/Makefile +++ b/lib/clang/libclangminimal/Makefile @@ -1,4 +1,5 @@ +.include .include "../clang.pre.mk" LIB= clangminimal diff --git a/lib/clang/liblldb/Makefile b/lib/clang/liblldb/Makefile index c32e4a387b2e..e6e1e638abce 100644 --- a/lib/clang/liblldb/Makefile +++ b/lib/clang/liblldb/Makefile @@ -1,4 +1,5 @@ +.include .include "../lldb.pre.mk" LIB= lldb diff --git a/lib/clang/libllvm/Makefile b/lib/clang/libllvm/Makefile index df39f2eb212e..b59d881ad99a 100644 --- a/lib/clang/libllvm/Makefile +++ b/lib/clang/libllvm/Makefile @@ -1,5 +1,5 @@ -.include +.include .include "../llvm.pre.mk" LIB= llvm diff --git a/lib/clang/libllvmminimal/Makefile b/lib/clang/libllvmminimal/Makefile index 83c7101b04f5..ce5535a59072 100644 --- a/lib/clang/libllvmminimal/Makefile +++ b/lib/clang/libllvmminimal/Makefile @@ -1,4 +1,5 @@ +.include .include "../llvm.pre.mk" LIB= llvmminimal diff --git a/share/man/man5/src.conf.5 b/share/man/man5/src.conf.5 index 89070b097f6f..fbd99580ba35 100644 --- a/share/man/man5/src.conf.5 +++ b/share/man/man5/src.conf.5 @@ -1,5 +1,5 @@ .\" DO NOT EDIT-- this file is @generated by tools/build/options/makeman. -.Dd September 21, 2023 +.Dd March 8, 2024 .Dt SRC.CONF 5 .Os .Sh NAME @@ -938,6 +938,9 @@ Do not build the tool. .It Va WITHOUT_LLVM_CXXFILT Install ELF Tool Chain's cxxfilt as c++filt, instead of LLVM's llvm-cxxfilt. +.It Va WITH_LLVM_FULL_DEBUGINFO +Generate full debug information for LLVM libraries and tools, which uses +more disk space and build resources, but allows for easier debugging. .It Va WITHOUT_LLVM_TARGET_AARCH64 Do not build LLVM target support for AArch64. The diff --git a/share/mk/src.opts.mk b/share/mk/src.opts.mk index dd88772fc43b..7b3e8a441229 100644 --- a/share/mk/src.opts.mk +++ b/share/mk/src.opts.mk @@ -207,6 +207,7 @@ __DEFAULT_NO_OPTIONS = \ LOADER_VERIEXEC_PASS_MANIFEST \ LLVM_ASSERTIONS \ LLVM_BINUTILS \ + LLVM_FULL_DEBUGINFO \ MALLOC_PRODUCTION \ OFED_EXTRA \ OPENLDAP \ diff --git a/tools/build/options/WITH_LLVM_FULL_DEBUGINFO b/tools/build/options/WITH_LLVM_FULL_DEBUGINFO new file mode 100644 index 000000000000..4362de9eb762 --- /dev/null +++ b/tools/build/options/WITH_LLVM_FULL_DEBUGINFO @@ -0,0 +1,2 @@ +Generate full debug information for LLVM libraries and tools, which uses +more disk space and build resources, but allows for easier debugging. diff --git a/usr.bin/clang/Makefile.inc b/usr.bin/clang/Makefile.inc index 831cd56a8c25..99e993b57cb2 100644 --- a/usr.bin/clang/Makefile.inc +++ b/usr.bin/clang/Makefile.inc @@ -1,14 +1,16 @@ -WARNS?= 0 - -.include +.include MK_PIE:= no # Explicit libXXX.a references +.if ${MK_LLVM_FULL_DEBUGINFO} == "no" .if ${COMPILER_TYPE} == "clang" DEBUG_FILES_CFLAGS= -gline-tables-only .else DEBUG_FILES_CFLAGS= -g1 .endif +.endif + +WARNS?= 0 .include "../Makefile.inc"