X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=driver%2Fmangler%2Fghc-asm.lprl;h=9a73bd2fe4848689897433724018aeaa74aca444;hb=12b7e9f1fa41e42350408f2bf0d6885f3fcba068;hp=91d20d67db0faa23d716272d8ab72a46071ee299;hpb=27b81b461fbc754779b2c941b9e1b9e49d54211b;p=ghc-hetmet.git diff --git a/driver/mangler/ghc-asm.lprl b/driver/mangler/ghc-asm.lprl index 91d20d6..9a73bd2 100644 --- a/driver/mangler/ghc-asm.lprl +++ b/driver/mangler/ghc-asm.lprl @@ -59,6 +59,20 @@ for the same reason. Advantage: No more ridiculous call sequences. %************************************************************************ \begin{code} +############################################################################ +# Make all regexp matching multi-line aware. This replaces the line below +# originally found in "sub mangle_asm": +# +# local($*) = 1; +# +# This used to work, but Perl 5.10 removes support for $*, so we uses an +# equivalent construct that works in Perl 5.6 and later. +# +BEGIN { if ($] >= 5.010) { + require overload; overload::constant( qr => sub { "(?m:$_[1])" } ); +} } +############################################################################ + $TargetPlatform = $TARGETPLATFORM; ($Pgm = $0) =~ s|.*/||; @@ -173,7 +187,13 @@ sub init_TARGET_STUFF { $T_X86_BADJMP = '^\tjmp\s+[^\.\*]'; $T_MOVE_DIRVS = '^(\s*(\.(p2)?align\s.*|\.globl\s+\S+|\.text|\.data|\.section\s+.*|\.type\s+.*|\.size\s+\S+\s*,\s*\d+|\.ident.*|\.local.*)\n)'; - $T_COPY_DIRVS = '^\s*\.(globl|type|size|local)'; + if ( $TargetPlatform =~ /solaris2/ ) { + # newer Solaris linkers are picky about .size information, so + # omit it (see #1421) + $T_COPY_DIRVS = '^\s*\.(globl|local)'; + } else { + $T_COPY_DIRVS = '^\s*\.(globl|type|size|local)'; + } $T_DOT_WORD = '\.(long|value|word|byte|zero)'; $T_DOT_GLOBAL = '\.globl'; @@ -536,10 +556,8 @@ print STDERR "T_HDR_vector: $T_HDR_vector\n"; \begin{code} sub mangle_asm { local($in_asmf, $out_asmf) = @_; - - # multi-line regexp matching: - local($*) = 1; local($i, $c); + local($*) = 1; # ia64-specific information for code chunks my $ia64_locnum;