%************************************************************************
%* *
+\subsection{Top-level code}
+%* *
+%************************************************************************
+
+\begin{code}
+$TargetPlatform = $TARGETPLATFORM;
+
+($Pgm = $0) =~ s|.*/||;
+$ifile = $ARGV[0];
+$ofile = $ARGV[1];
+
+if ( $TargetPlatform =~ /^i386-/ ) {
+ $StolenX86Regs = $ARGV[2];
+}
+
+&mangle_asm($ifile,$ofile);
+
+exit(0);
+\end{code}
+
+%************************************************************************
+%* *
\subsection{Constants for various architectures}
%* *
%************************************************************************
$T_HDR_direct = "\t.SPACE \$TEXT\$\n\t.SUBSPA \$CODE\$\n\t\.align 4\n";
#--------------------------------------------------------#
- } elsif ( $TargetPlatform =~ /^i386-.*-(linuxaout|freebsd2|netbsd|nextstep3|cygwin32|mingw32)$/ ) {
+ } elsif ( $TargetPlatform =~ /^i386-.*-(linuxaout|freebsd2|netbsd|openbsd|nextstep3|cygwin32|mingw32)$/ ) {
# NeXT added but not tested. CaS
$T_STABBY = 1; # 1 iff .stab things (usually if a.out format)
$chkcat[$i] = 'literal';
$chksymb[$i] = $1;
- } elsif ( /^$TUS[@]?__stg_split_marker(\d+)$TPOSTLBL[@]?$/o ) {
+ } elsif ( /^$TUS[@]?__stg_split_marker(\d*)$TPOSTLBL[@]?$/o ) {
$chk[++$i] = $_;
$chkcat[$i] = 'splitmarker';
$chksymb[$i] = $1;
$e =~ s/^\tret\n//;
$e =~ s/^\tpopl \%edi\n//;
$e =~ s/^\tpopl \%esi\n//;
+ $e =~ s/^\tpopl \%edx\n//;
$e =~ s/^\tpopl \%ecx\n//;
$e =~ s/^\taddl \$\d+,\%esp\n//;
$e =~ s/^\tsubl \$-\d+,\%esp\n//;
# HWL HACK: dont die, just print a warning
#print stderr "HWL: this should die! Epilogue junk?: $e\n" if $e =~ /^\t[^\.]/
# && $TargetPlatform !~ /^powerpc-/; #ToDo: remove test
- die "Epilogue junk?: $e\n" if $e =~ /^\t[^\.]/
+ die "Epilogue junk?: $e\n" if $e =~ /^\t[^\.\n]/
&& $TargetPlatform !~ /^powerpc-/; #ToDo: remove test
# glue together what's left
# blah_closure:
# ...
#
- if ( $TargetPlatform =~ /^i386/ && $to_move =~ /$TCOPYDIRVS/ ) {
+ if ( $TargetPlatform =~ /^(i386|sparc)/ && $to_move =~ /$TCOPYDIRVS/ ) {
$j = $i + 1;
while ( $j < $numchks && $chk[$j] =~ /$T_CONST_LBL/) {
$j++;
};
$c;
}
+\end{code}
-# make "require"r happy...
-1;
+\begin{code}
+sub tidy_up_and_die {
+ local($return_val, $msg) = @_;
+ print STDERR $msg;
+ exit (($return_val == 0) ? 0 : 1);
+}
\end{code}