Commit fb7a723b authored by ken's avatar ken
Browse files

[project @ 2001-09-04 18:29:20 by ken]

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
parent c00aaade
%
% (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}
......@@ -528,7 +528,7 @@ pprCLbl (CC_Label cc) = ppr cc
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
......
{-# 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 $
--
-- Driver flags
--
......@@ -482,7 +482,10 @@ buildStaticHscOpts = do
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!
......@@ -519,6 +522,9 @@ machdepCCOpts
| 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"] )
......
......@@ -869,7 +869,7 @@ doLink o_files = do
++ 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
......
......@@ -79,7 +79,7 @@
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
......@@ -94,7 +94,7 @@
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
......@@ -102,13 +102,13 @@
<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
<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
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
......@@ -116,7 +116,7 @@
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>
will not be linked.
</p>
......
......@@ -238,7 +238,7 @@ RTS---a possible implementation is:
#include &lt;windows.h&gt;
#include &lt;Rts.h&gt;
EXTFUN(__init_Adder);
EXTFUN(__stginit_Adder);
static char* args[] = { "ghcDll", NULL };
/* N.B. argv arrays must end with NULL */
......@@ -252,7 +252,7 @@ DllMain
{
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;
......
......@@ -126,7 +126,7 @@ package_details installing
, "PrelIOBase_NonTermination_closure"
, "PrelIOBase_BlockedOnDeadMVar_closure"
, "PrelWeak_runFinalizzerBatch_closure"
, "__init_Prelude"
, "__stginit_Prelude"
])
},
......
......@@ -592,7 +592,7 @@ sub mangle_asm {
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
......@@ -945,7 +945,7 @@ sub mangle_asm {
};
&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 }
......@@ -1226,7 +1226,7 @@ sub print_doctored {
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;
}
......
......@@ -24,4 +24,4 @@ PrelIOBase_stackOverflow_closure
PrelIOBase_BlockedOnDeadMVar_closure
PrelIOBase_NonTermination_closure
PrelWeak_runFinalizzerBatch_closure
__init_Prelude
__stginit_Prelude
/* -----------------------------------------------------------------------------
* $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
*
......@@ -287,7 +287,7 @@ typedef struct _RtsSymbolVal {
Sym(StgReturn) \
Sym(init_stack) \
SymX(cmp_thread) \
Sym(__init_PrelGHC) \
Sym(__stginit_PrelGHC) \
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
*
......@@ -39,7 +39,7 @@
# 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
......@@ -51,7 +51,7 @@ int main(int argc, char *argv[])
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;
......
/* -----------------------------------------------------------------------------
* $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
*
......@@ -58,7 +58,7 @@ static int rts_has_started_up = 0;
ullong startTime = 0;
#endif
EXTFUN(__init_Prelude);
EXTFUN(__stginit_Prelude);
static void initModules ( void (*)(void) );
void
......@@ -206,9 +206,9 @@ startupHaskell(int argc, char *argv[], void (*init_root)(void))
- 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,
......@@ -234,7 +234,7 @@ initModules ( void (*init_root)(void) )
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;
}
......
/* -----------------------------------------------------------------------------
* $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
*
......@@ -14,4 +14,4 @@ EXTFUN(stg_enterStackTop);
EXTFUN(stg_init_ret);
EXTFUN(stg_init);
EXTFUN(__init_PrelGHC);
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
*
......@@ -135,7 +135,7 @@ STGFUN(stg_enterStackTop)
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.
-------------------------------------------------------------------------- */
......@@ -150,7 +150,7 @@ STGFUN(stg_init_ret)
/* On entry to stg_init:
* init_stack[0] = &stg_init_ret;
* init_stack[1] = __init_Something;
* init_stack[1] = __stginit_Something;
*/
STGFUN(stg_init)
{
......@@ -162,5 +162,5 @@ STGFUN(stg_init)
/* PrelGHC doesn't really exist... */
START_MOD_INIT(__init_PrelGHC);
START_MOD_INIT(__stginit_PrelGHC);
END_MOD_INIT();
......@@ -268,7 +268,7 @@ find_label code lbl
reconstruct_label :: Label -> LabelKind -> Label
reconstruct_label root Init
= "__init_" ++ root ++ ":"
= "__stginit_" ++ root ++ ":"
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.
#
......@@ -41,7 +41,7 @@ endif
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"
......@@ -49,7 +49,12 @@ PLATFORM_CC_OPTS += -mno-cygwin
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)
......@@ -105,9 +110,9 @@ HC_BOOT_LD_OPTS = \
-u "PrelIOBase_NonTermination_closure" \
-u "PrelIOBase_BlockedOnDeadMVar_closure" \
-u "PrelWeak_runFinalizzerBatch_closure" \
-u "__init_Prelude" \
-u "__stginit_Prelude" \
-u "PrelMain_mainIO_closure" \
-u "__init_PrelMain"
-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)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment