summary refs log tree commit diff
path: root/pkgs/development/tools/build-managers/gnumake/3.82/intermediate-parallel.patch
blob: 9bb7add0bde28e9afe0d6850696cb559b9271a36 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
diff --git remake.c remake.c
index c0bf709..b1ddd23 100644
--- remake.c
+++ remake.c
@@ -612,6 +612,10 @@ update_file_1 (struct file *file, unsigned int depth)
                 d->file->dontcare = file->dontcare;
               }
 
+            /* We may have already considered this file, when we didn't know
+               we'd need to update it.  Force update_file() to consider it and
+               not prune it.  */
+            d->file->considered = !considered;
 
 	    dep_status |= update_file (d->file, depth);
 
diff --git tests/scripts/features/parallelism tests/scripts/features/parallelism
index d4250f0..76d24a7 100644
--- tests/scripts/features/parallelism
+++ tests/scripts/features/parallelism
@@ -214,6 +214,23 @@ rm main.x");
     rmfiles(qw(foo.y foo.y.in main.bar));
 }
 
+# Ensure intermediate/secondary files are not pruned incorrectly.
+# See Savannah bug #30653
+
+utouch(-15, 'file2');
+utouch(-10, 'file4');
+utouch(-5,  'file1');
+
+run_make_test(q!
+.INTERMEDIATE: file3
+file4: file3 ; @mv -f $< $@
+file3: file2 ; touch $@
+file2: file1 ; @touch $@
+!,
+              '--no-print-directory -j2', "touch file3");
+
+#rmfiles('file1', 'file2', 'file3', 'file4');
+
 if ($all_tests) {
     # Jobserver FD handling is messed up in some way.
     # Savannah bug #28189
-- 
1.7.12