ghc-hetmet.git
16 years agoWe don't need a SIGCONT handler any more
Simon Marlow [Wed, 4 Jul 2007 12:36:06 +0000 (12:36 +0000)]
We don't need a SIGCONT handler any more
The SIGCONT handler was used to put stdin back in O_NONBLOCK mode,
after the process is resumed, but we don't want to do that now: the
standard handles are kept in blocking mode.

16 years agoAdd first cut of the validate script
Simon Marlow [Wed, 4 Jul 2007 12:22:41 +0000 (12:22 +0000)]
Add first cut of the validate script

16 years agoAdded support for update frames to the CPS pass
Michael D. Adams [Tue, 3 Jul 2007 21:44:13 +0000 (21:44 +0000)]
Added support for update frames to the CPS pass
(This required a bit of refactoring of CmmInfo.)

16 years agoFix error message in CPS pass
Michael D. Adams [Tue, 3 Jul 2007 21:25:55 +0000 (21:25 +0000)]
Fix error message in CPS pass

16 years agoFactor cmmToRawCmm completely out of CPS
Michael D. Adams [Tue, 3 Jul 2007 21:17:34 +0000 (21:17 +0000)]
Factor cmmToRawCmm completely out of CPS
This patch also fixes how the CPS handles functions with an empty body.
Factoring cmmToRawCmm out of the CPS pass made that fix easier.

16 years agoRemove dead code in the CPS pass
Michael D. Adams [Tue, 3 Jul 2007 09:47:35 +0000 (09:47 +0000)]
Remove dead code in the CPS pass

16 years agoMinor formatting cleanup.
Michael D. Adams [Tue, 3 Jul 2007 09:36:25 +0000 (09:36 +0000)]
Minor formatting cleanup.

16 years agoMoved 'continuationToProc' into a separate file, 'CmmCPSGen.hs'.
Michael D. Adams [Tue, 3 Jul 2007 09:34:44 +0000 (09:34 +0000)]
Moved 'continuationToProc' into a separate file, 'CmmCPSGen.hs'.

16 years agoFinished support for foreign calls in the CPS pass
Michael D. Adams [Tue, 3 Jul 2007 09:13:20 +0000 (09:13 +0000)]
Finished support for foreign calls in the CPS pass

16 years agoMultiple improvements to CPS algorithm.
Michael D. Adams [Mon, 2 Jul 2007 08:42:21 +0000 (08:42 +0000)]
Multiple improvements to CPS algorithm.
These include:
 - Stack size detection now includes function arguments.
 - Stack size detection now avoids stack checks just because of
   the GC block.
 - A CmmCall followed by a CmmBranch will no longer generate an extra
   continuation consisting just of the brach.
 - Multiple CmmCall/CmmBranch pairs that all go to the same place
   will try to use the same continuation.  If they can't (because
   the return value signature is different), adaptor block are built.
 - Function entry statements are now in a separate block.
   (Fixed bug with branches to the entry block having unintended effects.)
 - Other changes that I can't recall right now.

16 years agoAllow safety information on calls in Cmm files
Michael D. Adams [Thu, 28 Jun 2007 10:11:33 +0000 (10:11 +0000)]
Allow safety information on calls in Cmm files

16 years agoFIX BUILD (Windows): catch up with changes to .cmm syntax
Simon Marlow [Tue, 3 Jul 2007 20:52:34 +0000 (20:52 +0000)]
FIX BUILD (Windows): catch up with changes to .cmm syntax

16 years agoImprove formatting of errors, and fix a typo
simonpj@microsoft.com [Tue, 3 Jul 2007 16:28:14 +0000 (16:28 +0000)]
Improve formatting of errors, and fix a typo

16 years agoFix for function info tables: the SRT field cannot be omitted if there are fields...
Simon Marlow [Tue, 3 Jul 2007 14:05:06 +0000 (14:05 +0000)]
Fix for function info tables: the SRT field cannot be omitted if there are fields following it

16 years agopprTypeInfo: print slow entry pt
Simon Marlow [Tue, 3 Jul 2007 14:03:04 +0000 (14:03 +0000)]
pprTypeInfo: print slow entry pt

