From owner-svn-ports-all@freebsd.org Tue Feb 20 09:39:16 2018 Return-Path: Delivered-To: svn-ports-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DAA35F15F3B; Tue, 20 Feb 2018 09:39:15 +0000 (UTC) (envelope-from tijl@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8CAB86D070; Tue, 20 Feb 2018 09:39:15 +0000 (UTC) (envelope-from tijl@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 85EB927979; Tue, 20 Feb 2018 09:39:15 +0000 (UTC) (envelope-from tijl@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1K9dFS3018572; Tue, 20 Feb 2018 09:39:15 GMT (envelope-from tijl@FreeBSD.org) Received: (from tijl@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1K9dF6M018568; Tue, 20 Feb 2018 09:39:15 GMT (envelope-from tijl@FreeBSD.org) Message-Id: <201802200939.w1K9dF6M018568@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tijl set sender to tijl@FreeBSD.org using -f From: Tijl Coosemans Date: Tue, 20 Feb 2018 09:39:15 +0000 (UTC) To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r462385 - in head/devel/gmake: . files X-SVN-Group: ports-head X-SVN-Commit-Author: tijl X-SVN-Commit-Paths: in head/devel/gmake: . files X-SVN-Commit-Revision: 462385 X-SVN-Commit-Repository: ports MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-ports-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the ports tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Feb 2018 09:39:16 -0000 Author: tijl Date: Tue Feb 20 09:39:14 2018 New Revision: 462385 URL: https://svnweb.freebsd.org/changeset/ports/462385 Log: - Remove fmake hack because FreeBSD 9 is EoL. - Fix compiler warning about realloc. [1] - Remove dependency on gettext-tools and iconv. [2] - Add upstream patch to fix hangs when doing parallel builds. [3] PR: 210938 [1], 212157 [2], 225899 [3] Obtained from: https://git.savannah.gnu.org/cgit/make.git/commit/?id=b552b05251980f693c729e251f93f5225b400714 [3] Exp-run by: antoine, truckman Added: head/devel/gmake/files/patch-glob-glob.c (contents, props changed) head/devel/gmake/files/patch-posixos.c (contents, props changed) Modified: head/devel/gmake/Makefile Modified: head/devel/gmake/Makefile ============================================================================== --- head/devel/gmake/Makefile Tue Feb 20 09:26:02 2018 (r462384) +++ head/devel/gmake/Makefile Tue Feb 20 09:39:14 2018 (r462385) @@ -3,7 +3,7 @@ PORTNAME= gmake PORTVERSION= 4.2.1 -PORTREVISION= 1 +PORTREVISION= 2 CATEGORIES= devel MASTER_SITES= GNU/make DISTNAME= make-${PORTVERSION} @@ -20,8 +20,6 @@ LICENSE_FILE= ${WRKSRC}/COPYING GNU_CONFIGURE= yes CONFIGURE_ARGS= --program-prefix=g \ --without-guile -# fmake does not like PO_DEPENDS_ON_POT being undefined -MAKE_ARGS= PO_DEPENDS_ON_POT= USES= cpe tar:bzip2 CPE_VENDOR= gnu @@ -29,9 +27,7 @@ CPE_VENDOR= gnu OPTIONS_DEFINE= NLS OPTIONS_SUB= yes -NLS_USES= gettext iconv -NLS_CONFIGURE_ON= ${ICONV_CONFIGURE_ARG} \ - --with-libintl-prefix=${LOCALBASE} +NLS_USES= gettext-runtime NLS_CONFIGURE_ENABLE= nls INFO= make Added: head/devel/gmake/files/patch-glob-glob.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/devel/gmake/files/patch-glob-glob.c Tue Feb 20 09:39:14 2018 (r462385) @@ -0,0 +1,10 @@ +--- glob/glob.c.orig 2013-10-20 17:14:38 UTC ++++ glob/glob.c +@@ -203,7 +203,6 @@ my_realloc (p, n) + return (char *) malloc (n); + return (char *) realloc (p, n); + } +-# define realloc my_realloc + # endif /* __SASC */ + #endif /* __GNU_LIBRARY__ || __DJGPP__ */ + Added: head/devel/gmake/files/patch-posixos.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/devel/gmake/files/patch-posixos.c Tue Feb 20 09:39:14 2018 (r462385) @@ -0,0 +1,170 @@ +From b552b05251980f693c729e251f93f5225b400714 Mon Sep 17 00:00:00 2001 +From: Paul Smith +Date: Sat, 3 Jun 2017 16:20:51 -0400 +Subject: [SV 51159] Use a non-blocking read with pselect to avoid hangs. + +* posixos.c (set_blocking): Set blocking on a file descriptor. +(jobserver_setup): Set non-blocking on the jobserver read side. +(jobserver_parse_auth): Ditto. +(jobserver_acquire_all): Set blocking to avoid a busy-wait loop. +(jobserver_acquire): If the non-blocking read() returns without +taking a token then try again. +--- + posixos.c | 97 ++++++++++++++++++++++++++++++++++++++++++++++----------------- + 1 file changed, 71 insertions(+), 26 deletions(-) + +diff --git a/posixos.c b/posixos.c +index e642d7f..dbafa51 100644 +--- posixos.c ++++ posixos.c +@@ -62,6 +62,24 @@ make_job_rfd (void) + #endif + } + ++static void ++set_blocking (int fd, int blocking) ++{ ++ // If we're not using pselect() don't change the blocking ++#ifdef HAVE_PSELECT ++ int flags; ++ EINTRLOOP (flags, fcntl (fd, F_GETFL)); ++ if (flags >= 0) ++ { ++ int r; ++ flags = blocking ? (flags & ~O_NONBLOCK) : (flags | O_NONBLOCK); ++ EINTRLOOP (r, fcntl (fd, F_SETFL, flags)); ++ if (r < 0) ++ pfatal_with_name ("fcntl(O_NONBLOCK)"); ++ } ++#endif ++} ++ + unsigned int + jobserver_setup (int slots) + { +@@ -86,6 +104,9 @@ jobserver_setup (int slots) + pfatal_with_name (_("init jobserver pipe")); + } + ++ /* When using pselect() we want the read to be non-blocking. */ ++ set_blocking (job_fds[0], 0); ++ + return 1; + } + +@@ -121,6 +142,9 @@ jobserver_parse_auth (const char *auth) + return 0; + } + ++ /* When using pselect() we want the read to be non-blocking. */ ++ set_blocking (job_fds[0], 0); ++ + return 1; + } + +@@ -169,7 +193,10 @@ jobserver_acquire_all (void) + { + unsigned int tokens = 0; + +- /* Close the write side, so the read() won't hang. */ ++ /* Use blocking reads to wait for all outstanding jobs. */ ++ set_blocking (job_fds[0], 1); ++ ++ /* Close the write side, so the read() won't hang forever. */ + close (job_fds[1]); + job_fds[1] = -1; + +@@ -236,18 +263,12 @@ jobserver_pre_acquire (void) + unsigned int + jobserver_acquire (int timeout) + { +- sigset_t empty; +- fd_set readfds; + struct timespec spec; + struct timespec *specp = NULL; +- int r; +- char intake; ++ sigset_t empty; + + sigemptyset (&empty); + +- FD_ZERO (&readfds); +- FD_SET (job_fds[0], &readfds); +- + if (timeout) + { + /* Alarm after one second (is this too granular?) */ +@@ -256,28 +277,52 @@ jobserver_acquire (int timeout) + specp = &spec; + } + +- r = pselect (job_fds[0]+1, &readfds, NULL, NULL, specp, &empty); +- +- if (r == -1) ++ while (1) + { +- /* Better be SIGCHLD. */ +- if (errno != EINTR) +- pfatal_with_name (_("pselect jobs pipe")); +- return 0; +- } ++ fd_set readfds; ++ int r; ++ char intake; + +- if (r == 0) +- /* Timeout. */ +- return 0; ++ FD_ZERO (&readfds); ++ FD_SET (job_fds[0], &readfds); + +- /* The read FD is ready: read it! */ +- EINTRLOOP (r, read (job_fds[0], &intake, 1)); +- if (r < 0) +- pfatal_with_name (_("read jobs pipe")); ++ r = pselect (job_fds[0]+1, &readfds, NULL, NULL, specp, &empty); ++ if (r < 0) ++ switch (errno) ++ { ++ case EINTR: ++ /* SIGCHLD will show up as an EINTR. */ ++ return 0; ++ ++ case EBADF: ++ /* Someone closed the jobs pipe. ++ That shouldn't happen but if it does we're done. */ ++ O (fatal, NILF, _("job server shut down")); + +- /* What does it mean if read() returns 0? It shouldn't happen because only +- the master make can reap all the tokens and close the write side...?? */ +- return r > 0; ++ default: ++ pfatal_with_name (_("pselect jobs pipe")); ++ } ++ ++ if (r == 0) ++ /* Timeout. */ ++ return 0; ++ ++ /* The read FD is ready: read it! This is non-blocking. */ ++ EINTRLOOP (r, read (job_fds[0], &intake, 1)); ++ ++ if (r < 0) ++ { ++ /* Someone sniped our token! Try again. */ ++ if (errno == EAGAIN) ++ continue; ++ ++ pfatal_with_name (_("read jobs pipe")); ++ } ++ ++ /* read() should never return 0: only the master make can reap all the ++ tokens and close the write side...?? */ ++ return r > 0; ++ } + } + + #else +-- +cgit v1.0-41-gc330 +