Compare commits

...

91 Commits

Author SHA1 Message Date
Fedora Release Engineering
bcee1864f4 Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2022-07-21 20:25:13 +00:00
DJ Delorie
7a05dfee17 Add SCL compatibility to LTS builds.
Adds basic compatibility without needing the full SCL toolchain.
2022-07-14 16:10:35 -04:00
DJ Delorie
b3884b6199 Add support for LTS versioned sub-packages
This change allows you to use one common spec file for two purposes:

1. If the name is set to "make" you get the same make-X.Y packages
as before.

2. If the name is set to "make-latest" you get a make-latest
meta-package and a makeXY subpackage on which it depends.  The
subpackage installs in /opt (or elsewhere) to avoid conflict with an
installed make-X.Y.  In this case, the user should edit:

  %global make make43   <-- to match the version being installed
  %global _prefix /opt/rh/%{make}  <-- to where you want it
2022-06-29 15:51:14 -04:00
DJ Delorie
00a29b7cdd Avoid large stack usage, require perl core modules
Rewrite filter/filter-out to avoid large stack usage.
Require perl core modules for testsuite

Resolves: #2010506

Reviewed-by: Carlos O'Donell <carlos@redhat.com>
2022-04-08 15:48:01 -04:00
Fedora Release Engineering
dc62df15c3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2022-01-20 18:36:11 +00:00
Fedora Release Engineering
48f881d9ec - Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2021-07-22 13:39:27 +00:00
DJ Delorie
ae5b60c6a1 Allow changing defaults for guile support. 2021-02-19 14:40:02 -05:00
Michal Kolar
34e875fab2 init FMF CI gating 2021-02-12 13:45:49 +00:00
Fedora Release Engineering
6925c68189 - Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2021-01-26 19:10:00 +00:00
Tom Stellard
3e611c05a0 Add BuildRequires: make
https://fedoraproject.org/wiki/Changes/Remove_make_from_BuildRoot
2021-01-06 21:23:31 +00:00
DJ Delorie
c55f31d05d Disable inheritance of jobserver FDs for recursive make. BZ #1827850
Backport upstream git d79fe162c009788888faaf0317253b6f0cac7092
https://bugzilla.redhat.com/show_bug.cgi?id=1827850
https://savannah.gnu.org/bugs/?58232
Remove on next make rebase
2020-07-29 17:56:00 -04:00
Fedora Release Engineering
efd32f8da0 - Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2020-07-28 06:46:48 +00:00
DJ Delorie
0d6b893b6e Update make-4.3 source tarball 2020-03-11 22:09:15 -04:00
DJ Delorie
56a9df0d91 Update to 4.3
Remove patches which have been applied upstream.
Remove old patches that were to help with the 3.8->4.0 migration.
Rebase the remaining patches.
2020-03-11 21:59:43 -04:00
Fedora Release Engineering
4bec0ace93 - Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2020-01-29 11:55:22 +00:00
DJ Delorie
b119ff1512 Use a non-blocking read with pselect to avoid hangs. BZ #1556839
Merges upstream git b552b05251980f693c729e251f93f5225b400714
https://savannah.gnu.org/bugs/?51159
2019-12-06 15:03:37 -05:00
Fedora Release Engineering
a58f35f819 - Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2019-07-25 15:45:58 +00:00
Igor Gnatenko
7f806a278b
Run autoreconf
Otherwise on arches like s390x it doesn't detect guile support.

Signed-off-by: Igor Gnatenko <ignatenkobrain@fedoraproject.org>
2019-02-17 22:14:58 +01:00
Igor Gnatenko
0bdbc64c9d
Switch to latest guile version
Signed-off-by: Igor Gnatenko <ignatenkobrain@fedoraproject.org>
2019-02-17 21:29:51 +01:00
Fedora Release Engineering
3c945c8317 - Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2019-02-01 09:32:51 +00:00
Igor Gnatenko
de7f11af49 Remove obsolete Group tag
References: https://fedoraproject.org/wiki/Changes/Remove_Group_Tag
2019-01-28 20:24:14 +01:00
Igor Gnatenko
e5dfe9e074
Remove obsolete scriptlets
References: https://fedoraproject.org/wiki/Changes/RemoveObsoleteScriptlets
Signed-off-by: Igor Gnatenko <ignatenkobrain@fedoraproject.org>
2019-01-27 19:39:09 +01:00
Fedora Release Engineering
36f155c8bb - Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2018-07-13 09:43:18 +00:00
Jason Tibbitts
95ae6bbdd1 Remove needless use of %defattr 2018-07-10 01:54:39 -05:00
Patsy Franklin
519a7c5bcb Fix build failure caused by automake versioning differences related
to the glob changes.

  Fix testing failure due to Perl changes related to expanding paths.
2018-04-25 15:23:40 -04:00
Patsy Franklin
993b78d5a3 Merge #1 Add CI tests using the standard test interface 2018-03-18 23:00:22 +00:00
Rex Dieter
49f4723b0c BR: gcc, rebuild (guile) 2018-02-20 11:59:10 -06:00
Igor Gnatenko
c34a6d6d07
Remove %clean section
None of currently supported distributions need that.
Last one was EL5 which is EOL for a while.

Signed-off-by: Igor Gnatenko <ignatenkobrain@fedoraproject.org>
2018-02-14 09:07:14 +01:00
Igor Gnatenko
694b30dfe6 Remove BuildRoot definition
None of currently supported distributions need that.
It was needed last for EL5 which is EOL now

Signed-off-by: Igor Gnatenko <ignatenkobrain@fedoraproject.org>
2018-02-13 23:48:04 +01:00
Fedora Release Engineering
dae5f53f05 - Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2018-02-08 00:48:42 +00:00
Igor Gnatenko
3ffc99baef
Fix wrong assumptions of glibc's glob internals
Signed-off-by: Igor Gnatenko <ignatenkobrain@fedoraproject.org>
2018-02-02 12:16:24 +01:00
Richard W.M. Jones
9c4a278bbd Add upstream patch to fix incorrect use of glibc 2.27 glob internals.
With glibc 2.27:

glob/libglob.a(glob.o): In function `glob_in_dir':
/home/rjones/d/fedora/make/master/make-4.2.1/glob/glob.c:1367: undefined reference to `__alloca'
/home/rjones/d/fedora/make/master/make-4.2.1/glob/glob.c:1342: undefined reference to `__alloca'
/home/rjones/d/fedora/make/master/make-4.2.1/glob/glob.c:1283: undefined reference to `__alloca'
/home/rjones/d/fedora/make/master/make-4.2.1/glob/glob.c:1256: undefined reference to `__alloca'
glob/libglob.a(glob.o): In function `glob':
/home/rjones/d/fedora/make/master/make-4.2.1/glob/glob.c:581: undefined reference to `__alloca'
glob/libglob.a(glob.o):/home/rjones/d/fedora/make/master/make-4.2.1/glob/glob.c:732: more undefined references to `__alloca' follow
collect2: error: ld returned 1 exit status

This is fixed upstream by:

http://git.savannah.gnu.org/cgit/make.git/patch/?id=48c8a116a914a325a0497721f5d8b58d5bba34d4

Note that the additional BuildRequires: autoconf, automake can be
removed after this patch is available in an upstream tarball.
2018-02-01 22:09:32 +00:00
Serhii Turivny
f83aa1e94f Add CI tests using the standard test interface 2017-10-10 16:39:07 +03:00
Fedora Release Engineering
539d55578b - Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild 2017-08-03 03:01:46 +00:00
Fedora Release Engineering
7a6a3abdcd - Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild 2017-07-26 20:46:19 +00:00
Petr Písař
ef864d2be6 perl dependency renamed to perl-interpreter <https://fedoraproject.org/wiki/Changes/perl_Package_to_Install_Core_Modules> 2017-07-12 14:26:47 +02:00
Stephen Gallagher
966e01fab7
Add missing %license macro 2017-02-01 20:42:52 -05:00
Patsy Franklin
2bfdac0113 Resolves: #1338558
- Rebase to make-4.2.1. Remove obsolete patches.
2016-09-25 18:04:08 -04:00
Patsy Franklin
d6bbfbfe82 - make test suite requires perl. 2016-09-25 16:33:36 -04:00
Dennis Gilmore
3fc63a36eb - Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild 2016-02-04 04:48:27 +00:00
Patsy Franklin
ec9e7e7c9c Resolves: #1277968
- Handle NULL returns from ttyname().
2015-11-04 16:05:03 -05:00
Patsy Franklin
5fe9b3a45f Resolves: #1194429
- Enable Guile support.
2015-10-30 01:43:50 -04:00
Patsy Franklin
2d4dfd6bee Resolves: #1150488
- Make 4.1 update, including patches included in make-4.0.
2015-10-29 22:58:16 -04:00
Zbigniew Jędrzejewski-Szmek
e5494879d5 Update to 4.1
Drop some unecessary elements of the spec file. Drop patches which
have been applied upstream or solved in another way, or don't apply
anymore.
2015-10-24 18:41:26 -04:00
Dennis Gilmore
97dd22fe6f - Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild 2015-06-17 19:24:35 +00:00
Jaromir Capik
4bdfdfc1de Adding STAGE1 bootstrap recipe 2015-06-16 21:37:51 +02:00
Till Maas
16e43594e4 Rebuilt for Fedora 23 Change
https://fedoraproject.org/wiki/Changes/Harden_all_packages_with_position-independent_code
2015-02-21 22:24:29 +01:00
Kyle McMartin
bdf98ed389 Pass the test-suite unconditionally until I fix the tests to cope with
deterministic ar archives (which result in expected rebuilds not occuring)
2014-09-03 10:18:47 -04:00
Peter Robinson
ee7f908927 - Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild 2014-08-17 08:33:29 +00:00
Dennis Gilmore
e62c874ba6 - Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild 2014-06-07 02:47:42 -05:00
Patsy Franklin
7b4e48e3b0 Resolves: #1017084
- Rebase to make-4.0
2014-04-30 22:35:14 -04:00
Petr Machata
7cf149fc79 Restore stack limit in processes spawned through $(shell)
- That caused intermittent failures in targets/SECONDARY.  Turns out
  those are caused by the test suite being non-deterministic.  Add a
  patch for that as well.
2013-08-22 18:17:20 +02:00
Petr Machata
ba10d75822 Backport upstream patch that adds wildcard expansion to pattern rules 2013-07-26 19:50:58 +02:00
Petr Machata
201e8d2a73 Add another fix for upstream bug 30612 2013-06-19 13:30:16 +02:00
Petr Machata
c2611a71f6 Update config.sub and config.guess to support aarch64 2013-04-04 16:23:23 +02:00
Dennis Gilmore
aa3f81378c - Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild 2013-02-14 00:15:29 -06:00
Petr Machata
4cf7c2db3f Drop patch5, which hasn't been applied for years 2012-11-29 20:02:41 +01:00
Petr Machata
a6daa69369 Actually add the patch from previous commit 2012-09-10 20:35:33 +02:00
Petr Machata
3c30cb13ff Add fix for upstream bug 30653, RH#835424 2012-09-10 20:30:20 +02:00
Petr Machata
19e83e35df Add one patch comment, fix another 2012-09-10 20:28:59 +02:00
Dennis Gilmore
f922366e1d Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild 2012-07-27 00:51:19 -05:00
Petr Machata
c662835b9a Add a patch for avoiding glob if possible 2012-03-13 23:03:27 +01:00
Petr Machata
e8bdb89472 Apply two patches proposed upstream 2012-03-13 00:12:30 +01:00
Petr Machata
3fa94216f6 Update gitignore 2012-03-13 00:11:47 +01:00
Dennis Gilmore
73b059a9b3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild 2012-01-13 03:15:51 -06:00
Petr Machata
d15338db67 Merge branch 'master' of ssh://pkgs.fedoraproject.org/make
Conflicts:
	make.spec
