Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 18 Sep 2020 08:12:01 -0500
From:      Kyle Evans <kevans@freebsd.org>
To:        Alex Richardson <arichardson@freebsd.org>
Cc:        src-committers <src-committers@freebsd.org>, svn-src-all <svn-src-all@freebsd.org>,  svn-src-head <svn-src-head@freebsd.org>
Subject:   Re: svn commit: r365876 - in head/lib/libarchive: . tests
Message-ID:  <CACNAnaGgB%2BfZa3TfFrQyinP%2B4oQ4Jx8UkQ=uf7O2MGP7oBO9kA@mail.gmail.com>
In-Reply-To: <202009181122.08IBMYpo032313@repo.freebsd.org>
References:  <202009181122.08IBMYpo032313@repo.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Fri, Sep 18, 2020 at 6:22 AM Alex Richardson <arichardson@freebsd.org> wrote:
>
> Author: arichardson
> Date: Fri Sep 18 11:22:34 2020
> New Revision: 365876
> URL: https://svnweb.freebsd.org/changeset/base/365876
>
> Log:
>   libarchive: fix mismatch between library and test configuration
>
>   I was investigating libarchive test failures on CheriBSD and it turns out
>   we get a reproducible SIGBUS for test_archive_m5, etc. Debugging this shows
>   that libarchive and the tests disagree when it comes to the definition of
>   archive_md5_ctx: libarchive assumes it's the OpenSSL type whereas the test
>   use the libmd type. The latter is not necessarily aligned enough to store
>   a pointer (16 bytes for CHERI RISC-V), so we were crashing when storing
>   EVP_MD_CTX* to an 8-byte-aligned archive_md5_ctx.
>
>   To avoid problems like this in the future, factor out the common compiler
>   flags into a Makefile.inc and include that from the tests Makefile.
>
>   Reviewed By:  lwhsu
>   Differential Revision: https://reviews.freebsd.org/D26469
>
> Added:
>   head/lib/libarchive/Makefile.inc   (contents, props changed)
> Modified:
>   head/lib/libarchive/Makefile
>   head/lib/libarchive/tests/Makefile
>
> [.. snip ..]
> Modified: head/lib/libarchive/tests/Makefile
> ==============================================================================
> --- head/lib/libarchive/tests/Makefile  Fri Sep 18 11:04:16 2020        (r365875)
> +++ head/lib/libarchive/tests/Makefile  Fri Sep 18 11:22:34 2020        (r365876)
> @@ -1,4 +1,5 @@
>  # $FreeBSD$
> +.include <src.opts.mk>
>
>  PACKAGE=       tests
>
> @@ -15,7 +16,7 @@ PROGS+=       libarchive_test
>  CFLAGS+= -I${.CURDIR} -I${.CURDIR:H} -I${.OBJDIR}
>  CFLAGS+= -I${_LIBARCHIVEDIR}/libarchive -I${_LIBARCHIVEDIR}/libarchive/test
>  CFLAGS+= -I${_LIBARCHIVEDIR}/test_utils
> -CFLAGS+= -DHAVE_LIBLZMA=1 -DHAVE_LZMA_H=1
> +.include "../Makefile.inc"
>
>  # Uncomment to link against dmalloc
>  #LDADD+= -L/usr/local/lib -ldmalloc

Is the explicit .include here necessary (e.g. for ordering)? I note
that inclusion of the parent directory's Makefile.inc is already
guaranteed by bsd.init.mk, so this duplicates all the CFLAGS
additions.

Thanks,

Kyle Evans



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CACNAnaGgB%2BfZa3TfFrQyinP%2B4oQ4Jx8UkQ=uf7O2MGP7oBO9kA>