From: ken Date: Wed, 28 Aug 2002 19:28:02 +0000 (+0000) Subject: [project @ 2002-08-28 19:28:02 by ken] X-Git-Tag: Approx_11550_changesets_converted~1745 X-Git-Url: http://git.megacz.com/?a=commitdiff_plain;h=c994c0e76bff57e297109e50b0d102c7116a3e55;p=ghc-hetmet.git [project @ 2002-08-28 19:28:02 by ken] Further mangler changes to get ghc working with gcc 3.04 on the Alpha. Jeff Lewis: "The compiler was sometimes emitting the $..ng label for a symbol before the regular label. This really confused the mangler, and it completely scrambled the file." --- diff --git a/ghc/driver/mangler/ghc-asm.lprl b/ghc/driver/mangler/ghc-asm.lprl index a0c3921..e9d6450 100644 --- a/ghc/driver/mangler/ghc-asm.lprl +++ b/ghc/driver/mangler/ghc-asm.lprl @@ -96,8 +96,8 @@ sub init_TARGET_STUFF { $T_CONST_LBL = '^\$L?C(\d+):$'; # regexp for what such a lbl looks like $T_POST_LBL = ':'; - $T_MOVE_DIRVS = '^(\s*(\.align\s+\d+|\.(globl|ent)\s+\S+|\#.*|\.(file|loc)\s+\S+\s+\S+|\.text|\.r?data)\n)'; - $T_COPY_DIRVS = '^\s*(\#|\.(file|globl|ent|loc))'; + $T_MOVE_DIRVS = '^(\s*(\$.*\.\.ng:|\.align\s+\d+|\.(globl|ent)\s+\S+|\#.*|\.(file|loc)\s+\S+\s+\S+|\.text|\.r?data)\n)'; + $T_COPY_DIRVS = '^\s*(\$.*\.\.ng:|\#|\.(file|globl|ent|loc))'; $T_hsc_cc_PAT = '\.ascii.*\)(hsc|cc) (.*)\\\\11"\n\t\.ascii\s+"(.*)\\\\0"'; $T_DOT_WORD = '\.(long|quad|byte|word)'; @@ -908,16 +908,18 @@ sub mangle_asm { if ( $TargetPlatform =~ /^alpha-/ && $c =~ /^\t\.ent\s+(\S+)/ ) { $ent = $1; # toss all prologue stuff, except for loading gp, and the ..ng address - if (($p, $r) = split(/^\t\.prologue/, $c)) { - if (($keep, $junk) = split(/\.\.ng:/, $p)) { - $keep =~ s/^\t\.frame.*\n/\t.frame \$30,0,\$26,0\n/; - $keep =~ s/^\t\.(mask|fmask).*\n//g; - $c = $keep . "..ng:\n"; - } else { - print STDERR "malformed code block ($ent)?\n" - } - } - $c .= "\t.prologue" . $r; + unless ($c =~ /\.ent.*\n\$.*\.\.ng:/) { + if (($p, $r) = split(/^\t\.prologue/, $c)) { + if (($keep, $junk) = split(/\.\.ng:/, $p)) { + $keep =~ s/^\t\.frame.*\n/\t.frame \$30,0,\$26,0\n/; + $keep =~ s/^\t\.(mask|fmask).*\n//g; + $c = $keep . "..ng:\n"; + } else { + print STDERR "malformed code block ($ent)?\n" + } + } + $c .= "\t.prologue" . $r; + } } $c =~ s/FUNNY#END#THING//;