Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 6 Sep 2021 09:25:35 GMT
From:      Alex Richardson <arichardson@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org
Subject:   git: 24f586182ff4 - main - Enable MK_LLVM_BINUTILS if MK_ASAN is requested
Message-ID:  <202109060925.1869PZbC046104@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch main has been updated by arichardson:

URL: https://cgit.FreeBSD.org/src/commit/?id=24f586182ff4d0e94a5c17cb542e0bffefb51fa7

commit 24f586182ff4d0e94a5c17cb542e0bffefb51fa7
Author:     Alex Richardson <arichardson@FreeBSD.org>
AuthorDate: 2021-09-06 09:24:33 +0000
Commit:     Alex Richardson <arichardson@FreeBSD.org>
CommitDate: 2021-09-06 09:24:34 +0000

    Enable MK_LLVM_BINUTILS if MK_ASAN is requested
    
    ASan will not be able to provide backtraces with symbol names with
    elftoolchain's addr2line. To fix this turn MK_LLVM_BINUTILS on by
    default when ASan instrumentation is requested.
    
    Reviewed By:    emaste, markj
    Differential Revision: https://reviews.freebsd.org/D31061
---
 share/mk/src.opts.mk | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/share/mk/src.opts.mk b/share/mk/src.opts.mk
index 5363cb6e78f9..28e18260affd 100644
--- a/share/mk/src.opts.mk
+++ b/share/mk/src.opts.mk
@@ -470,6 +470,12 @@ MK_CLANG_FULL:= no
 MK_LLVM_COV:= no
 .endif
 
+.if ${MK_ASAN} == "yes"
+# In order to get sensible backtraces from ASAN we have to install
+# llvm-symbolizer as /usr/bin/addr2line instead of the elftoolchain version.
+MK_LLVM_BINUTILS:=	yes
+.endif
+
 .if ${MK_LLVM_BINUTILS} == "yes"
 # MK_LLVM_CXXFILT is a subset of MK_LLVM_BINUTILS and should therefore be
 # enabled if MK_LLVM_BINUTILS is set.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202109060925.1869PZbC046104>