Date: Thu, 23 May 2019 00:59:05 +0000 (UTC) From: Enji Cooper <ngie@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r348137 - in stable/12: cddl/usr.sbin/zfsd cddl/usr.sbin/zfsd/tests contrib/googletest contrib/mandoc etc/mtree lib lib/clang lib/googletest lib/libc++ lib/libc++experimental lib/libc++... Message-ID: <201905230059.x4N0x5Vx009724@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: ngie Date: Thu May 23 00:59:05 2019 New Revision: 348137 URL: https://svnweb.freebsd.org/changeset/base/348137 Log: Revert r348136 I accidentally committed some unrelated local changes to `.../tests/sys/opencrypto` along with this MFC set. Deleted: stable/12/contrib/googletest/ stable/12/lib/googletest/ stable/12/share/examples/tests/tests/googletest/ stable/12/share/mk/googletest.test.inc.mk stable/12/share/mk/googletest.test.mk stable/12/tools/build/options/WITHOUT_GOOGLETEST Modified: stable/12/cddl/usr.sbin/zfsd/Makefile stable/12/cddl/usr.sbin/zfsd/Makefile.common stable/12/cddl/usr.sbin/zfsd/tests/Makefile stable/12/contrib/mandoc/lib.in stable/12/etc/mtree/BSD.tests.dist stable/12/etc/mtree/BSD.usr.dist stable/12/lib/Makefile stable/12/lib/clang/llvm.build.mk stable/12/lib/libc++/Makefile stable/12/lib/libc++experimental/Makefile stable/12/lib/libc++fs/Makefile stable/12/lib/libc/tests/stdlib/Makefile stable/12/lib/libclang_rt/Makefile.inc stable/12/lib/libcxxrt/Makefile stable/12/lib/libgcc_eh/Makefile.inc stable/12/lib/libomp/Makefile stable/12/lib/ofed/libibnetdisc/Makefile stable/12/share/examples/tests/tests/Makefile stable/12/share/mk/Makefile stable/12/share/mk/bsd.README stable/12/share/mk/bsd.progs.mk stable/12/share/mk/bsd.sys.mk stable/12/share/mk/bsd.test.mk stable/12/share/mk/src.libnames.mk stable/12/share/mk/src.opts.mk stable/12/tests/sys/opencrypto/cryptodev.py stable/12/tests/sys/opencrypto/cryptodevh.py stable/12/tests/sys/opencrypto/cryptotest.py stable/12/tests/sys/opencrypto/runtests.sh stable/12/tools/build/mk/OptionalObsoleteFiles.inc stable/12/usr.bin/dtc/Makefile stable/12/usr.sbin/pmc/Makefile Directory Properties: stable/12/ (props changed) Modified: stable/12/cddl/usr.sbin/zfsd/Makefile ============================================================================== --- stable/12/cddl/usr.sbin/zfsd/Makefile Thu May 23 00:55:28 2019 (r348136) +++ stable/12/cddl/usr.sbin/zfsd/Makefile Thu May 23 00:59:05 2019 (r348137) @@ -1,13 +1,12 @@ # $FreeBSD$ -.include <src.opts.mk> - .include "Makefile.common" PROG_CXX= zfsd MAN= zfsd.8 -HAS_TESTS= -SUBDIR.${MK_GOOGLETEST}+= tests - .include <bsd.prog.mk> + +# The unittests require devel/googletest and devel/googlemock from ports. +# Don't automatically build them. +SUBDIR= Modified: stable/12/cddl/usr.sbin/zfsd/Makefile.common ============================================================================== --- stable/12/cddl/usr.sbin/zfsd/Makefile.common Thu May 23 00:55:28 2019 (r348136) +++ stable/12/cddl/usr.sbin/zfsd/Makefile.common Thu May 23 00:59:05 2019 (r348137) @@ -28,11 +28,12 @@ INCFLAGS+= -I${SRCTOP}/cddl/contrib/opensolaris/lib/li INCFLAGS+= -I${SRCTOP}/sys/cddl/contrib/opensolaris/common/zfs INCFLAGS+= -I${SRCTOP}/sys/cddl/contrib/opensolaris/uts/common INCFLAGS+= -I${SRCTOP}/sys/cddl/contrib/opensolaris/uts/common/fs/zfs -INCFLAGS+= -I${SRCTOP}/cddl/usr.sbin CFLAGS= -g -DNEED_SOLARIS_BOOLEAN ${INCFLAGS} -LIBADD+= devdctl zfs zfs_core util geom bsdxml sbuf nvpair uutil +DPADD= ${LIBDEVDCTL} ${LIBZFS} ${LIBZFS_CORE} ${LIBUTIL} ${LIBGEOM} \ + ${LIBBSDXML} ${LIBSBUF} ${LIBNVPAIR} ${LIBUUTIL} +LIBADD= devdctl zfs zfs_core util geom bsdxml sbuf nvpair uutil cscope: find ${.CURDIR} -type f -a \( -name "*.[ch]" -o -name "*.cc" \) \ Modified: stable/12/cddl/usr.sbin/zfsd/tests/Makefile ============================================================================== --- stable/12/cddl/usr.sbin/zfsd/tests/Makefile Thu May 23 00:55:28 2019 (r348136) +++ stable/12/cddl/usr.sbin/zfsd/tests/Makefile Thu May 23 00:59:05 2019 (r348137) @@ -3,12 +3,30 @@ .include "${.CURDIR}/../Makefile.common" .PATH: ${.CURDIR:H} -GTESTS= zfsd_unittest +PLAIN_TESTS_CXX= zfsd_unittest +SRCS.zfsd_unittest:= ${SRCS:Nzfsd_main.cc} +SRCS.zfsd_unittest+= libmocks.c zfsd_unittest.cc +SRCS= -SRCS.zfsd_unittest:= ${SRCS:Nzfsd_main.cc} -SRCS.zfsd_unittest+= libmocks.c zfsd_unittest.cc -.undef SRCS +# Use #include <zfsd/xxx.h> in test programs. +INCFLAGS+= -I${.CURDIR:H:H} -LIBADD.zfsd_unittest+= gmock_main +.if defined(DESTDIR) || defined(SYSROOT) +INCFLAGS+= -I${SYSROOT:U${DESTDIR}}/usr/include +LDFLAGS.zfsd_unittest+= -L${SYSROOT:U${DESTDIR}}/lib \ + -L${SYSROOT:U${DESTDIR}}/usr/lib +.endif + +# Googletest options +INCFLAGS+= -I${LOCALBASE}/include -D_THREAD_SAFE -pthread +LDFLAGS.zfsd_unittest+= -L${LOCALBASE}/lib -D_THREAD_SAFE -pthread +LDADD.zfsd_unittest+= ${LOCALBASE}/lib/libgtest.a + +# GoogleMock options +LDADD.zfsd_unittest+= ${LOCALBASE}/lib/libgmock.a ${LOCALBASE}/lib/libgmock_main.a + +# Googlemock fails if we don't have this line +# https://groups.google.com/forum/#!msg/googletestframework/h8ixEPCFm0o/amwfu4xGJb0J +CFLAGS.zfsd_unittest+= -DGTEST_HAS_PTHREAD .include <bsd.test.mk> Modified: stable/12/contrib/mandoc/lib.in ============================================================================== --- stable/12/contrib/mandoc/lib.in Thu May 23 00:55:28 2019 (r348136) +++ stable/12/contrib/mandoc/lib.in Thu May 23 00:59:05 2019 (r348137) @@ -62,9 +62,7 @@ LINE("libfsid", "Filesystem Identification Library (l LINE("libftpio", "FTP Connection Management Library (libftpio, \\-lftpio)") LINE("libform", "Curses Form Library (libform, \\-lform)") LINE("libgeom", "Userland API Library for Kernel GEOM subsystem (libgeom, \\-lgeom)") -LINE("libgmock", "GoogleMock library (libgmock, \\-lgmock)") LINE("libgpio", "General-Purpose Input Output (GPIO) library (libgpio, \\-lgpio)") -LINE("libgtest", "GoogleTest library (libgtest, \\-lgtest)") LINE("libhammer", "HAMMER Filesystem Userland Library (libhammer, \\-lhammer)") LINE("libi386", "i386 Architecture Library (libi386, \\-li386)") LINE("libintl", "Internationalized Message Handling Library (libintl, \\-lintl)") Modified: stable/12/etc/mtree/BSD.tests.dist ============================================================================== --- stable/12/etc/mtree/BSD.tests.dist Thu May 23 00:55:28 2019 (r348136) +++ stable/12/etc/mtree/BSD.tests.dist Thu May 23 00:59:05 2019 (r348137) @@ -270,16 +270,6 @@ test-programs .. .. - googletest - gmock - .. - gmock_main - .. - gtest - .. - gtest_main - .. - .. libarchive .. libbe @@ -433,8 +423,6 @@ examples tests atf - .. - googletest .. plain .. Modified: stable/12/etc/mtree/BSD.usr.dist ============================================================================== --- stable/12/etc/mtree/BSD.usr.dist Thu May 23 00:55:28 2019 (r348136) +++ stable/12/etc/mtree/BSD.usr.dist Thu May 23 00:59:05 2019 (r348137) @@ -13,18 +13,6 @@ .. event .. - gmock - internal - custom - .. - .. - .. - gtest - internal - custom - .. - .. - .. sqlite3 .. ucl Modified: stable/12/lib/Makefile ============================================================================== --- stable/12/lib/Makefile Thu May 23 00:55:28 2019 (r348136) +++ stable/12/lib/Makefile Thu May 23 00:59:05 2019 (r348137) @@ -170,7 +170,6 @@ _libcplusplus+= libc++fs .endif SUBDIR.${MK_EFI}+= libefivar -SUBDIR.${MK_GOOGLETEST}+= googletest SUBDIR.${MK_LIBTHR}+= libthr SUBDIR.${MK_LLVM_LIBUNWIND}+= libgcc_eh SUBDIR.${MK_LLVM_LIBUNWIND}+= libgcc_s Modified: stable/12/lib/clang/llvm.build.mk ============================================================================== --- stable/12/lib/clang/llvm.build.mk Thu May 23 00:55:28 2019 (r348136) +++ stable/12/lib/clang/llvm.build.mk Thu May 23 00:59:05 2019 (r348137) @@ -101,7 +101,7 @@ CFLAGS+= -ffunction-sections CFLAGS+= -fdata-sections LDFLAGS+= -Wl,--gc-sections -CXXSTD?= c++11 +CXXFLAGS+= -std=c++11 CXXFLAGS+= -fno-exceptions CXXFLAGS+= -fno-rtti CXXFLAGS.clang+= -stdlib=libc++ Modified: stable/12/lib/libc++/Makefile ============================================================================== --- stable/12/lib/libc++/Makefile Thu May 23 00:55:28 2019 (r348136) +++ stable/12/lib/libc++/Makefile Thu May 23 00:59:05 2019 (r348137) @@ -76,7 +76,9 @@ CFLAGS+= -nostdinc++ CFLAGS+= -nostdlib CFLAGS+= -D_LIBCPP_BUILDING_LIBRARY CFLAGS+= -DLIBCXXRT -CXXSTD?= c++11 +.if empty(CXXFLAGS:M-std=*) +CXXFLAGS+= -std=c++11 +.endif LIBADD+= cxxrt INCSGROUPS= STD EXP EXT Modified: stable/12/lib/libc++experimental/Makefile ============================================================================== --- stable/12/lib/libc++experimental/Makefile Thu May 23 00:55:28 2019 (r348136) +++ stable/12/lib/libc++experimental/Makefile Thu May 23 00:59:05 2019 (r348137) @@ -20,6 +20,8 @@ CXXFLAGS+= -nostdinc++ CXXFLAGS+= -nostdlib CXXFLAGS+= -D_LIBCPP_BUILDING_LIBRARY CXXFLAGS+= -DLIBCXXRT -CXXSTD?= c++14 +.if empty(CXXFLAGS:M-std=*) +CXXFLAGS+= -std=c++14 +.endif .include <bsd.lib.mk> Modified: stable/12/lib/libc++fs/Makefile ============================================================================== --- stable/12/lib/libc++fs/Makefile Thu May 23 00:55:28 2019 (r348136) +++ stable/12/lib/libc++fs/Makefile Thu May 23 00:59:05 2019 (r348137) @@ -22,6 +22,8 @@ CXXFLAGS+= -nostdinc++ CXXFLAGS+= -nostdlib CXXFLAGS+= -D_LIBCPP_BUILDING_LIBRARY CXXFLAGS+= -DLIBCXXRT -CXXSTD?= c++14 +.if empty(CXXFLAGS:M-std=*) +CXXFLAGS+= -std=c++14 +.endif .include <bsd.lib.mk> Modified: stable/12/lib/libc/tests/stdlib/Makefile ============================================================================== --- stable/12/lib/libc/tests/stdlib/Makefile Thu May 23 00:55:28 2019 (r348136) +++ stable/12/lib/libc/tests/stdlib/Makefile Thu May 23 00:59:05 2019 (r348137) @@ -49,8 +49,8 @@ PROGS+= h_getopt h_getopt_long CFLAGS+= -I${.CURDIR} -CXXSTD.cxa_thread_atexit_test= c++11 -CXXSTD.cxa_thread_atexit_nothr_test= c++11 +CXXFLAGS.cxa_thread_atexit_test+= -std=c++11 +CXXFLAGS.cxa_thread_atexit_nothr_test+= -std=c++11 LIBADD.cxa_thread_atexit_test+= pthread .for t in h_getopt h_getopt_long Modified: stable/12/lib/libclang_rt/Makefile.inc ============================================================================== --- stable/12/lib/libclang_rt/Makefile.inc Thu May 23 00:55:28 2019 (r348136) +++ stable/12/lib/libclang_rt/Makefile.inc Thu May 23 00:59:05 2019 (r348137) @@ -41,4 +41,4 @@ CFLAGS+= -funwind-tables CXXFLAGS+= -fvisibility-inlines-hidden CXXFLAGS+= -fvisibility=hidden CFLAGS+= -I${CRTSRC}/lib -CXXSTD= c++11 +CXXFLAGS+= -std=c++11 Modified: stable/12/lib/libcxxrt/Makefile ============================================================================== --- stable/12/lib/libcxxrt/Makefile Thu May 23 00:55:28 2019 (r348136) +++ stable/12/lib/libcxxrt/Makefile Thu May 23 00:59:05 2019 (r348137) @@ -22,7 +22,9 @@ SRCS+= libelftc_dem_gnu3.c\ WARNS= 0 CFLAGS+= -isystem ${SRCDIR} -nostdinc++ -CXXSTD?= c++11 +.if empty(CXXFLAGS:M-std=*) +CXXFLAGS+= -std=c++11 +.endif VERSION_MAP= ${.CURDIR}/Version.map .include <bsd.lib.mk> Modified: stable/12/lib/libgcc_eh/Makefile.inc ============================================================================== --- stable/12/lib/libgcc_eh/Makefile.inc Thu May 23 00:55:28 2019 (r348136) +++ stable/12/lib/libgcc_eh/Makefile.inc Thu May 23 00:59:05 2019 (r348137) @@ -27,8 +27,10 @@ CXXFLAGS.${file}+= -fno-exceptions -funwind-tables .endfor CFLAGS+= -I${UNWINDINCDIR} -I${.CURDIR} -D_LIBUNWIND_IS_NATIVE_ONLY +.if empty(CXXFLAGS:M-std=*) +CXXFLAGS+= -std=c++11 +.endif CXXFLAGS+= -fno-rtti -CXXSTD?= c++11 STATIC_CXXFLAGS+= -fvisibility=hidden -fPIC # Probably need to just move this earlier or use CXXFLAGS .if ${MK_DIRDEPS_BUILD} == "yes" Modified: stable/12/lib/libomp/Makefile ============================================================================== --- stable/12/lib/libomp/Makefile Thu May 23 00:55:28 2019 (r348136) +++ stable/12/lib/libomp/Makefile Thu May 23 00:59:05 2019 (r348137) @@ -53,9 +53,9 @@ CFLAGS+= -I${ITTSRC} CFLAGS+= -ffunction-sections CFLAGS+= -fdata-sections CXXFLAGS+= -fvisibility-inlines-hidden +CXXFLAGS+= -std=c++11 CXXFLAGS+= -fno-exceptions CXXFLAGS+= -fno-rtti -CXXSTD= c++11 LDFLAGS+= -Wl,--warn-shared-textrel LDFLAGS+= -Wl,--gc-sections Modified: stable/12/lib/ofed/libibnetdisc/Makefile ============================================================================== --- stable/12/lib/ofed/libibnetdisc/Makefile Thu May 23 00:55:28 2019 (r348136) +++ stable/12/lib/ofed/libibnetdisc/Makefile Thu May 23 00:59:05 2019 (r348137) @@ -32,7 +32,7 @@ CFLAGS+= -DHAVE_CONFIG_H=1 CFLAGS+= -I${_spath} CFLAGS+= -I${SYSROOT:U${DESTDIR}}/${INCLUDEDIR}/infiniband .if ${COMPILER_FEATURES:Mc++11} -CXXSTD= c++11 +CXXFLAGS+= -std=c++11 .endif VERSION_MAP= ${_spath}/libibnetdisc.map Modified: stable/12/share/examples/tests/tests/Makefile ============================================================================== --- stable/12/share/examples/tests/tests/Makefile Thu May 23 00:55:28 2019 (r348136) +++ stable/12/share/examples/tests/tests/Makefile Thu May 23 00:59:05 2019 (r348137) @@ -1,7 +1,5 @@ # $FreeBSD$ -.include <src.opts.mk> - # Directory into which the Kyuafile provided by this directory will be # installed. # @@ -22,10 +20,6 @@ TESTS_SUBDIRS+= atf TESTS_SUBDIRS+= plain TESTS_SUBDIRS+= tap - -.if ${MK_GOOGLETEST} != no -TESTS_SUBDIRS+= googletest -.endif # We leave KYUAFILE unset so that bsd.test.mk auto-generates a Kyuafile # for us based on the contents of the TESTS_SUBDIRS line above. The Modified: stable/12/share/mk/Makefile ============================================================================== --- stable/12/share/mk/Makefile Thu May 23 00:55:28 2019 (r348136) +++ stable/12/share/mk/Makefile Thu May 23 00:59:05 2019 (r348137) @@ -73,8 +73,6 @@ FILESDIR= ${BINDIR}/mk .if ${MK_TESTS} != "no" FILES+= atf.test.mk -FILES+= googletest.test.inc.mk -FILES+= googletest.test.mk FILES+= plain.test.mk FILES+= suite.test.mk FILES+= tap.test.mk Modified: stable/12/share/mk/bsd.README ============================================================================== --- stable/12/share/mk/bsd.README Thu May 23 00:55:28 2019 (r348136) +++ stable/12/share/mk/bsd.README Thu May 23 00:59:05 2019 (r348137) @@ -649,8 +649,6 @@ ATF_TESTS_CXX The names of the ATF C++ test programs t ATF_TESTS_SH The names of the ATF sh test programs to build. -GTESTS The names of the GoogleTest test programs to build. - KYUAFILE If 'auto' (the default), generate a Kyuafile out of the test programs defined in the Makefile. If 'yes', then a manually-crafted Kyuafile must be supplied with the Modified: stable/12/share/mk/bsd.progs.mk ============================================================================== --- stable/12/share/mk/bsd.progs.mk Thu May 23 00:55:28 2019 (r348136) +++ stable/12/share/mk/bsd.progs.mk Thu May 23 00:59:05 2019 (r348137) @@ -22,8 +22,8 @@ PROGS += ${PROGS_CXX} .if defined(PROG) # just one of many -PROG_OVERRIDE_VARS += BINDIR BINGRP BINOWN BINMODE CSTD CXXSTD DPSRCS MAN \ - NO_SHARED NO_WERROR PROGNAME SRCS STRIP WARNS +PROG_OVERRIDE_VARS += BINDIR BINGRP BINOWN BINMODE DPSRCS MAN NO_WERROR \ + PROGNAME SRCS STRIP WARNS PROG_VARS += CFLAGS CXXFLAGS DEBUG_FLAGS DPADD INTERNALPROG LDADD LIBADD \ LINKS LDFLAGS MLINKS ${PROG_OVERRIDE_VARS} .for v in ${PROG_VARS:O:u} Modified: stable/12/share/mk/bsd.sys.mk ============================================================================== --- stable/12/share/mk/bsd.sys.mk Thu May 23 00:55:28 2019 (r348136) +++ stable/12/share/mk/bsd.sys.mk Thu May 23 00:59:05 2019 (r348137) @@ -24,11 +24,6 @@ CFLAGS+= -std=iso9899:1999 .else # CSTD CFLAGS+= -std=${CSTD} .endif # CSTD - -.if !empty(CXXSTD) -CXXFLAGS+= -std=${CXXSTD} -.endif - # -pedantic is problematic because it also imposes namespace restrictions #CFLAGS+= -pedantic .if defined(WARNS) Modified: stable/12/share/mk/bsd.test.mk ============================================================================== --- stable/12/share/mk/bsd.test.mk Thu May 23 00:55:28 2019 (r348136) +++ stable/12/share/mk/bsd.test.mk Thu May 23 00:59:05 2019 (r348137) @@ -63,7 +63,6 @@ _TESTS= # Pull in the definitions of all supported test interfaces. .include <atf.test.mk> -.include <googletest.test.mk> .include <plain.test.mk> .include <tap.test.mk> Modified: stable/12/share/mk/src.libnames.mk ============================================================================== --- stable/12/share/mk/src.libnames.mk Thu May 23 00:55:28 2019 (r348136) +++ stable/12/share/mk/src.libnames.mk Thu May 23 00:59:05 2019 (r348137) @@ -18,10 +18,6 @@ _PRIVATELIBS= \ bsdstat \ devdctl \ event \ - gmock \ - gtest \ - gmock_main \ - gtest_main \ heimipcc \ heimipcs \ ifconfig \ @@ -304,10 +300,6 @@ _DP_dpv= dialog figpar util ncursesw _DP_dialog= ncursesw m _DP_cuse= pthread _DP_atf_cxx= atf_c -_DP_gtest= pthread -_DP_gmock= gtest -_DP_gmock_main= gmock -_DP_gtest_main= gtest _DP_devstat= kvm _DP_pam= radius tacplus opie md util .if ${MK_KERBEROS} != "no" @@ -385,15 +377,6 @@ LIBATF_CXX= ${LIBDESTDIR}${LIBDIR_BASE}/libprivateatf- LDADD_atf_c= -lprivateatf-c LDADD_atf_cxx= -lprivateatf-c++ -LIBGMOCK= ${LIBDESTDIR}${LIBDIR_BASE}/libprivategmock.a -LIBGMOCK_MAIN= ${LIBDESTDIR}${LIBDIR_BASE}/libprivategmock_main.a -LIBGTEST= ${LIBDESTDIR}${LIBDIR_BASE}/libprivategtest.a -LIBGTEST_MAIN= ${LIBDESTDIR}${LIBDIR_BASE}/libprivategtest_main.a -LDADD_gmock= -lprivategmock -LDADD_gtest= -lprivategtest -LDADD_gmock_main= -lprivategmock_main -LDADD_gtest_main= -lprivategtest_main - .for _l in ${_PRIVATELIBS} LIB${_l:tu}?= ${LIBDESTDIR}${LIBDIR_BASE}/libprivate${_l}.a .endfor @@ -430,15 +413,6 @@ LDADD_${_l}+= ${LDADD_${_d}} DPADD_atf_cxx+= ${DPADD_atf_c} LDADD_atf_cxx+= ${LDADD_atf_c} -DPADD_gmock+= ${DPADD_gtest} -LDADD_gmock+= ${LDADD_gtest} - -DPADD_gmock_main+= ${DPADD_gmock} -LDADD_gmock_main+= ${LDADD_gmock} - -DPADD_gtest_main+= ${DPADD_gtest} -LDADD_gtest_main+= ${LDADD_gtest} - # Detect LDADD/DPADD that should be LIBADD, before modifying LDADD here. _BADLDADD= .for _l in ${LDADD:M-l*:N-l*/*:C,^-l,,} @@ -577,10 +551,6 @@ LIBROKENDIR= ${OBJTOP}/kerberos5/lib/libroken LIBWINDDIR= ${OBJTOP}/kerberos5/lib/libwind LIBATF_CDIR= ${OBJTOP}/lib/atf/libatf-c LIBATF_CXXDIR= ${OBJTOP}/lib/atf/libatf-c++ -LIBGMOCKDIR= ${OBJTOP}/lib/googletest/gmock -LIBGMOCK_MAINDIR= ${OBJTOP}/lib/googletest/gmock_main -LIBGTESTDIR= ${OBJTOP}/lib/googletest/gtest -LIBGTEST_MAINDIR= ${OBJTOP}/lib/googletest/gtest_main LIBALIASDIR= ${OBJTOP}/lib/libalias/libalias LIBBLACKLISTDIR= ${OBJTOP}/lib/libblacklist LIBBLOCKSRUNTIMEDIR= ${OBJTOP}/lib/libblocksruntime Modified: stable/12/share/mk/src.opts.mk ============================================================================== --- stable/12/share/mk/src.opts.mk Thu May 23 00:55:28 2019 (r348136) +++ stable/12/share/mk/src.opts.mk Thu May 23 00:59:05 2019 (r348137) @@ -108,7 +108,6 @@ __DEFAULT_YES_OPTIONS = \ GDB \ GNU_DIFF \ GNU_GREP \ - GOOGLETEST \ GPIO \ HAST \ HTML \ @@ -435,7 +434,6 @@ MK_${var}:= no # Order is somewhat important. # .if !${COMPILER_FEATURES:Mc++11} -MK_GOOGLETEST:= no MK_LLVM_LIBUNWIND:= no .endif @@ -518,10 +516,6 @@ MK_FREEBSD_UPDATE:= no .if ${MK_TESTS} == "no" MK_DTRACE_TESTS:= no -.endif - -.if ${MK_TESTS_SUPPORT} == "no" -MK_GOOGLETEST:= no .endif .if ${MK_ZONEINFO} == "no" Modified: stable/12/tests/sys/opencrypto/cryptodev.py ============================================================================== --- stable/12/tests/sys/opencrypto/cryptodev.py Thu May 23 00:55:28 2019 (r348136) +++ stable/12/tests/sys/opencrypto/cryptodev.py Thu May 23 00:59:05 2019 (r348137) @@ -3,7 +3,6 @@ # Copyright (c) 2014 The FreeBSD Foundation # Copyright 2014 John-Mark Gurney # All rights reserved. -# Copyright 2019 Enji Cooper # # This software was developed by John-Mark Gurney under # the sponsorship from the FreeBSD Foundation. @@ -33,85 +32,76 @@ from __future__ import print_function import array -import binascii +import dpkt from fcntl import ioctl import os -import random import signal from struct import pack as _pack -import sys -import time -import dpkt - from cryptodevh import * __all__ = [ 'Crypto', 'MismatchError', ] class FindOp(dpkt.Packet): - __byte_order__ = '@' - __hdr__ = ( - ('crid', 'i', 0), - ('name', '32s', 0), - ) + __byte_order__ = '@' + __hdr__ = ( ('crid', 'i', 0), + ('name', '32s', 0), + ) class SessionOp(dpkt.Packet): - __byte_order__ = '@' - __hdr__ = ( - ('cipher', 'I', 0), - ('mac', 'I', 0), - ('keylen', 'I', 0), - ('key', 'P', 0), - ('mackeylen', 'i', 0), - ('mackey', 'P', 0), - ('ses', 'I', 0), - ) + __byte_order__ = '@' + __hdr__ = ( ('cipher', 'I', 0), + ('mac', 'I', 0), + ('keylen', 'I', 0), + ('key', 'P', 0), + ('mackeylen', 'i', 0), + ('mackey', 'P', 0), + ('ses', 'I', 0), + ) class SessionOp2(dpkt.Packet): - __byte_order__ = '@' - __hdr__ = ( - ('cipher', 'I', 0), - ('mac', 'I', 0), - ('keylen', 'I', 0), - ('key', 'P', 0), - ('mackeylen', 'i', 0), - ('mackey', 'P', 0), - ('ses', 'I', 0), - ('crid', 'i', 0), - ('pad0', 'i', 0), - ('pad1', 'i', 0), - ('pad2', 'i', 0), - ('pad3', 'i', 0), - ) + __byte_order__ = '@' + __hdr__ = ( ('cipher', 'I', 0), + ('mac', 'I', 0), + ('keylen', 'I', 0), + ('key', 'P', 0), + ('mackeylen', 'i', 0), + ('mackey', 'P', 0), + ('ses', 'I', 0), + ('crid', 'i', 0), + ('pad0', 'i', 0), + ('pad1', 'i', 0), + ('pad2', 'i', 0), + ('pad3', 'i', 0), + ) class CryptOp(dpkt.Packet): - __byte_order__ = '@' - __hdr__ = ( - ('ses', 'I', 0), - ('op', 'H', 0), - ('flags', 'H', 0), - ('len', 'I', 0), - ('src', 'P', 0), - ('dst', 'P', 0), - ('mac', 'P', 0), - ('iv', 'P', 0), - ) + __byte_order__ = '@' + __hdr__ = ( ('ses', 'I', 0), + ('op', 'H', 0), + ('flags', 'H', 0), + ('len', 'I', 0), + ('src', 'P', 0), + ('dst', 'P', 0), + ('mac', 'P', 0), + ('iv', 'P', 0), + ) class CryptAEAD(dpkt.Packet): - __byte_order__ = '@' - __hdr__ = ( - ('ses', 'I', 0), - ('op', 'H', 0), - ('flags', 'H', 0), - ('len', 'I', 0), - ('aadlen', 'I', 0), - ('ivlen', 'I', 0), - ('src', 'P', 0), - ('dst', 'P', 0), - ('aad', 'P', 0), - ('tag', 'P', 0), - ('iv', 'P', 0), - ) + __byte_order__ = '@' + __hdr__ = ( + ('ses', 'I', 0), + ('op', 'H', 0), + ('flags', 'H', 0), + ('len', 'I', 0), + ('aadlen', 'I', 0), + ('ivlen', 'I', 0), + ('src', 'P', 0), + ('dst', 'P', 0), + ('aad', 'P', 0), + ('tag', 'P', 0), + ('iv', 'P', 0), + ) # h2py.py can't handle multiarg macros CRIOGET = 3221513060 @@ -126,595 +116,445 @@ CIOCFINDDEV = 3223610220 CIOCCRYPTAEAD = 3225445229 def _getdev(): - buf = array.array('I', [0]) - fd = os.open('/dev/crypto', os.O_RDWR) - try: - ioctl(fd, CRIOGET, buf, 1) - finally: - os.close(fd) + fd = os.open('/dev/crypto', os.O_RDWR) + buf = array.array('I', [0]) + ioctl(fd, CRIOGET, buf, 1) + os.close(fd) - return buf[0] + return buf[0] _cryptodev = _getdev() -def str_to_ascii(val): - if sys.version_info[0] >= 3: - if isinstance(val, str): - return val.encode("ascii") - return val - def _findop(crid, name): - fop = FindOp() - fop.crid = crid - fop.name = str_to_ascii(name) - s = array.array('B', fop.pack_hdr()) - ioctl(_cryptodev, CIOCFINDDEV, s, 1) - fop.unpack(s) + fop = FindOp() + fop.crid = crid + fop.name = name + s = array.array('B', fop.pack_hdr()) + ioctl(_cryptodev, CIOCFINDDEV, s, 1) + fop.unpack(s) - try: - idx = fop.name.index(b'\x00') - name = fop.name[:idx] - except ValueError: - name = fop.name + try: + idx = fop.name.index('\x00') + name = fop.name[:idx] + except ValueError: + name = fop.name - return fop.crid, name + return fop.crid, name -def array_tobytes(array_obj): - if sys.version_info[:2] >= (3, 2): - return array_obj.tobytes() - return array_obj.tostring() - class Crypto: - @staticmethod - def findcrid(name): - return _findop(-1, name)[0] + @staticmethod + def findcrid(name): + return _findop(-1, name)[0] - @staticmethod - def getcridname(crid): - return _findop(crid, '')[1] + @staticmethod + def getcridname(crid): + return _findop(crid, '')[1] - def __init__(self, cipher=0, key=None, mac=0, mackey=None, - crid=CRYPTOCAP_F_SOFTWARE | CRYPTOCAP_F_HARDWARE, maclen=None): - self._ses = None - self._maclen = maclen - ses = SessionOp2() - ses.cipher = cipher - ses.mac = mac + def __init__(self, cipher=0, key=None, mac=0, mackey=None, + crid=CRYPTOCAP_F_SOFTWARE | CRYPTOCAP_F_HARDWARE): + self._ses = None + ses = SessionOp2() + ses.cipher = cipher + ses.mac = mac - if key is not None: - ses.keylen = len(key) - k = array.array('B', key) - ses.key = k.buffer_info()[0] - else: - self.key = None + if key is not None: + ses.keylen = len(key) + k = array.array('B', key) + ses.key = k.buffer_info()[0] + else: + self.key = None - if mackey is not None: - ses.mackeylen = len(mackey) - mk = array.array('B', mackey) - ses.mackey = mk.buffer_info()[0] + if mackey is not None: + ses.mackeylen = len(mackey) + mk = array.array('B', mackey) + ses.mackey = mk.buffer_info()[0] + self._maclen = 16 # parameterize? + else: + self._maclen = None - if not cipher and not mac: - raise ValueError('one of cipher or mac MUST be specified.') - ses.crid = crid - #print(ses) - s = array.array('B', ses.pack_hdr()) - #print(s) - ioctl(_cryptodev, CIOCGSESSION2, s, 1) - ses.unpack(s) + if not cipher and not mac: + raise ValueError('one of cipher or mac MUST be specified.') + ses.crid = crid + #print(ses) + s = array.array('B', ses.pack_hdr()) + #print(s) + ioctl(_cryptodev, CIOCGSESSION2, s, 1) + ses.unpack(s) - self._ses = ses.ses + self._ses = ses.ses - def __del__(self): - if self._ses is None: - return + def __del__(self): + if self._ses is None: + return - try: - ioctl(_cryptodev, CIOCFSESSION, _pack('I', self._ses)) - except TypeError: - pass - self._ses = None + try: + ioctl(_cryptodev, CIOCFSESSION, _pack('I', self._ses)) + except TypeError: + pass + self._ses = None - def _doop(self, op, src, iv): - cop = CryptOp() - cop.ses = self._ses - cop.op = op - cop.flags = 0 - cop.len = len(src) - s = array.array('B', src) - cop.src = cop.dst = s.buffer_info()[0] - if self._maclen is not None: - m = array.array('B', [0] * self._maclen) - cop.mac = m.buffer_info()[0] - ivbuf = array.array('B', str_to_ascii(iv)) - cop.iv = ivbuf.buffer_info()[0] + def _doop(self, op, src, iv): + cop = CryptOp() + cop.ses = self._ses + cop.op = op + cop.flags = 0 + cop.len = len(src) + s = array.array('B', src) + cop.src = cop.dst = s.buffer_info()[0] + if self._maclen is not None: + m = array.array('B', [0] * self._maclen) + cop.mac = m.buffer_info()[0] + ivbuf = array.array('B', iv) + cop.iv = ivbuf.buffer_info()[0] - cop_b = bytes(cop) - #print('cop:', cop_b) - ioctl(_cryptodev, CIOCCRYPT, cop_b) + #print('cop:', cop) + ioctl(_cryptodev, CIOCCRYPT, str(cop)) - s = array_tobytes(s) - if self._maclen is not None: - return s, array_tobytes(m) + s = s.tostring() + if self._maclen is not None: + return s, m.tostring() - return s + return s - def _doaead(self, op, src, aad, iv, tag=None): - caead = CryptAEAD() - caead.ses = self._ses - caead.op = op - caead.flags = CRD_F_IV_EXPLICIT - caead.flags = 0 - caead.len = len(src) - src = str_to_ascii(src) - s = array.array("B", src) - caead.src = caead.dst = s.buffer_info()[0] - caead.aadlen = len(aad) - aad = str_to_ascii(aad) - saad = array.array('B', aad) - caead.aad = saad.buffer_info()[0] + def _doaead(self, op, src, aad, iv, tag=None): + caead = CryptAEAD() + caead.ses = self._ses + caead.op = op + caead.flags = CRD_F_IV_EXPLICIT + caead.flags = 0 + caead.len = len(src) + s = array.array('B', src) + caead.src = caead.dst = s.buffer_info()[0] + caead.aadlen = len(aad) + saad = array.array('B', aad) + caead.aad = saad.buffer_info()[0] - if self._maclen is None: - raise ValueError('must have a tag length') + if self._maclen is None: + raise ValueError('must have a tag length') - if tag is None: - tag = array.array('B', [0] * self._maclen) - else: - assert len(tag) == self._maclen, \ + if tag is None: + tag = array.array('B', [0] * self._maclen) + else: + assert len(tag) == self._maclen, \ '%d != %d' % (len(tag), self._maclen) - tag = str_to_ascii(tag) - tag = array.array('B', tag) + tag = array.array('B', tag) - caead.tag = tag.buffer_info()[0] + caead.tag = tag.buffer_info()[0] - ivbuf = array.array('B', iv) - caead.ivlen = len(iv) - caead.iv = ivbuf.buffer_info()[0] + ivbuf = array.array('B', iv) + caead.ivlen = len(iv) + caead.iv = ivbuf.buffer_info()[0] - caead_b = bytes(caead) - ioctl(_cryptodev, CIOCCRYPTAEAD, caead_b) + ioctl(_cryptodev, CIOCCRYPTAEAD, str(caead)) - s = array_tobytes(s) + s = s.tostring() - return s, array_tobytes(tag) + return s, tag.tostring() - def perftest(self, op, size, timeo=3): - inp = array.array('B', (random.randint(0, 255) for x in range(size))) - out = array.array('B', str_to_ascii(inp)) + def perftest(self, op, size, timeo=3): + import random + import time - # prep ioctl - cop = CryptOp() - cop.ses = self._ses - cop.op = op - cop.flags = 0 - cop.len = len(inp) - s = array.array('B', str_to_ascii(inp)) - cop.src = s.buffer_info()[0] - cop.dst = out.buffer_info()[0] - if self._maclen is not None: - m = array.array('B', [0] * self._maclen) - cop.mac = m.buffer_info()[0] - ivbuf = array.array('B', (random.randint(0, 255) for x in range(16))) - cop.iv = ivbuf.buffer_info()[0] + inp = array.array('B', (random.randint(0, 255) for x in xrange(size))) + out = array.array('B', inp) - exit = [ False ] - def alarmhandle(a, b, exit=exit): - exit[0] = True + # prep ioctl + cop = CryptOp() + cop.ses = self._ses + cop.op = op + cop.flags = 0 + cop.len = len(inp) + s = array.array('B', inp) + cop.src = s.buffer_info()[0] + cop.dst = out.buffer_info()[0] + if self._maclen is not None: + m = array.array('B', [0] * self._maclen) + cop.mac = m.buffer_info()[0] + ivbuf = array.array('B', (random.randint(0, 255) for x in xrange(16))) + cop.iv = ivbuf.buffer_info()[0] - oldalarm = signal.signal(signal.SIGALRM, alarmhandle) - signal.alarm(timeo) + exit = [ False ] + def alarmhandle(a, b, exit=exit): + exit[0] = True - start = time.time() - reps = 0 - cop_b = bytes(cop) - while not exit[0]: - ioctl(_cryptodev, CIOCCRYPT, cop_b) - reps += 1 + oldalarm = signal.signal(signal.SIGALRM, alarmhandle) + signal.alarm(timeo) - end = time.time() + start = time.time() + reps = 0 + while not exit[0]: + ioctl(_cryptodev, CIOCCRYPT, str(cop)) + reps += 1 - signal.signal(signal.SIGALRM, oldalarm) + end = time.time() - print('time:', end - start) - print('perf MB/sec:', (reps * size) / (end - start) / 1024 / 1024) + signal.signal(signal.SIGALRM, oldalarm) - def encrypt(self, data, iv, aad=None): - if aad is None: - return self._doop(COP_ENCRYPT, data, iv) - else: - return self._doaead(COP_ENCRYPT, data, aad, - iv) + print('time:', end - start) + print('perf MB/sec:', (reps * size) / (end - start) / 1024 / 1024) - def decrypt(self, data, iv, aad=None, tag=None): - if aad is None: - return self._doop(COP_DECRYPT, data, iv) - else: - return self._doaead(COP_DECRYPT, data, aad, - iv, tag=tag) + def encrypt(self, data, iv, aad=None): + if aad is None: + return self._doop(COP_ENCRYPT, data, iv) + else: + return self._doaead(COP_ENCRYPT, data, aad, + iv) + def decrypt(self, data, iv, aad=None, tag=None): + if aad is None: + return self._doop(COP_DECRYPT, data, iv) + else: + return self._doaead(COP_DECRYPT, data, aad, + iv, tag=tag) + class MismatchError(Exception): - pass + pass class KATParser: - def __init__(self, fname, fields): - self.fields = set(fields) - self._pending = None - self.fname = fname - self.fp = None + def __init__(self, fname, fields): + self.fp = open(fname) + self.fields = set(fields) + self._pending = None - def __enter__(self): - self.fp = open(self.fname) - return self + def __iter__(self): + while True: + didread = False + if self._pending is not None: + i = self._pending + self._pending = None + else: + i = self.fp.readline() + didread = True - def __exit__(self, exc_type, exc_value, exc_tb): - if self.fp is not None: - self.fp.close() + if didread and not i: + return - def __iter__(self): - return self + if (i and i[0] == '#') or not i.strip(): + continue + if i[0] == '[': + yield i[1:].split(']', 1)[0], self.fielditer() + else: + raise ValueError('unknown line: %r' % repr(i)) - def __next__(self): - while True: - didread = False - if self._pending is not None: - i = self._pending - self._pending = None - else: - i = self.fp.readline() *** DIFF OUTPUT TRUNCATED AT 1000 LINES ***
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201905230059.x4N0x5Vx009724>