'-fwarn-unused-imports');
@MinusWallOpts = (@MinusWOpts,
'-fwarn-unused-matches',
+ '-fwarn-type-defaults',
'-fwarn-name-shadowing',
'-fwarn-missing-signatures');
\end{code}
@HsSourceCppOpts =
( "-D__HASKELL1__=$Haskell1Version"
, "-D__GLASGOW_HASKELL__=$ProjectVersionInt"
- # not yet -- SDM
- # , "-D__CONCURRENT_HASKELL__"
+ , "-D__HASKELL98__"
+ , "-D__CONCURRENT_HASKELL__"
);
@UserLibrary_dir= (); #-L things;...
# make depend for Haskell
$MkDependHS
- = ( $INSTALLING ) ? "$InstBinDirGhc/mkdependHS"
+ = ( $INSTALLING ) ? "$InstLibExecDirGhc/mkdependHS"
: "$TopPwd/$CURRENT_DIR/$GHC_UTILS_DIR/mkdependHS/mkdependHS";
# Fill in later
@MkDependHS_flags = ();
$Only_generate_deps = 0; # "
$PostprocessCcOutput = 0;
+# Win32 only:
+# static /= 0 => produce code for DLLs (when compiling/linking.)
+$Static = 1;
+$Static = 0 if ($TargetPlatform =~ /-mingw32$/);
+
# native code-gen or via C?
$HaveNativeCodeGen = $GhcWithNativeCodeGen;
$HscOut = '-C='; # '-C=' ==> .hc output; '-S=' ==> .s output; '-N=' ==> neither
$PROFgroup = ''; # set to group if an explicit -Ggroup specified
$PROFauto = ''; # set to relevant hsc flag if -auto or -auto-all
$PROFcaf = ''; # set to relevant hsc flag if -caf-all
+$PROFdict = ''; # set to relevant hsc flag if -auto-dicts
$PROFignore_scc = ''; # set to relevant parser flag if explicit sccs ignored
$UNPROFscc_auto = ''; # set to relevant hsc flag if forcing auto sccs without profiling
$TICKYing = ''; # set to t if compiling for ticky-ticky profiling
# See remark re: cloning in defn of minusnotO
'-fclone-binds',
+ '-fdo-case-elim',
'-fmax-simplifier-iterations1',
$Oopt_PedanticBottoms,
']',
} else {
push(@HsC_flags, $PROFauto) if $PROFauto;
push(@HsC_flags, $PROFcaf) if $PROFcaf;
- #push(@HsC_flags, $PROFdict) if $PROFdict;
+ push(@HsC_flags, $PROFdict) if $PROFdict;
$Oopt_FinalStgProfilingMassage = '-fmassage-stg-for-profiling';
# things that are referenced by the RTS - make sure that we pull 'em in
unshift(@Ld_flags,
- ( '-u', "${uscore}PrelBase_IZh_static_info"
- ,'-u', "${uscore}PrelBase_CZh_static_info"
- ,'-u', "${uscore}PrelBase_FZh_static_info"
- ,'-u', "${uscore}PrelBase_DZh_static_info"
- ,'-u', "${uscore}PrelAddr_AZh_static_info"
- ,'-u', "${uscore}PrelAddr_WZh_static_info"
- ,'-u', "${uscore}PrelAddr_I64Zh_static_info"
- ,'-u', "${uscore}PrelAddr_W64Zh_static_info"
+ ( '-u', "${uscore}PrelBase_Izh_static_info"
+ ,'-u', "${uscore}PrelBase_Czh_static_info"
+ ,'-u', "${uscore}PrelBase_Fzh_static_info"
+ ,'-u', "${uscore}PrelBase_Dzh_static_info"
+ ,'-u', "${uscore}PrelAddr_Azh_static_info"
+ ,'-u', "${uscore}PrelAddr_Wzh_static_info"
+ ,'-u', "${uscore}PrelAddr_I64zh_static_info"
+ ,'-u', "${uscore}PrelAddr_W64zh_static_info"
,'-u', "${uscore}PrelStable_StablePtr_static_info"
- ,'-u', "${uscore}PrelBase_IZh_con_info"
- ,'-u', "${uscore}PrelBase_CZh_con_info"
- ,'-u', "${uscore}PrelBase_FZh_con_info"
- ,'-u', "${uscore}PrelBase_DZh_con_info"
- ,'-u', "${uscore}PrelAddr_AZh_con_info"
- ,'-u', "${uscore}PrelAddr_WZh_con_info"
- ,'-u', "${uscore}PrelAddr_I64Zh_con_info"
- ,'-u', "${uscore}PrelAddr_W64Zh_con_info"
+ ,'-u', "${uscore}PrelBase_Izh_con_info"
+ ,'-u', "${uscore}PrelBase_Czh_con_info"
+ ,'-u', "${uscore}PrelBase_Fzh_con_info"
+ ,'-u', "${uscore}PrelBase_Dzh_con_info"
+ ,'-u', "${uscore}PrelAddr_Azh_con_info"
+ ,'-u', "${uscore}PrelAddr_Wzh_con_info"
+ ,'-u', "${uscore}PrelAddr_I64zh_con_info"
+ ,'-u', "${uscore}PrelAddr_W64zh_con_info"
,'-u', "${uscore}PrelStable_StablePtr_con_info"
,'-u', "${uscore}PrelBase_False_static_closure"
,'-u', "${uscore}PrelBase_True_static_closure"
,'-u', "${uscore}PrelPack_unpackCString_closure"
+ ,'-u', "${uscore}PrelException_stackOverflow_closure"
+ ,'-u', "${uscore}PrelException_heapOverflow_closure"
));
if (!$NoHaskellMain) {
unshift (@Ld_flags,'-u', "${uscore}PrelMain_mainIO_closure");
unshift(@Ld_flags, ('-Xlinker -bbigtoc'));
}
+
} # end of setupLinkOpts
\end{code}
push(@SysLibrary, "-l$LibGmp");
}
-push(@SysLibrary, '-lm');
+push(@SysLibrary, '-lm') if !( $TargetPlatform =~ /^.*(cygwin32|mingw32)$/ );
\end{code}
%************************************************************************
local($output) = ($Specific_output_file ne '') ? "-o $Specific_output_file" : '';
@Files_to_tidy = ($Specific_output_file ne '') ? $Specific_output_file : 'a.out';
+ #
+ # Win32 DLLs - link with import libraries, not the real archives.
+ #
+ if ( $TargetPlatform =~ /-mingw32$/ && !$Static ) {
+ foreach $a ( @SysLibrary ) {
+ next if ($a eq '-lm');
+ $a = "${a}_imp" if ($a =~ /^-l/);
+ }
+ push(@Link_file, ( $INSTALLING ) ? "$InstLibDirGhc/Main.o"
+ : "$TopPwd/$CURRENT_DIR/$GHC_RUNTIME_DIR/Main.o");
+ push(@Link_file, ( $INSTALLING ) ? "$InstLibDirGhc/PrelMain.o"
+ : "$TopPwd/$CURRENT_DIR/$GHC_LIB_DIR/PrelMain.o");
+ push(@Ld_flags, "-mno-cygwin");
+ }
local($to_do) = "$lnkr $Verbose @Ld_flags $output @Link_file $TopClosureFile $libdirs @UserLibrary @SysLibrary";
&run_something($to_do, 'Linker');
push(@HsC_flags, '-fsource-unchanged');
}
+ # Indicate whether we're static or not.
+ # This will only ever
+ push(@HsC_flags, '-static') if $Static;
+
# Run the compiler
&runHsc($ifile_root, $hsc_out, $hsc_hi, $hsc_out_c_stub, $hsc_out_h_stub, $going_interactive);
if ( $going_interactive ) {
# don't need .hi unless we're going to show it on stdout:
- $ProduceHi = '-nohifile=' if ! $HiOnStdout;
+ $ProduceHi = '-nohifile=' if ! ($HiOnStdout || $Specific_hi_file ne '' );
$do_cc = 0; $do_as = 0; $Do_lnkr = 0; # and we won't go any further...
}
local($c_flags) = "@CcBoth_flags";
local($ddebug_flag) = ( $DEBUGging ) ? '-DDEBUG' : '';
+ $c_flags .= " -mno-cygwin" if ( $TargetPlatform =~ /-mingw32$/ );
+
# "input" files to use that are not in some weird directory;
# to help C compilers grok .hc files [ToDo: de-hackify]
local($cc_help) = "ghc$$.c";
$GCs = $1 if /^\s*([0-9,]+) (collections? in generation 0|garbage collections? performed)/;
+ if ( /^\s+([0-9]+)\s+Mb total memory/ ) {
+ $TotMem = $1;
+ }
+
# The presence of -? in the following pattern is only there to
# accommodate 0.29 && <= 2.05 RTS'
if ( /^\s*INIT\s+time\s*(\d+\.\d\d)s\s*\(\s*-?(\d+\.\d\d)s elapsed\)/ ) {
# print out what we found
print STDERR "<<$SysSpecificTiming: ",
- "$BytesAlloc bytes, $GCs GCs, $AvgResidency/$MaxResidency avg/max bytes residency ($ResidencySamples samples), $InitTime INIT ($InitElapsed elapsed), $MutTime MUT ($MutElapsed elapsed), $GcTime GC ($GcElapsed elapsed)",
+ "$BytesAlloc bytes, $GCs GCs, $AvgResidency/$MaxResidency avg/max bytes residency ($ResidencySamples samples), ${TotMem}M in use, $InitTime INIT ($InitElapsed elapsed), $MutTime MUT ($MutElapsed elapsed), $GcTime GC ($GcElapsed elapsed)",
" :$SysSpecificTiming>>\n";
# OK, party over
# stop after generating .o files
/^-link-chk$/ && do { $LinkChk = 1; next arg; };
- /^-no-link-chk$/ && do { $LinkChk = 0; next arg; };
# don't do consistency-checking after a link
+ /^-no-link-chk$/ && do { $LinkChk = 0; next arg; };
/^-tmpdir$/ && do { $Tmp_prefix = &grab_arg_arg(*Args,'-tmpdir', '');
$Tmp_prefix = "$Tmp_prefix/ghc$$";
$Status++;
}
}
+ $ProduceHi='-hifile=';
next arg; };
# The suffix to use when looking for interface files
/^-prof$/ && do { $PROFing = 'p'; next arg; }; # profiling -- details later!
- /^-auto/ && do {
- # generate auto SCCs on top level bindings
- # -auto-all = all top level bindings
- # -auto = only top level exported bindings
- $PROFauto = ( /-all/ )
- ? '-fauto-sccs-on-all-toplevs'
- : '-fauto-sccs-on-exported-toplevs';
+ /^-auto-dicts$/ && do {
+ $PROFdicts = '-fauto-sccs-on-dicts';
+ next arg; };
+ /^-auto-all$/ && do {
+ $PROFauto = '-fauto-sccs-on-all-toplevs';
+ next arg; };
+ /^-auto$/ && do {
+ $PROFauto = '-fauto-sccs-on-exported-toplevs';
next arg; };
/^-caf-all/ && do { # generate individual CAF SCC annotations
/^-keep-s-files?-too$/ && do { $Keep_s_file_too = 1; next arg; };
/^-fignore-interface-pragmas$/ && do { push(@HsC_flags, $_); next arg; };
+ /^-fignore-asserts$/ && do { push(@HsC_flags, $_); next arg; };
/^-fno-implicit-prelude$/ && do { $NoImplicitPrelude= 1; push(@HsC_flags, $_); next arg; };
}
next arg; };
- /^-fno-asm-mangling$/ && do { $DoAsmMangling = 0; next arg; };
+ /^-fno-asm-mangling$/ && do { $DoAsmMangling = 0; next arg; };
/^-fallow-overlapping-instances$/ && do { push(@HsC_flags, $_); next arg; };
/^-fallow-undecidable-instances$/ && do { push(@HsC_flags, $_); next arg; };
/^-fno-speciali[sz]e$/
&& do { $Oopt_DoSpecialise = ''; next arg; };
+ /^-fcompiling-prelude$/ && do { push(@HsC_flags, $_); next arg; };
# Now the foldr/build options, which are *on* by default (for -O).
/^-fno-let-from-(case|app|strict-let)$/ # experimental, really (WDP 95/10)
&& do { push(@HsC_flags, $_); next arg; };
+ /^-funbox-strict-fields$/
+ && do { push(@HsC_flags, $_); next arg; };
+
# --------------- Warnings etc. ------
/^-fwarn-(.*)$/ && do { push(@HsC_flags, $_); next arg; };
#---------- Linker (gcc, really) ---------------------------------------
- /^-static$/ && do { push(@Ld_flags, $_); next arg; };
+ /^-static$/ && do { $Static=1; push(@Ld_flags, $_); next arg; };
/^-no-hs-main$/ && do { $NoHaskellMain=1; next arg; };
#---------- mixed cc and linker magic ----------------------------------