16 years agofix compilation for x86_64
Simon Marlow [Thu, 28 Jun 2007 12:45:44 +0000 (12:45 +0000)]
fix compilation for x86_64

16 years agoFix stack check amount for user declared continuation functions
Michael D. Adams [Thu, 28 Jun 2007 11:18:12 +0000 (11:18 +0000)]
Fix stack check amount for user declared continuation functions

16 years agoRemove unused parameter in force_gc_block for CPS
Michael D. Adams [Thu, 28 Jun 2007 10:17:34 +0000 (10:17 +0000)]
Remove unused parameter in force_gc_block for CPS

16 years agoFix a bug in the Cmm parser where formal params didn't get bound
Michael D. Adams [Thu, 28 Jun 2007 10:13:12 +0000 (10:13 +0000)]
Fix a bug in the Cmm parser where formal params didn't get bound

16 years agoMake CPS account for on-stack arguments when doing the stack check
Michael D. Adams [Thu, 28 Jun 2007 10:10:06 +0000 (10:10 +0000)]
Make CPS account for on-stack arguments when doing the stack check

16 years agoComment and formatting updates for the CPS pass
Michael D. Adams [Thu, 28 Jun 2007 08:25:43 +0000 (08:25 +0000)]
Comment and formatting updates for the CPS pass

16 years agoFix typo from amend-record
Michael D. Adams [Wed, 27 Jun 2007 16:05:55 +0000 (16:05 +0000)]
Fix typo from amend-record

16 years agoImplemented and fixed bugs in CmmInfo handling
Michael D. Adams [Wed, 27 Jun 2007 15:21:30 +0000 (15:21 +0000)]
Implemented and fixed bugs in CmmInfo handling

16 years agoFormatting only
Michael D. Adams [Wed, 27 Jun 2007 15:17:51 +0000 (15:17 +0000)]
Formatting only

16 years agoAdded stack checks to the CPS algorithm
Michael D. Adams [Wed, 27 Jun 2007 15:15:03 +0000 (15:15 +0000)]
Added stack checks to the CPS algorithm

This eliminates one of the panics introduced by
the previous patch:
'First pass at implementing info tables for CPS'

The other panic introduced by that patch still remains.
It was due to the need to convert from a
  ContinuationInfo to a CmmInfo.
  (codeGen/CgInfoTbls.hs:emitClosureCodeAndInfoTable)
  (codeGen/CgInfoTbls.hs:emitReturnTarget)

16 years agoFirst pass at implementing info tables for CPS
Michael D. Adams [Wed, 27 Jun 2007 15:12:57 +0000 (15:12 +0000)]
First pass at implementing info tables for CPS

This is a fairly complete implementation, however
two 'panic's have been placed in the critical path
where the implementation is still a bit lacking so
do not expect it to run quite yet.

One call to panic is because we still need to create
a GC block for procedures that don't have them yet.
(cmm/CmmCPS.hs:continuationToProc)

The other is due to the need to convert from a
ContinuationInfo to a CmmInfo.
(codeGen/CgInfoTbls.hs:emitClosureCodeAndInfoTable)
(codeGen/CgInfoTbls.hs:emitReturnTarget)

16 years agoAdded an SRT to each CmmCall and added the current SRT to the CgMonad
Michael D. Adams [Wed, 27 Jun 2007 15:09:03 +0000 (15:09 +0000)]
Added an SRT to each CmmCall and added the current SRT to the CgMonad

16 years agoAdded pointerhood to LocalReg
Michael D. Adams [Wed, 27 Jun 2007 15:01:33 +0000 (15:01 +0000)]
Added pointerhood to LocalReg
This version should compile but is still incomplete as it introduces
potential bugs at the places marked 'TODO FIXME NOW'.
It is being recorded to help keep track of changes.

16 years agoFix bug relating to the return values of prim ops
Michael D. Adams [Tue, 26 Jun 2007 19:23:52 +0000 (19:23 +0000)]
Fix bug relating to the return values of prim ops
The return values were getting put in a LocalReg
but that LocalReg needed to be stored into the enclosing
expression's return register (e.g. R1).

