Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 23 Dec 2021 02:28:48 -0600
From:      Kyle Evans <kevans@freebsd.org>
To:        Alex Richardson <arichardson@freebsd.org>
Cc:        src-committers <src-committers@freebsd.org>,  "<dev-commits-src-all@freebsd.org>" <dev-commits-src-all@freebsd.org>, dev-commits-src-main@freebsd.org
Subject:   Re: git: 7bc797e3f380 - main - Add build system support for ASAN+UBSAN instrumentation
Message-ID:  <CACNAnaHEDmKtH9iFgg4mT3tihnMrV9okMOx2Mcg3b1pgp%2BJoNA@mail.gmail.com>
In-Reply-To: <202108021335.172DZ5xV050547@gitrepo.freebsd.org>
References:  <202108021335.172DZ5xV050547@gitrepo.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Mon, Aug 2, 2021 at 8:35 AM Alex Richardson <arichardson@freebsd.org> wrote:
>
> The branch main has been updated by arichardson:
>
> URL: https://cgit.FreeBSD.org/src/commit/?id=7bc797e3f3807660cf98e5b1bd63545cafe820f8
>
> commit 7bc797e3f3807660cf98e5b1bd63545cafe820f8
> Author:     Alex Richardson <arichardson@FreeBSD.org>
> AuthorDate: 2021-08-02 08:48:21 +0000
> Commit:     Alex Richardson <arichardson@FreeBSD.org>
> CommitDate: 2021-08-02 13:33:24 +0000
>
>     Add build system support for ASAN+UBSAN instrumentation
>
>     This adds two new options WITH_ASAN/WITH_UBSAN that can be set to
>     enable instrumentation of all binaries with AddressSanitizer and/or
>     UndefinedBehaviourSanitizer. This current patch is almost sufficient
>     to get a complete buildworld with sanitizer instrumentation but in
>     order to actually build and boot a system it depends on a few more
>     follow-up commits.
>
>     Reviewed By:    brooks, kib, markj
>     Differential Revision: https://reviews.freebsd.org/D31043
> [...]
> --- a/share/mk/sys.mk
> +++ b/share/mk/sys.mk
> @@ -242,7 +242,7 @@ LFLAGS              ?=
>  # compiler driver flags (e.g. -mabi=*) that conflict with flags to LD.
>  LD             ?=      ld
>  LDFLAGS                ?=
> -_LDFLAGS       =       ${LDFLAGS:S/-Wl,//g:N-mabi=*:N-fuse-ld=*:N--ld-path=*}
> +_LDFLAGS       =       ${LDFLAGS:S/-Wl,//g:N-mabi=*:N-fuse-ld=*:N--ld-path=*:N-fsanitize=*:N-fno-sanitize=*}
>
>  MAKE           ?=      make
>

I know you're just the one that touched it last, but would it be any
easier to enumerate what we *can* pass to the linker from LDFLAGS
rather than what we can't? Now we need to add :N-flto* to this, and I
wonder what else we're going to wind up stumbling across as time goes
on.

Thanks,

Kyle Evans



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CACNAnaHEDmKtH9iFgg4mT3tihnMrV9okMOx2Mcg3b1pgp%2BJoNA>