summaryrefslogtreecommitdiff
path: root/driver
diff options
context:
space:
mode:
authoraudreyt@audreyt.org <unknown>2007-07-11 18:24:30 +0000
committeraudreyt@audreyt.org <unknown>2007-07-11 18:24:30 +0000
commitc8b4b5ed1b5824c7e30fbfd2905f823c4b66d8c8 (patch)
tree15688ca0d6b3ad367addc36f57dedc3f4ad1a3a6 /driver
parent28ae38a309c6484c3ba1b4658277c32d71eadaaa (diff)
downloadhaskell-c8b4b5ed1b5824c7e30fbfd2905f823c4b66d8c8.tar.gz
* Evil Mangler broke under Perl 5.9+ because $* is gone; this fixes it.
Perl 4's special variable $* controls multi-line matching; it's been deprecated from Perl 5's inception, and is finally removed in Perl versions 5.9 (soon to be 5.10). Since GHC depends on Perl 5.6+ anyway, this patch introduces an equivalent effect to $* without using that special variable, by hooking into Perl's regex parsing process to add the /m flag.
Diffstat (limited to 'driver')
-rw-r--r--driver/mangler/ghc-asm.lprl7
1 files changed, 5 insertions, 2 deletions
diff --git a/driver/mangler/ghc-asm.lprl b/driver/mangler/ghc-asm.lprl
index 88766cba88..7c8bd0a8ff 100644
--- a/driver/mangler/ghc-asm.lprl
+++ b/driver/mangler/ghc-asm.lprl
@@ -542,10 +542,13 @@ print STDERR "T_HDR_vector: $T_HDR_vector\n";
\begin{code}
sub mangle_asm {
local($in_asmf, $out_asmf) = @_;
+ local($i, $c);
# multi-line regexp matching:
- local($*) = 1;
- local($i, $c);
+ # local($*) = 1;
+ # the above line used to work, but Perl 5.10 removes $*, so we uses an
+ # equivalent construct that works in Perl 5.6 and later.
+ BEGIN { require overload; overload::constant( qr => sub { "(?m:$_[1])" } ) }
# ia64-specific information for code chunks
my $ia64_locnum;