[CRIU] [PATCH] Make gen-syscalls.pl compatible with perl < 5.13.2

Alexander Kolesen kolesen.a at gmail.com
Mon Sep 16 17:53:50 EDT 2013


An error occurs when trying to build crtools on ARM systems
with perl versions earlier than 5.13.2 due to lack of /r modifier.

% make
...
  GEN      arch/arm/syscalls.S
Bareword found where operator expected at arch/arm/gen-syscalls.pl line 8, near "s/.*include\///gr"
Bareword found where operator expected at arch/arm/gen-syscalls.pl line 10, near "s/.*include\///gr"
Bareword found where operator expected at arch/arm/gen-syscalls.pl line 13, near "s/.*include\///gr"
Bareword found where operator expected at arch/arm/gen-syscalls.pl line 16, near "tr/.-/_/r"
Bareword found where operator expected at arch/arm/gen-syscalls.pl line 17, near "tr/.-/_/r"
syntax error at arch/arm/gen-syscalls.pl line 8, near "s/.*include\///gr"
syntax error at arch/arm/gen-syscalls.pl line 10, near "s/.*include\///gr"
syntax error at arch/arm/gen-syscalls.pl line 13, near "s/.*include\///gr"
syntax error at arch/arm/gen-syscalls.pl line 16, near "tr/.-/_/r"
syntax error at arch/arm/gen-syscalls.pl line 17, near "tr/.-/_/r"
BEGIN not safe after errors--compilation aborted at arch/arm/gen-syscalls.pl line 60.
make[1]: *** No rule to make target `arch/arm/syscalls.S', needed by `arch/arm/syscalls.o'.  Stop.

Signed-off-by: Alexander Kolesen <kolesen.a at gmail.com>
---
 arch/arm/gen-syscalls.pl | 15 ++++++++++-----
 1 file changed, 10 insertions(+), 5 deletions(-)

diff --git a/arch/arm/gen-syscalls.pl b/arch/arm/gen-syscalls.pl
index ee52112..9176f01 100755
--- a/arch/arm/gen-syscalls.pl
+++ b/arch/arm/gen-syscalls.pl
@@ -5,16 +5,21 @@ use warnings;
 
 my $in         = $ARGV[0];
 my $codesout   = $ARGV[1];
-my $codes      = $ARGV[1] =~ s/.*include\///gr;
+my $codes      = $ARGV[1];
+$codes         =~ s/.*include\///g;
 my $protosout  = $ARGV[2];
-my $protos     = $ARGV[2] =~ s/.*include\///gr;
+my $protos     = $ARGV[2];
+$protos        =~ s/.*include\///g;
 my $asmout     = $ARGV[3];
 my $asmcommon  = $ARGV[4];
-my $prototypes = $ARGV[5] =~ s/.*include\///gr;
+my $prototypes = $ARGV[5];
+$prototypes    =~ s/.*include\///g;
 my $bits       = $ARGV[6];
 
-my $codesdef   = $codes =~ tr/.-/_/r;
-my $protosdef  = $protos =~ tr/.-/_/r;
+my $codesdef   = $codes;
+$codesdef      =~ tr/.-/_/;
+my $protosdef  = $protos;
+$protosdef     =~ tr/.-/_/;
 my $code       = "code$bits";
 my $need_aux   = 0;
 
-- 
1.8.3.2



More information about the CRIU mailing list