提交 67ef4f63 编写于 作者: D Dr. Stephen Henson

use different names for asm temp files to avoid problems on some platforms

上级 3bfe583b
...@@ -8,6 +8,9 @@ my @ARGS = @ARGV; ...@@ -8,6 +8,9 @@ my @ARGS = @ARGV;
my $top = shift @ARGS; my $top = shift @ARGS;
my $target = shift @ARGS; my $target = shift @ARGS;
my $tmptarg = $target;
$tmptarg =~ s/\.[^\\\/\.]+$/.tmp/;
my $runasm = 1; my $runasm = 1;
...@@ -48,11 +51,15 @@ while (<IN>) ...@@ -48,11 +51,15 @@ while (<IN>)
my ($from, $to); my ($from, $to);
#delete any temp file lying around
unlink $tmptarg;
#rename target temporarily #rename target temporarily
rename($target, "tmptarg.s") || die "Can't rename $target"; rename($target, $tmptarg) || die "Can't rename $target";
#edit target #edit target
open(IN,"tmptarg.s") || die "Can't open temporary file"; open(IN,$tmptarg) || die "Can't open temporary file";
open(OUT, ">$target") || die "Can't open output file $target"; open(OUT, ">$target") || die "Can't open output file $target";
while (<IN>) while (<IN>)
...@@ -75,16 +82,12 @@ if ($runasm) ...@@ -75,16 +82,12 @@ if ($runasm)
# restore target # restore target
unlink $target; unlink $target;
rename "tmptarg.s", $target; rename $tmptarg, $target;
die "Error executing assembler!" if $rv != 0; die "Error executing assembler!" if $rv != 0;
} }
else else
{ {
# Don't care about target # Don't care about target
unlink "tmptarg.s"; unlink $tmptarg;
} }
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册