From: ken Date: Tue, 4 Sep 2001 18:29:22 +0000 (+0000) Subject: [project @ 2001-09-04 18:29:20 by ken] X-Git-Tag: Approximately_9120_patches~1026 X-Git-Url: http://git.megacz.com/?p=ghc-hetmet.git;a=commitdiff_plain;h=fb7a723bfd7650a705cb226e07c5b08b7a8e9279 [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 --- diff --git a/ghc/compiler/absCSyn/CLabel.lhs b/ghc/compiler/absCSyn/CLabel.lhs index e5e09a2..c8712f5 100644 --- a/ghc/compiler/absCSyn/CLabel.lhs +++ b/ghc/compiler/absCSyn/CLabel.lhs @@ -1,7 +1,7 @@ % % (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 diff --git a/ghc/compiler/main/DriverFlags.hs b/ghc/compiler/main/DriverFlags.hs index 06e2bc5..435e50a 100644 --- a/ghc/compiler/main/DriverFlags.hs +++ b/ghc/compiler/main/DriverFlags.hs @@ -1,7 +1,7 @@ {-# 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"] ) diff --git a/ghc/compiler/main/DriverPipeline.hs b/ghc/compiler/main/DriverPipeline.hs index 3fd507c..4ab9f55 100644 --- a/ghc/compiler/main/DriverPipeline.hs +++ b/ghc/compiler/main/DriverPipeline.hs @@ -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 diff --git a/ghc/docs/comm/the-beast/driver.html b/ghc/docs/comm/the-beast/driver.html index 374871b..6b9a768 100644 --- a/ghc/docs/comm/the-beast/driver.html +++ b/ghc/docs/comm/the-beast/driver.html @@ -79,7 +79,7 @@ adding the symbols that the RTS needs from libHSstd, such as PrelWeak_runFinalizzerBatch_closure and - __init_Prelude, to the link line with the + __stginit_Prelude, to the link line with the -u 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 Main.c). It calls startupHaskell, which - itself calls __init_PrelMain, which is therefore, + itself calls __stginit_PrelMain, which is therefore, since it occurs in the standard library, one of the symbols passed to the linker using the -u option. This is fine for standalone Haskell programs, but as soon as the Haskell code is only @@ -102,13 +102,13 @@ main() 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 - __init_PrelMain had better not be linked in, - because it tries to call __init_Main, which won't + __stginit_PrelMain had better not be linked in, + because it tries to call __stginit_Main, which won't exist. In other words, the RTS's main() refers to - __init_PrelMain which in turn refers to - __init_Main. Although the RTS's main() + __stginit_PrelMain which in turn refers to + __stginit_Main. Although the RTS's main() might not be linked in if the program provides its own, the driver - will normally force __init_PrelMain to be linked in anyway, + will normally force __stginit_PrelMain to be linked in anyway, using -u, because it's a back-reference from the RTS to HSstd. This case is coped with by the -no-hs-main flag, which suppresses passing the corresonding -u option @@ -116,7 +116,7 @@ it didn't work. In addition, the driver generally places the C program providing the main() that we want to use before the RTS on the link line. Therefore, the RTS's main is never used and - without the -u the label __init_PrelMain + without the -u the label __stginit_PrelMain will not be linked.

diff --git a/ghc/docs/users_guide/win32-dlls.sgml b/ghc/docs/users_guide/win32-dlls.sgml index fd096e5..488f5bd 100644 --- a/ghc/docs/users_guide/win32-dlls.sgml +++ b/ghc/docs/users_guide/win32-dlls.sgml @@ -238,7 +238,7 @@ RTS---a possible implementation is: #include <windows.h> #include <Rts.h> -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; diff --git a/ghc/driver/PackageSrc.hs b/ghc/driver/PackageSrc.hs index f37f912..6fcec81 100644 --- a/ghc/driver/PackageSrc.hs +++ b/ghc/driver/PackageSrc.hs @@ -126,7 +126,7 @@ package_details installing , "PrelIOBase_NonTermination_closure" , "PrelIOBase_BlockedOnDeadMVar_closure" , "PrelWeak_runFinalizzerBatch_closure" - , "__init_Prelude" + , "__stginit_Prelude" ]) }, diff --git a/ghc/driver/mangler/ghc-asm.lprl b/ghc/driver/mangler/ghc-asm.lprl index e3a6a12..e53680e 100644 --- a/ghc/driver/mangler/ghc-asm.lprl +++ b/ghc/driver/mangler/ghc-asm.lprl @@ -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 + || /^${T_US}__stginit.*${T_POST_LBL}$/o # __stginit || /^${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; } diff --git a/ghc/rts/HSprel.def b/ghc/rts/HSprel.def index 56e4718..073cda3 100644 --- a/ghc/rts/HSprel.def +++ b/ghc/rts/HSprel.def @@ -24,4 +24,4 @@ PrelIOBase_stackOverflow_closure PrelIOBase_BlockedOnDeadMVar_closure PrelIOBase_NonTermination_closure PrelWeak_runFinalizzerBatch_closure -__init_Prelude +__stginit_Prelude diff --git a/ghc/rts/Linker.c b/ghc/rts/Linker.c index 8a3d680..9160aea 100644 --- a/ghc/rts/Linker.c +++ b/ghc/rts/Linker.c @@ -1,5 +1,5 @@ /* ----------------------------------------------------------------------------- - * $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) \ diff --git a/ghc/rts/Main.c b/ghc/rts/Main.c index 11a0027..83fb115 100644 --- a/ghc/rts/Main.c +++ b/ghc/rts/Main.c @@ -1,5 +1,5 @@ /* ----------------------------------------------------------------------------- - * $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 #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; diff --git a/ghc/rts/RtsStartup.c b/ghc/rts/RtsStartup.c index 8732c9a..5d6e446 100644 --- a/ghc/rts/RtsStartup.c +++ b/ghc/rts/RtsStartup.c @@ -1,5 +1,5 @@ /* ----------------------------------------------------------------------------- - * $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_" 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_" 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; } diff --git a/ghc/rts/StgStartup.h b/ghc/rts/StgStartup.h index 5d0827d..f983e22 100644 --- a/ghc/rts/StgStartup.h +++ b/ghc/rts/StgStartup.h @@ -1,5 +1,5 @@ /* ----------------------------------------------------------------------------- - * $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); diff --git a/ghc/rts/StgStartup.hc b/ghc/rts/StgStartup.hc index bed2312..92dc701 100644 --- a/ghc/rts/StgStartup.hc +++ b/ghc/rts/StgStartup.hc @@ -1,5 +1,5 @@ /* ----------------------------------------------------------------------------- - * $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(); diff --git a/ghc/utils/debugNCG/Diff_Gcc_Nat.hs b/ghc/utils/debugNCG/Diff_Gcc_Nat.hs index 725cf85..eec034d 100644 --- a/ghc/utils/debugNCG/Diff_Gcc_Nat.hs +++ b/ghc/utils/debugNCG/Diff_Gcc_Nat.hs @@ -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 diff --git a/mk/bootstrap.mk b/mk/bootstrap.mk index fa5e846..ed01970 100644 --- a/mk/bootstrap.mk +++ b/mk/bootstrap.mk @@ -1,5 +1,5 @@ # ----------------------------------------------------------------------------- -# $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)