Skip to content

Commit 3025126

Browse files
committed
Fix race condition in automatic zend_vm_gen.php invocation
As previously written, this was treated as two independent targets having the same recipe. GNU Make 4.3 has a new "grouped targets" feature that allows specifying that these are actually both outputs of a single recipe, but that's very recent. Work around this by using an intermediate target.
1 parent be5fd30 commit 3025126

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

Zend/Makefile.frag

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,13 @@ $(srcdir)/zend_ini_parser.c: $(srcdir)/zend_ini_parser.y
3232
$(srcdir)/zend_ini_scanner.c: $(srcdir)/zend_ini_scanner.l
3333
@(cd $(top_srcdir); $(RE2C) $(RE2C_FLAGS) --no-generation-date --case-inverted -cbdFt Zend/zend_ini_scanner_defs.h -oZend/zend_ini_scanner.c Zend/zend_ini_scanner.l)
3434

35-
$(srcdir)/zend_vm_execute.h $(srcdir)/zend_vm_opcodes.c: $(srcdir)/zend_vm_def.h $(srcdir)/zend_vm_execute.skl $(srcdir)/zend_vm_gen.php
35+
# Use an intermediate target to indicate that zend_vm_gen.php produces both files
36+
# at the same time, rather than the same recipe applying for two different targets.
37+
# The "grouped targets" feature, which would solve this directly, is only available
38+
# since GNU Make 4.3.
39+
$(srcdir)/zend_vm_execute.h $(srcdir)/zend_vm_opcodes.c: vm.gen.intermediate ;
40+
.INTERMEDIATE: vm.gen.intermediate
41+
vm.gen.intermediate: $(srcdir)/zend_vm_def.h $(srcdir)/zend_vm_execute.skl $(srcdir)/zend_vm_gen.php
3642
@if test ! -z "$(PHP)"; then \
3743
$(PHP) $(srcdir)/zend_vm_gen.php; \
3844
fi;

0 commit comments

Comments
 (0)