16 years agoRemoved trailing whitespace
Michael D. Adams [Thu, 21 Jun 2007 08:40:47 +0000 (08:40 +0000)]
Removed trailing whitespace

16 years agoFixed typo in comment
Michael D. Adams [Tue, 19 Jun 2007 08:58:34 +0000 (08:58 +0000)]
Fixed typo in comment

16 years agoAdd forgotten compiler/cmm/CmmInfo.hs
Michael D. Adams [Wed, 13 Jun 2007 10:56:43 +0000 (10:56 +0000)]
Add forgotten compiler/cmm/CmmInfo.hs

16 years agoAdd formal parameters to the Cmm parser
Michael D. Adams [Wed, 6 Jun 2007 09:05:10 +0000 (09:05 +0000)]
Add formal parameters to the Cmm parser
This patch is incomplete and will probably not compile by itself
but it is being recorded to help keep track of later changes.

16 years agoMinor comment update
Michael D. Adams [Wed, 6 Jun 2007 08:53:28 +0000 (08:53 +0000)]
Minor comment update

16 years agoChanged C-- parser to allow multiple return values
Michael D. Adams [Tue, 29 May 2007 17:45:53 +0000 (17:45 +0000)]
Changed C-- parser to allow multiple return values

16 years agoAdded early draft of parameter passing to the CPS converter
Michael D. Adams [Tue, 29 May 2007 15:06:16 +0000 (15:06 +0000)]
Added early draft of parameter passing to the CPS converter

16 years agoMinor code cleanup
Michael D. Adams [Tue, 29 May 2007 15:04:36 +0000 (15:04 +0000)]
Minor code cleanup

16 years agoFix bug with proc-point detection (only a temporary fix)
Michael D. Adams [Tue, 29 May 2007 15:02:06 +0000 (15:02 +0000)]
Fix bug with proc-point detection (only a temporary fix)

16 years agoMove global register saving from the backend to codeGen (CPS specific parts)
Michael D. Adams [Fri, 25 May 2007 19:57:32 +0000 (19:57 +0000)]
Move global register saving from the backend to codeGen (CPS specific parts)

16 years agoMoved global register saving from the backend to codeGen
Michael D. Adams [Fri, 25 May 2007 19:38:04 +0000 (19:38 +0000)]
Moved global register saving from the backend to codeGen

This frees the Cmm data type from keeping a list of live global registers
in CmmCall which helps prepare for the CPS conversion phase.

CPS conversion does its own liveness analysis and takes input that should
not directly refer to parameter registers (e.g. R1, F5, D3, L2).  Since
these are the only things which could occur in the live global register
list, CPS conversion makes that field of the CmmCall constructor obsolite.

Once the CPS conversion pass is fully implemented, global register saving
will move from codeGen into the CPS pass.  Until then, this patch
is worth scrutinizing and testing to ensure it doesn't cause any performance
or correctness problems as the code passed to the backends by the CPS
converting will look very similar to the code that this patch makes codeGen
pass to the backend.

16 years agoFormatting changes for CPS code.
Michael D. Adams [Fri, 25 May 2007 17:08:45 +0000 (17:08 +0000)]
Formatting changes for CPS code.

16 years agoFormatted documentation for compiler/cmm/Dataflow.hs
Michael D. Adams [Thu, 24 May 2007 16:14:14 +0000 (16:14 +0000)]
Formatted documentation for compiler/cmm/Dataflow.hs

16 years agoRenamed CmmCPSData to CmmBrokenBlock and documented it
Michael D. Adams [Thu, 24 May 2007 16:01:28 +0000 (16:01 +0000)]
Renamed CmmCPSData to CmmBrokenBlock and documented it

16 years agoMinor re-organizing of compiler/cmm/CmmCPS.hs
Michael D. Adams [Wed, 23 May 2007 12:15:21 +0000 (12:15 +0000)]
Minor re-organizing of compiler/cmm/CmmCPS.hs

