From owner-dev-commits-src-all@freebsd.org Sun Aug 8 17:35:36 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 8318B660AF5; Sun, 8 Aug 2021 17:35:36 +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 4GjRFN3FSwz3HKB; Sun, 8 Aug 2021 17:35:36 +0000 (UTC) (envelope-from git@FreeBSD.org) 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 5692718E09; Sun, 8 Aug 2021 17:35:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 178HZaLY048455; Sun, 8 Aug 2021 17:35:36 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 178HZaUo048454; Sun, 8 Aug 2021 17:35:36 GMT (envelope-from git) Date: Sun, 8 Aug 2021 17:35:36 GMT Message-Id: <202108081735.178HZaUo048454@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ed Maste Subject: git: 47363e99d3d3 - main - Enable compressed debug on little-endian targets MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 47363e99d3d312c510902b68d5cf3094ddc7bb76 Auto-Submitted: auto-generated 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: Sun, 08 Aug 2021 17:35:36 -0000 The branch main has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=47363e99d3d312c510902b68d5cf3094ddc7bb76 commit 47363e99d3d312c510902b68d5cf3094ddc7bb76 Author: Ed Maste AuthorDate: 2021-08-07 14:46:07 +0000 Commit: Ed Maste CommitDate: 2021-08-08 17:31:28 +0000 Enable compressed debug on little-endian targets Compressed debug was enabled by default in commit c910570e7573, but broke the build on big-endian targets, and so was disabled in 89ed2ecb14ce. Older versions of LLD fail with big-endian compressed debug sections. This was fixed in LLD upstream (commit c6ebc651b6fa) and merged to FreeBSD main (commit d69d07569ee2) by dim. External toolchains (e.g. the llvm12 package) will not yet have the fix. These may be used to link against base system .a archives, so compressed debug sections would cause trouble even though the base system is fixed. Enable compressed debug sections again, for little-endian targets only. As discussed on freebsd-hackers[1] I expect to undo this in the future (using compressed debug everywhere), once fixed versions of lld are widely available. Note that to be pedantically correct we should check both the compiler and the linker for compressed debug support, but given the external toolchain constraint the extra complexity does not seem worthwhile. [1] https://lists.freebsd.org/archives/freebsd-hackers/2021-August/000188.html PR: 257638 Reported by: jrtc27 [impact of .a archives] Discussed with: imp Relnotes: Yes Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D31454 Revert "Disable compressed debug by default" This reverts commit 89ed2ecb14ceabc27883282cf96559a9e7d52717. --- share/mk/bsd.compiler.mk | 9 ++++++++- share/mk/bsd.sys.mk | 2 +- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/share/mk/bsd.compiler.mk b/share/mk/bsd.compiler.mk index 681f6ffec14c..757361a566dd 100644 --- a/share/mk/bsd.compiler.mk +++ b/share/mk/bsd.compiler.mk @@ -235,7 +235,14 @@ ${X_}COMPILER_FEATURES+= c++11 c++14 ${X_}COMPILER_FEATURES+= c++17 .endif .if ${${X_}COMPILER_TYPE} == "clang" -${X_}COMPILER_FEATURES+= compressed-debug retpoline init-all +${X_}COMPILER_FEATURES+= retpoline init-all +# PR257638 lld fails with BE compressed debug. Fixed in main but external tool +# chains will initially not have the fix. For now limit the feature to LE +# targets. +.include +.if ${TARGET_ENDIANNESS} == "1234" +${X_}COMPILER_FEATURES+= compressed-debug +.endif .endif .if ${${X_}COMPILER_TYPE} == "clang" && ${${X_}COMPILER_VERSION} >= 100000 || \ (${${X_}COMPILER_TYPE} == "gcc" && ${${X_}COMPILER_VERSION} >= 80100) diff --git a/share/mk/bsd.sys.mk b/share/mk/bsd.sys.mk index 031d49bbaca2..a964cf6e596c 100644 --- a/share/mk/bsd.sys.mk +++ b/share/mk/bsd.sys.mk @@ -247,7 +247,7 @@ CFLAGS+= ${SSP_CFLAGS} # Additional flags passed in CFLAGS and CXXFLAGS when MK_DEBUG_FILES is # enabled. -DEBUG_FILES_CFLAGS?= -g +DEBUG_FILES_CFLAGS?= -g -gz=zlib # Allow user-specified additional warning flags, plus compiler and file # specific flag overrides, unless we've overridden this...