THIS CHANGE AFFECTS ALL OBJECT FILES COMPILED FROM HASKELL.
Please say "make -C ghc/lib/std clean; make -C hslibs clean".
This commit eliminates spurious warning messages when compiling on
the Alpha. There are two kinds of spurious warning messages:
(1) gcc: -noprefix_recognition: linker input file unused since linking not done
This warning is because we pass the flag "-Xlinker -noprefix_recognition"
to gcc. We remove this warning by no longer passing the flag to gcc,
and by removing the reason we were passing the flag in the first place:
__init_* is now renamed to __stginit_*.
(2) .../includes/Regs.h: warning: call-clobbered register used for global
register variable
This warning and all other warnings except (1), we eliminate by
passing the -w flag to gcc.
MERGE TO STABLE BRANCH
15 files changed:
%
% (c) The GRASP/AQUA Project, Glasgow University, 1992-1998
%
%
% (c) The GRASP/AQUA Project, Glasgow University, 1992-1998
%
-% $Id: CLabel.lhs,v 1.46 2001/04/20 14:54:37 sewardj Exp $
+% $Id: CLabel.lhs,v 1.47 2001/09/04 18:29:20 ken Exp $
%
\section[CLabel]{@CLabel@: Information to make C Labels}
%
\section[CLabel]{@CLabel@: Information to make C Labels}
pprCLbl (CCS_Label ccs) = ppr ccs
pprCLbl (ModuleInitLabel mod)
pprCLbl (CCS_Label ccs) = ppr ccs
pprCLbl (ModuleInitLabel mod)
- = ptext SLIT("__init_") <> ptext (moduleNameFS (moduleName mod))
+ = ptext SLIT("__stginit_") <> ptext (moduleNameFS (moduleName mod))
ppIdFlavor :: IdLabelInfo -> SDoc
ppIdFlavor :: IdLabelInfo -> SDoc
{-# OPTIONS -#include "hschooks.h" #-}
-----------------------------------------------------------------------------
{-# OPTIONS -#include "hschooks.h" #-}
-----------------------------------------------------------------------------
--- $Id: DriverFlags.hs,v 1.67 2001/08/31 13:51:45 sewardj Exp $
+-- $Id: DriverFlags.hs,v 1.68 2001/09/04 18:29:20 ken Exp $
machdepCCOpts
| prefixMatch "alpha" cTARGETPLATFORM
machdepCCOpts
| prefixMatch "alpha" cTARGETPLATFORM
- = return ( ["-static", "-Xlinker -noprefix_recognition"], [] )
+ = return ( ["-static"], ["-w"] )
+ -- For now, to suppress the gcc warning "call-clobbered
+ -- register used for global register variable", we simply
+ -- disable all warnings altogether using the -w flag. Oh well.
| prefixMatch "hppa" cTARGETPLATFORM
-- ___HPUX_SOURCE, not _HPUX_SOURCE, is #defined if -ansi!
| prefixMatch "hppa" cTARGETPLATFORM
-- ___HPUX_SOURCE, not _HPUX_SOURCE, is #defined if -ansi!
| prefixMatch "sparc" cTARGETPLATFORM
= return ( [], ["-w"] )
| prefixMatch "sparc" cTARGETPLATFORM
= return ( [], ["-w"] )
+ -- For now, to suppress the gcc warning "call-clobbered
+ -- register used for global register variable", we simply
+ -- disable all warnings altogether using the -w flag. Oh well.
| prefixMatch "powerpc" cTARGETPLATFORM || prefixMatch "rs6000" cTARGETPLATFORM
= return ( ["-static"], ["-finhibit-size-directive"] )
| prefixMatch "powerpc" cTARGETPLATFORM || prefixMatch "rs6000" cTARGETPLATFORM
= return ( ["-static"], ["-finhibit-size-directive"] )
++ extra_ld_opts
++ if static && not no_hs_main then
[ "-u", prefixUnderscore "PrelMain_mainIO_closure",
++ extra_ld_opts
++ if static && not no_hs_main then
[ "-u", prefixUnderscore "PrelMain_mainIO_closure",
- "-u", prefixUnderscore "__init_PrelMain"]
+ "-u", prefixUnderscore "__stginit_PrelMain"]
else []))
-- parallel only: move binary to another dir -- HWL
else []))
-- parallel only: move binary to another dir -- HWL
adding
the symbols that the RTS needs from libHSstd, such as
<code>PrelWeak_runFinalizzerBatch_closure</code> and
adding
the symbols that the RTS needs from libHSstd, such as
<code>PrelWeak_runFinalizzerBatch_closure</code> and
- <code>__init_Prelude</code>, to the link line with the
+ <code>__stginit_Prelude</code>, to the link line with the
<code>-u</code> flag. The standard library appears before the
RTS on the link line, and these options cause the corresponding
symbols to be picked up even so the linked might not have seen them
<code>-u</code> flag. The standard library appears before the
RTS on the link line, and these options cause the corresponding
symbols to be picked up even so the linked might not have seen them
supplied by the RTS (in the file
<a href="http://cvs.haskell.org/cgi-bin/cvsweb.cgi/fptools/ghc/rts/Main.c"><code>Main.c</code></a>).
It calls <code>startupHaskell</code>, which
supplied by the RTS (in the file
<a href="http://cvs.haskell.org/cgi-bin/cvsweb.cgi/fptools/ghc/rts/Main.c"><code>Main.c</code></a>).
It calls <code>startupHaskell</code>, which
- itself calls <code>__init_PrelMain</code>, which is therefore,
+ itself calls <code>__stginit_PrelMain</code>, which is therefore,
since it occurs in the standard library, one of the symbols
passed to the linker using the <code>-u</code> option. This is fine
for standalone Haskell programs, but as soon as the Haskell code is only
since it occurs in the standard library, one of the symbols
passed to the linker using the <code>-u</code> option. This is fine
for standalone Haskell programs, but as soon as the Haskell code is only
<code>main()</code> function of that foreign language should be used
instead of that of the Haskell runtime. In this case, the previously
described arrangement unfortunately fails as
<code>main()</code> function of that foreign language should be used
instead of that of the Haskell runtime. In this case, the previously
described arrangement unfortunately fails as
- <code>__init_PrelMain</code> had better not be linked in,
- because it tries to call <code>__init_Main</code>, which won't
+ <code>__stginit_PrelMain</code> had better not be linked in,
+ because it tries to call <code>__stginit_Main</code>, which won't
exist. In other words, the RTS's <code>main()</code> refers to
exist. In other words, the RTS's <code>main()</code> refers to
- <code>__init_PrelMain</code> which in turn refers to
- <code>__init_Main</code>. Although the RTS's <code>main()</code>
+ <code>__stginit_PrelMain</code> which in turn refers to
+ <code>__stginit_Main</code>. Although the RTS's <code>main()</code>
might not be linked in if the program provides its own, the driver
might not be linked in if the program provides its own, the driver
- will normally force <code>__init_PrelMain</code> to be linked in anyway,
+ will normally force <code>__stginit_PrelMain</code> to be linked in anyway,
using <code>-u</code>, because it's a back-reference from the
RTS to HSstd. This case is coped with by the <code>-no-hs-main</code>
flag, which suppresses passing the corresonding <code>-u</code> option
using <code>-u</code>, because it's a back-reference from the
RTS to HSstd. This case is coped with by the <code>-no-hs-main</code>
flag, which suppresses passing the corresonding <code>-u</code> option
it didn't work. In addition, the driver generally places the C program
providing the <code>main()</code> that we want to use before the RTS
on the link line. Therefore, the RTS's main is never used and
it didn't work. In addition, the driver generally places the C program
providing the <code>main()</code> that we want to use before the RTS
on the link line. Therefore, the RTS's main is never used and
- without the <code>-u</code> the label <code>__init_PrelMain</code>
+ without the <code>-u</code> the label <code>__stginit_PrelMain</code>
#include <windows.h>
#include <Rts.h>
#include <windows.h>
#include <Rts.h>
+EXTFUN(__stginit_Adder);
static char* args[] = { "ghcDll", NULL };
/* N.B. argv arrays must end with NULL */
static char* args[] = { "ghcDll", NULL };
/* N.B. argv arrays must end with NULL */
{
if (reason == DLL_PROCESS_ATTACH) {
/* By now, the RTS DLL should have been hoisted in, but we need to start it up. */
{
if (reason == DLL_PROCESS_ATTACH) {
/* By now, the RTS DLL should have been hoisted in, but we need to start it up. */
- startupHaskell(1, args, __init_Adder);
+ startupHaskell(1, args, __stginit_Adder);
return TRUE;
}
return TRUE;
return TRUE;
}
return TRUE;
, "PrelIOBase_NonTermination_closure"
, "PrelIOBase_BlockedOnDeadMVar_closure"
, "PrelWeak_runFinalizzerBatch_closure"
, "PrelIOBase_NonTermination_closure"
, "PrelIOBase_BlockedOnDeadMVar_closure"
, "PrelWeak_runFinalizzerBatch_closure"
unless $KNOWN_FUNNY_THING{$thing}
|| /^${T_US}stg_.*${T_POST_LBL}$/o # RTS internals
|| /^${T_US}__fexp_.*${T_POST_LBL}$/o # foreign export
unless $KNOWN_FUNNY_THING{$thing}
|| /^${T_US}stg_.*${T_POST_LBL}$/o # RTS internals
|| /^${T_US}__fexp_.*${T_POST_LBL}$/o # foreign export
- || /^${T_US}__init.*${T_POST_LBL}$/o # __init<module>
+ || /^${T_US}__stginit.*${T_POST_LBL}$/o # __stginit<module>
|| /^${T_US}.*_btm${T_POST_LBL}$/o # large bitmaps
|| /^${T_US}.*_closure_tbl${T_POST_LBL}$/o # closure tables
|| /^_uname:/o; # x86/Solaris2
|| /^${T_US}.*_btm${T_POST_LBL}$/o # large bitmaps
|| /^${T_US}.*_closure_tbl${T_POST_LBL}$/o # closure tables
|| /^_uname:/o; # x86/Solaris2
};
&print_doctored($chk[$i], 0);
if ($TargetPlatform =~ /^powerpc-|^rs6000-/ && $printDS) {
};
&print_doctored($chk[$i], 0);
if ($TargetPlatform =~ /^powerpc-|^rs6000-/ && $printDS) {
-#ok if ($chksymb[$i] !~ /\__init_Main/) {
+#ok if ($chksymb[$i] !~ /\__stginit_Main/) {
print OUTASM "\.csect ${chksymb[$i]}[DS]\n";
print OUTASM "${p}TOC[tc0], 0\n";
#ok }
print OUTASM "\.csect ${chksymb[$i]}[DS]\n";
print OUTASM "${p}TOC[tc0], 0\n";
#ok }
if ( $TargetPlatform !~ /^i386-/
|| ! /^\t[a-z]/ # no instructions in here, apparently
if ( $TargetPlatform !~ /^i386-/
|| ! /^\t[a-z]/ # no instructions in here, apparently
- || /^${T_US}__init_[A-Za-z0-9_]+${T_POST_LBL}/) {
+ || /^${T_US}__stginit_[A-Za-z0-9_]+${T_POST_LBL}/) {
print OUTASM $_;
return;
}
print OUTASM $_;
return;
}
PrelIOBase_BlockedOnDeadMVar_closure
PrelIOBase_NonTermination_closure
PrelWeak_runFinalizzerBatch_closure
PrelIOBase_BlockedOnDeadMVar_closure
PrelIOBase_NonTermination_closure
PrelWeak_runFinalizzerBatch_closure
/* -----------------------------------------------------------------------------
/* -----------------------------------------------------------------------------
- * $Id: Linker.c,v 1.64 2001/09/04 16:49:12 sewardj Exp $
+ * $Id: Linker.c,v 1.65 2001/09/04 18:29:21 ken Exp $
*
* (c) The GHC Team, 2000, 2001
*
*
* (c) The GHC Team, 2000, 2001
*
Sym(StgReturn) \
Sym(init_stack) \
SymX(cmp_thread) \
Sym(StgReturn) \
Sym(init_stack) \
SymX(cmp_thread) \
+ Sym(__stginit_PrelGHC) \
SymX(freeHaskellFunctionPtr) \
SymX(OnExitHook) \
SymX(ErrorHdrHook) \
SymX(freeHaskellFunctionPtr) \
SymX(OnExitHook) \
SymX(ErrorHdrHook) \
/* -----------------------------------------------------------------------------
/* -----------------------------------------------------------------------------
- * $Id: Main.c,v 1.30 2001/08/14 13:40:09 sewardj Exp $
+ * $Id: Main.c,v 1.31 2001/09/04 18:29:21 ken Exp $
*
* (c) The GHC Team 1998-2000
*
*
* (c) The GHC Team 1998-2000
*
# include <windows.h>
#endif
# include <windows.h>
#endif
-extern void __init_PrelMain(void);
+extern void __stginit_PrelMain(void);
/* Hack: we assume that we're building a batch-mode system unless
* INTERPRETER is set
/* Hack: we assume that we're building a batch-mode system unless
* INTERPRETER is set
SchedulerStatus status;
/* all GranSim/GUM init is done in startupHaskell; sets IAmMainThread! */
SchedulerStatus status;
/* all GranSim/GUM init is done in startupHaskell; sets IAmMainThread! */
- startupHaskell(argc,argv,__init_PrelMain);
+ startupHaskell(argc,argv,__stginit_PrelMain);
/* kick off the computation by creating the main thread with a pointer
to mainIO_closure representing the computation of the overall program;
/* kick off the computation by creating the main thread with a pointer
to mainIO_closure representing the computation of the overall program;
/* -----------------------------------------------------------------------------
/* -----------------------------------------------------------------------------
- * $Id: RtsStartup.c,v 1.52 2001/08/14 13:40:09 sewardj Exp $
+ * $Id: RtsStartup.c,v 1.53 2001/09/04 18:29:21 ken Exp $
*
* (c) The GHC Team, 1998-2000
*
*
* (c) The GHC Team, 1998-2000
*
ullong startTime = 0;
#endif
ullong startTime = 0;
#endif
+EXTFUN(__stginit_Prelude);
static void initModules ( void (*)(void) );
void
static void initModules ( void (*)(void) );
void
- we supply a unique integer to each statically declared cost
centre and cost centre stack in the program.
- we supply a unique integer to each statically declared cost
centre and cost centre stack in the program.
- The code generator inserts a small function "__init_<module>" in each
- module and calls the registration functions in each of the modules
- it imports. So, if we call "__init_PrelMain", each reachable module in the
+ The code generator inserts a small function "__stginit_<module>" in each
+ module and calls the registration functions in each of the modules it
+ imports. So, if we call "__stginit_PrelMain", each reachable module in the
program will be registered (because PrelMain.mainIO calls Main.main).
The init* functions are compiled in the same way as STG code,
program will be registered (because PrelMain.mainIO calls Main.main).
The init* functions are compiled in the same way as STG code,
init_sp = 0;
init_stack = (F_ *)allocate(INIT_STACK_SIZE / sizeof(W_));
init_stack[init_sp++] = (F_)stg_init_ret;
init_sp = 0;
init_stack = (F_ *)allocate(INIT_STACK_SIZE / sizeof(W_));
init_stack[init_sp++] = (F_)stg_init_ret;
- init_stack[init_sp++] = (F_)__init_Prelude;
+ init_stack[init_sp++] = (F_)__stginit_Prelude;
if (init_root != NULL) {
init_stack[init_sp++] = (F_)init_root;
}
if (init_root != NULL) {
init_stack[init_sp++] = (F_)init_root;
}
/* -----------------------------------------------------------------------------
/* -----------------------------------------------------------------------------
- * $Id: StgStartup.h,v 1.4 2000/03/08 17:48:24 simonmar Exp $
+ * $Id: StgStartup.h,v 1.5 2001/09/04 18:29:21 ken Exp $
*
* (c) The GHC Team, 1998-1999
*
*
* (c) The GHC Team, 1998-1999
*
EXTFUN(stg_init_ret);
EXTFUN(stg_init);
EXTFUN(stg_init_ret);
EXTFUN(stg_init);
+EXTFUN(__stginit_PrelGHC);
/* -----------------------------------------------------------------------------
/* -----------------------------------------------------------------------------
- * $Id: StgStartup.hc,v 1.15 2001/03/23 16:36:21 simonmar Exp $
+ * $Id: StgStartup.hc,v 1.16 2001/09/04 18:29:21 ken Exp $
*
* (c) The GHC Team, 1998-1999
*
*
* (c) The GHC Team, 1998-1999
*
Special STG entry points for module registration.
This stuff is problematic for Hugs, because it introduces a
Special STG entry points for module registration.
This stuff is problematic for Hugs, because it introduces a
- dependency between the RTS and the program (ie. __init_PrelMain). So
+ dependency between the RTS and the program (ie. __stginit_PrelMain). So
we currently disable module initialisation for Hugs.
-------------------------------------------------------------------------- */
we currently disable module initialisation for Hugs.
-------------------------------------------------------------------------- */
/* On entry to stg_init:
* init_stack[0] = &stg_init_ret;
/* On entry to stg_init:
* init_stack[0] = &stg_init_ret;
- * init_stack[1] = __init_Something;
+ * init_stack[1] = __stginit_Something;
/* PrelGHC doesn't really exist... */
/* PrelGHC doesn't really exist... */
-START_MOD_INIT(__init_PrelGHC);
+START_MOD_INIT(__stginit_PrelGHC);
reconstruct_label :: Label -> LabelKind -> Label
reconstruct_label root Init
reconstruct_label :: Label -> LabelKind -> Label
reconstruct_label root Init
- = "__init_" ++ root ++ ":"
+ = "__stginit_" ++ root ++ ":"
reconstruct_label root kind
= root ++ "_" ++ pp kind ++ ":"
where
reconstruct_label root kind
= root ++ "_" ++ pp kind ++ ":"
where
# -----------------------------------------------------------------------------
# -----------------------------------------------------------------------------
-# $Id: bootstrap.mk,v 1.13 2001/07/24 04:45:59 ken Exp $
+# $Id: bootstrap.mk,v 1.14 2001/09/04 18:29:22 ken Exp $
#
# Makefile rules for booting from .hc files without a driver.
#
#
# Makefile rules for booting from .hc files without a driver.
#
ifeq "$(rs6000_TARGET_ARCH)" "1"
PLATFORM_CC_OPTS += -static
ifeq "$(rs6000_TARGET_ARCH)" "1"
PLATFORM_CC_OPTS += -static
-PLATFORM_HC_BOOT_CC_OPTS += -static -finhibit-size-directive
+PLATFORM_HC_BOOT_CC_OPTS += -finhibit-size-directive
endif
ifeq "$(mingw32_TARGET_OS)" "1"
endif
ifeq "$(mingw32_TARGET_OS)" "1"
endif
ifeq "$(alpha_TARGET_ARCH)" "1"
endif
ifeq "$(alpha_TARGET_ARCH)" "1"
-PLATFORM_CC_OPTS += -static -Xlinker -noprefix_recognition
+PLATFORM_CC_OPTS += -static
+PLATFORM_HC_BOOT_CC_OPTS += -w
+endif
+
+ifeq "$(sparc_TARGET_ARCH)" "1"
+PLATFORM_HC_BOOT_CC_OPTS += -w
endif
PLATFORM_CC_OPTS += -D__GLASGOW_HASKELL__=$(ProjectVersionInt)
endif
PLATFORM_CC_OPTS += -D__GLASGOW_HASKELL__=$(ProjectVersionInt)
-u "PrelIOBase_NonTermination_closure" \
-u "PrelIOBase_BlockedOnDeadMVar_closure" \
-u "PrelWeak_runFinalizzerBatch_closure" \
-u "PrelIOBase_NonTermination_closure" \
-u "PrelIOBase_BlockedOnDeadMVar_closure" \
-u "PrelWeak_runFinalizzerBatch_closure" \
+ -u "__stginit_Prelude" \
-u "PrelMain_mainIO_closure" \
-u "PrelMain_mainIO_closure" \
+ -u "__stginit_PrelMain"
HC_BOOT_LIBS = -lHStext -lHStext_cbits -lHSutil -lHSposix -lHSposix_cbits -lHSconcurrent -lHSlang -lHSlang_cbits -lHSstd -lHSstd_cbits -lHSrts -lgmp -lm $(EXTRA_HC_BOOT_LIBS)
HC_BOOT_LIBS = -lHStext -lHStext_cbits -lHSutil -lHSposix -lHSposix_cbits -lHSconcurrent -lHSlang -lHSlang_cbits -lHSstd -lHSstd_cbits -lHSrts -lgmp -lm $(EXTRA_HC_BOOT_LIBS)