From nobody Fri Mar 08 08:19:47 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 4TrfGr56LNz5D8Lv; Fri, 8 Mar 2024 08:19:48 +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 4TrfGr1581z4rtP; Fri, 8 Mar 2024 08:19:48 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1709885988; 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=Nrps8a1bNGwXTZ5WYn4drHbf7qYKhFJZCz/spdR8T4A=; b=UP3ak9wnfkubz5q3zRxHQAfE0TY/2YBoUsF+x/oT4MYar7MexVO+SuFdxRbu2AEPngMnPz YLcxgBZVj2lZ5NRgYMXWABCp28QoPm2slJYlZZ9mMwMFa5dYOzOv8LEofI45onzDP4Qau8 xf24JMGe5ZU5Q3xBxlc8w8Er+k4a7uXsAm42nGl+Q0U8bnYkIigxL4xAge6KBR0OE81Ged HVzHn+Mr6E1CSMI2S6Ym4P2kQSBOYZDH0syE8f7d6NCxPrrpjLSnU/LC0onqilmbrfiLYt b4xA/2qbPca5wAP40KmzzW3W0ozZNsVi/ZxXQv3MsfvJs5Ej/akaPJOnesTLzg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1709885988; a=rsa-sha256; cv=none; b=hUUFybA9eTSGOW8j5vyGZISwubcER0k+PoIklLEJUDVnyhpMhcNcgeV4lbDlyd3+40ZNBd DEES6La/KH8DFYC9I4KLqRzkEWPC+IDhAbeTWoM8fg1fGuErkWZXsi8vjYhibosDbiWkbN dLoRQNNIgY0gVKK2p8QkskCUHC732SApinaLA3e9opCfcBIpLwUAcBW8P2iVQewyy9dVZ4 3eBW3ZIx/NAI94NaODtUXUn97X8YDrlLgPciJnGhZeyEixJcXTQ4lfRgJfBNBZwKbA7tdE lIJXkUgxnU/j8OcSTMluiZPhYIEZ7p31rpftH96XDTq3kWJYkcQN0GWtYLtJpQ== 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=1709885988; 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=Nrps8a1bNGwXTZ5WYn4drHbf7qYKhFJZCz/spdR8T4A=; b=xLaAmprcQdeqUsKLuOZu8ySR2CIRpvai2D7eYJ4ppq6jqD2j6wifndUeIi0MZZ0lYJKJ8a 2maOsjjioWRYKhbC6B5e4q8XFTNWHxdplKAfq3I79vO+YtNyB1p6xvJa9wRHnPl09fh4sc tBaLO5zu2tcY2ES8te5Fkp1hjOXhjYw9FnIAqkNm4F8s+tA5MbSduoOJpKfEK5jOLDZubR Mde7ZOl9o6cf1/0h4qm+1dg2HgJFP/ZMcgVbzY6uG8U2eIehq4Bk8hZPs0FeOL52EribhM HkNno1C1TqFsbAPPbAN8pERGRco+EwBDd4fZWFfpmHrPW0HY/UPA/4Dy9YBTqQ== 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 4TrfGr0Xy0z194J; Fri, 8 Mar 2024 08:19:48 +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 4288JlWZ061801; Fri, 8 Mar 2024 08:19:47 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 4288Jlen061798; Fri, 8 Mar 2024 08:19:47 GMT (envelope-from git) Date: Fri, 8 Mar 2024 08:19:47 GMT Message-Id: <202403080819.4288Jlen061798@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: f5fca73651a3 - stable/13 - 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/13 X-Git-Reftype: branch X-Git-Commit: f5fca73651a39dd75683c0f2374ac2cb0d11e670 Auto-Submitted: auto-generated The branch stable/13 has been updated by dim: URL: https://cgit.FreeBSD.org/src/commit/?id=f5fca73651a39dd75683c0f2374ac2cb0d11e670 commit f5fca73651a39dd75683c0f2374ac2cb0d11e670 Author: Dimitry Andric AuthorDate: 2024-02-11 19:02:51 +0000 Commit: Dimitry Andric CommitDate: 2024-03-08 08:19:05 +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 0a2ae8f6b802..75d3b7c14507 100644 --- a/lib/clang/Makefile.inc +++ b/lib/clang/Makefile.inc @@ -1,12 +1,14 @@ -.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 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 9aab6fc459c1..181b4fea466d 100644 --- a/share/man/man5/src.conf.5 +++ b/share/man/man5/src.conf.5 @@ -1,6 +1,6 @@ .\" DO NOT EDIT-- this file is @generated by tools/build/options/makeman. .\" $FreeBSD$ -.Dd September 24, 2023 +.Dd March 8, 2024 .Dt SRC.CONF 5 .Os .Sh NAME @@ -916,6 +916,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 3add35bc07c3..811b0a493d50 100644 --- a/share/mk/src.opts.mk +++ b/share/mk/src.opts.mk @@ -210,6 +210,7 @@ __DEFAULT_NO_OPTIONS = \ LOADER_FIREWIRE \ LOADER_VERBOSE \ LOADER_VERIEXEC_PASS_MANIFEST \ + LLVM_FULL_DEBUGINFO \ OFED_EXTRA \ OPENLDAP \ RPCBIND_WARMSTART_SUPPORT \ 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 8fb62b876678..8f6b098de2d4 100644 --- a/usr.bin/clang/Makefile.inc +++ b/usr.bin/clang/Makefile.inc @@ -1,15 +1,17 @@ -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 .if ${MACHINE_ARCH:Mmips*} && ${MACHINE_ARCH:Mmips64*} == "" CFLAGS+= -mxgot