Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 4 Jun 2022 12:01:25 GMT
From:      Dimitry Andric <dim@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org
Subject:   git: 36c1a99ff45f - stable/13 - Add several sanitizer ignore lists under /usr/lib/clang
Message-ID:  <202206041201.254C1Prf093959@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch stable/13 has been updated by dim:

URL: https://cgit.FreeBSD.org/src/commit/?id=36c1a99ff45fe279d478a615f8c66aa10b003cea

commit 36c1a99ff45fe279d478a615f8c66aa10b003cea
Author:     Dimitry Andric <dim@FreeBSD.org>
AuthorDate: 2022-05-27 18:23:37 +0000
Commit:     Dimitry Andric <dim@FreeBSD.org>
CommitDate: 2022-06-04 12:00:20 +0000

    Add several sanitizer ignore lists under /usr/lib/clang
    
    Some of the sanitizers from compiler-rt can use ignore lists, which are
    loosely modeled on valgrind's example. Upstream provides default lists
    for AddressSanitizer, CFI, and MemorySanitizer, so install these in the
    expected location, /usr/lib/clang/14.0.3/share.
    
    Reviewed by:    emaste
    MFC after:      2 weeks
    Differential Revision: https://reviews.freebsd.org/D35338
    
    (cherry picked from commit 7b6f5ebef68194c09708abeb6426ca7602b6dab1)
---
 etc/mtree/BSD.usr.dist                   | 2 ++
 lib/libclang_rt/asan/Makefile            | 3 +++
 lib/libclang_rt/cfi/Makefile             | 3 +++
 lib/libclang_rt/compiler-rt-vars.mk      | 1 +
 lib/libclang_rt/msan/Makefile            | 3 +++
 tools/build/mk/OptionalObsoleteFiles.inc | 4 ++++
 6 files changed, 16 insertions(+)

diff --git a/etc/mtree/BSD.usr.dist b/etc/mtree/BSD.usr.dist
index 2c9d793676f7..fc201efb5c26 100644
--- a/etc/mtree/BSD.usr.dist
+++ b/etc/mtree/BSD.usr.dist
@@ -55,6 +55,8 @@
                 lib
                     freebsd
                     ..
+                share
+                    ..
                 ..
             ..
         ..
diff --git a/lib/libclang_rt/asan/Makefile b/lib/libclang_rt/asan/Makefile
index 66641c7e9121..3ad706cd3c9d 100644
--- a/lib/libclang_rt/asan/Makefile
+++ b/lib/libclang_rt/asan/Makefile
@@ -80,4 +80,7 @@ SRCS+=		ubsan/ubsan_init.cpp
 SRCS+=		ubsan/ubsan_monitor.cpp
 SRCS+=		ubsan/ubsan_value.cpp
 
+FILESDIR=	${SANITIZER_SHAREDIR}
+FILES+=		asan/asan_ignorelist.txt
+
 .include <bsd.lib.mk>
diff --git a/lib/libclang_rt/cfi/Makefile b/lib/libclang_rt/cfi/Makefile
index 9910565b2f38..fffd62ab0d3e 100644
--- a/lib/libclang_rt/cfi/Makefile
+++ b/lib/libclang_rt/cfi/Makefile
@@ -36,4 +36,7 @@ SRCS+=		sanitizer_common/sanitizer_thread_registry.cpp
 SRCS+=		sanitizer_common/sanitizer_tls_get_addr.cpp
 SRCS+=		sanitizer_common/sanitizer_type_traits.cpp
 
+FILESDIR=	${SANITIZER_SHAREDIR}
+FILES+=		cfi/cfi_ignorelist.txt
+
 .include <bsd.lib.mk>
diff --git a/lib/libclang_rt/compiler-rt-vars.mk b/lib/libclang_rt/compiler-rt-vars.mk
index dc89ded251ba..ab97cbb0c0b5 100644
--- a/lib/libclang_rt/compiler-rt-vars.mk
+++ b/lib/libclang_rt/compiler-rt-vars.mk
@@ -1,6 +1,7 @@
 CLANG_SUBDIR=clang/14.0.3
 CLANGDIR=	/usr/lib/${CLANG_SUBDIR}
 SANITIZER_LIBDIR=		${CLANGDIR}/lib/freebsd
+SANITIZER_SHAREDIR=		${CLANGDIR}/share
 
 # armv[67] is a bit special since we allow a soft-floating version via
 # CPUTYPE matching *soft*. This variant may not actually work though.
diff --git a/lib/libclang_rt/msan/Makefile b/lib/libclang_rt/msan/Makefile
index 76e05af7462c..12a6f035d71f 100644
--- a/lib/libclang_rt/msan/Makefile
+++ b/lib/libclang_rt/msan/Makefile
@@ -64,4 +64,7 @@ SRCS+=		ubsan/ubsan_init.cpp
 SRCS+=		ubsan/ubsan_monitor.cpp
 SRCS+=		ubsan/ubsan_value.cpp
 
+FILESDIR=	${SANITIZER_SHAREDIR}
+FILES+=		msan/msan_ignorelist.txt
+
 .include <bsd.lib.mk>
diff --git a/tools/build/mk/OptionalObsoleteFiles.inc b/tools/build/mk/OptionalObsoleteFiles.inc
index 78cc6ee8e126..be20223309b4 100644
--- a/tools/build/mk/OptionalObsoleteFiles.inc
+++ b/tools/build/mk/OptionalObsoleteFiles.inc
@@ -1551,6 +1551,10 @@ OLD_FILES+=usr/lib/clang/14.0.3/lib/freebsd/libclang_rt.xray-profiling-x86_64.a
 OLD_FILES+=usr/lib/clang/14.0.3/lib/freebsd/libclang_rt.xray-x86_64.a
 OLD_DIRS+=usr/lib/clang/14.0.3/lib/freebsd
 OLD_DIRS+=usr/lib/clang/14.0.3/lib
+OLD_FILES+=usr/lib/clang/14.0.3/share/asan_ignorelist.txt
+OLD_FILES+=usr/lib/clang/14.0.3/share/cfi_ignorelist.txt
+OLD_FILES+=usr/lib/clang/14.0.3/share/msan_ignorelist.txt
+OLD_DIRS+=usr/lib/clang/14.0.3/share
 OLD_DIRS+=usr/lib/clang/14.0.3
 OLD_DIRS+=usr/lib/clang
 OLD_FILES+=usr/share/doc/llvm/clang/LICENSE.TXT



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