Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 5 Jun 2020 08:46:51 +0000 (UTC)
From:      Alex Richardson <arichardson@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r361829 - in head/lib/libc/tests: gen/posix_spawn sys
Message-ID:  <202006050846.0558kpap028807@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: arichardson
Date: Fri Jun  5 08:46:50 2020
New Revision: 361829
URL: https://svnweb.freebsd.org/changeset/base/361829

Log:
  Avoid using non-portable dd status=none flag
  
  Copying the approach chosen in r309412. This fixes building the libc tests
  on a macOS host since the macOS /bin/dd binary does not support status=none.
  
  As there only seem to be two uses, this commit changes the two Makefiles.
  If this becomes more common, we could also add a wrapper bootstrap script
  that ignores status= and forwards the remaining args to the real dd.
  Another alternative would be to remove the status flag and pipe stderr to
  /dev/null, but them we lose error messages.
  
  Reviewed By:	brooks
  Differential Revision: https://reviews.freebsd.org/D24785

Modified:
  head/lib/libc/tests/gen/posix_spawn/Makefile
  head/lib/libc/tests/sys/Makefile

Modified: head/lib/libc/tests/gen/posix_spawn/Makefile
==============================================================================
--- head/lib/libc/tests/gen/posix_spawn/Makefile	Fri Jun  5 08:12:08 2020	(r361828)
+++ head/lib/libc/tests/gen/posix_spawn/Makefile	Fri Jun  5 08:46:50 2020	(r361829)
@@ -19,8 +19,12 @@ CLEANFILES+=	h_nonexec
 
 .include "../../Makefile.netbsd-tests"
 
+# The dd status=none option is non-standard. Only use it when this test succeeds
+# rather than require dd to be a bootstrap tool.
+DD_NOSTATUS!=(dd status=none count=0 2> /dev/null && echo status=none) || true
+DD=dd ${DD_NOSTATUS}
 h_zero:
-	dd if=/dev/zero of=h_zero bs=1k count=2 status=none
+	${DD} if=/dev/zero of=h_zero bs=1k count=2
 	chmod a+x h_zero
 
 CLEANFILES+=	h_zero

Modified: head/lib/libc/tests/sys/Makefile
==============================================================================
--- head/lib/libc/tests/sys/Makefile	Fri Jun  5 08:12:08 2020	(r361828)
+++ head/lib/libc/tests/sys/Makefile	Fri Jun  5 08:46:50 2020	(r361829)
@@ -96,7 +96,11 @@ truncate_test_FILESGRP= wheel
 truncate_test_FILESPACKAGE=	${PACKAGE}
 
 CLEANFILES=	truncate_test.root_owned
+# The dd status=none option is non-standard. Only use it when this test succeeds
+# rather than require dd to be a bootstrap tool.
+DD_NOSTATUS!=(dd status=none count=0 2> /dev/null && echo status=none) || true
+DD=dd ${DD_NOSTATUS}
 truncate_test.root_owned:
-	dd if=/dev/null bs=1 count=1 of=${.TARGET} status=none
+	${DD} if=/dev/null bs=1 count=1 of=${.TARGET}
 
 .include <bsd.test.mk>



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202006050846.0558kpap028807>