2011-11-03 10:35:26 +01:00
Petr Machata
88ea1307f7 Add a patch for preserving -j across Makefile rebuild 2011-11-03 10:33:23 +01:00
Dennis Gilmore
122b5f0711 - Rebuilt for glibc bug#747377 2011-10-26 19:11:55 -05:00
Lubomir Rintel
2257aac321 Fix free-after-use with nested assignments (#703104) 2011-05-12 11:58:47 +02:00
Dennis Gilmore
f4292858b8 - Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild 2011-02-08 09:06:53 -06:00
Petr Machata
ccbdcb62ff Merge branch 'f14/master'
Conflicts:
	make.spec
2010-10-27 02:48:02 +02:00
Petr Machata
49cf6ef2f1 Merge remote branch 'origin/f14/master' into f14/master
Conflicts:
	make.spec
2010-10-27 02:45:42 +02:00
Petr Machata
4527792b27 func_sort should use isblank, not isspace 2010-10-27 02:43:31 +02:00
Jesse Keating
f03de169f9 - Rebuilt for gcc bug 634757 2010-09-29 22:57:29 -07:00
Jesse Keating
9f8da0d334 - Rebuilt for gcc bug 634757 2010-09-29 14:46:13 -07:00
Petr Machata
656d7d1eb5 Add upstream fixes for upstream bugs 30612 and 30723
- savannah #30723 - implicit re-executing of subdirs
- savannah #30612 - error parsing library references
- RHBZ 631552 - make 3.82 fails on a valid dependency
2010-09-13 13:56:02 +02:00
Petr Machata
8105161bd7 - Upstream 3.82:
- Drop rlimit, fdleak, strcpy-overlap, recursion-test, double-free
    patches, make supports this functionality now
  - Disable the memory patch for the time being
  - Port remaining patches
  - Add weird-shell patch, upstream bug 30748
- Resolves: #618998
2010-08-12 15:25:36 +02:00
Petr Machata
83d3b5a753 - Add BR procps
- Resolves: #616813
2010-08-11 11:35:23 +02:00
Fedora Release Engineering
fd10e2cd33 dist-git conversion 2010-07-29 02:51:29 +00:00
Jesse Keating
26212b01e8 Fix the release to match the changelog and upgrade path 2010-07-12 22:52:26 +00:00
Petr Machata
1be63b156a - Add a patch by Steve Kemp @debian that might fix the double free problem.
- Related: #609806
2010-07-01 14:13:38 +00:00
Petr Machata
9c0942e9d9 - Fix testsuite on F13
- Resolves: #600004
2010-06-04 12:13:11 +00:00
Bill Nottingham
1c7ca6c48f Fix typo that causes a failure to update the common directory. (releng
#2781)
2009-11-25 23:18:40 +00:00
Petr Machata
bed4db9ca3 - Fix installation with --excludedocs
- Resolves: #515917
- Change previous ChangeLog entry, it turned out that that commit actually
    did resolve the mentioned bug.
2009-08-11 14:09:31 +00:00
Petr Machata
f9dc59f27b - Replace the use of strcpy on overlapping areas with memmove. It's
possible that this ...
- Resolves: #514721
2009-07-31 11:48:15 +00:00
Jesse Keating
7b15cec2a5 - Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild 2009-07-25 11:41:11 +00:00
Jesse Keating
63abf036f3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild 2009-02-25 23:01:14 +00:00
Petr Machata
9d4c9891e3 - Fix patches to apply cleanly with fuzz=0 2008-09-22 10:52:47 +00:00
Petr Machata
e801fa1472 - Mark opened files as cloexec to prevent their leaking through fork
- Resolves: #462090
2008-09-22 08:42:20 +00:00
Petr Machata
eb9bbd322e - Fix the rlimit patch. The success flag is kept in memory shared with
parent process after vfork, and so cannot be reset.
- Related: #214033
2008-03-25 17:38:16 +00:00
Jesse Keating
5710b6e4bb - Autorebuild for GCC 4.3 2008-02-19 19:59:45 +00:00
50 changed files with 1511 additions and 679 deletions

View File

@ -1 +0,0 @@
make-3.81.tar.bz2

1
.fmf/version Normal file
View File

@ -0,0 +1 @@
1

8
.gitignore vendored Normal file
View File

@ -0,0 +1,8 @@
make-3.81.tar.bz2
/make-*/
make-3.82.tar.bz2
*.rpm
/make-4.0.tar.bz2
/make-4.1.tar.bz2
/make-4.2.1.tar.bz2
/make-4.3.tar.gz

View File

@ -1,21 +0,0 @@
# Makefile for source rpm: make
# $Id: Makefile,v 1.1 2004/09/09 08:11:20 cvsdist Exp $
NAME := make
SPECFILE = $(firstword $(wildcard *.spec))
define find-makefile-common
for d in common ../common ../../common ; do if [ -f $$d/Makefile.common ] ; then if [ -f $$d/CVS/Root -a -w $$/Makefile.common ] ; then cd $$d ; cvs -Q update ; fi ; echo "$$d/Makefile.common" ; break ; fi ; done
endef
MAKEFILE_COMMON := $(shell $(find-makefile-common))
ifeq ($(MAKEFILE_COMMON),)
# attempt a checkout
define checkout-makefile-common
test -f CVS/Root && { cvs -Q -d $$(cat CVS/Root) checkout common && echo "common/Makefile.common" ; } || { echo "ERROR: I can't figure out how to checkout the 'common' module." ; exit -1 ; } >&2
endef
MAKEFILE_COMMON := $(shell $(checkout-makefile-common))
endif
include $(MAKEFILE_COMMON)

7
STAGE1-make Normal file
View File

@ -0,0 +1,7 @@
srpm $1
mcd $BUILDDIR/$1
$SRC/${1}-*/configure $TCONFIGARGS
notparallel
test -d tools/gnulib/lib && make $J V=1 -C tools/gnulib/lib
make $J V=1
make $J install DESTDIR=${ROOTFS}

19
gating.yaml Normal file
View File

@ -0,0 +1,19 @@
--- !Policy
product_versions:
- fedora-*
decision_context: bodhi_update_push_stable
subject_type: koji_build
rules:
- !PassingTestCaseRule {test_case_name: fedora-ci.koji-build.tier0.functional}
--- !Policy
product_versions:
- rhel-8
decision_context: osci_compose_gate
rules:
- !PassingTestCaseRule {test_case_name: baseos-ci.brew-build.tier1.functional}
--- !Policy
product_versions:
- rhel-9
decision_context: osci_compose_gate
rules:
- !PassingTestCaseRule {test_case_name: baseos-ci.brew-build.tier1.functional}

View File

@ -1,11 +0,0 @@
--- make-3.80/configure
+++ make-3.80/configure
@@ -6794,7 +6794,7 @@
fi
rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
if test "$ac_cv_search_clock_gettime" = no; then
- for ac_lib in rt posix4; do
+ for ac_lib in posix4; do
LIBS="-l$ac_lib $ac_func_search_save_LIBS"
cat >conftest.$ac_ext <<_ACEOF
#line $LINENO "configure"

View File

@ -1,11 +0,0 @@
--- make-3.80/make.h.jj 2002-09-11 12:55:44.000000000 -0400
+++ make-3.80/make.h 2005-03-07 09:24:53.000000000 -0500
@@ -474,7 +474,7 @@ extern long int lseek ();
#endif /* Not GNU C library or POSIX. */
#ifdef HAVE_GETCWD
-# if !defined(VMS) && !defined(__DECC)
+# if !defined(VMS) && !defined(__DECC) && !defined(getcwd)
extern char *getcwd ();
#endif
#else

View File

@ -1,23 +0,0 @@
--- make-3.80/main.c.jj 2002-08-09 21:27:17.000000000 -0400
+++ make-3.80/main.c 2004-12-13 12:48:25.000000000 -0500
@@ -1549,6 +1549,20 @@ int main (int argc, char ** argv)
}
}
+#ifdef PIPE_BUF
+ if (job_slots > PIPE_BUF)
+#elif defined _POSIX_PIPE_BUF
+ if (job_slots > _POSIX_PIPE_BUF)
+#else
+ if (job_slots > 512)
+#endif
+ {
+ error (NILF,
+ _("More parallel jobs (-jN) than this platform can handle requested."));
+ error (NILF, _("Resetting to single job (-j1) mode."));
+ job_slots = 1;
+ }
+
/* If we have >1 slot but no jobserver-fds, then we're a top-level make.
Set up the pipe and install the fds option for our children. */

View File

@ -1,151 +0,0 @@
--- make-3.80/misc.c.jj 2002-09-12 18:15:58.000000000 -0400
+++ make-3.80/misc.c 2005-08-22 05:46:05.000000000 -0400
@@ -311,17 +311,31 @@ strerror (errnum)
/* Print an error message from errno. */
+void
+perror_with_name_err (const char *str, const char *name, int errnum)
+{
+ error (NILF, _("%s%s: %s"), str, name, strerror (errnum));
+}
+
void
perror_with_name (const char *str, const char *name)
{
- error (NILF, _("%s%s: %s"), str, name, strerror (errno));
+ perror_with_name_err (str, name, errno);
}
/* Print an error message from errno and exit. */
+void
+pfatal_with_name_err (const char *name, int errnum)
+{
+ fatal (NILF, _("%s: %s"), name, strerror (errnum));
+
+ /* NOTREACHED */
+}
+
void
pfatal_with_name (const char *name)
{
- fatal (NILF, _("%s: %s"), name, strerror (errno));
+ pfatal_with_name_err (name, errno);
/* NOTREACHED */
}
--- make-3.81/main.c.jj 2006-05-23 12:51:25.000000000 +0200
+++ make-3.81/main.c 2006-05-23 12:50:48.000000000 +0200
@@ -1502,13 +1502,13 @@
strcat (template, DEFAULT_TMPFILE);
outfile = open_tmpfile (&stdin_nm, template);
if (outfile == 0)
- pfatal_with_name (_("fopen (temporary file)"));
+ pfatal_with_name_err (_("fopen (temporary file)"), errno);
while (!feof (stdin) && ! ferror (stdin))
{
char buf[2048];
unsigned int n = fread (buf, 1, sizeof (buf), stdin);
if (n > 0 && fwrite (buf, 1, n, outfile) != n)
- pfatal_with_name (_("fwrite (temporary file)"));
+ pfatal_with_name_err (_("fwrite (temporary file)"), errno);
}
(void) fclose (outfile);
@@ -1681,7 +1681,7 @@
else if ((job_rfd = dup (job_fds[0])) < 0)
{
if (errno != EBADF)
- pfatal_with_name (_("dup jobserver"));
+ pfatal_with_name_err (_("dup jobserver"), errno);
error (NILF,
_("warning: jobserver unavailable: using -j1. Add `+' to parent make rule."));
@@ -1721,7 +1721,7 @@
char c = '+';
if (pipe (job_fds) < 0 || (job_rfd = dup (job_fds[0])) < 0)
- pfatal_with_name (_("creating jobs pipe"));
+ pfatal_with_name_err (_("creating jobs pipe"), errno);
/* Every make assumes that it always has one job it can run. For the
submakes it's the token they were given by their parent. For the
@@ -1736,7 +1736,7 @@
EINTRLOOP (r, write (job_fds[1], &c, 1));
if (r != 1)
- pfatal_with_name (_("init jobserver pipe"));
+ pfatal_with_name_err (_("init jobserver pipe"), errno);
}
/* Fill in the jobserver_fds struct for our children. */
@@ -2151,8 +2151,8 @@
/* If there is a temp file from reading a makefile from stdin, get rid of
it now. */
if (stdin_nm && unlink (stdin_nm) < 0 && errno != ENOENT)
- perror_with_name (_("unlink (temporary file): "), stdin_nm);
+ perror_with_name_err (_("unlink (temporary file): "), stdin_nm, errno);
{
int status;
--- make-3.81/make.h.jj 2006-05-23 12:54:45.000000000 +0200
+++ make-3.81/make.h 2006-05-23 12:55:00.000000000 +0200
@@ -414,6 +414,8 @@
extern void log_working_directory PARAMS ((int));
extern void pfatal_with_name PARAMS ((const char *)) __attribute__ ((noreturn));
extern void perror_with_name PARAMS ((const char *, const char *));
+extern void pfatal_with_name_err PARAMS ((const char *, int errnum)) __attribute__ ((noreturn));
+extern void perror_with_name_err PARAMS ((const char *, const char *, int errnum));
extern char *savestring PARAMS ((const char *, unsigned int));
extern char *concat PARAMS ((const char *, const char *, const char *));
extern char *xmalloc PARAMS ((unsigned int));
--- make-3.81/job.c.jj 2006-05-23 13:01:35.000000000 +0200
+++ make-3.81/job.c 2006-05-23 13:50:44.000000000 +0200
@@ -859,7 +859,7 @@
EINTRLOOP (r, write (job_fds[1], &token, 1));
if (r != 1)
- pfatal_with_name (_("write jobserver"));
+ pfatal_with_name_err (_("write jobserver"), errno);
DB (DB_JOBS, (_("Released token for child 0x%08lx (%s).\n"),
(unsigned long int) child, child->file->name));
@@ -1699,6 +1699,7 @@
/* Set interruptible system calls, and read() for a job token. */
set_child_handler_action_flags (1, waiting_jobs != NULL);
+ errno = 0;
got_token = read (job_rfd, &token, 1);
saved_errno = errno;
set_child_handler_action_flags (0, waiting_jobs != NULL);
@@ -1713,10 +1714,14 @@
/* If the error _wasn't_ expected (EINTR or EBADF), punt. Otherwise,
go back and reap_children(), and try again. */
- errno = saved_errno;
- if (errno != EINTR && errno != EBADF)
- pfatal_with_name (_("read jobs pipe"));
- if (errno == EBADF)
+ if (saved_errno != EINTR && saved_errno != EBADF)
+ {
+ if (got_token == 0)
+ fatal (NILF, _("read jobs pipe EOF"));
+ else
+ pfatal_with_name_err (_("read jobs pipe"), saved_errno);
+ }
+ if (saved_errno == EBADF)
DB (DB_JOBS, ("Read returned EBADF.\n"));
}
#endif
@@ -1831,7 +1836,7 @@
error (NILF,
_("cannot enforce load limits on this operating system"));
else
- perror_with_name (_("cannot enforce load limit: "), "getloadavg");
+ perror_with_name_err (_("cannot enforce load limit: "), "getloadavg", errno);
}
lossage = errno;
load = 0;