16 years agoFixed missing '#include "HsVersions.h"'
Michael D. Adams [Wed, 23 May 2007 11:28:30 +0000 (11:28 +0000)]
Fixed missing '#include "HsVersions.h"'

16 years agoFactored proc-point analysis into separate file (compiler/cmm/CmmProcPoint)
Michael D. Adams [Wed, 23 May 2007 11:27:29 +0000 (11:27 +0000)]
Factored proc-point analysis into separate file (compiler/cmm/CmmProcPoint)

16 years agoRemoved an older version of selectStackFormat
Michael D. Adams [Wed, 23 May 2007 10:52:48 +0000 (10:52 +0000)]
Removed an older version of selectStackFormat

16 years agoRefined the handling of stack frame headers
Michael D. Adams [Wed, 23 May 2007 10:51:12 +0000 (10:51 +0000)]
Refined the handling of stack frame headers

16 years agoMisc. cleanups to CPS converter
Michael D. Adams [Wed, 23 May 2007 09:49:04 +0000 (09:49 +0000)]
Misc. cleanups to CPS converter

16 years agoFixed CPS converter to preserve function names
Michael D. Adams [Wed, 23 May 2007 09:47:21 +0000 (09:47 +0000)]
Fixed CPS converter to preserve function names

16 years agoAdded Proc-Point analysis to the CPS converter (not polished yet)
Michael D. Adams [Tue, 22 May 2007 15:31:33 +0000 (15:31 +0000)]
Added Proc-Point analysis to the CPS converter (not polished yet)

16 years agoMake CmmProc take CmmFormals as argument
Michael D. Adams [Tue, 22 May 2007 15:20:08 +0000 (15:20 +0000)]
Make CmmProc take CmmFormals as argument

Since a CmmCall returns CmmFormals which may include
global registers (and indeed one place in the code
returns the results of a CmmCall into BaseReg) and
since CPS conversion will change those return slots
into formal arguments for the continuation of the call,
CmmProc has to have CmmFormals for the formal arguments.

Oddly, the old code never made use of procedure arguments
so this change only effects the types and not any of the code.
(Because [] is both of type [LocalReg] and CmmFormals.)

16 years agoA small move of the comments in ./compiler/cmm/Dataflow.hs
Michael D. Adams [Tue, 22 May 2007 13:53:05 +0000 (13:53 +0000)]
A small move of the comments in ./compiler/cmm/Dataflow.hs

16 years agoAdded forgotten ./compiler/cmm/CmmLive.hs
Michael D. Adams [Mon, 21 May 2007 18:25:17 +0000 (18:25 +0000)]
Added forgotten ./compiler/cmm/CmmLive.hs

16 years agoDocument use of no-break space in lexer for C--
Michael D. Adams [Mon, 21 May 2007 09:09:39 +0000 (09:09 +0000)]
Document use of no-break space in lexer for C--

16 years agoRenamed BlockExitInfo to FinalStmt and all its constructors to match usage
Michael D. Adams [Mon, 21 May 2007 09:00:28 +0000 (09:00 +0000)]
Renamed BlockExitInfo to FinalStmt and all its constructors to match usage

16 years agoMajor cleanup of the CPS code (but more is still to come)
Michael D. Adams [Fri, 18 May 2007 21:34:58 +0000 (21:34 +0000)]
Major cleanup of the CPS code (but more is still to come)

16 years agoAdded listSplitUniqSupply to ./compiler/basicTypes/UniqSupply.lhs
Michael D. Adams [Fri, 18 May 2007 20:09:42 +0000 (20:09 +0000)]
Added listSplitUniqSupply to ./compiler/basicTypes/UniqSupply.lhs

The function
  listSplitUniqSupply :: UniqSupply -> [UniqSupply]
splits a UniqSupply into an infinite list of supplies.
It is a generalization of splitUniqSupply.

16 years agoSecond working draft of a CPS algorithm for C--.
Michael D. Adams [Fri, 18 May 2007 18:00:04 +0000 (18:00 +0000)]
Second working draft of a CPS algorithm for C--.
This is a safety check-in, before I begin a cleanup.

