From owner-svn-src-head@freebsd.org Sat Sep 19 12:08:18 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 5591E3DE254; Sat, 19 Sep 2020 12:08:18 +0000 (UTC) (envelope-from arichardson@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (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 "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BtqGp1ZX1z3Vh1; Sat, 19 Sep 2020 12:08:18 +0000 (UTC) (envelope-from arichardson@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 197B8BEC2; Sat, 19 Sep 2020 12:08:18 +0000 (UTC) (envelope-from arichardson@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 08JC8Het047876; Sat, 19 Sep 2020 12:08:17 GMT (envelope-from arichardson@FreeBSD.org) Received: (from arichardson@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08JC8Giu047870; Sat, 19 Sep 2020 12:08:16 GMT (envelope-from arichardson@FreeBSD.org) Message-Id: <202009191208.08JC8Giu047870@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arichardson set sender to arichardson@FreeBSD.org using -f From: Alex Richardson Date: Sat, 19 Sep 2020 12:08:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r365901 - in head: cddl/lib/libspl tools/build/cross-build/include/common tools/build/cross-build/include/common/sys tools/build/cross-build/include/linux/sys tools/build/cross-build/in... X-SVN-Group: head X-SVN-Commit-Author: arichardson X-SVN-Commit-Paths: in head: cddl/lib/libspl tools/build/cross-build/include/common tools/build/cross-build/include/common/sys tools/build/cross-build/include/linux/sys tools/build/cross-build/include/mac/sys tools/build... X-SVN-Commit-Revision: 365901 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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: Sat, 19 Sep 2020 12:08:18 -0000 Author: arichardson Date: Sat Sep 19 12:08:16 2020 New Revision: 365901 URL: https://svnweb.freebsd.org/changeset/base/365901 Log: Fix dtrace tools bootstrap on non-FreeBSD after OpenZFS import This required surprisingly few build system changes and only two changes to the openZFS compat headers which have been upstreamed as https://github.com/openzfs/zfs/pull/10863 Reviewed By: #zfs, freqlabs Differential Revision: https://reviews.freebsd.org/D26193 Deleted: head/tools/build/cross-build/include/common/sys/uio.h Modified: head/cddl/lib/libspl/Makefile head/tools/build/cross-build/include/common/string.h head/tools/build/cross-build/include/common/sys/cdefs.h head/tools/build/cross-build/include/linux/sys/stat.h head/tools/build/cross-build/include/mac/sys/_types.h head/tools/build/mk/Makefile.boot Modified: head/cddl/lib/libspl/Makefile ============================================================================== --- head/cddl/lib/libspl/Makefile Sat Sep 19 11:27:16 2020 (r365900) +++ head/cddl/lib/libspl/Makefile Sat Sep 19 12:08:16 2020 (r365901) @@ -14,13 +14,14 @@ SRCS = \ list.c \ mkdirp.c \ page.c \ - strlcat.c \ - strlcpy.c \ timestamp.c \ zone.c \ include/sys/list.h \ include/sys/list_impl.h +# These functions are not required when bootstrapping and the atomic code +# will not compile when building on macOS. +.if !defined(BOOTSTRAPPING) SRCS += \ getexecname.c \ gethostid.c \ @@ -37,6 +38,7 @@ SRCS += atomic.S .else .PATH: ${SRCTOP}/sys/contrib/openzfs/lib/libspl/asm-generic SRCS += atomic.c +.endif .endif Modified: head/tools/build/cross-build/include/common/string.h ============================================================================== --- head/tools/build/cross-build/include/common/string.h Sat Sep 19 11:27:16 2020 (r365900) +++ head/tools/build/cross-build/include/common/string.h Sat Sep 19 12:08:16 2020 (r365901) @@ -37,6 +37,10 @@ */ #pragma once +/* Avoid incompatible opensolaris redeclarations (without _FORTIFY_SOURCE). */ +#define HAVE_STRLCAT 1 +#define HAVE_STRLCPY 1 + #include_next /* * FreeBSD string.h #includes strings.h and all libmd code depends on Modified: head/tools/build/cross-build/include/common/sys/cdefs.h ============================================================================== --- head/tools/build/cross-build/include/common/sys/cdefs.h Sat Sep 19 11:27:16 2020 (r365900) +++ head/tools/build/cross-build/include/common/sys/cdefs.h Sat Sep 19 12:08:16 2020 (r365901) @@ -276,3 +276,11 @@ typedef unsigned long u_long; #ifndef __DEQUALIFY #define __DEQUALIFY(type, var) ((type)(__uintptr_t)(const volatile void *)(var)) #endif + + +/* Expose all declarations when using FreeBSD headers */ +#define __POSIX_VISIBLE 200809 +#define __XSI_VISIBLE 700 +#define __BSD_VISIBLE 1 +#define __ISO_C_VISIBLE 2011 +#define __EXT1_VISIBLE 1 Modified: head/tools/build/cross-build/include/linux/sys/stat.h ============================================================================== --- head/tools/build/cross-build/include/linux/sys/stat.h Sat Sep 19 11:27:16 2020 (r365900) +++ head/tools/build/cross-build/include/linux/sys/stat.h Sat Sep 19 12:08:16 2020 (r365901) @@ -59,3 +59,6 @@ #ifndef S_ISTXT #define S_ISTXT S_ISVTX #endif + +/* This include is needed for OpenZFS bootstrap */ +#include Modified: head/tools/build/cross-build/include/mac/sys/_types.h ============================================================================== --- head/tools/build/cross-build/include/mac/sys/_types.h Sat Sep 19 11:27:16 2020 (r365900) +++ head/tools/build/cross-build/include/mac/sys/_types.h Sat Sep 19 12:08:16 2020 (r365901) @@ -43,3 +43,5 @@ * __darwin_ct_rune_t exists. */ typedef __darwin_ct_rune_t __ct_rune_t; +/* Needed for opensolaris compat. */ +typedef __int64_t off64_t; Modified: head/tools/build/mk/Makefile.boot ============================================================================== --- head/tools/build/mk/Makefile.boot Sat Sep 19 11:27:16 2020 (r365900) +++ head/tools/build/mk/Makefile.boot Sat Sep 19 12:08:16 2020 (r365901) @@ -44,7 +44,6 @@ LIBELF:=${WORLDTMP}/legacy/usr/lib/libelf.a CFLAGS+= -Werror=implicit-function-declaration -Werror=implicit-int \ -Werror=return-type -Wundef CFLAGS+= -DHAVE_NBTOOL_CONFIG_H=1 -CFLAGS+= -D__BSD_VISIBLE=1 CFLAGS+= -I${SRCTOP}/tools/build/cross-build/include/common # b64_pton and b64_ntop is in libresolv on MacOS and Linux: