I decided to go the long way after all and ended up with the following patch
to the mangler. I successfully made stage=2 and the offending programs work.
Please give it a cursory look and an eventual thumbs-up before I commit it.

Volker
-- 
Volker Stolz * http://www-i2.informatik.rwth-aachen.de/stolz/ * PGP * S/MIME
? vs.prl
Index: ghc-asm.lprl
===================================================================
RCS file: /home/cvs/root/fptools/ghc/driver/mangler/ghc-asm.lprl,v
retrieving revision 1.113
diff -u -r1.113 ghc-asm.lprl
--- ghc-asm.lprl        13 Sep 2004 09:56:12 -0000      1.113
+++ ghc-asm.lprl        15 Sep 2004 12:43:57 -0000
@@ -615,8 +615,9 @@
            local($thing);
            chop($thing = $_);
            $thing =~ s/:$//;
-           print STDERR "Warning: retaining unknown function \`$thing' in output from 
C compiler\n"
-               unless # $KNOWN_FUNNY_THING{$thing}
+           $chk[++$i]   = $_;
+           $chksymb[$i] = '';
+           if (
                       /^${T_US}stg_.*${T_POST_LBL}$/o          # RTS internals
                    || /^${T_US}__stg_.*${T_POST_LBL}$/o        # more RTS internals
                    || /^${T_US}__fexp_.*${T_POST_LBL}$/o       # foreign export
@@ -626,10 +627,13 @@
                    || /^${T_US}.*_srtd${T_POST_LBL}$/o          # large bitmaps
                    || /^${T_US}.*_fast${T_POST_LBL}$/o         # primops
                    || /^${T_US}.*_closure_tbl${T_POST_LBL}$/o  # closure tables
-                    || /^_uname:/o;                            # x86/Solaris2
-           $chk[++$i]   = $_;
-           $chkcat[$i]  = 'misc';
-           $chksymb[$i] = '';
+                    || /^_uname:/o                             # x86/Solaris2
+               ) {
+                       $chkcat[$i]  = 'misc';
+                 } else {
+                       print STDERR "Warning: retaining unknown function \`$thing' in 
output from C compiler\n";
+                       $chkcat[$i]  = 'unknown';
+               }
 
        } elsif ( $TargetPlatform =~ /^powerpc-apple-.*/ && ( 
                   /^\.picsymbol_stub/
@@ -866,8 +870,9 @@
 
        # On SPARCs, we don't do --- BEGIN/END ---, we just
        # toss the register-windowing save/restore/ret* instructions
-       # directly:
-       if ( $TargetPlatform =~ /^sparc-/ ) {
+       # directly unless they've been generated by function definitions in header
+       # files on Solaris:
+       if ( $TargetPlatform =~ /^sparc-/ && ! ( $TargetPlatform =~ /solaris2$/ && 
$chkcat[$i] eq 'unknown' )) {
            $c =~ s/^\t(save.*|restore.*|ret|retl)\n//g;
            # throw away PROLOGUE comments
            $c =~ s/^\t!#PROLOGUE# 0\n\t!#PROLOGUE# 1\n//;
@@ -1031,7 +1036,7 @@
 
        next if $chkcat[$i] eq 'DONE ALREADY';
 
-       if ( $chkcat[$i] eq 'misc' ) {
+       if ( $chkcat[$i] eq 'misc' || $chkcat[$i] eq 'unknown' ) {
            if ($chk[$i] ne '') {
                print OUTASM $T_HDR_misc;
                &print_doctored($chk[$i], 0);
_______________________________________________
Cvs-ghc mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/cvs-ghc

Reply via email to