diff options
author | Adrian M. Enache <enache@rdslink.ro> | 2003-07-19 02:15:37 +0300 |
---|---|---|
committer | Jarkko Hietaniemi <jhi@iki.fi> | 2003-07-27 15:13:10 +0000 |
commit | 1df3498620ecc1df99a2455e631a135f1710416f (patch) | |
tree | 5eefdb3c46f3a4cd93f5d6352185ac0c5b63a5ac /utils | |
parent | 8f33b42a5befbbd0d1d798a463bfe4ac2ba9bf10 (diff) | |
download | perl-1df3498620ecc1df99a2455e631a135f1710416f.tar.gz |
Re: [perl #22984] perl-5.8.1-RC2: TEST -bytecompile won't work at all
Message-ID: <20030718201537.GA1574@ratsnest.hole>
p4raw-id: //depot/perl@20220
Diffstat (limited to 'utils')
-rw-r--r-- | utils/perlcc.PL | 41 |
1 files changed, 3 insertions, 38 deletions
diff --git a/utils/perlcc.PL b/utils/perlcc.PL index 15a276a3cb..313a972d88 100644 --- a/utils/perlcc.PL +++ b/utils/perlcc.PL @@ -225,53 +225,18 @@ sub compile_module { } sub compile_byte { - require ByteLoader; - my $stash = grab_stash(); - my $command = "$BinPerl -MO=Bytecode,$stash $Input"; - # The -a option means we'd have to close the file and lose the - # lock, which would create the tiniest of races. Instead, append - # the output ourselves. - vprint 1, "Writing on $Output"; - - my $openflags = O_WRONLY | O_CREAT; - $openflags |= O_BINARY if eval { O_BINARY; 1 }; - $openflags |= O_EXLOCK if eval { O_EXLOCK; 1 }; - - # these dies are not "$0: .... \n" because they "can't happen" - - sysopen(OUT, $Output, $openflags) - or die "can't write to $Output: $!"; - - # this is blocking; hold on; why are we doing this?? - # flock OUT, LOCK_EX or die "can't lock $Output: $!" - # unless eval { O_EXLOCK; 1 }; - - truncate(OUT, 0) - or die "couldn't trunc $Output: $!"; - - print OUT <<EOF; -#!$^X -use ByteLoader $ByteLoader::VERSION; -EOF - - # Now the compile: - vprint 1, "Compiling..."; - vprint 3, "Calling $command"; + my $command = "$BinPerl -MO=Bytecode,-H,-o$Output $Input"; + $Input =~ s/^-e.*$/-e/; my ($output_r, $error_r) = spawnit($command); if (@$error_r && $? != 0) { - _die("$0: $Input did not compile, which can't happen:\n@$error_r\n"); + _die("$0: $Input did not compile:\n@$error_r\n"); } else { my @error = grep { !/^$Input syntax OK$/o } @$error_r; warn "$0: Unexpected compiler output:\n@error" if @error; } - # Write it and leave. - print OUT @$output_r or _die("can't write $Output: $!"); - close OUT or _die("can't close $Output: $!"); - - # wait, how could it be anything but what you see next? chmod 0777 & ~umask, $Output or _die("can't chmod $Output: $!"); exit 0; } |