From owner-dev-commits-src-all@freebsd.org Mon Aug 2 13:35:08 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 7AE5C673FEF; Mon, 2 Aug 2021 13:35:08 +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 4GdfBh2rJzz4RYp; Mon, 2 Aug 2021 13:35:08 +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 3A1FB20729; Mon, 2 Aug 2021 13:35:08 +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 172DZ8Xq050596; Mon, 2 Aug 2021 13:35:08 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 172DZ8ln050595; Mon, 2 Aug 2021 13:35:08 GMT (envelope-from git) Date: Mon, 2 Aug 2021 13:35:08 GMT Message-Id: <202108021335.172DZ8ln050595@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Alex Richardson Subject: git: c826e08841fb - main - Fix MK_TESTS build with MK_ASAN/MK_UBSAN MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: arichardson X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: c826e08841fbcc0ba0c5a78aa09d6ee22a95f2f9 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: Mon, 02 Aug 2021 13:35:08 -0000 The branch main has been updated by arichardson: URL: https://cgit.FreeBSD.org/src/commit/?id=c826e08841fbcc0ba0c5a78aa09d6ee22a95f2f9 commit c826e08841fbcc0ba0c5a78aa09d6ee22a95f2f9 Author: Alex Richardson AuthorDate: 2021-08-02 08:49:50 +0000 Commit: Alex Richardson CommitDate: 2021-08-02 13:33:24 +0000 Fix MK_TESTS build with MK_ASAN/MK_UBSAN Reviewed By: markj Differential Revision: https://reviews.freebsd.org/D31049 --- tests/sys/capsicum/Makefile | 6 ++++++ usr.sbin/rpcbind/tests/Makefile | 8 ++++++++ 2 files changed, 14 insertions(+) diff --git a/tests/sys/capsicum/Makefile b/tests/sys/capsicum/Makefile index ded91803cf8a..1d2543b2ef4d 100644 --- a/tests/sys/capsicum/Makefile +++ b/tests/sys/capsicum/Makefile @@ -43,6 +43,12 @@ PROGS+= $p NO_SHARED.$p= SRCS.$p= mini-me.c .endfor +.if ${MK_ASAN} != "no" || ${MK_UBSAN} != "no" +# mini-me.o is linked into a static binary so we can't use sanitizers. +# Note: We have to set CFLAGS here since it will be built as part of +# _PROGS_COMMON_OBJS and therefore NO_SHARED.$p does not disable ASAN/UBSAN. +CFLAGS.mini-me.c+= -fno-sanitize=address -fno-sanitize=undefined +.endif BINDIR= ${TESTSDIR} diff --git a/usr.sbin/rpcbind/tests/Makefile b/usr.sbin/rpcbind/tests/Makefile index 515214763421..dae57a29fda7 100644 --- a/usr.sbin/rpcbind/tests/Makefile +++ b/usr.sbin/rpcbind/tests/Makefile @@ -14,4 +14,12 @@ CFLAGS+= -DINET6 WARNS?= 3 +.if ${MK_ASAN} != "no" +# Work around "error: duplicate symbol: getifaddrs" when building with ASAN. +# The ASAN interceptors also define getifaddrs, but we want to prefer the local +# stub symbol here, so using a shared sanitizer runtime moves the local +# definition first in the symbol resolution order. +LDFLAGS+=-shared-libasan +.endif + .include