git: 83c20b8a2da0 - main - tests/sys/kern/crc32: Check for SSE4.2 before using it

Alexander Richardson arichardson at freebsd.org
Wed Feb 3 09:25:05 UTC 2021


On Wed, 3 Feb 2021, 08:24 Peter Jeremy, <peter at rulingia.com> wrote:

> On 2021-Feb-02 10:08:27 +0000, Alex Richardson <arichardson at FreeBSD.org>
> wrote:
> >The branch main has been updated by arichardson:
> >
> >URL:
> https://cgit.FreeBSD.org/src/commit/?id=83c20b8a2da04937cf4af127366b3dc92c855784
> ...
> >    Differential Revision: https://reviews.freebsd.org/D28395
> >---
> ...
> >diff --git a/tests/sys/kern/Makefile b/tests/sys/kern/Makefile
> >index 1806d7ce8597..f350b740b7ea 100644
> >--- a/tests/sys/kern/Makefile
> >+++ b/tests/sys/kern/Makefile
> >@@ -56,15 +56,15 @@ NETBSD_ATF_TESTS_C+=       sysv_test
> > CFLAGS.mqueue_test+=  -I${SRCTOP}/tests
> > LIBADD.mqueue_test+=  rt
> >
> >-.if ${MACHINE_ARCH} == "amd64" || \
> >-    ${MACHINE_ARCH} == "i386" || \
> >-    ${MACHINE_CPUARCH} == "aarch64"
> > ATF_TESTS_C+= libkern_crc32
> >+SRCS.libkern_crc32+=  libkern_crc32.c
> >+.PATH: ${SRCTOP}/sys/libkern
> >+SRCS.libkern_crc32+=  gsb_crc32.c
> >+CFLAGS.libkern_crc32+=        -DTESTING
> > .if ${MACHINE_ARCH} == "amd64" || ${MACHINE_ARCH} == "i386"
> >-LDADD.libkern_crc32+= ${SRCTOP}/sys/libkern/x86/crc32_sse42.c
> >-.else
> >-LDADD.libkern_crc32+= ${SRCTOP}/sys/libkern/arm64/crc32c_armv8.S
> >-.endif
> >+SRCS.libkern_crc32+=  ${SRCTOP}/sys/libkern/x86/crc32_sse42.c
> >+.elif ${MACHINE_CPUARCH} == "aarch64"
> >+SRCS.libkern_crc32+=  ${SRCTOP}/sys/libkern/arm64/crc32c_armv8.S
> > .endif
> >
> > # subr_unit.c contains functions whose prototypes lie in headers that
> cannot be
>
> This breaks buildworld with a RO /usr/src for me:
> ...
> ===> tests/sys/kern (all)
> ...
> Building /usr/obj/usr/src/arm64.aarch64/tests/sys/kern/pdeathsig
> (cd /usr/src/tests/sys/kern &&  DEPENDFILE=.depend.libkern_crc32
> NO_SUBDIR=1 make -f /usr/src/tests/sys/kern/Makefile _RECURSING_PROGS=t
> PROG=libkern_crc32 )
> Building /usr/src/sys/libkern/arm64/crc32c_armv8.o
> clang -cc1as: error: unable to open output file
> '/usr/src/sys/libkern/arm64/crc32c_armv8.o': 'Read-only file system'
> *** Error code 1
>
> I do have an (empty)
> /usr/obj/usr/src/arm64.aarch64/tests/sys/kern/usr/src/sys/libkern/arm64
>

Hi,

I have a fix that I'm currently testing and will commit shortly. It seems
the problem is that I changed it from (ab)using LDADD to using SRCS which
defaults to creating the .o file in the same directory as the source.

Alex


More information about the dev-commits-src-all mailing list