16 years agoFixed missing space in pretty printer for CmmJump
Michael D. Adams [Fri, 18 May 2007 13:24:32 +0000 (13:24 +0000)]
Fixed missing space in pretty printer for CmmJump

16 years agoAdded spLimReg to complement spReg and hpReg
Michael D. Adams [Fri, 18 May 2007 13:23:17 +0000 (13:23 +0000)]
Added spLimReg to complement spReg and hpReg

16 years agoAdded types CmmActuals and CmmFormals for function parameters to Cmm
Michael D. Adams [Fri, 18 May 2007 13:20:31 +0000 (13:20 +0000)]
Added types CmmActuals and CmmFormals for function parameters to Cmm

16 years agoFirst complete draft of a CPS algorithm. (Still hackish needs polishing)
Michael D. Adams [Wed, 16 May 2007 16:01:24 +0000 (16:01 +0000)]
First complete draft of a CPS algorithm.  (Still hackish needs polishing)

16 years agoAdded "C--" foreign calling convention
Michael D. Adams [Wed, 16 May 2007 15:57:58 +0000 (15:57 +0000)]
Added "C--" foreign calling convention

16 years agoAdded 'return' to C--, and made arguments to 'jump' into CmmExpr
Michael D. Adams [Wed, 16 May 2007 15:53:37 +0000 (15:53 +0000)]
Added 'return' to C--, and made arguments to 'jump' into CmmExpr

16 years agoTypo fix in a comment.
Michael D. Adams [Mon, 14 May 2007 12:12:31 +0000 (12:12 +0000)]
Typo fix in a comment.

16 years agoFixed liveness analysis to use a slower but more correct solution
Michael D. Adams [Thu, 10 May 2007 13:52:50 +0000 (13:52 +0000)]
Fixed liveness analysis to use a slower but more correct solution

16 years agoHooked the C-- CPS pass into the compilation pipeline
Michael D. Adams [Thu, 10 May 2007 13:46:00 +0000 (13:46 +0000)]
Hooked the C-- CPS pass into the compilation pipeline
At present it just annotates each block with a comment
indicating what local registers are live at the start
of the block.

16 years agoAdded compiler/cmm/Dataflow.hs
Michael D. Adams [Thu, 10 May 2007 10:36:50 +0000 (10:36 +0000)]
Added compiler/cmm/Dataflow.hs
Dataflow.hs contains an early draft of the live variable analysis.
This draft contains known bugs and is being recorded only to provide
a point to be revert back to if necessary.

16 years agoGenerate .LC_ indirection-symbols also on x86_64 (as on all other archs running Linux)
Clemens Fruhwirth [Thu, 28 Jun 2007 10:24:32 +0000 (10:24 +0000)]
Generate .LC_ indirection-symbols also on x86_64 (as on all other archs running Linux)

16 years agoRestrict .type directives to Linux targets only
Clemens Fruhwirth [Sat, 30 Jun 2007 08:22:43 +0000 (08:22 +0000)]
Restrict .type directives to Linux targets only

16 years agoHave the users guide just refer to the wiki page on how to report a bug
Ian Lynagh [Mon, 2 Jul 2007 14:09:36 +0000 (14:09 +0000)]
Have the users guide just refer to the wiki page on how to report a bug

16 years agoTry harder to avoid making a variable with RULES into a loop-breaker
simonpj@microsoft.com [Mon, 2 Jul 2007 13:24:31 +0000 (13:24 +0000)]
Try harder to avoid making a variable with RULES into a loop-breaker

See Note [Recursive rules] in OccurAnal

16 years agoRemove the large ghci banner, and the flags to choose which banner to show
Ian Lynagh [Mon, 2 Jul 2007 11:01:55 +0000 (11:01 +0000)]
Remove the large ghci banner, and the flags to choose which banner to show
Fans of the banner can add
    putStrLn "   ___         ___ _"
    putStrLn "  / _ \\ /\\  /\\/ __(_)"
    putStrLn " / /_\\// /_/ / /  | |   GHC Interactive, for Haskell 98."
    putStrLn "/ /_\\\\/ __  / /___| |   http://www.haskell.org/ghc/"
    putStrLn "\\____/\\/ /_/\\____/|_|   Type :? for help."
    putStrLn ""
