From nobody Fri Feb 16 23:20:30 2024 X-Original-To: dev-commits-src-main@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 4Tc7Fq1VR9z59yJm; Fri, 16 Feb 2024 23:20:31 +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 4Tc7Fq0tqgz4hXw; Fri, 16 Feb 2024 23:20:31 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708125631; 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=qeyzyD5kI9h8u7tHoJAMac8GF2F3jqG+FRHrfEQulYE=; b=DgBuVHwnbXP1yqfP1sDA8v7Ta3NRmHxdJXL1XfbdXbU+MOjezXc8LhaDIyPr/xge9EqMJN OxGmHWhZ/SA/19AiNI+y5om76GQFOuFrHm6vRBtXa2O2fkw6VwPAtwo93XVJQ/B6UwGFlq CRmrAMxwTg1d8oLHYm1EU9heP8ieHxn7QF3nzrRLO1ff6RkQAKyw3z/iWRQ2rGf/95QI1z RemCpTj0nZbjDIOGb3MPoxFJk51iyZ+0P8j/JFFa8o6J70luuLLQnXV27v8qRJxUkGzeQL VoW+ywzAVXNsIccuCaHw6eoKt+/tUtS9lLKd1cbBjkWaJNf+aFKE1WSrAAOv3Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708125631; 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=qeyzyD5kI9h8u7tHoJAMac8GF2F3jqG+FRHrfEQulYE=; b=Ju1/BnONEKh1zD50ePmxb77sloGn+ATvw1vGulLytjYsph4YueLZch8kbmfQS7VW8mc8us YqfLLZyqvd2MrAgas77ojQr+bOvrBngFG44UDISP/LaQvwPPQJkzpkr9OUvUtGvAEy7mUY Ndl3/uOsEFdaQsMMKOtH65hj5vkix1imMQJ3RdMZwIQ4CA9VZObz5y+tidVX5O3+qvt2zc eZVqUemilhD0bXyz4LVQwbdZn894NSEmzxGmEoqMWGtGWV4LwRj4gFeiuE5nEDP46nKIwB O2EyBlyhKVRHuBxw9bkN329gWrHaiYOpIzIkaQK/f6BvB+S0ZpPnPvnPaVU29g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1708125631; a=rsa-sha256; cv=none; b=rIj7bhfgZAODY+6KhM9bTpaGELzFpdwY16WN4uAfJb+I4sm4qiBMBimsRkusrXZG7gNZya 9U/T+C+JOdkWUmaSG8Bpu0jUshQrrvC8CVvg0GFuGi752IE5ov6/hF7tE+yQuBlgNPWZfk kricHmkc4IahKvDKdTvp4vIdUovyYnQm1bP4mNhsZTV4l+yEzUNtQDc6/fpCzYxj8SjwT1 jVWFu41XqF8lMJNPBJ7+Ht+1gh3iJJP6S/Ke+Bju77cxFaw2JynqaYjqj1PGcL05VTRL57 W4+w8G9CTgAwSz4cCcH3OYgpQZlJppDDzyQ+mYgI5F4n66CTqz+iRuNgzsvFHA== 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 4Tc7Fp5nRbzl27; Fri, 16 Feb 2024 23:20:30 +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 41GNKUgF075493; Fri, 16 Feb 2024 23:20:30 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 41GNKUm3075490; Fri, 16 Feb 2024 23:20:30 GMT (envelope-from git) Date: Fri, 16 Feb 2024 23:20:30 GMT Message-Id: <202402162320.41GNKUm3075490@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Dimitry Andric Subject: git: 73ff7384e025 - main - Optionally create full debuginfo for llvm-related executables List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@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/main X-Git-Reftype: branch X-Git-Commit: 73ff7384e025033abc98fd5437a48beb8077a90b Auto-Submitted: auto-generated The branch main has been updated by dim: URL: https://cgit.FreeBSD.org/src/commit/?id=73ff7384e025033abc98fd5437a48beb8077a90b commit 73ff7384e025033abc98fd5437a48beb8077a90b Author: Dimitry Andric AuthorDate: 2024-02-11 19:02:51 +0000 Commit: Dimitry Andric CommitDate: 2024-02-16 23:15:32 +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 --- 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 e6affc81ab9c..a32b267afeb4 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 November 13, 2023 +.Dd February 16, 2024 .Dt SRC.CONF 5 .Os .Sh NAME @@ -929,6 +929,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 cf7f3f7dffa7..20c98cf45567 100644 --- a/share/mk/src.opts.mk +++ b/share/mk/src.opts.mk @@ -205,6 +205,7 @@ __DEFAULT_NO_OPTIONS = \ LOADER_VERBOSE \ LOADER_VERIEXEC_PASS_MANIFEST \ 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"