From nobody Mon Apr 24 17:21:19 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Q4sNv58qMz476ft; Mon, 24 Apr 2023 17:21:19 +0000 (UTC) (envelope-from git@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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Q4sNv4jxCz4L5H; Mon, 24 Apr 2023 17:21:19 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1682356879; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=LcCBdOf8C98EuiAn8N1G1cdFGiHj/Ld/mIjHn5fKu/4=; b=NgJFQxes6qUSVXFjOpP9/n2Tx7ctCVsqWlkMaylKdJPaA+4O+thDVd47fWfKNjmQPxfRt0 Rl4F7cwMNJY0aa4J/qNM4/8MMfTodphPuN3B6mh8RJByEYHjxZUqulv0SLF08vhonZ5Dyl 7nLwYh6xAVPtkK2wm8Enspqj2jHf3JyIqHZQKCFUn7GHyWFRwzMi7b3N/iwqwO2kK+E1a8 V8fVGhtcTd7+IXxWbP/OSRjUpytVhfGEHGfzxYoNLcVvgebKj670d4DfoBeeUSSMQ4Aqhq HP6jY35PJJJEnxRVDCldSNWtaxbGqcxEYeelcv+lMcMFKbDT2GXg2lTJn9jcCg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1682356879; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=LcCBdOf8C98EuiAn8N1G1cdFGiHj/Ld/mIjHn5fKu/4=; b=Xi5EXjmaG6LWt2QnVlYFjChVovEwgUcGXIG9uNo7QFNko9wpWykIvTrZgJsW4GG/ln2hra l5sytYc+gKgTGwk68Cnk9PD8CRnQTlhh9t8oCUrQhnnmha478M5MsiTkTpFTQgIPtW4+uY qnSaLar/wPhTzaGtbGorqko1GMLgo54yKxx4tSJsNM9Y117m75lfhTplc1KFyciJ0L5g0u OX2S4xz13VKh1qbHuwMKYrUYc02Q/L8kmdrdv8T63oyOhn8llMEXqsT5CZJugQ/Uq84kEJ L5px/IXErINkLmMEuA2M3m1caVt0l0v5qMdYViv24NEtFJwajCjy2hpNeHQsjg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1682356879; a=rsa-sha256; cv=none; b=AUG90MIEHHwAuuS49rp6eE55j/ebbG5JiPrYgRe3UkIA7XjDFBs4DpKPG7BMg+vum4Z/Cn X5o3Yc+TLDpKLH6FP0R90UUN3VwIEWB0GzMIqTII5UmWy9Gvnba/cY3FpMmFiymMbbuhqR dwzH0/Tqra1TgEM6Y1jq9bE6j0aPTGFks0dGLeF6tAs0HW3lJMEaUW/HEkpRApap1mM4n0 gYQeby7/ECmT0cSPlv34xIzbfCLddSPlqDGzQxHxPtksKlp7e4+T5xaP8rEaeABqzt7UB3 R5i5A8RY+WPMj1AKUAi1lu4iippVTqKHKc8vF/qKQ+kCFDIuNv2aBupoNGrDww== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Q4sNv3nH2zYqv; Mon, 24 Apr 2023 17:21:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 33OHLJik043813; Mon, 24 Apr 2023 17:21:19 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 33OHLJSX043812; Mon, 24 Apr 2023 17:21:19 GMT (envelope-from git) Date: Mon, 24 Apr 2023 17:21:19 GMT Message-Id: <202304241721.33OHLJSX043812@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Simon J. Gerraty" Subject: git: 976ba7f02a21 - main - Enable building tar for non-FreeBSD host List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: sjg X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 976ba7f02a211c57709301782e710c5b38a3f272 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by sjg: URL: https://cgit.FreeBSD.org/src/commit/?id=976ba7f02a211c57709301782e710c5b38a3f272 commit 976ba7f02a211c57709301782e710c5b38a3f272 Author: Simon J. Gerraty AuthorDate: 2023-04-24 17:20:17 +0000 Commit: Simon J. Gerraty CommitDate: 2023-04-24 17:20:17 +0000 Enable building tar for non-FreeBSD host For DIRDEPS_BUILD we need Makefile.depend.options to force libegacy to be built on older FreeBSD and non-FreeBSD hosts. Add readpassphrase to libegacy to avoid the need for libbsd on Linux src.opts.mk disable TESTS for host if MK_host_egacy is yes Reviewed by: imp Sponsored by: Juniper Networks, Inc. Differential Revision: https://reviews.freebsd.org/D39766 --- lib/libarchive/config_freebsd.h | 2 ++ share/mk/src.opts.mk | 6 ++++++ tools/build/Makefile | 12 ++++++++++++ tools/build/cross-build/include/linux/includes.h | 4 ++++ usr.bin/tar/Makefile.depend.host | 11 +++++++++++ usr.bin/tar/Makefile.depend.options | 6 ++++++ 6 files changed, 41 insertions(+) diff --git a/lib/libarchive/config_freebsd.h b/lib/libarchive/config_freebsd.h index 20230ca26adf..dabc84d17ee6 100644 --- a/lib/libarchive/config_freebsd.h +++ b/lib/libarchive/config_freebsd.h @@ -100,7 +100,9 @@ #define HAVE_DIRENT_H 1 #define HAVE_DIRFD 1 #define HAVE_DLFCN_H 1 +#ifndef __linux__ #define HAVE_D_MD_ORDER 1 +#endif #define HAVE_EFTYPE 1 #define HAVE_EILSEQ 1 #define HAVE_ERRNO_H 1 diff --git a/share/mk/src.opts.mk b/share/mk/src.opts.mk index 8f56f757b60b..62d3936ded20 100644 --- a/share/mk/src.opts.mk +++ b/share/mk/src.opts.mk @@ -360,6 +360,12 @@ __DEFAULT_YES_OPTIONS+=NETLINK_SUPPORT __DEFAULT_NO_OPTIONS+=NETLINK_SUPPORT .endif +# MK_host_egacy is set by local.sys.mk so is valid here +.if ${MACHINE} == "host" && ${MK_host_egacy} == "yes" +# we cannot expect tests to work +BROKEN_OPTIONS+= TESTS +.endif + .-include .include diff --git a/tools/build/Makefile b/tools/build/Makefile index a1b8bbb8b2aa..1dc6e9fc189b 100644 --- a/tools/build/Makefile +++ b/tools/build/Makefile @@ -208,6 +208,18 @@ CFLAGS.closefrom.c+= -DSTDC_HEADERS -DHAVE_SYS_DIR_H -DHAVE_DIRENT_H \ SRCS+= progname.c # Stub implementations of fflagstostr/strtofflags SRCS+= fflags.c + +# tar needs readpassphrase +# the version from openssh is already "portable" +# but we need to take care with .PATH as we +# do not want getopt_long.c from crypto/openssh/openbsd-compat +# and we do not want readpassphrase.c from libc/gen +.PATH: ${SRCTOP}/crypto/openssh +OBJS_SRCS_FILTER= T R +SRCS+= openbsd-compat/readpassphrase.c + +INCS+= ${SRCTOP}/crypto/openssh/openbsd-compat/readpassphrase.h + .endif # ${MAKE.OS} == "Linux" .if ${.MAKE.OS} == "Darwin" diff --git a/tools/build/cross-build/include/linux/includes.h b/tools/build/cross-build/include/linux/includes.h new file mode 100644 index 000000000000..ed9ea212ee10 --- /dev/null +++ b/tools/build/cross-build/include/linux/includes.h @@ -0,0 +1,4 @@ +#include +#include + +#define DEF_WEAK(a) diff --git a/usr.bin/tar/Makefile.depend.host b/usr.bin/tar/Makefile.depend.host new file mode 100644 index 000000000000..f80275d86ab1 --- /dev/null +++ b/usr.bin/tar/Makefile.depend.host @@ -0,0 +1,11 @@ +# $FreeBSD$ +# Autogenerated - do NOT edit! + +DIRDEPS = \ + + +.include + +.if ${DEP_RELDIR} == ${_DEP_RELDIR} +# local dependencies - needed for -jN in clean tree +.endif diff --git a/usr.bin/tar/Makefile.depend.options b/usr.bin/tar/Makefile.depend.options new file mode 100644 index 000000000000..4dcc6c412671 --- /dev/null +++ b/usr.bin/tar/Makefile.depend.options @@ -0,0 +1,6 @@ +DIRDEPS_OPTIONS = host_egacy + +DIRDEPS.host_egacy.yes = tools/build + +.include +