to their ~/.ghci

16 years agoPrint the right usage message
Ian Lynagh [Mon, 2 Jul 2007 10:26:51 +0000 (10:26 +0000)]
Print the right usage message
The logic for printing the ghc and ghci usage messages was inverted.
However, the ghci case will never actually happen with the current code,
as we print a usage message when cli_mode == ShowUsage and choose the
ghci usage message if cli_mode == DoInteractive. This should be fixed
as part of a larger options handling overhaul.

16 years ago-fasm doesn't really take an argument
Ian Lynagh [Mon, 2 Jul 2007 10:26:29 +0000 (10:26 +0000)]
-fasm doesn't really take an argument

16 years agoclean installPackage too
Simon Marlow [Thu, 21 Jun 2007 11:30:23 +0000 (11:30 +0000)]
clean installPackage too

16 years agoFIX #1471: print strings using Haskell quoting syntax
Simon Marlow [Mon, 2 Jul 2007 09:22:57 +0000 (09:22 +0000)]
FIX #1471: print strings using Haskell quoting syntax

16 years agoNeed to build filepath before directory
Ian Lynagh [Sat, 30 Jun 2007 14:15:18 +0000 (14:15 +0000)]
Need to build filepath before directory

16 years agoTidy up -keep* flags
Ian Lynagh [Sat, 30 Jun 2007 13:39:44 +0000 (13:39 +0000)]
Tidy up -keep* flags

16 years agoImprove loop-breaker scoring in OccAnal (idea from Roman)
simonpj@microsoft.com [Fri, 29 Jun 2007 21:57:17 +0000 (21:57 +0000)]
Improve loop-breaker scoring in OccAnal (idea from Roman)

See Note [Closure conversion] in OccurAnal for details of this
patch (which merely involves *deleting* a test!).  The test case
was produced by Roman, and shows up when doing closure conversion
and vectorisation for data parallelism.  But perhaps other times too.

16 years agoMany comments about oclose, plus a fix for Trac #1456
simonpj@microsoft.com [Fri, 29 Jun 2007 21:53:34 +0000 (21:53 +0000)]
Many comments about oclose, plus a fix for Trac #1456

There was a rather subtle bug in the way 'oclose' works when
generalising top-level function definitions.  See
Note [Important subtlety in oclose]
in FunDeps for an explanatoin.

I also tidied up duplication in comments while I was here.