View File

@ -1,18 +0,0 @@
diff -urp make-3.81/main.c make-3.81-pm/main.c
--- make-3.81/main.c 2007-09-24 15:28:34.000000000 +0200
+++ make-3.81-pm/main.c 2007-09-24 15:32:50.000000000 +0200
@@ -1669,8 +1669,12 @@ main (int argc, char **argv, char **envp
if (job_slots > 0)
{
- close (job_fds[0]);
- close (job_fds[1]);
+ if (restarts == 0)
+ {
+ close (job_fds[0]);
+ close (job_fds[1]);
+ }
+
job_fds[0] = job_fds[1] = -1;
free (jobserver_fds->list);
free (jobserver_fds);

View File

@ -1,261 +0,0 @@
diff -Bburpd make-3.81_orig/file.c make-3.81/file.c
--- make-3.81_orig/file.c 2006-05-23 13:59:11.000000000 +0200
+++ make-3.81/file.c 2006-05-23 14:39:34.000000000 +0200
@@ -490,7 +490,7 @@ expand_deps (struct file *f)
o = subst_expand (buffer, d->name, "%", "$*", 1, 2, 0);
- free (d->name);
+ hash_strfree (d->name);
d->name = savestring (buffer, o - buffer);
d->staticpattern = 0; /* Clear staticpattern so that we don't
re-expand %s below. */
@@ -549,7 +549,7 @@ expand_deps (struct file *f)
dp->name[0] = '\0';
else
{
- free (dp->name);
+ hash_strfree (dp->name);
dp->name = savestring (buffer, o - buffer);
}
}
@@ -580,7 +580,7 @@ expand_deps (struct file *f)
if (d1->file == 0)
d1->file = enter_file (d1->name);
else
- free (d1->name);
+ hash_strfree (d1->name);
d1->name = 0;
d1->staticpattern = 0;
d1->need_2nd_expansion = 0;
Only in make-3.81: file.c~
diff -Bburpd make-3.81_orig/implicit.c make-3.81/implicit.c
--- make-3.81_orig/implicit.c 2006-05-23 13:59:11.000000000 +0200
+++ make-3.81/implicit.c 2006-05-23 14:40:01.000000000 +0200
@@ -864,7 +864,7 @@ pattern_search (struct file *file, int a
dep->file = enter_file (dep->name);
/* enter_file uses dep->name _if_ we created a new file. */
if (dep->name != dep->file->name)
- free (dep->name);
+ hash_strfree (dep->name);
dep->name = 0;
dep->file->tried_implicit |= dep->changed;
}
Only in make-3.81: implicit.c~
diff -Bburpd make-3.81_orig/main.c make-3.81/main.c
--- make-3.81_orig/main.c 2006-05-23 13:59:11.000000000 +0200
+++ make-3.81/main.c 2006-05-23 14:40:49.000000000 +0200
@@ -540,6 +540,7 @@ initialize_global_hash_tables (void)
init_hash_files ();
hash_init_directories ();
hash_init_function_table ();
+ init_hash_strings ();
}
static struct file *
Only in make-3.81: main.c~
diff -Bburpd make-3.81_orig/make.h make-3.81/make.h
--- make-3.81_orig/make.h 2006-05-23 13:59:11.000000000 +0200
+++ make-3.81/make.h 2006-05-23 14:41:21.000000000 +0200
@@ -431,6 +431,11 @@ extern void print_spaces PARAMS ((unsign
extern char *find_percent PARAMS ((char *));
extern FILE *open_tmpfile PARAMS ((char **, const char *));
+extern void init_hash_strings PARAMS ((void));
+extern char *hash_strdup PARAMS ((const char *));
+extern char *hash_savestring PARAMS ((const char *, unsigned int));
+extern void hash_strfree PARAMS ((char *));
+
#ifndef NO_ARCHIVES
extern int ar_name PARAMS ((char *));
extern void ar_parse_name PARAMS ((char *, char **, char **));
Only in make-3.81: make.h~
diff -Bburpd make-3.81_orig/misc.c make-3.81/misc.c
--- make-3.81_orig/misc.c 2006-05-23 13:59:11.000000000 +0200
+++ make-3.81/misc.c 2006-05-23 14:42:59.000000000 +0200
@@ -16,8 +16,10 @@ You should have received a copy of the G
GNU Make; see the file COPYING. If not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. */
+#include <assert.h>
#include "make.h"
#include "dep.h"
+#include "hash.h"
#include "debug.h"
/* Variadic functions. We go through contortions to allow proper function
@@ -511,7 +513,7 @@ void
free_dep (struct dep *d)
{
if (d->name != 0)
- free (d->name);
+ hash_strfree (d->name);
if (d->stem != 0)
free (d->stem);
@@ -535,7 +537,7 @@ copy_dep_chain (const struct dep *d)
bcopy ((char *) d, (char *) c, sizeof (struct dep));
if (c->name != 0)
- c->name = xstrdup (c->name);
+ c->name = hash_strdup (c->name);
if (c->stem != 0)
c->stem = xstrdup (c->stem);
@@ -909,3 +911,154 @@ close_stdout (void)
exit (EXIT_FAILURE);
}
}
+
+/* Hash table of duplicated strings. */
+
+struct hash_string
+{
+ char *string;
+ unsigned int count;
+};
+
+static unsigned long
+string_hash_1 (key)
+ const void *key;
+{
+ return_ISTRING_HASH_1 (((const struct hash_string *) key)->string);
+}
+
+static unsigned long
+string_hash_2 (key)
+ const void *key;
+{
+ return_ISTRING_HASH_2 (((const struct hash_string *) key)->string);
+}
+
+static int
+string_hash_cmp (x, y)
+ const void *x;
+ const void *y;
+{
+ return_ISTRING_COMPARE (((const struct hash_string *) x)->string,
+ ((const struct hash_string *) y)->string);
+}
+
+static struct hash_table strings;
+
+void
+init_hash_strings ()
+{
+ hash_init (&strings, 1000, string_hash_1, string_hash_2,
+ string_hash_cmp);
+}
+
+/* Keep track duplicated string and return the old one if exists. */
+
+char *
+hash_strdup (ptr)
+ const char *ptr;
+{
+ struct hash_string *h, key;
+
+ if (*ptr == '\0')
+ return "";
+
+ key.string = (char *) ptr;
+ key.count = 0;
+ h = (struct hash_string *) hash_find_item (&strings, &key);
+ if (h == NULL)
+ {
+ char *result = (char *) malloc (strlen (ptr) + 1);
+
+ if (result == NULL)
+ fatal (NILF, _("virtual memory exhausted"));
+
+ strcpy (result, ptr);
+
+ h = (struct hash_string *) malloc (sizeof (struct hash_string));
+ if (h == NULL)
+ fatal (NILF, _("virtual memory exhausted"));
+
+ h->string = result;
+ h->count = 1;
+ hash_insert (&strings, h);
+ }
+ else
+ {
+ h->count++;
+ assert (h->count != 0);
+ }
+
+ return h->string;
+}
+
+char *
+hash_savestring (str, length)
+ const char *str;
+ unsigned int length;
+{
+ struct hash_string *h, key;
+
+ if (length == 0 || *str == '\0')
+ return "";
+
+ key.string = alloca (length + 1);
+ key.count = 0;
+ bcopy (str, key.string, length);
+ key.string [length] = '\0';
+
+ h = (struct hash_string *) hash_find_item (&strings, &key);
+ if (h == NULL)
+ {
+ char *out = (char *) xmalloc (length + 1);
+ bcopy (str, out, length);
+ out[length] = '\0';
+
+ h = (struct hash_string *) malloc (sizeof (struct hash_string));
+ if (h == NULL)
+ fatal (NILF, _("virtual memory exhausted"));
+
+ h->string = out;
+ h->count = 1;
+ hash_insert (&strings, h);
+ }
+ else
+ {
+ h->count++;
+ assert (h->count != 0);
+ }
+
+ return h->string;
+}
+
+void
+hash_strfree (ptr)
+ char *ptr;
+{
+ struct hash_string *h, key;
+
+ if (*ptr == '\0')
+ return;
+
+ key.string = ptr;
+ key.count = 0;
+ h = (struct hash_string *) hash_find_item (&strings, &key);
+
+ /* Check if string comes from hash_strdup or hash_savestring. */
+ if (h == NULL || h->string != ptr)
+ {
+ free (ptr);
+ return;
+ }
+
+ h->count--;
+ if (h->count == 0)
+ {
+ struct hash_string *d;
+
+ d = hash_delete (&strings, h);
+ assert (d == h);
+ free (h->string);
+ free (h);
+ }
+}
Only in make-3.81: misc.c~
Only in make-3.81: read.c~

View File

@ -1,23 +0,0 @@
--- make-3.81-orig/job.c 2007-02-21 19:10:54.000000000 +0100
+++ make-3.81-pm/job.c 2007-02-22 18:13:59.000000000 +0100
@@ -2706,7 +2706,7 @@
unsigned int line_len = strlen (line);
char *new_line = (char *) alloca (shell_len + (sizeof (minus_c) - 1)
- + (line_len * 2) + 1);
+ + (line_len * 4) + 1);
char *command_ptr = NULL; /* used for batch_mode_shell mode */
# ifdef __EMX__ /* is this necessary? */
@@ -2740,9 +2740,10 @@
#endif
if (PRESERVE_BSNL)
{
- *(ap++) = '\\';
+ *(ap++) = '\'';
*(ap++) = '\\';
*(ap++) = '\n';
+ *(ap++) = '\'';
}
++p;

View File

@ -1,108 +0,0 @@
diff -Burp make-3.81/job.c make-3.81-pm/job.c
--- make-3.81/job.c 2006-11-30 11:00:23.000000000 +0100
+++ make-3.81-pm/job.c 2006-11-30 10:58:46.000000000 +0100
@@ -2079,6 +2079,9 @@ exec_command (char **argv, char **envp)
# else
/* Run the program. */
+#ifdef SET_STACK_SIZE
+ restore_original_stack_rlimit ();
+#endif
environ = envp;
execvp (argv[0], argv);
diff -Burp make-3.81/main.c make-3.81-pm/main.c
--- make-3.81/main.c 2006-11-30 11:00:23.000000000 +0100
+++ make-3.81-pm/main.c 2006-11-30 10:38:04.000000000 +0100
@@ -44,12 +44,51 @@ Foundation, Inc., 51 Franklin St, Fifth
# include <fcntl.h>
#endif
-#if defined(HAVE_SYS_RESOURCE_H) && defined(HAVE_GETRLIMIT) && defined(HAVE_SETRLIMIT)
-# define SET_STACK_SIZE
-#endif
-
#ifdef SET_STACK_SIZE
# include <sys/resource.h>
+/* Whether the rlimit was set successfuly */
+static int setrlimit_succeeded = 0;
+/* Original rlim_cur */
+static rlim_t setrlimit_orig_cur = 0;
+
+/* Get rid of any avoidable limit on stack size so that alloca does
+ not fail. */
+void
+set_max_stack_rlimit (void)
+{
+ struct rlimit rlim;
+
+ /* Back off if the limit is still set, probably due to failure in
+ restore_original_stack_rlimit. */
+ if (setrlimit_succeeded)
+ return;
+
+ if (getrlimit (RLIMIT_STACK, &rlim) == 0)
+ {
+ setrlimit_orig_cur = rlim.rlim_cur;
+ rlim.rlim_cur = rlim.rlim_max;
+ if (setrlimit (RLIMIT_STACK, &rlim) != -1)
+ setrlimit_succeeded = 1;
+ }
+}
+
+/* Set the rlimit back to its original value. To be called before
+ process spawn. */
+void
+restore_original_stack_rlimit (void)
+{
+ struct rlimit rlim;
+
+ if (!setrlimit_succeeded)
+ return;
+
+ if (getrlimit (RLIMIT_STACK, &rlim) == 0)
+ {
+ rlim.rlim_cur = setrlimit_orig_cur;
+ if (setrlimit (RLIMIT_STACK, &rlim) != -1)
+ setrlimit_succeeded = 0;
+ }
+}
#endif
#ifdef _AMIGA
@@ -915,17 +954,7 @@ main (int argc, char **argv, char **envp
#endif
#ifdef SET_STACK_SIZE
- /* Get rid of any avoidable limit on stack size. */
- {
- struct rlimit rlim;
-
- /* Set the stack limit huge so that alloca does not fail. */
- if (getrlimit (RLIMIT_STACK, &rlim) == 0)
- {
- rlim.rlim_cur = rlim.rlim_max;
- setrlimit (RLIMIT_STACK, &rlim);
- }
- }
+ set_max_stack_rlimit ();
#endif
#ifdef HAVE_ATEXIT
diff -Burp make-3.81/make.h make-3.81-pm/make.h
--- make-3.81/make.h 2006-11-30 11:00:23.000000000 +0100
+++ make-3.81-pm/make.h 2006-11-30 10:29:50.000000000 +0100
@@ -346,6 +346,13 @@ extern int strcmpi (const char *,const c
#define N_(msgid) gettext_noop (msgid)
#define S_(msg1,msg2,num) ngettext (msg1,msg2,num)
+/* Handle rlimit */
+#if defined(HAVE_SYS_RESOURCE_H) && defined(HAVE_GETRLIMIT) && defined(HAVE_SETRLIMIT)
+# define SET_STACK_SIZE
+void set_max_stack_rlimit (void);
+void restore_original_stack_rlimit (void);
+#endif
+
/* Handle other OSs. */
#if defined(HAVE_DOS_PATHS)
# define PATH_SEPARATOR_CHAR ';'

View File

@ -0,0 +1,14 @@
diff -up make-3.82/configure\~ make-3.82/configure
--- make-3.82/configure~ 2010-07-28 07:41:51.000000000 +0200
+++ make-3.82/configure 2010-08-11 15:07:50.000000000 +0200
@@ -7215,7 +7215,7 @@ return clock_gettime ();
return 0;
}
_ACEOF
-for ac_lib in '' rt posix4; do
+for ac_lib in '' posix4; do
if test -z "$ac_lib"; then
ac_res="none required"
else
Diff finished. Wed Aug 11 15:07:59 2010

36
make-4.3-cloexec.patch Normal file
View File

@ -0,0 +1,36 @@
From d79fe162c009788888faaf0317253b6f0cac7092 Mon Sep 17 00:00:00 2001
From: Kevin Buettner <kevinb@redhat.com>
Date: Thu, 23 Apr 2020 17:05:34 -0400
Subject: [SV 58232] Disable inheritance of jobserver FDs for recursive make
A parent make will invoke a sub-make with close-on-exec disabled for
the jobserver pipe FDs. Force close-on-exec to be to be enabled in
the sub-make so the pipe is not always passed to child jobs.
I have a test case which, when invoked with a suitable -j switch,
will hang if the recipe inherits the jobserver pipe. This test case
was inspired by a real world case in which testing GDB on Fedora
would hang due to some poorly written test GDB cases having been
passed the jobserver file descriptors.
* src/posixos.c (jobserver_parse_auth): Call fd_noinherit() for
jobserver pipe descriptors.
Copyright-paperwork-exempt: yes
diff --git a/src/posixos.c b/src/posixos.c
index 525f292c..eab175a4 100644
--- a/src/posixos.c
+++ b/src/posixos.c
@@ -145,6 +145,11 @@ jobserver_parse_auth (const char *auth)
/* When using pselect() we want the read to be non-blocking. */
set_blocking (job_fds[0], 0);
+ /* By default we don't send the job pipe FDs to our children.
+ See jobserver_pre_child() and jobserver_post_child(). */
+ fd_noinherit (job_fds[0]);
+ fd_noinherit (job_fds[1]);
+
return 1;
}

268
make-4.3-filter-out.patch Normal file
View File

@ -0,0 +1,268 @@
From e49e11e069fe7f214263be1782242b9b50f71eaa Mon Sep 17 00:00:00 2001
From: Paul Smith <psmith@gnu.org>
Date: Thu, 12 Nov 2020 17:00:39 -0500
Subject: [SV 59093] Rewrite filter/filter-out to avoid large stack usage
* src/function.c (func_filter_filterout): Allocate arrays to hold
pattern and word information rather than creating linked lists on
the stack.
* tests/scripts/functions/filter-out: Test large filters.
diff --git a/src/function.c b/src/function.c
index 0917e0cd..5edfe8b3 100644
--- a/src/function.c
+++ b/src/function.c
@@ -910,7 +910,6 @@ func_foreach (char *o, char **argv, const char *funcname UNUSED)
struct a_word
{
- struct a_word *next;
struct a_word *chain;
char *str;
size_t length;
@@ -941,7 +940,6 @@ a_word_hash_cmp (const void *x, const void *y)
struct a_pattern
{
- struct a_pattern *next;
char *str;
char *percent;
size_t length;
@@ -950,78 +948,84 @@ struct a_pattern
static char *
func_filter_filterout (char *o, char **argv, const char *funcname)
{
- struct a_word *wordhead;
- struct a_word **wordtail;
+ struct a_word *words;
+ struct a_word *word_end;
struct a_word *wp;
- struct a_pattern *pathead;
- struct a_pattern **pattail;
+ struct a_pattern *patterns;
+ struct a_pattern *pat_end;
struct a_pattern *pp;
+ size_t pat_count = 0, word_count = 0;
struct hash_table a_word_table;
int is_filter = funcname[CSTRLEN ("filter")] == '\0';
- const char *pat_iterator = argv[0];
- const char *word_iterator = argv[1];
+ const char *cp;
int literals = 0;
- int words = 0;
int hashing = 0;
char *p;
size_t len;
+ int doneany = 0;
- /* Chop ARGV[0] up into patterns to match against the words.
- We don't need to preserve it because our caller frees all the
- argument memory anyway. */
+ /* Find the number of words and get memory for them. */
+ cp = argv[1];
+ while ((p = find_next_token (&cp, NULL)) != 0)
+ ++word_count;
- pattail = &pathead;
- while ((p = find_next_token (&pat_iterator, &len)) != 0)
- {
- struct a_pattern *pat = alloca (sizeof (struct a_pattern));
+ if (!word_count)
+ return o;
+
+ words = xcalloc (word_count * sizeof (struct a_word));
+ word_end = words + word_count;
- *pattail = pat;
- pattail = &pat->next;
+ /* Find the number of patterns and get memory for them. */
+ cp = argv[0];
+ while ((p = find_next_token (&cp, NULL)) != 0)
+ ++pat_count;
- if (*pat_iterator != '\0')
- ++pat_iterator;
+ patterns = xcalloc (pat_count * sizeof (struct a_pattern));
+ pat_end = patterns + pat_count;
+
+ /* Chop argv[0] up into patterns to match against the words. */
+
+ cp = argv[0];
+ pp = patterns;
+ while ((p = find_next_token (&cp, &len)) != 0)
+ {
+ if (*cp != '\0')
+ ++cp;
- pat->str = p;
p[len] = '\0';
- pat->percent = find_percent (p);
- if (pat->percent == 0)
+ pp->str = p;
+ pp->percent = find_percent (p);
+ if (pp->percent == 0)
literals++;
-
/* find_percent() might shorten the string so LEN is wrong. */
- pat->length = strlen (pat->str);
+ pp->length = strlen (pp->str);
+
+ ++pp;
}
- *pattail = 0;
/* Chop ARGV[1] up into words to match against the patterns. */
- wordtail = &wordhead;
- while ((p = find_next_token (&word_iterator, &len)) != 0)
+ cp = argv[1];
+ wp = words;
+ while ((p = find_next_token (&cp, &len)) != 0)
{
- struct a_word *word = alloca (sizeof (struct a_word));
-
- *wordtail = word;
- wordtail = &word->next;
-
- if (*word_iterator != '\0')
- ++word_iterator;
+ if (*cp != '\0')
+ ++cp;
p[len] = '\0';
- word->str = p;
- word->length = len;
- word->matched = 0;
- word->chain = 0;
- words++;
+ wp->str = p;
+ wp->length = len;
+ ++wp;
}
- *wordtail = 0;
/* Only use a hash table if arg list lengths justifies the cost. */
- hashing = (literals >= 2 && (literals * words) >= 10);
+ hashing = (literals > 1 && (literals * word_count) >= 10);
if (hashing)
{
- hash_init (&a_word_table, words, a_word_hash_1, a_word_hash_2,
+ hash_init (&a_word_table, word_count, a_word_hash_1, a_word_hash_2,
a_word_hash_cmp);
- for (wp = wordhead; wp != 0; wp = wp->next)
+ for (wp = words; wp < word_end; ++wp)
{
struct a_word *owp = hash_insert (&a_word_table, wp);
if (owp)
@@ -1029,51 +1033,49 @@ func_filter_filterout (char *o, char **argv, const char *funcname)
}
}
- if (words)
+ /* Run each pattern through the words, killing words. */
+ for (pp = patterns; pp < pat_end; ++pp)
{
- int doneany = 0;
-
- /* Run each pattern through the words, killing words. */
- for (pp = pathead; pp != 0; pp = pp->next)
+ if (pp->percent)
+ for (wp = words; wp < word_end; ++wp)
+ wp->matched |= pattern_matches (pp->str, pp->percent, wp->str);
+ else if (hashing)
{
- if (pp->percent)
- for (wp = wordhead; wp != 0; wp = wp->next)
- wp->matched |= pattern_matches (pp->str, pp->percent, wp->str);
- else if (hashing)
+ struct a_word a_word_key;
+ a_word_key.str = pp->str;
+ a_word_key.length = pp->length;
+ wp = hash_find_item (&a_word_table, &a_word_key);
+ while (wp)
{
- struct a_word a_word_key;
- a_word_key.str = pp->str;
- a_word_key.length = pp->length;
- wp = hash_find_item (&a_word_table, &a_word_key);
- while (wp)
- {
- wp->matched |= 1;
- wp = wp->chain;
- }
+ wp->matched |= 1;
+ wp = wp->chain;
}
- else
- for (wp = wordhead; wp != 0; wp = wp->next)
- wp->matched |= (wp->length == pp->length
- && strneq (pp->str, wp->str, wp->length));
}
+ else
+ for (wp = words; wp < word_end; ++wp)
+ wp->matched |= (wp->length == pp->length
+ && strneq (pp->str, wp->str, wp->length));
+ }
- /* Output the words that matched (or didn't, for filter-out). */
- for (wp = wordhead; wp != 0; wp = wp->next)
- if (is_filter ? wp->matched : !wp->matched)
- {
- o = variable_buffer_output (o, wp->str, strlen (wp->str));
- o = variable_buffer_output (o, " ", 1);
- doneany = 1;
- }
+ /* Output the words that matched (or didn't, for filter-out). */
+ for (wp = words; wp < word_end; ++wp)
+ if (is_filter ? wp->matched : !wp->matched)
+ {
+ o = variable_buffer_output (o, wp->str, strlen (wp->str));
+ o = variable_buffer_output (o, " ", 1);
+ doneany = 1;
+ }
- if (doneany)
- /* Kill the last space. */
- --o;
- }
+ if (doneany)
+ /* Kill the last space. */
+ --o;
if (hashing)
hash_free (&a_word_table, 0);
+ free (patterns);
+ free (words);
+
return o;
}
diff --git a/tests/scripts/functions/filter-out b/tests/scripts/functions/filter-out
index 1fe4819d..dec5343e 100644
--- a/tests/scripts/functions/filter-out
+++ b/tests/scripts/functions/filter-out
@@ -27,6 +27,22 @@ all: ; @echo '$(files1) $(files2)'
!,
'', "foo.elc foo.elc\n");
+# Force use of hash (see function.c:func_filter_filterout for params)
+
+my $base = 'foo.1 foo.2 foo.3 foo.4 foo.5 foo.6 foo.7 foo.8 foo.9 foo.10';
+
+my $base10 = join(' ', ($base) x 10);
+my $out3 = join(' ', ('foo.3') x 10);
+my $out456 = join(' ', ('foo.4 foo.5 foo.6') x 10);
+
+run_make_test("words := $base10" . q!
+files1 := $(filter %.3, $(words))
+files2 := $(filter %.4 foo.5 foo.6, $(words))
+all: ; @echo '$(files1) $(files2)'
+!,
+ '', "$out3 $out456\n");
+
+
# Escaped patterns
run_make_test(q!all:;@echo '$(filter foo\%bar,foo%bar fooXbar)'!,
'', "foo%bar\n");

12
make-4.3-getcwd.patch Normal file
View File

@ -0,0 +1,12 @@
diff -Nrup a/src/makeint.h b/src/makeint.h
--- a/src/makeint.h 2016-05-21 16:22:32.000000000 -0400
+++ b/src/makeint.h 2016-09-22 16:12:38.606702160 -0400
@@ -596,7 +596,7 @@ long int lseek ();
# endif
# ifdef HAVE_GETCWD
-# if !defined(VMS) && !defined(__DECC)
+# if !defined(VMS) && !defined(__DECC) && !defined(getcwd)
char *getcwd ();
# endif
# else

25
make-4.3-j8k.patch Normal file
View File

@ -0,0 +1,25 @@
diff -Nrup a/src/main.c b/src/main.c
--- a/src/main.c 2016-05-31 03:17:26.000000000 -0400
+++ b/src/main.c 2016-09-22 16:18:52.283889265 -0400
@@ -2051,6 +2051,21 @@ main (int argc, char **argv, char **envp
}
#endif
+#ifdef PIPE_BUF
+ if (job_slots > PIPE_BUF)
+#elif defined _POSIX_PIPE_BUF
+ if (job_slots > _POSIX_PIPE_BUF)
+#else
+ if (job_slots > 512)
+#endif
+ {
+ O (error, NILF,
+ _("More parallel jobs (-jN) than this platform can handle requested."));
+ O (error, NILF, _("Resetting to single job (-j1) mode."));
+ job_slots = 1;
+ }
+
+
/* If we have >1 slot at this point, then we're a top-level make.
Set up the jobserver.

405
make.spec
View File

@ -1,26 +1,81 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
Summary: A GNU tool which simplifies the build process for users # This decides the SRPM name. Set to "make" for a rolling release
# (like Fedora) or "make-latest" for a long term release that needs
# optional versioned updates.
Name: make Name: make
Epoch: 1 Epoch: 1
Version: 3.81 Version: 4.3
Release: 10%{?dist} Release: 11%{?dist}
License: GPLv2+ License: GPLv3+
Group: Development/Tools
URL: http://www.gnu.org/software/make/ URL: http://www.gnu.org/software/make/
Source: ftp://ftp.gnu.org/gnu/make/make-%{version}.tar.bz2 Source: ftp://ftp.gnu.org/gnu/make/make-%{version}.tar.gz
Patch: make-3.79.1-noclock_gettime.patch
Patch4: make-3.80-j8k.patch
Patch5: make-3.80-getcwd.patch
Patch6: make-3.81-err-reporting.patch
Patch7: make-3.81-memory.patch
Patch8: make-3.81-rlimit.patch
Patch9: make-3.81-newlines.patch
Patch10: make-3.81-jobserver.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
Requires(post): /sbin/install-info
Requires(preun): /sbin/install-info
%description %if "%{name}" != "make"
# Set this to the sub-package base name, for "make-latest"
%global make make43
%if 0%{?rhel} > 0
%global _prefix /opt/rh/%{make}
%else
# We intentionally do not define a case for Fedora, as it should not
# need this functionality, and letting it error avoids accidents.
%{error:"Each downstream must specify its own /opt namespace"}
%endif
Summary: Meta package to include latest version of make
%else
%global make %{name}
Summary: A GNU tool which simplifies the build process for users
%endif
%if 0%{?rhel} > 0
# This gives the user the option of saying --with guile, but defaults to WITHOUT
%bcond_with guile
%else
# This gives the user the option of saying --without guile, but defaults to WITH
%bcond_without guile
%endif
Patch0: make-4.3-getcwd.patch
# Assume we don't have clock_gettime in configure, so that
# make is not linked against -lpthread (and thus does not
# limit stack to 2MB).
Patch1: make-4.0-noclock_gettime.patch
# BZs #142691, #17374
Patch2: make-4.3-j8k.patch
# https://bugzilla.redhat.com/show_bug.cgi?id=1827850
# https://savannah.gnu.org/bugs/?58232
# Remove on next make rebase
Patch3: make-4.3-cloexec.patch
# https://bugzilla.redhat.com/show_bug.cgi?id=2010506
# https://savannah.gnu.org/bugs/?59093
# Remove on next make rebase
Patch4: make-4.3-filter-out.patch
# autoreconf
BuildRequires: make
BuildRequires: autoconf, automake, gettext-devel
BuildRequires: procps
BuildRequires: perl
%if %{with guile}
BuildRequires: pkgconfig(guile-2.2)
%endif
BuildRequires: gcc
%if "%{name}" != "make"
# We're still on the make-latest package
Requires: %{make}
%description -n make-latest
The latest GNU Make, with a version-specific install
%files -n make-latest
%package -n %{make}
Summary: A GNU tool which simplifies the build process for users
%endif
%description -n %{make}
A GNU tool for controlling the generation of executables and other A GNU tool for controlling the generation of executables and other
non-source files of a program from the program's source files. Make non-source files of a program from the program's source files. Make
allows users to build and install packages without any significant allows users to build and install packages without any significant
@ -28,54 +83,308 @@ knowledge about the details of the build process. The details about
how the program should be built are provided for make in the program's how the program should be built are provided for make in the program's
makefile. makefile.
%package -n %{make}-devel
Summary: Header file for externally visible definitions
%description -n %{make}-devel
The %{make}-devel package contains gnumake.h.
%prep %prep
%setup -q %autosetup -n make-%{version} -p1
%patch -p1
%patch4 -p1 rm -f tests/scripts/features/parallelism.orig
%patch5 -p1
%patch6 -p1
%patch7 -p1
%patch8 -p1
%patch9 -p1
%patch10 -p1
%build %build
%configure autoreconf -vfi
make %{?_smp_mflags}
%configure \
%if %{with guile}
--with-guile
%else
--without-guile
%endif
%make_build
%install %install
rm -rf ${RPM_BUILD_ROOT} %make_install
make DESTDIR=$RPM_BUILD_ROOT install
ln -sf make ${RPM_BUILD_ROOT}/%{_bindir}/gmake ln -sf make ${RPM_BUILD_ROOT}/%{_bindir}/gmake
ln -sf make.1 ${RPM_BUILD_ROOT}/%{_mandir}/man1/gmake.1 ln -sf make.1 ${RPM_BUILD_ROOT}/%{_mandir}/man1/gmake.1
rm -f ${RPM_BUILD_ROOT}/%{_infodir}/dir rm -f ${RPM_BUILD_ROOT}/%{_infodir}/dir
%find_lang %name %if "%{name}" != "make"
install -d -m 755 ${RPM_BUILD_ROOT}/etc/scl/prefixes
dirname %{_prefix} > %{make}.prefix
install -p -m 644 %{make}.prefix ${RPM_BUILD_ROOT}/etc/scl/prefixes/%{make}
echo "export PATH=%{_prefix}/bin:\$PATH" > enable.scl
install -p -m 755 enable.scl ${RPM_BUILD_ROOT}/%{_prefix}/enable
%endif
%find_lang make
%check %check
echo ============TESTING=============== echo ============TESTING===============
/usr/bin/env LANG=C make check /usr/bin/env LANG=C make check && true
echo ============END TESTING=========== echo ============END TESTING===========
%clean %files -n %{make} -f make.lang
rm -rf ${RPM_BUILD_ROOT} %license COPYING
%doc NEWS README AUTHORS
%post
/sbin/install-info %{_infodir}/make.info.gz %{_infodir}/dir --entry="* Make: (make). The GNU make utility." || :
%preun
if [ $1 = 0 ]; then
/sbin/install-info --delete %{_infodir}/make.info.gz %{_infodir}/dir --entry="* Make: (make). The GNU make utility." || :
fi
%files -f %{name}.lang
%defattr(-,root,root)
%doc NEWS README COPYING AUTHORS
%{_bindir}/* %{_bindir}/*
%{_mandir}/man*/* %{_mandir}/man*/*
%{_infodir}/*.info* %{_infodir}/*.info*
%{_includedir}/gnumake.h
%if "%{name}" != "make"
/etc/scl/prefixes/%{make}
%{_prefix}/enable
%endif
%files -n %{make}-devel
%{_includedir}/gnumake.h
%changelog %changelog
* Thu Jul 21 2022 Fedora Release Engineering <releng@fedoraproject.org> - 1:4.3-11
- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild
* Thu Jul 14 2022 DJ Delorie <dj@redhat.com> - 1:4.3-10
- Add SCL compatibility to LTS builds.
* Wed Jun 29 2022 DJ Delorie <dj@redhat.com> - 1:4.3-9
- Enable long-term supported builds.
* Fri Apr 8 2022 DJ Delorie <dj@redhat.com> - 1:4.3-8
- Rewrite filter/filter-out to avoid large stack usage. BZ #2010506
- Require perl core modules for testsuite
* Thu Jan 20 2022 Fedora Release Engineering <releng@fedoraproject.org> - 1:4.3-7
- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild
* Thu Jul 22 2021 Fedora Release Engineering <releng@fedoraproject.org> - 1:4.3-6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild
* Fri Feb 19 2021 DJ Delorie <dj@redhat.com> - 1:4.3-5
- Allow users to build with or without guile support as desired.
- Allow derivative downstreams to default to disabling guile support.
* Tue Jan 26 2021 Fedora Release Engineering <releng@fedoraproject.org> - 1:4.3-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
* Wed Jul 29 2020 DJ Delorie <dj@redhat.com> - 1:4.3-3
- Disable inheritance of jobserver FDs for recursive make. BZ #1827850
* Tue Jul 28 2020 Fedora Release Engineering <releng@fedoraproject.org> - 1:4.3-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
* Wed Mar 11 2020 DJ Delorie <dj@redhat.com> - 1:4.3-1
- Rebase to make-4.3. Remove obsolete patches.
* Wed Jan 29 2020 Fedora Release Engineering <releng@fedoraproject.org> - 1:4.2.1-16
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
* Fri Dec 06 2019 DJ Delorie <dj@redhat.com> - 1:4.2.1-15
- Use a non-blocking read with pselect to avoid hangs. BZ #1556839
* Thu Jul 25 2019 Fedora Release Engineering <releng@fedoraproject.org> - 1:4.2.1-14
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
* Sun Feb 17 2019 Igor Gnatenko <ignatenkobrain@fedoraproject.org> - 1:4.2.1-13
- Run autoreconf
* Sun Feb 17 2019 Igor Gnatenko <ignatenkobrain@fedoraproject.org> - 1:4.2.1-12
- Switch to latest guile version
* Fri Feb 01 2019 Fedora Release Engineering <releng@fedoraproject.org> - 1:4.2.1-11
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
* Fri Jul 13 2018 Fedora Release Engineering <releng@fedoraproject.org> - 1:4.2.1-10
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
* Wed Apr 25 2018 Patsy Griffin Franklin <pfrankli@redhat.com> 1:4.2.1-9
- Fix build failure caused by automake versioning differences related
to the glob changes.
- Fix testing failure due to Perl changes related to expanding paths.
* Tue Feb 20 2018 Rex Dieter <rdieter@fedoraproject.org> - 1:4.2.1-8
- BR: gcc, rebuild (guile)
* Thu Feb 08 2018 Fedora Release Engineering <releng@fedoraproject.org> - 1:4.2.1-7
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
* Fri Feb 02 2018 Igor Gnatenko <ignatenkobrain@fedoraproject.org> - 1:4.2.1-6
- Fix wrong assumptions of glibc's glob internals
* Thu Feb 01 2018 Richard W.M. Jones <rjones@redhat.com> - 1:4.2.1-5
- Add upstream patch to fix incorrect use of glibc 2.27 glob internals.
* Thu Aug 03 2017 Fedora Release Engineering <releng@fedoraproject.org> - 1:4.2.1-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild
* Wed Jul 26 2017 Fedora Release Engineering <releng@fedoraproject.org> - 1:4.2.1-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
* Wed Feb 01 2017 Stephen Gallagher <sgallagh@redhat.com> - 4.2.1-2
- Add missing %%license macro
* Sun Sep 25 2016 Fedora Release Engineering <releng@fedoraproject.org> - 1:4.2.1-1
- Rebase to make-4.2.1. Remove obsolete patches. BZ #1338558
* Sun Sep 25 2016 Fedora Release Engineering <releng@fedoraproject.org> - 1:4.1-6
- Make test suite requires Perl to run.
* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 1:4.1-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
* Wed Nov 4 2015 Patsy Franklin <pfrankli@redhat.com> 1:4.1-4
- Handle NULL returns from ttyname() Upstream Bug 43434.
Resolves: #1277968
* Thu Oct 29 2015 Patsy Franklin <pfrankli@redhat.com> 1:4.1-3
- Enable Guile support.
* Thu Oct 29 2015 Patsy Franklin <pfrankli@redhat.com> 1:4.1-2
- Include patches dropped in last update as they fix reported bugs and
update the spec file to include more info on the patches.
* Sat Oct 24 2015 Zbigniew Jędrzejewski-Szmek <zbyszek@laptop> - 1:4.1-1
- Update to latest version
* Wed Jun 17 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1:4.0-5.1
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild
* Sat Feb 21 2015 Till Maas <opensource@till.name> - 1:4.0-4.1
- Rebuilt for Fedora 23 Change
https://fedoraproject.org/wiki/Changes/Harden_all_packages_with_position-independent_code
* Wed Sep 03 2014 Kyle McMartin <kyle@fedoraproject.org> - 1:4.0-3.1
- Pass the test-suite unconditionally until I fix the tests to cope with
deterministic ar archives (which result in expected rebuilds not occuring)
* Sun Aug 17 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1:4.0-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild
* Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1:4.0-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild
* Wed Apr 30 2014 Patsy Franklin <pfrankli@redhat.com> 1:4.0-1
- Rebase to make-4.0
- Created make-devel sub-package to handle new dependency on gnumake.h.
* Thu Aug 22 2013 Petr Machata <pmachata@redhat.com> - 1:3.82-19
- make now restores rlimit to its original values before launching
subprocess via $(shell) (make-3.82-func_shell-rlimit.patch)
- Determinize one test (make-3.82-tests-SECONDARY.patch)
* Fri Jul 26 2013 Petr Machata <pmachata@redhat.com> - 1:3.82-18
- Backport upstream patch that adds wildcard expansion to pattern
rules. (make-3.82-stem_glob.patch)
* Wed Jun 19 2013 Petr Machata <pmachata@redhat.com> - 1:3.82-17
- Add another fix for upstream bug 30612
* Thu Apr 4 2013 Petr Machata <pmachata@redhat.com> - 1:3.82-16
- Update config.sub and config.guess to support aarch64
* Thu Feb 14 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1:3.82-15
- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild
* Thu Nov 29 2012 Petr Machata <pmachata@redhat.com> - 1:3.82-14
- Drop patch5, which hasn't been applied for years
* Mon Sep 10 2012 Petr Machata <pmachata@redhat.com> - 1:3.82-13
- Add fix for upstream bug 30653
- Resolves: #835424
* Fri Jul 27 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1:3.82-12
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild
* Tue Mar 13 2012 Petr Machata <pmachata@redhat.com> - 1:3.82-11
- Add a patch for avoiding glob if possible by Michael Meeks
* Mon Mar 12 2012 Petr Machata <pmachata@redhat.com> - 1:3.82-10
- Apply the following patches, proposed upstream by Norbert Thiebaud:
- A patch for warning on call of undefined function
- A patch for tracing calls to "eval" and "call"
* Fri Jan 13 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1:3.82-9
- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild
* Thu Nov 3 2011 Petr Machata <pmachata@redhat.com> - 1:3.82-8
- Add a patch for preserving -j across Makefile rebuild
- Resolves: #698702
* Wed Oct 26 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1:3.82-7
- Rebuilt for glibc bug#747377
* Thu May 12 2011 Lubomir Rintel <lkundrak@v3.sk> - 1:3.82-6
- Fix free-after-use with nested assignments (#703104)
* Tue Feb 08 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1:3.82-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild
* Wed Oct 27 2010 Petr Machata <pmachata@redhat.com> - 1:3.82-4
- Fix a discrepancy between behavior of find_next_token and
pre-allocation of token memory in func_sort.
- Resolves: #643359
* Wed Sep 29 2010 jkeating - 1:3.82-3
- Rebuilt for gcc bug 634757
* Mon Sep 13 2010 Petr Machata <pmachata@redhat.com> - 1:3.82-2
- Add upstream fixes for upstream bugs 30612 and 30723
- Resolves: #631552
* Wed Aug 11 2010 Petr Machata <pmachata@redhat.com> - 1:3.82-1
- Upstream 3.82:
- Drop rlimit, fdleak, strcpy-overlap, recursion-test, double-free
patches, make supports this functionality now
- Disable the memory patch for the time being
- Port remaining patches
- Add weird-shell patch, upstream bug 30748
- Resolves: #618998
* Wed Aug 11 2010 Petr Machata <pmachata@redhat.com> - 1:3.81-21
- Add BR procps
- Resolves: #616813
* Thu Jul 1 2010 Petr Machata <pmachata@redhat.com> - 1:3.81-20
- Add a patch by Steve Kemp @debian that might fix the double free
problem.
- Related: #609806
* Fri Jun 4 2010 Petr Machata <pmachata@redhat.com> - 1:3.81-19
- Fix testsuite on F13
- Resolves: #600004
* Tue Aug 11 2009 Petr Machata <pmachata@redhat.com> - 1:3.81-18
- Fix installation with --excludedocs
- Resolves: #515917
* Fri Jul 31 2009 Petr Machata <pmachata@redhat.com> - 1:3.81-17
- Replace the use of strcpy on overlapping areas with memmove
- Resolves: #514721
* Sat Jul 25 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1:3.81-16
- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild
* Wed Feb 25 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1:3.81-15
- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild
* Mon Sep 22 2008 Petr Machata <pmachata@redhat.com> - 1:3.81-14
- Fix patches to apply cleanly with fuzz=0
* Tue Sep 16 2008 Petr Machata <pmachata@redhat.com> - 1:3.81-13
- Mark opened files as cloexec to prevent their leaking through fork
- Resolves: #462090
* Tue Mar 25 2008 Petr Machata <pmachata@redhat.com> - 1:3.81-12
- Fix the rlimit patch. The success flag is kept in memory shared
with parent process after vfork, and so cannot be reset.
- Related: #214033
* Tue Feb 19 2008 Fedora Release Engineering <rel-eng@fedoraproject.org> - 1:3.81-11
- Autorebuild for GCC 4.3
* Thu Oct 4 2007 Petr Machata <pmachata@redhat.com> - 1:3.81-10 * Thu Oct 4 2007 Petr Machata <pmachata@redhat.com> - 1:3.81-10
- Fix parallel builds with reexec. - Fix parallel builds with reexec.
- Related: #212111, #211290 - Related: #212111, #211290
@ -139,7 +448,7 @@ fi
* Tue Feb 07 2006 Jesse Keating <jkeating@redhat.com> - 1:3.80-10.1 * Tue Feb 07 2006 Jesse Keating <jkeating@redhat.com> - 1:3.80-10.1
- rebuilt for new gcc4.1 snapshot and glibc changes - rebuilt for new gcc4.1 snapshot and glibc changes
* Mon Feb 02 2006 Petr Machata <pmachata@redhat.com> 3.80-10 * Thu Feb 02 2006 Petr Machata <pmachata@redhat.com> 3.80-10
- H.J. Lu caught a typo in the patch and provided a new one. (#175376) - H.J. Lu caught a typo in the patch and provided a new one. (#175376)
* Mon Jan 09 2006 Petr Machata <pmachata@redhat.com> 3.80-9 * Mon Jan 09 2006 Petr Machata <pmachata@redhat.com> 3.80-9

6
plans/ci.fmf Normal file
View File

@ -0,0 +1,6 @@
summary: CI Gating Plan
discover:
how: fmf
directory: tests
execute:
how: beakerlib

View File

@ -1 +1 @@
354853e0b2da90c527e35aabb8d6f1e6 make-3.81.tar.bz2 SHA512 (make-4.3.tar.gz) = 9a1185cc468368f4ec06478b1cfa343bf90b5cd7c92c0536567db0315b0ee909af53ecce3d44cfd93dd137dbca1ed13af5713e8663590c4fdd21ea635d78496b

View File

@ -0,0 +1,63 @@
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# Makefile of /tools/make/Regression/GNU-make-utility-v-3-82-shipped-with-el7-breaks
# Description: Test for GNU make utility v.3.82 shipped with el7 breaks
# Author: Michal Kolar <mkolar@redhat.com>
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# Copyright (c) 2016 Red Hat, Inc.
#
# This program is free software: you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation, either version 2 of
# the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be
# useful, but WITHOUT ANY WARRANTY; without even the implied
# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
# PURPOSE. See the GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see http://www.gnu.org/licenses/.
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
export TEST=/tools/make/Regression/GNU-make-utility-v-3-82-shipped-with-el7-breaks
export TESTVERSION=1.0
BUILT_FILES=
FILES=$(METADATA) runtest.sh Makefile PURPOSE test.mk golden.output
.PHONY: all install download clean
run: $(FILES) build
./runtest.sh
build: $(BUILT_FILES)
test -x runtest.sh || chmod a+x runtest.sh
clean:
rm -f *~ $(BUILT_FILES)
include /usr/share/rhts/lib/rhts-make.include
$(METADATA): Makefile
@echo "Owner: Michal Kolar <mkolar@redhat.com>" > $(METADATA)
@echo "Name: $(TEST)" >> $(METADATA)
@echo "TestVersion: $(TESTVERSION)" >> $(METADATA)
@echo "Path: $(TEST_DIR)" >> $(METADATA)
@echo "Description: GNU make utility v.3.82 shipped with el7 breaks" >> $(METADATA)
@echo "Type: Regression" >> $(METADATA)
@echo "TestTime: 2m" >> $(METADATA)
@echo "RunFor: make" >> $(METADATA)
@echo "Requires: make coreutils sed diffutils" >> $(METADATA)
@echo "Priority: Normal" >> $(METADATA)
@echo "License: GPLv2+" >> $(METADATA)
@echo "Confidential: yes" >> $(METADATA)
@echo "Destructive: no" >> $(METADATA)
@echo "Releases: -RHEL4 -RHELClient5 -RHELServer5" >> $(METADATA)
rhts-lint $(METADATA)

View File

@ -0,0 +1,3 @@
PURPOSE of /tools/make/Regression/GNU-make-utility-v-3-82-shipped-with-el7-breaks
Author: Michal Kolar <mkolar@redhat.com>
Summary: GNU make utility v.3.82 shipped with el7 breaks environment vars

View File

@ -0,0 +1,2 @@
echo "TEST=false"
TEST=false

View File

@ -0,0 +1,17 @@
summary: GNU make utility v.3.82 shipped with el7 breaks
description: |
Summary: GNU make utility v.3.82 shipped with el7 breaks environment vars
contact:
- Michal Kolar <mkolar@redhat.com>
component:
- make
test: ./runtest.sh
framework: beakerlib
recommend:
- make
- coreutils
- sed
- diffutils
duration: 2m
extra-summary: /tools/make/Regression/GNU-make-utility-v-3-82-shipped-with-el7-breaks
extra-task: /tools/make/Regression/GNU-make-utility-v-3-82-shipped-with-el7-breaks

View File

@ -0,0 +1,57 @@
#!/bin/bash
# vim: dict+=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# runtest.sh of /tools/make/Regression/GNU-make-utility-v-3-82-shipped-with-el7-breaks
# Description: Test for BZ#1323206 (GNU make utility v.3.82 shipped with el7 breaks)
# Author: Michal Kolar <mkolar@redhat.com>
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# Copyright (c) 2016 Red Hat, Inc.
#
# This program is free software: you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation, either version 2 of
# the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be
# useful, but WITHOUT ANY WARRANTY; without even the implied
# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
# PURPOSE. See the GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see http://www.gnu.org/licenses/.
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# Include Beaker environment
. /usr/share/beakerlib/beakerlib.sh || exit 1
CMD="make"
PACKAGE="make"
BIN="$(which $CMD)"
export PACKAGE="${PACKAGE:-$(rpm -qf --qf='%{name}\n' $BIN)}"
rlJournalStart
rlPhaseStartSetup
rlShowRunningKernel
rlAssertRpm $PACKAGE
rlRun "TmpDir=\$(mktemp -d)"
rlRun "cp test.mk golden.output $TmpDir"
rlRun "pushd $TmpDir"
rlPhaseEnd
rlPhaseStartTest
rlRun "make -f test.mk test TEST=false >stdout"
rlRun "sed -i -e '/Entering directory/d' -e '/Leaving directory/d' stdout"
rlRun "diff golden.output stdout"
rlPhaseEnd
rlPhaseStartCleanup
rlRun "popd"
rlRun "rm -r $TmpDir"
rlPhaseEnd
rlJournalPrintText
rlJournalEnd

View File

@ -0,0 +1,5 @@
# User makefile
test: TEST ?= true
test:
echo "TEST=$(TEST)"

View File

@ -0,0 +1,63 @@
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# Makefile of /tools/make/Regression/Use-after-free-when-eval-in-variable
# Description: Test for Use-after-free() when eval in variable
# Author: Marek Polacek <polacek@redhat.com>
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# Copyright (c) 2012 Red Hat, Inc. All rights reserved.
#
# This copyrighted material is made available to anyone wishing
# to use, modify, copy, or redistribute it subject to the terms
# and conditions of the GNU General Public License version 2.
#
# This program is distributed in the hope that it will be
# useful, but WITHOUT ANY WARRANTY; without even the implied
# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
# PURPOSE. See the GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public
# License along with this program; if not, write to the Free
# Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
# Boston, MA 02110-1301, USA.
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
export TEST=/tools/make/Regression/Use-after-free-when-eval-in-variable
export TESTVERSION=1.0
BUILT_FILES=
FILES=$(METADATA) runtest.sh Makefile PURPOSE test.mk
.PHONY: all install download clean
run: $(FILES) build
./runtest.sh
build: $(BUILT_FILES)
test -x runtest.sh || chmod a+x runtest.sh
clean:
rm -f *~ $(BUILT_FILES)
include /usr/share/rhts/lib/rhts-make.include
$(METADATA): Makefile
@echo "Owner: Marek Polacek <polacek@redhat.com>" > $(METADATA)
@echo "Name: $(TEST)" >> $(METADATA)
@echo "TestVersion: $(TESTVERSION)" >> $(METADATA)
@echo "Path: $(TEST_DIR)" >> $(METADATA)
@echo "Description: Test for Use-after-free() when eval in variable)" >> $(METADATA)
@echo "Type: Regression" >> $(METADATA)
@echo "TestTime: 2m" >> $(METADATA)
@echo "RunFor: make" >> $(METADATA)
@echo "Requires: make coreutils" >> $(METADATA)
@echo "Priority: Normal" >> $(METADATA)
@echo "License: GPLv2" >> $(METADATA)
@echo "Confidential: no" >> $(METADATA)
@echo "Destructive: no" >> $(METADATA)
rhts-lint $(METADATA)

View File

@ -0,0 +1,3 @@
PURPOSE of /tools/make/Regression/Use-after-free-when-eval-in-variable
Author: Marek Polacek <polacek@redhat.com>
Summary: Use-after-free() when eval in variable assignments reassigns the same variable

View File

@ -0,0 +1,15 @@
summary: Test for Use-after-free() when eval in variable)
description: |
Summary: Use-after-free() when eval in variable assignments reassigns the same variable
contact:
- Marek Polacek <polacek@redhat.com>
component:
- make
test: ./runtest.sh
framework: beakerlib
recommend:
- make
- coreutils
duration: 2m
extra-summary: /tools/make/Regression/Use-after-free-when-eval-in-variable
extra-task: /tools/make/Regression/Use-after-free-when-eval-in-variable

View File

@ -0,0 +1,55 @@
#!/bin/bash
# vim: dict=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# runtest.sh of /tools/make/Regression/Use-after-free-when-eval-in-variable
# Description: Test for Use-after-free() when eval in variable
# Author: Marek Polacek <polacek@redhat.com>
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# Copyright (c) 2012 Red Hat, Inc. All rights reserved.
#
# This copyrighted material is made available to anyone wishing
# to use, modify, copy, or redistribute it subject to the terms
# and conditions of the GNU General Public License version 2.
#
# This program is distributed in the hope that it will be
# useful, but WITHOUT ANY WARRANTY; without even the implied
# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
# PURPOSE. See the GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public
# License along with this program; if not, write to the Free
# Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
# Boston, MA 02110-1301, USA.
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# Include Beaker environment
. /usr/share/beakerlib/beakerlib.sh || exit 1
CMD="make"
BIN="$(which $CMD)"
PACKAGE="make"
export PACKAGE="${PACKAGE:-$(rpm -qf --qf='%{name}\n' $BIN)}"
rlJournalStart
rlPhaseStartSetup
rlShowRunningKernel
rlAssertRpm $PACKAGE
rlRun "TmpDir=\$(mktemp -d)"
rlRun "cp test.mk $TmpDir"
rlRun "pushd $TmpDir"
rlPhaseEnd
rlPhaseStartTest
rlRun "make -f test.mk"
rlPhaseEnd
rlPhaseStartCleanup
rlRun "popd"
rlRun "rm -r $TmpDir"
rlPhaseEnd
rlJournalPrintText
rlJournalEnd

View File

@ -0,0 +1,2 @@
VARIABLE = $(eval VARIABLE := $(shell sleep 1; echo echo ahoj))$(VARIABLE)
wololo:; $(VARIABLE)

View File

@ -0,0 +1,63 @@
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# Makefile of /tools/make/Regression/make-3-79-has-a-parsing-bug
# Description: make 3.79 has a parsing bug
# Author: Michal Kolar <mkolar@redhat.com>
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# Copyright (c) 2017 Red Hat, Inc.
#
# This program is free software: you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation, either version 2 of
# the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be
# useful, but WITHOUT ANY WARRANTY; without even the implied
# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
# PURPOSE. See the GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see http://www.gnu.org/licenses/.
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
export TEST=/tools/make/Regression/make-3-79-has-a-parsing-bug
export TESTVERSION=1.0
BUILT_FILES=
FILES=$(METADATA) runtest.sh Makefile PURPOSE test.mk
.PHONY: all install download clean
run: $(FILES) build
./runtest.sh
build: $(BUILT_FILES)
test -x runtest.sh || chmod a+x runtest.sh
clean:
rm -f *~ $(BUILT_FILES)
include /usr/share/rhts/lib/rhts-make.include
$(METADATA): Makefile
@echo "Owner: Michal Kolar <mkolar@redhat.com>" > $(METADATA)
@echo "Name: $(TEST)" >> $(METADATA)
@echo "TestVersion: $(TESTVERSION)" >> $(METADATA)
@echo "Path: $(TEST_DIR)" >> $(METADATA)
@echo "Description: make 3.79 has a parsing bug" >> $(METADATA)
@echo "Type: Regression" >> $(METADATA)
@echo "TestTime: 1m" >> $(METADATA)
@echo "RunFor: make" >> $(METADATA)
@echo "Requires: make coreutils" >> $(METADATA)
@echo "Priority: Normal" >> $(METADATA)
@echo "License: GPLv2+" >> $(METADATA)
@echo "Confidential: no" >> $(METADATA)
@echo "Destructive: no" >> $(METADATA)
@echo "Releases: -RHEL4 -RHELClient5 -RHELServer5" >> $(METADATA)
rhts-lint $(METADATA)

View File

@ -0,0 +1,3 @@
PURPOSE of /tools/make/Regression/make-3-79-has-a-parsing-bug
Description: make 3.79 has a parsing bug
Author: Michal Kolar <mkolar@redhat.com>

View File

@ -0,0 +1,14 @@
summary: make 3.79 has a parsing bug
description: ''
contact:
- Michal Kolar <mkolar@redhat.com>
component:
- make
test: ./runtest.sh
framework: beakerlib
recommend:
- make
- coreutils
duration: 1m
extra-summary: /tools/make/Regression/make-3-79-has-a-parsing-bug
extra-task: /tools/make/Regression/make-3-79-has-a-parsing-bug

View File

@ -0,0 +1,55 @@
#!/bin/bash
# vim: dict+=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# runtest.sh of /tools/make/Regression/make-3-79-has-a-parsing-bug
# Description: make 3.79 has a parsing bug
# Author: Michal Kolar <mkolar@redhat.com>
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# Copyright (c) 2017 Red Hat, Inc.
#
# This program is free software: you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation, either version 2 of
# the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be
# useful, but WITHOUT ANY WARRANTY; without even the implied
# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
# PURPOSE. See the GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see http://www.gnu.org/licenses/.
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# Include Beaker environment
. /usr/share/beakerlib/beakerlib.sh || exit 1
CMD="make"
BIN="$(which $CMD)"
PACKAGE="make"
export PACKAGE="${PACKAGE:-$(rpm -qf --qf='%{name}\n' $BIN)}"
rlJournalStart
rlPhaseStartSetup
rlShowRunningKernel
rlAssertRpm $PACKAGE
rlRun "TmpDir=\$(mktemp -d)"
rlRun "cp test.mk $TmpDir"
rlRun "pushd $TmpDir"
rlPhaseEnd
rlPhaseStartTest
rlRun "touch file.l"
rlRun "make -f test.mk"
rlPhaseEnd
rlPhaseStartCleanup
rlRun "popd"
rlRun "rm -r $TmpDir"
rlPhaseEnd
rlJournalPrintText
rlJournalEnd

View File

@ -0,0 +1,13 @@
# Author: Petr Muller <pmuller@redhat.com>
default: out/file.o
%/.exists:
-mkdir $(@D)
touch $@
src/file.c: file.l src/.exists
@echo file.l to $@
touch $@
out/%.o: src/%.c out/.exists
@echo -c $< -o $@
touch $@

63
tests/order-only/Makefile Normal file
View File

@ -0,0 +1,63 @@
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# Makefile of /tools/make/Regression/order-only
# Description: Test for make bug
# Author: Petr Muller <pmuller@redhat.com>
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# Copyright (c) 2017 Red Hat, Inc.
#
# This program is free software: you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation, either version 3 of
# the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be
# useful, but WITHOUT ANY WARRANTY; without even the implied
# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
# PURPOSE. See the GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see http://www.gnu.org/licenses/.
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
export TEST=/tools/make/Regression/order-only
export TESTVERSION=1.0
BUILT_FILES=
FILES=$(METADATA) runtest.sh Makefile PURPOSE test.mk golden.output
.PHONY: all install download clean
run: $(FILES) build
./runtest.sh
build: $(BUILT_FILES)
test -x runtest.sh || chmod a+x runtest.sh
clean:
rm -f *~ $(BUILT_FILES)
include /usr/share/rhts/lib/rhts-make.include
$(METADATA): Makefile
@echo "Owner: Petr Muller <pmuller@redhat.com>" > $(METADATA)
@echo "Name: $(TEST)" >> $(METADATA)
@echo "TestVersion: $(TESTVERSION)" >> $(METADATA)
@echo "Path: $(TEST_DIR)" >> $(METADATA)
@echo "Description: Test for make bug" >> $(METADATA)
@echo "Type: Regression" >> $(METADATA)
@echo "TestTime: 1m" >> $(METADATA)
@echo "RunFor: make" >> $(METADATA)
@echo "Requires: make coreutils diffutils" >> $(METADATA)
@echo "Priority: Normal" >> $(METADATA)
@echo "License: GPLv3" >> $(METADATA)
@echo "Confidential: no" >> $(METADATA)
@echo "Destructive: no" >> $(METADATA)
@echo "Releases: -RHEL4 -RHELClient5 -RHELServer5" >> $(METADATA)
rhts-lint $(METADATA)

4
tests/order-only/PURPOSE Normal file
View File

@ -0,0 +1,4 @@
PURPOSE of /tools/make/Regression/order-only
Description: Regression Test for make bug
Author: Petr Muller <pmuller@redhat.com>
Summary: Test that make doesn't insert bogus values into order-only dependencies

View File

@ -0,0 +1,9 @@
mkdir -p dir/b/.
@ [a/b/c]
^ []
? []
mkdir -p a/b/.
@ [a]
^ []
? []
rm dir/b/.

16
tests/order-only/main.fmf Normal file
View File

@ -0,0 +1,16 @@
summary: Test for make bug
description: |
Summary: Test that make doesn't insert bogus values into order-only dependencies
contact:
- Petr Muller <pmuller@redhat.com>
component:
- make
test: ./runtest.sh
framework: beakerlib
recommend:
- make
- coreutils
- diffutils
duration: 1m
extra-summary: /tools/make/Regression/order-only
extra-task: /tools/make/Regression/order-only

55
tests/order-only/runtest.sh Executable file
View File

@ -0,0 +1,55 @@
#!/bin/bash
# vim: dict+=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# runtest.sh of /tools/make/Regression/order-only
# Description: Test for make bug
# Author: Petr Muller <pmuller@redhat.com>
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# Copyright (c) 2017 Red Hat, Inc.
#
# This program is free software: you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation, either version 3 of
# the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be
# useful, but WITHOUT ANY WARRANTY; without even the implied
# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
# PURPOSE. See the GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see http://www.gnu.org/licenses/.
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# Include Beaker environment
. /usr/share/beakerlib/beakerlib.sh || exit 1
CMD="make"
BIN="$(which $CMD)"
PACKAGE="make"
export PACKAGE="${PACKAGE:-$(rpm -qf --qf='%{name}\n' $BIN)}"
rlJournalStart
rlPhaseStartSetup
rlShowRunningKernel
rlAssertRpm $PACKAGE
rlRun "TmpDir=\$(mktemp -d)"
rlRun "cp test.mk golden.output $TmpDir"
rlRun "pushd $TmpDir"
rlPhaseEnd
rlPhaseStartTest
rlRun "make -f test.mk | grep -v -e 'Entering' -e 'Leaving' >tested.output"
rlRun "diff golden.output tested.output"
rlPhaseEnd
rlPhaseStartCleanup
rlRun "popd"
rlRun "rm -r $TmpDir"
rlPhaseEnd
rlJournalPrintText
rlJournalEnd

17
tests/order-only/test.mk Normal file
View File

@ -0,0 +1,17 @@
all: ./a/b/c a
clean:
rm -rf a dir
%/.:
mkdir -p $(@)
a/%/c: | ./dir/%/.
@echo "@ [$@]"
@echo "^ [$^]"
@echo "? [$?]"
a: | ./a/b/.
@echo "@ [$@]"
@echo "^ [$^]"
@echo "? [$?]"

View File

@ -0,0 +1,63 @@
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# Makefile of /tools/make/Sanity/smoke-check-make-runs
# Description: Show your version. Build a one-file project.
# Author: Vaclav Kadlcik <vkadlcik@redhat.com>
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# Copyright (c) 2015 Red Hat, Inc.
#
# This program is free software: you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation, either version 2 of
# the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be
# useful, but WITHOUT ANY WARRANTY; without even the implied
# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
# PURPOSE. See the GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see http://www.gnu.org/licenses/.
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
export TEST=/tools/make/Sanity/smoke-check-make-runs
export TESTVERSION=1.0
BUILT_FILES=
FILES=$(METADATA) runtest.sh Makefile PURPOSE hello_world.c smoke.mk
.PHONY: all install download clean
run: $(FILES) build
./runtest.sh
build: $(BUILT_FILES)
test -x runtest.sh || chmod a+x runtest.sh
clean:
rm -f *~ $(BUILT_FILES)
include /usr/share/rhts/lib/rhts-make.include
$(METADATA): Makefile
@echo "Owner: Vaclav Kadlcik <vkadlcik@redhat.com>" > $(METADATA)
@echo "Name: $(TEST)" >> $(METADATA)
@echo "TestVersion: $(TESTVERSION)" >> $(METADATA)
@echo "Path: $(TEST_DIR)" >> $(METADATA)
@echo "Description: Show your version. Build a one-file project." >> $(METADATA)
@echo "Type: Sanity" >> $(METADATA)
@echo "TestTime: 5m" >> $(METADATA)
@echo "RunFor: make" >> $(METADATA)
@echo "Requires: make gcc" >> $(METADATA)
@echo "Priority: Normal" >> $(METADATA)
@echo "License: GPLv2+" >> $(METADATA)
@echo "Confidential: no" >> $(METADATA)
@echo "Destructive: no" >> $(METADATA)
@echo "Releases: -RHEL4 -RHELClient5 -RHELServer5" >> $(METADATA)
rhts-lint $(METADATA)

View File

@ -0,0 +1,3 @@
PURPOSE of /tools/make/Sanity/smoke-check-make-runs
Description: Show your version. Build a one-file project.
Author: Vaclav Kadlcik <vkadlcik@redhat.com>

View File

@ -0,0 +1,8 @@
#include <stdio.h>
int main(int argc, char ** argv) {
if (printf("Hello world!\n") < 0) {
return -1;
}
return 0;
}

View File

@ -0,0 +1,14 @@
summary: Show your version. Build a one-file project.
description: ''
contact:
- Vaclav Kadlcik <vkadlcik@redhat.com>
component:
- make
test: ./runtest.sh
framework: beakerlib
recommend:
- make
- gcc
duration: 5m
extra-summary: /tools/make/Sanity/smoke-check-make-runs
extra-task: /tools/make/Sanity/smoke-check-make-runs

View File

@ -0,0 +1,61 @@
#!/bin/bash
# vim: dict+=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# runtest.sh of /tools/make/Sanity/smoke-check-make-runs
# Description: Show your version. Build a one-file project.
# Author: Vaclav Kadlcik <vkadlcik@redhat.com>
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# Copyright (c) 2015 Red Hat, Inc.
#
# This program is free software: you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation, either version 2 of
# the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be
# useful, but WITHOUT ANY WARRANTY; without even the implied
# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
# PURPOSE. See the GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see http://www.gnu.org/licenses/.
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# Include Beaker environment
. /usr/share/beakerlib/beakerlib.sh || exit 1
MAKE="$(which --skip-alias make)"
PACKAGE="make"
export PACKAGE="${PACKAGE:-$(rpm -qf --qf='%{name}\n' $MAKE)}"
rlJournalStart
rlPhaseStartSetup
rlAssertRpm $PACKAGE
rlRun "TmpDir=\$(mktemp -d)" 0 "Creating tmp directory"
rlRun "cp hello_world.c $TmpDir"
rlRun "cp smoke.mk $TmpDir/Makefile"
rlRun "pushd $TmpDir"
rlPhaseEnd
rlPhaseStartTest
rlRun -t -s 'make -v'
rlAssertNotGrep '^STDERR:' $rlRun_LOG
rlAssertGrep '^STDOUT: GNU Make [0-9]' $rlRun_LOG
rlAssertNotExists 'hello_world'
rlRun 'make'
rlAssertExists 'hello_world'
rlRun './hello_world'
rlRun 'make clean'
rlAssertNotExists 'hello_world'
rlPhaseEnd
rlPhaseStartCleanup
rlRun "popd"
rlRun "rm -r $TmpDir" 0 "Removing tmp directory"
rlPhaseEnd
rlJournalPrintText
rlJournalEnd

View File

@ -0,0 +1,9 @@
all: hello_world
hello_world: hello_world.o
$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $^
clean:
rm -f hello_world hello_world.o
.SUFFIXES: .c