blob: a43fbba0b60a8568c8de01dbc8c093261fb58441 [file] [log] [blame]
Brad Bishop1a4b7ee2018-12-16 17:11:34 -08001From 40702abf3156fa92ef70ee5d445fe52dd6cfbc7d Mon Sep 17 00:00:00 2001
2From: Robert Yang <liezhi.yang@windriver.com>
3Date: Thu, 20 Sep 2018 18:48:48 +0800
4Subject: [PATCH] ExtUtils/MM_Unix.pm: fix race issues
5
6Fixed a race issue when compile libhtml-parser-perl and others who use MakeMaker:
7[snip]
8chmod 755 blib/arch/auto/HTML/Parser/Parser.so
9chmod 644 "Parser.bs"
10[snip]
11
12The rule INST_DYNAMIC removes '.bs' file which are generated by BOOTSTRAP, but
13the have no dependencies, so there is a race issue:
14
15BOOTSTRAP:
16 touch foo.bs
17 chmod 755 foo.bs
18
19INST_DYNAMIC:
20 rm -fr foo.bs
21
22The error would happen when INST_DYNAMIC removes foo.bs after BOOTSTRAP touched
23it but before chmod on it.
24
25Upstream-Status: Backport [https://github.com/Perl-Toolchain-Gang/ExtUtils-MakeMaker/commit/44e95e717372abe2b0a6ee55de4b686760b65360]
26
27Note, This is not a real backport, upstream has totally refactored it in one
28patch, please see the link above, it's not a good idea to backport such a big
29patch, I just referred it to fix the problem in a simple way. I mark it as
30backport is because we can drop the patch after upgrade perl to 5.26 or 5.28.
31
32Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
33---
34 cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Unix.pm | 2 +-
35 1 file changed, 1 insertion(+), 1 deletion(-)
36
37diff --git a/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Unix.pm b/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Unix.pm
38index 95d9761..9cabe2d 100644
39--- a/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Unix.pm
40+++ b/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Unix.pm
41@@ -933,7 +933,7 @@ OTHERLDFLAGS = '.$ld_opt.$otherldflags.'
42 INST_DYNAMIC_DEP = '.$inst_dynamic_dep.'
43 INST_DYNAMIC_FIX = '.$ld_fix.'
44
45-$(INST_DYNAMIC): $(OBJECT) $(MYEXTLIB) $(INST_ARCHAUTODIR)$(DFSEP).exists $(EXPORT_LIST) $(PERL_ARCHIVEDEP) $(PERL_ARCHIVE_AFTER) $(INST_DYNAMIC_DEP)
46+$(INST_DYNAMIC): $(OBJECT) $(MYEXTLIB) $(INST_ARCHAUTODIR)$(DFSEP).exists $(EXPORT_LIST) $(PERL_ARCHIVEDEP) $(PERL_ARCHIVE_AFTER) $(INST_DYNAMIC_DEP) $(BOOTSTRAP)
47 ');
48 if ($armaybe ne ':'){
49 $ldfrom = 'tmp$(LIB_EXT)';
50--
512.7.4
52