diff options
Diffstat (limited to 'sys-devel/make')
-rw-r--r-- | sys-devel/make/Manifest | 2 | ||||
-rw-r--r-- | sys-devel/make/files/make-4.2.1-pselect-non-blocking.patch | 172 | ||||
-rw-r--r-- | sys-devel/make/make-4.2.1-r4.ebuild | 59 |
3 files changed, 233 insertions, 0 deletions
diff --git a/sys-devel/make/Manifest b/sys-devel/make/Manifest index 2a7745d461a0..0992bd3a4edb 100644 --- a/sys-devel/make/Manifest +++ b/sys-devel/make/Manifest @@ -4,6 +4,8 @@ AUX make-4.2.1-glob-internals.patch 1752 BLAKE2B 97616f18dcc30dbda296942d7dfa5b1 AUX make-4.2.1-glob-v2.patch 1073 BLAKE2B bcced0694ed0206394d750452cec2c0ee8356fd8b779b9ee4d6fbf0d3dd736a0465b0f12a1629508669efb7c4ffe1d17f1aeb9b925d86e9e75a5b90119ddd5c9 SHA512 2f19578979cc5af622d6571e4d9c97e5567acd4036076e9c426a8d4505b6da191cf9b6edb1cecc0aff14efce52d3062c21d10a36d569743acdfc660007f928f4 AUX make-4.2.1-guile-2.2.patch 11401 BLAKE2B 0bd3c4d813d0205eb2a204f4819fcad3f188bd3a2656e9883643561c82cbf2a58aa22cae46429094856aea76e0396529df3c39aa37f6f69ea9fbc2379e686a62 SHA512 c1c827f1f6400a973fee87d143061c0635b1d37c6aa25b0d1c92a83dc535aff1edf515d92006d029575e10b4199be4ac290a01a8ab433c71e075852274a8ae43 AUX make-4.2.1-perl526.patch 655 BLAKE2B 98bc8bf7ec5bcdb0d726b046ae58cebada8e360087da4c212da19a4cda622c5bbc1c00782802589aee3142a62c3b8a2df18cfa8bc98c523e2eb65aaa29398a6d SHA512 3817f6efed5fbcd2bb9d1747bea4af5a197ef4aa552ab79accee5139d25241956eca669edd19eff32df2a51fee666b6bc398fb6277b1f92f6175eca2d2228d6e +AUX make-4.2.1-pselect-non-blocking.patch 4476 BLAKE2B da96e19c42a4a98714fa1de17e32bd0acd6cb553e34622945b2ea1c7cc6269b0c033fd60a7da19b80b80469e1340f33dfeedb42508e610dd5726c461bdf7d914 SHA512 39c83ee50cc2a5e8d30c77081e3c12e2848ba558bbbb3cc9eade7087a5514aaed13cdbb23caa7d4ab2047e62a65fc638622310b53faa4ff80b20daafb2e33d7c DIST make-4.2.1.tar.bz2 1407126 BLAKE2B fa6d43f5fd46182182a296c58dcd138a1a4568104eda760bbb3c241c023dee216789cf3128e5ac2b416cec76e1ba82d5b5e7852da12e86138a7d0865c85a42b4 SHA512 9cf00869a2f938492554f71d8cb288b5b009b3bd0489ef164f2c8f6532fc37db5c7e20af1dea288536e7c9710ee0bc6e1ddcdfc4928a8540e6e43661741825b8 EBUILD make-4.2.1-r3.ebuild 1662 BLAKE2B 996e5bc27c0e26ffef1a876e79f5dfef58cda43a6a676f45bf05aad301cb7c11e5c8cd7c786a2d751720b73f0f276edd3da826f43c6bab422a3e7a345ef1b5cf SHA512 12360a215fa6fc924bcf34bef9c544ac989b6db4cc76463e3134356a1201fc8d73a31d256cbd5b9746a381a4aa3b486b17fc386a70a80fc8f4a7a2d96ff1ee83 +EBUILD make-4.2.1-r4.ebuild 1731 BLAKE2B 05f7012267af0a47636d7a38059c9dd5996ca53242142d87f8ae43d207928c99f669d7d59ed6d7217d5701975cb0ceb2b3ad236da0c5f5253793d826332be108 SHA512 f0350f156a400b45cae90e0a2ac0f7c3f8e5ff2d2a9b627814de416ca984c55931bddd957d67536b0bcbae07096d5b0cb0bc88ae64590d70eabb129e658e0388 MISC metadata.xml 253 BLAKE2B 295e9d6d93aaa12af413972e1590c67087801cc09c9aa6b59d4606c0f4106d1dacf2baa9858559083b4c6d91beeef218d0729e8593a33788958da6d2897e8ce2 SHA512 54a9069aeb4165d2dff3d473c8001bc51613aac9dff3f7f5e9971a9891a737a31511ffa11cbd523febe581ac1d9de2bdf2f40410f0c4239138f2ccca3ef15555 diff --git a/sys-devel/make/files/make-4.2.1-pselect-non-blocking.patch b/sys-devel/make/files/make-4.2.1-pselect-non-blocking.patch new file mode 100644 index 000000000000..61e19516f3c3 --- /dev/null +++ b/sys-devel/make/files/make-4.2.1-pselect-non-blocking.patch @@ -0,0 +1,172 @@ +https://bugs.gentoo.org/664632 + +From b552b05251980f693c729e251f93f5225b400714 Mon Sep 17 00:00:00 2001 +From: Paul Smith <psmith@gnu.org> +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 +--- a/posixos.c ++++ b/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 + diff --git a/sys-devel/make/make-4.2.1-r4.ebuild b/sys-devel/make/make-4.2.1-r4.ebuild new file mode 100644 index 000000000000..fbc399d853b2 --- /dev/null +++ b/sys-devel/make/make-4.2.1-r4.ebuild @@ -0,0 +1,59 @@ +# Copyright 1999-2018 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +EAPI="6" + +inherit flag-o-matic + +DESCRIPTION="Standard tool to compile source trees" +HOMEPAGE="https://www.gnu.org/software/make/make.html" +SRC_URI="mirror://gnu//make/${P}.tar.bz2" + +LICENSE="GPL-3+" +SLOT="0" +KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~ppc-aix ~x64-cygwin ~amd64-fbsd ~x86-fbsd ~amd64-linux ~arm-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~m68k-mint ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris" +IUSE="guile nls static" + +CDEPEND="guile? ( >=dev-scheme/guile-1.8:= )" +DEPEND="${CDEPEND} + nls? ( sys-devel/gettext )" +RDEPEND="${CDEPEND} + nls? ( virtual/libintl )" + +PATCHES=( + "${FILESDIR}"/${PN}-3.82-darwin-library_search-dylib.patch + "${FILESDIR}"/${PN}-4.2-default-cxx.patch + "${FILESDIR}"/${PN}-4.2.1-perl526.patch + "${FILESDIR}"/${PN}-4.2.1-glob-internals.patch + "${FILESDIR}"/${PN}-4.2.1-pselect-non-blocking.patch +) + +src_prepare() { + default + # These patches require special handling as they modify configure.ac + # which in turn triggers maintainer-mode when being applied the + # usual way. + eapply -Z "${FILESDIR}"/${PN}-4.2.1-glob-v2.patch \ + "${FILESDIR}"/${P}-guile-2.2.patch +} + +src_configure() { + use static && append-ldflags -static + local myeconfargs=( + --program-prefix=g + $(use_with guile) + $(use_enable nls) + ) + econf "${myeconfargs[@]}" +} + +src_install() { + emake DESTDIR="${D}" install + dodoc AUTHORS NEWS README* + if [[ ${USERLAND} == "GNU" ]] ; then + # we install everywhere as 'gmake' but on GNU systems, + # symlink 'make' to 'gmake' + dosym gmake /usr/bin/make + dosym gmake.1 /usr/share/man/man1/make.1 + fi +} |