mirror of
https://github.com/mirror/make.git
synced 2026-09-06 06:35:00 +08:00
[SV 54233] Preserve higher command_state values on also_make targets.
If multiple pattern rules have the same pattern as also-make targets and we attempt to run them at the same time, we might downgrade the command state from 'running' to 'deps_running'; this will prevent that also_make from being considered complete causing make to wait forever for it to finish. Ensure that set_command_state never downgrades the state of a target. * src/file.c (set_command_state): Don't downgrade command_state. * src/filedef.h (struct file): Document the order prerequisite. * test/scripts/features/patternrules: Test the behavior.
This commit is contained in:
@@ -220,6 +220,22 @@ all: foo.x foo-mt.x
|
||||
|
||||
1;
|
||||
|
||||
# Test pattern rules building the same targets
|
||||
# See SV 54233. Rely on our standard test timeout to break the loop
|
||||
|
||||
touch('a.c');
|
||||
|
||||
run_make_test(q!
|
||||
all: a.elf a.dbg
|
||||
|
||||
%.elf %.lnk: %.c ; : $*.elf $*.lnk
|
||||
|
||||
%.elf %.dbg: %.lnk ; : $*.elf $*.dbg
|
||||
!,
|
||||
'-j2', ": a.elf a.lnk\n: a.elf a.dbg\n");
|
||||
|
||||
unlink('a.c');
|
||||
|
||||
# This tells the test driver that the perl test script executed properly.
|
||||
1;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user