16 years agoImprove error message (Trac #1446)
simonpj@microsoft.com [Fri, 29 Jun 2007 20:32:19 +0000 (20:32 +0000)]
Improve error message (Trac #1446)

16 years agoFixing hpc tools for 6.2 and 6.4
andy@galois.com [Fri, 29 Jun 2007 18:53:07 +0000 (18:53 +0000)]
Fixing hpc tools for 6.2 and 6.4

16 years agoRefine printing of names in unification mis-match
simonpj@microsoft.com [Fri, 29 Jun 2007 16:13:37 +0000 (16:13 +0000)]
Refine printing of names in unification mis-match

16 years agoImprove name-printing on unification mis-matches, when types share a common occurrenc...
simonpj@microsoft.com [Fri, 29 Jun 2007 11:48:33 +0000 (11:48 +0000)]
Improve name-printing on unification mis-matches, when types share a common occurrence name

This improvement arose from a suggestion in Trac #1465

16 years agoAdd flags for record extensions; still not working properly though
simonpj@microsoft.com [Thu, 28 Jun 2007 08:29:49 +0000 (08:29 +0000)]
Add flags for record extensions; still not working properly though

16 years agoFIX BUILD: we need --exclude-module Trace.* too
Simon Marlow [Fri, 29 Jun 2007 11:02:40 +0000 (11:02 +0000)]
FIX BUILD: we need --exclude-module Trace.* too

16 years agounbreak "recompile utils with stage 1"
Simon Marlow [Fri, 29 Jun 2007 09:07:05 +0000 (09:07 +0000)]
unbreak "recompile utils with stage 1"

16 years agoChecking that type indexes contain no synonym family applications
Manuel M T Chakravarty [Fri, 29 Jun 2007 06:36:56 +0000 (06:36 +0000)]
Checking that type indexes contain no synonym family applications

16 years agoRHS of a type instance must be a tau type
Manuel M T Chakravarty [Fri, 29 Jun 2007 04:59:31 +0000 (04:59 +0000)]
RHS of a type instance must be a tau type

16 years agoOverlap check for type families
Manuel M T Chakravarty [Fri, 29 Jun 2007 04:20:07 +0000 (04:20 +0000)]
Overlap check for type families
- If two "type instance"s overlap, they right-hand sides must be syntactically
  equal under the overlap substitution.  (Ie, we admit limited overlap, but
  require the system to still be confluent.)

16 years agoFurther compileToCore improvements
Tim Chevalier [Fri, 29 Jun 2007 01:48:31 +0000 (01:48 +0000)]
Further compileToCore improvements

Per suggestions from Simon M:

* Changed GHC.checkModule so that it doesn't call depanal.
* Changed GHC.checkModule to optionally return Core bindings
as a component of the CheckedModule that it returns (and
resulting changes to HscMain.hscFileCheck).
* As a result, simplified GHC.compileToCore and changed it
to load the given file so that the caller doesn't have to.

16 years agoFixed a documentation error
Michael D. Adams [Fri, 8 Jun 2007 09:11:57 +0000 (09:11 +0000)]
Fixed a documentation error

16 years agodisable .type directives on Windows; they confuse mingw's assembler
Simon Marlow [Thu, 28 Jun 2007 10:45:16 +0000 (10:45 +0000)]
disable .type directives on Windows; they confuse mingw's assembler

16 years agoSet .type @object for all global symbols in NCG
Clemens Fruhwirth [Wed, 27 Jun 2007 16:51:50 +0000 (16:51 +0000)]
Set .type @object for all global symbols in NCG

When linking against a dynamic library, the linker will emit a warning
if no type information is present within the library. We generate the
most trivial type for all externally visible labels, namely @object.

16 years agoAlso make proper references when not using fPIC but linking against dynamic libs
Clemens Fruhwirth [Tue, 19 Jun 2007 14:29:31 +0000 (14:29 +0000)]
Also make proper references when not using fPIC but linking against dynamic libs

16 years agoGenerate RelocatableReadOnlyData as .data
Clemens Fruhwirth [Wed, 27 Jun 2007 16:06:40 +0000 (16:06 +0000)]
Generate RelocatableReadOnlyData as .data

The GNU linker expects read-only sections to be relocation
free. Presumably because the dynamic linker maps all read-only
sections as read-only mmaps and hence can't do relocations.

If we want text-relocation-free shared libraries we have to put all
relocations into writable sections, hence .data.  See
http://www.mail-archive.com/cvs-all@haskell.org/msg15119.html

16 years agoGeneralize linkDynLib for ELF platforms
Clemens Fruhwirth [Wed, 27 Jun 2007 09:08:19 +0000 (09:08 +0000)]
Generalize linkDynLib for ELF platforms

To create a dynamic shared object (DSO) on ELF platforms, we invoke
"gcc -shared". This in turn invokes ld. We supply -Bsymbolic to the
linker, as "ld -Bsymbolic -shared -o <lib> <objs>" resolves all
references from <objs> to <objs> at library creation time.

See http://hackage.haskell.org/trac/ghc/wiki/Commentary/PositionIndependentCode

16 years agoRenames functions and constructors to fit their new ability for dynamic linking
Clemens Fruhwirth [Wed, 27 Jun 2007 09:01:00 +0000 (09:01 +0000)]
Renames functions and constructors to fit their new ability for dynamic linking
function: staticLink -> linkBinary (will link non static binaries too)
function: doMkDLL -> linkDynLib (as we can link on ELF too where DLL is an inappropriate term)
constructor: MkDLL -> LinkDynLib