From owner-svn-src-head@freebsd.org Fri Sep 18 13:12:15 2020 Return-Path: Delivered-To: svn-src-head@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 874E13E3571; Fri, 18 Sep 2020 13:12:15 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (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 "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BtDl3354Vz4Ywt; Fri, 18 Sep 2020 13:12:15 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from mail-qk1-f172.google.com (mail-qk1-f172.google.com [209.85.222.172]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) (Authenticated sender: kevans) by smtp.freebsd.org (Postfix) with ESMTPSA id 4E31E10403; Fri, 18 Sep 2020 13:12:15 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: by mail-qk1-f172.google.com with SMTP id o16so5915693qkj.10; Fri, 18 Sep 2020 06:12:15 -0700 (PDT) X-Gm-Message-State: AOAM531okwi0MCKGZPUDi4GhXoTE7CGn1MWpWVakkeouV8PAU3SKuyc6 3u1s4w7DRY9xpvjj/ZKR4WQthtLPMSQG+fjFcp4= X-Google-Smtp-Source: ABdhPJybpoBETkfBzC0d7YTXU6qnjW5FMmr2SQiQIzOn22a7h7lg6wZskMcyum3psITgHka5OJW6ZCQL9e+sZyIYYLo= X-Received: by 2002:a05:620a:4fb:: with SMTP id b27mr34467887qkh.120.1600434734287; Fri, 18 Sep 2020 06:12:14 -0700 (PDT) MIME-Version: 1.0 References: <202009181122.08IBMYpo032313@repo.freebsd.org> In-Reply-To: <202009181122.08IBMYpo032313@repo.freebsd.org> From: Kyle Evans Date: Fri, 18 Sep 2020 08:12:01 -0500 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r365876 - in head/lib/libarchive: . tests To: Alex Richardson Cc: src-committers , svn-src-all , svn-src-head Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Sep 2020 13:12:15 -0000 On Fri, Sep 18, 2020 at 6:22 AM Alex Richardson 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 > > 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