ghc-hetmet.git
19 years ago[project @ 2005-01-27 11:30:49 by simonmar]
simonmar [Thu, 27 Jan 2005 11:30:49 +0000 (11:30 +0000)]
[project @ 2005-01-27 11:30:49 by simonmar]
GhcBootLibs=YES when building libraries the first time.

19 years ago[project @ 2005-01-27 11:29:03 by simonmar]
simonmar [Thu, 27 Jan 2005 11:29:03 +0000 (11:29 +0000)]
[project @ 2005-01-27 11:29:03 by simonmar]
Suppress .cmm suffix rules when $(BootingFromHc)

19 years ago[project @ 2005-01-27 11:27:22 by simonmar]
simonmar [Thu, 27 Jan 2005 11:27:22 +0000 (11:27 +0000)]
[project @ 2005-01-27 11:27:22 by simonmar]
updates to hc-file-bundle target

19 years ago[project @ 2005-01-27 11:12:52 by simonpj]
simonpj [Thu, 27 Jan 2005 11:12:58 +0000 (11:12 +0000)]
[project @ 2005-01-27 11:12:52 by simonpj]
Remove redundant .hi-boot files.  The earliest compiler we claim to be able
to compile GHC with is GHC 5, and that needs hi-boot-5 boot files.  So the
plain hi-boot files are dead.

Reason for removing them now is that my big commit accidentally splatted
them with binary data; so if you ever want to recover them, go back
one revision beore the one I'm deleting.

19 years ago[project @ 2005-01-27 10:51:06 by simonmar]
simonmar [Thu, 27 Jan 2005 10:51:06 +0000 (10:51 +0000)]
[project @ 2005-01-27 10:51:06 by simonmar]
bootstrapping wibble

19 years ago[project @ 2005-01-27 10:44:00 by simonpj]
simonpj [Thu, 27 Jan 2005 10:45:48 +0000 (10:45 +0000)]
[project @ 2005-01-27 10:44:00 by simonpj]
--------------------------------------------
          Replace hi-boot files with hs-boot files
   --------------------------------------------

This major commit completely re-organises the way that recursive modules
are dealt with.

  * It should have NO EFFECT if you do not use recursive modules

  * It is a BREAKING CHANGE if you do

====== Warning: .hi-file format has changed, so if you are
====== updating into an existing HEAD build, you'll
====== need to make clean and re-make

The details:  [documentation still to be done]

* Recursive loops are now broken with Foo.hs-boot (or Foo.lhs-boot),
  not Foo.hi-boot

* An hs-boot files is a proper source file.  It is compiled just like
  a regular Haskell source file:
ghc Foo.hs generates Foo.hi, Foo.o
ghc Foo.hs-boot generates Foo.hi-boot, Foo.o-boot

* hs-boot files are precisely a subset of Haskell. In particular:
- they have the same import, export, and scoping rules
- errors (such as kind errors) in hs-boot files are checked
  You do *not* need to mention the "original" name of something in
  an hs-boot file, any more than you do in any other Haskell module.

* The Foo.hi-boot file generated by compiling Foo.hs-boot is a machine-
  generated interface file, in precisely the same format as Foo.hi

* When compiling Foo.hs, its exports are checked for compatibility with
  Foo.hi-boot (previously generated by compiling Foo.hs-boot)

* The dependency analyser (ghc -M) knows about Foo.hs-boot files, and
  generates appropriate dependencies.  For regular source files it
  generates
Foo.o : Foo.hs
Foo.o : Baz.hi -- Foo.hs imports Baz
Foo.o : Bog.hi-boot -- Foo.hs source-imports Bog

  For a hs-boot file it generates similar dependencies
Bog.o-boot : Bog.hs-boot
Bog.o-boot : Nib.hi -- Bog.hs-boto imports Nib

* ghc -M is also enhanced to use the compilation manager dependency
  chasing, so that
ghc -M Main
  will usually do the job.  No need to enumerate all the source files.

* The -c flag is no longer a "compiler mode". It simply means "omit the
  link step", and synonymous with -no-link.

19 years ago[project @ 2005-01-26 16:57:31 by stolz]
stolz [Wed, 26 Jan 2005 16:57:31 +0000 (16:57 +0000)]
[project @ 2005-01-26 16:57:31 by stolz]
Automagically find docbook on FreeBSD (or anybody else who cares to store
it under /usr/local/share/xsl/docbook)

19 years ago[project @ 2005-01-26 16:56:45 by simonmar]
simonmar [Wed, 26 Jan 2005 16:56:45 +0000 (16:56 +0000)]
[project @ 2005-01-26 16:56:45 by simonmar]
tidy up

19 years ago[project @ 2005-01-26 16:11:58 by simonmar]
simonmar [Wed, 26 Jan 2005 16:11:58 +0000 (16:11 +0000)]
[project @ 2005-01-26 16:11:58 by simonmar]
updates

19 years ago[project @ 2005-01-26 16:10:02 by simonpj]
simonpj [Wed, 26 Jan 2005 16:10:06 +0000 (16:10 +0000)]
[project @ 2005-01-26 16:10:02 by simonpj]
-----------------------
Fixup to hoistForAllTys
-----------------------

* hoistForAllTys moves from TcHsType to TcType

hoistForAllTys was being too vigorous and breaking up type synonyms,
even when it was entirely unnecessary to do so.

Not only does this make error messsages less good, but it's actually
wrong for Haskell 98, because we are meant to report under-applied
type synonyms, and that check doesn't happen until after hoistForAllTys.
This led to a very obscure bug, immortalised as tcfail129.

19 years ago[project @ 2005-01-26 16:08:55 by simonmar]
simonmar [Wed, 26 Jan 2005 16:08:55 +0000 (16:08 +0000)]
[project @ 2005-01-26 16:08:55 by simonmar]
Build ghc/lib (untested)

19 years ago[project @ 2005-01-26 16:05:48 by simonmar]
simonmar [Wed, 26 Jan 2005 16:05:48 +0000 (16:05 +0000)]
[project @ 2005-01-26 16:05:48 by simonmar]
hc-file-bundle: need to track ghc/lib too

19 years ago[project @ 2005-01-26 16:03:40 by simonmar]
simonmar [Wed, 26 Jan 2005 16:03:41 +0000 (16:03 +0000)]
[project @ 2005-01-26 16:03:40 by simonmar]
Common up the ghc_ge_XXX variables into config.mk, and add the
ability to build ghc/lib and ghc/utils using the stage1 compiler, by
saying 'make UseStage1=YES'.  This is going to be useful for
bootstrapping.

19 years ago[project @ 2005-01-26 15:04:08 by simonmar]
simonmar [Wed, 26 Jan 2005 15:04:09 +0000 (15:04 +0000)]
[project @ 2005-01-26 15:04:08 by simonmar]
Remove System.FilePath, use System.Directory.Internals for now.

19 years ago[project @ 2005-01-26 13:45:11 by simonmar]
simonmar [Wed, 26 Jan 2005 13:45:11 +0000 (13:45 +0000)]
[project @ 2005-01-26 13:45:11 by simonmar]
Avoid use of System.FilePath, which is going away

19 years ago[project @ 2005-01-26 12:58:09 by simonmar]
simonmar [Wed, 26 Jan 2005 12:58:09 +0000 (12:58 +0000)]
[project @ 2005-01-26 12:58:09 by simonmar]
fileLoop: catch InvalidArgument and behave as for EOF (i.e. terminate
the session).  This means that the user can close stdin to end a GHCi
session, but it also means that the tests that run programs which use
getContents inside GHCi won't crash because stdin has been closed.

19 years ago[project @ 2005-01-24 00:36:03 by ross]
ross [Mon, 24 Jan 2005 00:36:03 +0000 (00:36 +0000)]
[project @ 2005-01-24 00:36:03 by ross]
make hsc2hs work with Hugs

19 years ago[project @ 2005-01-23 20:34:17 by wolfgang]
wolfgang [Sun, 23 Jan 2005 20:34:17 +0000 (20:34 +0000)]
[project @ 2005-01-23 20:34:17 by wolfgang]
Distinguish between rodata and relrodata (relocatable read-only data) in the
mangler.
By default, use $T_HDR_rodata if $T_HDR_relrodata is not defined for a
particular platform.

19 years ago[project @ 2005-01-23 18:50:40 by wolfgang]
wolfgang [Sun, 23 Jan 2005 18:50:45 +0000 (18:50 +0000)]
[project @ 2005-01-23 18:50:40 by wolfgang]
Make the NCG distinguish between the read-only data section and the
"relocatable read-only data" section.
Read-only data is supposed to be _really_ read-only, whereas "relrodata"
can have relocations, but should not be modified by the program at runtime.

For Linux, put relrodata into ".data" by default, as the dynamic linker
tends to do evil things to avoid relocating things in read-only sections.

19 years ago[project @ 2005-01-23 18:18:05 by wolfgang]
wolfgang [Sun, 23 Jan 2005 18:18:05 +0000 (18:18 +0000)]
[project @ 2005-01-23 18:18:05 by wolfgang]
Darwin / Mac OS X:

For builds with dynamic libraries, fix up dynamic library paths
("install names") for binaries. Otherwise, a dynamically-linked stage2 ghc
would contain the path names of the build directories.

19 years ago[project @ 2005-01-23 17:05:31 by panne]
panne [Sun, 23 Jan 2005 17:05:31 +0000 (17:05 +0000)]
[project @ 2005-01-23 17:05:31 by panne]
In the installed package.conf, all includeDirs were empty, so no GHC/package
headers were found. This commit fixes that (in a hopefully correct way).

19 years ago[project @ 2005-01-23 09:41:01 by krasimir]
krasimir [Sun, 23 Jan 2005 09:41:01 +0000 (09:41 +0000)]
[project @ 2005-01-23 09:41:01 by krasimir]
Use withProgName. Without it getProgName from the executed script will return
"<interactive>"

19 years ago[project @ 2005-01-23 06:10:15 by wolfgang]
wolfgang [Sun, 23 Jan 2005 06:10:24 +0000 (06:10 +0000)]
[project @ 2005-01-23 06:10:15 by wolfgang]
Add support for the dead code stripping feature of recent Apple linkers.
If your code is compiled using the NCG, you can now specify
-optl-W,-dead_strip on the GHC command line when linking.
It will have basically the same effect as using split-objs to build the
libraries.

Advantages over split-objs:
    * No evil perl script involved
    * Requires no special handling when building libraries

Disadvantages:
    * The current version of Apple's linker is slow when given the
      -dead_strip flag. _REALLY_ slow.
    * Mac OS X only.

This works by making the NCG emit the .subsections_via_symbols directive.
Additionally, we have to add an extra label at the top of every info table,
and make sure that the entry code references it (otherwise the info table
will be considered part of the preceding entry code).
The mangler just removes the .subsections_via_symbols directive.

19 years ago[project @ 2005-01-22 08:20:31 by krasimir]
krasimir [Sat, 22 Jan 2005 08:20:31 +0000 (08:20 +0000)]
[project @ 2005-01-22 08:20:31 by krasimir]
import Foreign.Ptr and Foreign.C under Windows

19 years ago[project @ 2005-01-21 19:58:51 by sof]
sof [Fri, 21 Jan 2005 19:59:01 +0000 (19:59 +0000)]
[project @ 2005-01-21 19:58:51 by sof]
win32 only:
  Tidy up delivery and handling of console events by having the low-level
  console event handler signal the RTS thread blocked waiting for I/O.

19 years ago[project @ 2005-01-21 18:06:26 by panne]
panne [Fri, 21 Jan 2005 18:06:26 +0000 (18:06 +0000)]
[project @ 2005-01-21 18:06:26 by panne]
* Require happy >= 1.15 for build
* Build some needed PostScript docs
* Merge the ghc-doc- sub-package into the ghc sub-package, it's quite
  unusual to find the docs for a package blah under
  /usr/share/doc/packages/blah-doc

19 years ago[project @ 2005-01-21 16:55:14 by simonmar]
simonmar [Fri, 21 Jan 2005 16:55:14 +0000 (16:55 +0000)]
[project @ 2005-01-21 16:55:14 by simonmar]
small wibble

19 years ago[project @ 2005-01-21 16:32:36 by simonmar]
simonmar [Fri, 21 Jan 2005 16:32:36 +0000 (16:32 +0000)]
[project @ 2005-01-21 16:32:36 by simonmar]
Begin updating the porting instructions for GHC 6.4.  A few details
have changed.

19 years ago[project @ 2005-01-21 16:02:47 by simonmar]
simonmar [Fri, 21 Jan 2005 16:02:58 +0000 (16:02 +0000)]
[project @ 2005-01-21 16:02:47 by simonmar]
Don't try to run finalizers at program exit.  This turned out to be
hard if not impossible to do in general, so now we don't attempt it at
all.

The Main.main wrapper, previously called runIO and now called
runMainIO, flushes stdout and stderr before exiting.  This should
catch most cases where programs rely on Handles being flushed at
program exit, but note that now if you simply drop a Handle in your
program, there's no guarantee it'll be flushed on exit.  If the
punters complain enough, I suppose we could implement a global
Handle table and flush them all at exit... I'd rather not do this if
possible, though.  Better to teach people to close their Handles
properly.

19 years ago[project @ 2005-01-21 12:48:38 by simonmar]
simonmar [Fri, 21 Jan 2005 12:48:39 +0000 (12:48 +0000)]
[project @ 2005-01-21 12:48:38 by simonmar]
Update packages documentation (phew)

19 years ago[project @ 2005-01-21 11:04:39 by simonmar]
simonmar [Fri, 21 Jan 2005 11:04:39 +0000 (11:04 +0000)]
[project @ 2005-01-21 11:04:39 by simonmar]
Update the --help text

19 years ago[project @ 2005-01-21 00:14:41 by ross]
ross [Fri, 21 Jan 2005 00:14:41 +0000 (00:14 +0000)]
[project @ 2005-01-21 00:14:41 by ross]
repair import breakage

19 years ago[project @ 2005-01-20 18:35:47 by ross]
ross [Thu, 20 Jan 2005 18:35:47 +0000 (18:35 +0000)]
[project @ 2005-01-20 18:35:47 by ross]
more precise imports (including try from System.IO.Error)

19 years ago[project @ 2005-01-20 16:15:02 by simonmar]
simonmar [Thu, 20 Jan 2005 16:15:02 +0000 (16:15 +0000)]
[project @ 2005-01-20 16:15:02 by simonmar]
ghc-pkg list: show hidden packages in parentheses

19 years ago[project @ 2005-01-20 15:06:17 by simonmar]
simonmar [Thu, 20 Jan 2005 15:06:23 +0000 (15:06 +0000)]
[project @ 2005-01-20 15:06:17 by simonmar]
Squash gcc 3.4.x warnings.

19 years ago[project @ 2005-01-20 15:05:59 by simonmar]
simonmar [Thu, 20 Jan 2005 15:05:59 +0000 (15:05 +0000)]
[project @ 2005-01-20 15:05:59 by simonmar]
One package.conf.in file I forgot

19 years ago[project @ 2005-01-20 14:30:17 by simonmar]
simonmar [Thu, 20 Jan 2005 14:30:17 +0000 (14:30 +0000)]
[project @ 2005-01-20 14:30:17 by simonmar]
Avoid a warning

19 years ago[project @ 2005-01-20 14:22:19 by simonmar]
simonmar [Thu, 20 Jan 2005 14:22:33 +0000 (14:22 +0000)]
[project @ 2005-01-20 14:22:19 by simonmar]
Fill in the haddock-interfaces and haddock-html fields in the
package.conf files.

To do this I had to make some changes:

  - haddock-interfaces requires the value of $(datadir).  We can't
    just plug this in, because $(datadir) might change at install-time
    (eg. a Windows installer can be placed anywhere, as can a Unix
    binary .tar.gz distribution).  The current trick is for the
    compiler to splice in the value of $libdir in package.conf at
    runtime.  So we could extend this mechanism and tell the compiler
    the value of $datadir via a command-line option, but that seems
    ugly.

    On Windows, $datadir==$libdir, so we don't need any changes:
    package.conf still uses $libdir, and a Windows installation is
    independent of its absolute location.  Even 'make install' on
    Windows should have this property.

    On Unix:
- for 'make install' and in-place execution, we just use
          absolute paths in package.conf

- for a binary dist, we generate a package.conf that refers
  to $libdir and $datadir, and splice in the values at
  install-time (distrib/Makefile-bin.in).

  - Also, I renamed $libdir to $topdir to more closely reflect its
    actual meaning.  This is somewhat malicious in that it will flush
    out all those clients using $libdir when they really shouldn't
    be :-)

19 years ago[project @ 2005-01-20 12:02:06 by simonpj]
simonpj [Thu, 20 Jan 2005 12:02:06 +0000 (12:02 +0000)]
[project @ 2005-01-20 12:02:06 by simonpj]
Fix syntax error

19 years ago[project @ 2005-01-19 18:31:07 by wolfgang]
wolfgang [Wed, 19 Jan 2005 18:31:07 +0000 (18:31 +0000)]
[project @ 2005-01-19 18:31:07 by wolfgang]
Update comments for PowerPC register mapping.

19 years ago[project @ 2005-01-19 11:48:15 by simonmar]
simonmar [Wed, 19 Jan 2005 11:48:15 +0000 (11:48 +0000)]
[project @ 2005-01-19 11:48:15 by simonmar]
-jN friendliness

19 years ago[project @ 2005-01-19 10:04:17 by simonmar]
simonmar [Wed, 19 Jan 2005 10:04:17 +0000 (10:04 +0000)]
[project @ 2005-01-19 10:04:17 by simonmar]
Mention -fffi in this chapter.

19 years ago[project @ 2005-01-18 16:28:43 by simonmar]
simonmar [Tue, 18 Jan 2005 16:28:43 +0000 (16:28 +0000)]
[project @ 2005-01-18 16:28:43 by simonmar]
USE_MMAP on Linux too: this is needed for sparc64-unknown-linux at
least, and since it seems to work on i386-unknown-linux too we might
as well enable it.  We should probably use it on more arches/OSs too.

19 years ago[project @ 2005-01-18 15:58:12 by simonpj]
simonpj [Tue, 18 Jan 2005 15:58:12 +0000 (15:58 +0000)]
[project @ 2005-01-18 15:58:12 by simonpj]
Wibble

19 years ago[project @ 2005-01-18 13:51:28 by simonmar]
simonmar [Tue, 18 Jan 2005 13:51:28 +0000 (13:51 +0000)]
[project @ 2005-01-18 13:51:28 by simonmar]
Update a comment

19 years ago[project @ 2005-01-18 12:18:11 by simonpj]
simonpj [Tue, 18 Jan 2005 12:19:12 +0000 (12:19 +0000)]
[project @ 2005-01-18 12:18:11 by simonpj]
------------------------
    Reorganisation of hi-boot files
   ------------------------

The main point of this commit is to arrange that in the Compilation
Manager's dependendency graph, hi-boot files are proper nodes. This
is important to make sure that we compile everything in the right
order.  It's a step towards hs-boot files.

* The fundamental change is that CompManager.ModSummary has a new
  field, ms_boot :: IsBootInterface

  I also tided up CompManager a bit.  No change to the Basic Plan.

  ModSummary is now exported abstractly from CompManager (was concrete)

* Hi-boot files now have import declarations.  The idea is they are
  compulsory, so that the dependency analyser can find them

* I changed an invariant: the Compilation Manager used to ensure that
  hscMain was given a HomePackageTable only for the modules 'below' the
  one being compiled.  This was really only important for instances and
  rules, and it was a bit inconvenient.  So I moved the filter to the
  compiler itself: see HscTypes.hptInstances and hptRules.

* Module Packages.hs now defines
    data PackageIdH
    = HomePackage  -- The "home" package is the package
  -- curently being compiled
    | ExtPackage PackageId -- An "external" package is any other package

   It was just a Maybe type before, so this makes it a bit clearer.

* I tried to add a bit better location info to the IfM monad, so that
  errors in interfaces come with a slightly more helpful error message.
  See the if_loc field in TcRnTypes --- and follow-on consequences

* Changed Either to Maybes.MaybeErr in a couple of places (more perspicuous)

19 years ago[project @ 2005-01-18 11:31:03 by simonmar]
simonmar [Tue, 18 Jan 2005 11:31:03 +0000 (11:31 +0000)]
[project @ 2005-01-18 11:31:03 by simonmar]
Try again: Complain if --enable-src-tree-{happy,alex,haddock} is
given, but the relevant sources don't exist.

19 years ago[project @ 2005-01-18 11:30:17 by simonmar]
simonmar [Tue, 18 Jan 2005 11:30:17 +0000 (11:30 +0000)]
[project @ 2005-01-18 11:30:17 by simonmar]
Revert previous, used wrong version of aclocal.m4

19 years ago[project @ 2005-01-18 11:15:53 by simonmar]
simonmar [Tue, 18 Jan 2005 11:15:53 +0000 (11:15 +0000)]
[project @ 2005-01-18 11:15:53 by simonmar]
Complain if --enable-src-tree-{happy,alex,haddock} is given, but the
relevant sources don't exist.

19 years ago[project @ 2005-01-17 16:46:58 by simonmar]
simonmar [Mon, 17 Jan 2005 16:46:58 +0000 (16:46 +0000)]
[project @ 2005-01-17 16:46:58 by simonmar]
sparc-.*linux: slight modification to rev. 1.107, the whitespace
before .section should be \s+, not \t.  Fixes problems with even more
recent gcc versions on sparc64.

19 years ago[project @ 2005-01-17 12:01:13 by simonmar]
simonmar [Mon, 17 Jan 2005 12:01:13 +0000 (12:01 +0000)]
[project @ 2005-01-17 12:01:13 by simonmar]
Fix a bug in the register clobbering logic noticed by Wolfgang Thaller.

19 years ago[project @ 2005-01-16 05:31:39 by wolfgang]
wolfgang [Sun, 16 Jan 2005 05:31:45 +0000 (05:31 +0000)]
[project @ 2005-01-16 05:31:39 by wolfgang]
A first stab at position independent code generation for i386-linux.
It doesn't work yet, but it shouldn't break anything.

What we need now is one or both of the following:
a) A volunteer to implement PIC for x86 -fvia-C
    (I definitely refuse to touch any piece of code that contains
     both Perl and x86 assembly).
b) A volunteer to improve the NCG to the point where it can compile
   the RTS (so we won't need point a).

19 years ago[project @ 2005-01-16 02:50:16 by wolfgang]
wolfgang [Sun, 16 Jan 2005 02:50:16 +0000 (02:50 +0000)]
[project @ 2005-01-16 02:50:16 by wolfgang]
pprExpr: add cases for CmmPicBaseReg and CmmRegOff
so that we can do -fPIC -ddump-opt-cmm

19 years ago[project @ 2005-01-14 22:47:29 by wolfgang]
wolfgang [Fri, 14 Jan 2005 22:47:29 +0000 (22:47 +0000)]
[project @ 2005-01-14 22:47:29 by wolfgang]
Fix a typo in the previous commit.

19 years ago[project @ 2005-01-14 22:12:54 by wolfgang]
wolfgang [Fri, 14 Jan 2005 22:12:55 +0000 (22:12 +0000)]
[project @ 2005-01-14 22:12:54 by wolfgang]
When -dynamic is specified but -fPIC is not, generate code that works around
the ELF dynamic linker's misguided attempts to keep the main program unaware
of dynamic linking.

This involves generating indirect references and computed jumps for position
dependent code, too, and making all constant data sections writable in order
to persuade ld to not use "COPY" relocations.

Tested on powerpc-linux; in theory, it also applies to i386-linux, but other
parts of the PIC story are missing there.

Note that the writable-const-data hack could be improved a bit by
distinguishing between "really" constant data and "relocatable" constant data,
which would be a nice thing to do anyway.

19 years ago[project @ 2005-01-14 17:57:41 by simonmar]
simonmar [Fri, 14 Jan 2005 17:57:55 +0000 (17:57 +0000)]
[project @ 2005-01-14 17:57:41 by simonmar]
HEADS UP!  You now need to use an up to date Happy from CVS to build
GHC.  Happy version 1.15 will be released shortly.

Replace the slow hacked up String-based GetImports with one based on
the real Haskell parser.  This requires a new addition to Happy to
support parsing partial files.  We now avoid reading each source file
off the disk twice: once to get its module name and imports, and again
to parse it.  Instead we just slurp it once, and cache the StringBuffer.

This should result in improved startup times for ghc --make,
especially when there are lots of source files.

19 years ago[project @ 2005-01-14 16:00:55 by simonmar]
simonmar [Fri, 14 Jan 2005 16:00:55 +0000 (16:00 +0000)]
[project @ 2005-01-14 16:00:55 by simonmar]
Add mk/fptools.css to $(SRC_DIST_FILES)

19 years ago[project @ 2005-01-14 11:46:24 by simonmar]
simonmar [Fri, 14 Jan 2005 11:46:24 +0000 (11:46 +0000)]
[project @ 2005-01-14 11:46:24 by simonmar]
hGetStringBuffer: hClose the file after we've read it (duh).  This
causes a real problem on Windows, where the file remains locked in
GHCi, and cannot be modified until after the finalizer has closed it
(bug #1047408).

19 years ago[project @ 2005-01-14 11:34:44 by simonmar]
simonmar [Fri, 14 Jan 2005 11:34:44 +0000 (11:34 +0000)]
[project @ 2005-01-14 11:34:44 by simonmar]
retire $(compiling_with_4xx): we don't support compiling with 4.x any more

19 years ago[project @ 2005-01-14 08:01:26 by wolfgang]
wolfgang [Fri, 14 Jan 2005 08:01:32 +0000 (08:01 +0000)]
[project @ 2005-01-14 08:01:26 by wolfgang]
Dynamic Linking, Part 2:

Hack the Makefiles to build dynamic libraries.
This allows you to actually use dynamic libraries to greatly reduce binary
sizes on Darwin/PowerPC and on powerpc64-linux (for now).

To use this, add the following to your build.mk

SplitObjs=NO
GhcBuildDylibs=YES
GhcStage2HcOpts=-dynamic
GhcLibHcOpts+=-fPIC -dynamic
GhcRtsHcOpts+=-fPIC -dynamic
GHC_CC_OPTS+=-fPIC

(You can leave out the last three lines on powerpc64-linux).

Then, to compile a program using dynamic libraries, pass the -dynamic option to GHC.
To make GHCi use the dynamic libraries instead of .o files, just delete the HS*.o files.

The dynamic library files are named libHSfoo_dyn.dylib or libHSfoo_dyn.so.

Note that the dynamic and static libraries are build from the same .o files,
but we really want to build the static libraries with SplitObjs and without
-fPIC -dynamic to achieve better code size and performance.

ghc/compiler/ghci/Linker.lhs:
    When looking for a library, look for HSfoo.o first (as before),
    then look for libHSfoo_dyn.[so/dylib] before looking for
    libHSfoo.[so/dylib].

ghc/compiler/main/DriverPipeline.hs:
    Main.dll_o and PrelMain.dll_o are dead, at least for now.

ghc/compiler/main/Packages.lhs:
    When -dynamic is specified, add "_dyn" to all libraries specified in
    hs-libraries (not to the extra-libs).

ghc/lib/compat/Makefile:
    Never build libghccompat as a dynamic lib.

mk/package.mk:
    if GhcBuildDylibs is set to YES, build dynamic libraries.

mk/target.mk:
    When installing .dylibs (Darwin only), update the install_name to point
    to the final location.
    (Somebody please read Apple's documentation on what install_names are,
    and then comment on whether this is a useful feature or whether it should
    be done the "normal" unix way).

19 years ago[project @ 2005-01-13 16:32:34 by simonmar]
simonmar [Thu, 13 Jan 2005 16:32:34 +0000 (16:32 +0000)]
[project @ 2005-01-13 16:32:34 by simonmar]
Small optimisation: allow lookForInline to skip over CmmNop too

19 years ago[project @ 2005-01-13 16:21:14 by simonmar]
simonmar [Thu, 13 Jan 2005 16:21:14 +0000 (16:21 +0000)]
[project @ 2005-01-13 16:21:14 by simonmar]
default STOLEN_X86_REGS to 4 (workaround because GHC doesn't normally
define STOLEN_X86_REGS when compiling plan .c source)

19 years ago[project @ 2005-01-13 16:08:22 by simonmar]
simonmar [Thu, 13 Jan 2005 16:08:23 +0000 (16:08 +0000)]
[project @ 2005-01-13 16:08:22 by simonmar]
Fix up STM when compiling unregisterised.  There were a few wibbles
with the stack layout.

19 years ago[project @ 2005-01-13 16:07:33 by simonmar]
simonmar [Thu, 13 Jan 2005 16:07:33 +0000 (16:07 +0000)]
[project @ 2005-01-13 16:07:33 by simonmar]
Instead of defining NO_REGS when IN_STG_CODE==0, define
NO_GLOBAL_REG_DECLS instead.

This means that in non-STG code we can still get at the values of
REG_R1 & co., even though the global register decls are turned off.
This is necessary because we sometimes need to set up different stack
layouts depending on REG_R1.

19 years ago[project @ 2005-01-13 16:05:37 by simonmar]
simonmar [Thu, 13 Jan 2005 16:05:37 +0000 (16:05 +0000)]
[project @ 2005-01-13 16:05:37 by simonmar]
Make it so that global register declarations are turned off if
NO_GLOBAL_REG_DECLS is defined.

19 years ago[project @ 2005-01-13 16:04:52 by simonmar]
simonmar [Thu, 13 Jan 2005 16:04:52 +0000 (16:04 +0000)]
[project @ 2005-01-13 16:04:52 by simonmar]
Improve a comment

19 years ago[project @ 2005-01-13 16:04:18 by simonmar]
simonmar [Thu, 13 Jan 2005 16:04:18 +0000 (16:04 +0000)]
[project @ 2005-01-13 16:04:18 by simonmar]
slight simplification

19 years ago[project @ 2005-01-13 14:15:38 by simonmar]
simonmar [Thu, 13 Jan 2005 14:15:38 +0000 (14:15 +0000)]
[project @ 2005-01-13 14:15:38 by simonmar]
Fix the unreg test in the rule for building AutoApply$(_way).cmm

19 years ago[project @ 2005-01-13 14:12:40 by simonmar]
simonmar [Thu, 13 Jan 2005 14:12:40 +0000 (14:12 +0000)]
[project @ 2005-01-13 14:12:40 by simonmar]
Add way debug_u

19 years ago[project @ 2005-01-13 12:44:08 by simonmar]
simonmar [Thu, 13 Jan 2005 12:44:08 +0000 (12:44 +0000)]
[project @ 2005-01-13 12:44:08 by simonmar]
Fix bug(s) in the register allocator: if a virtual register is both in
memory and in a register (perhaps because it was recently loaded from
a spill slot), and the current instruction writes it, we're supposed
to invalidate the memory slot.  That wasn't happening properly.

This fixes two problems noticed when using -prof -fasm: 10queens in the
testsuite gives the wrong answer, and nofib/spectral/hartel/ida fails
with a 'head []' message.  Interesting bug to track down!

19 years ago[project @ 2005-01-12 23:52:17 by wolfgang]
wolfgang [Wed, 12 Jan 2005 23:52:17 +0000 (23:52 +0000)]
[project @ 2005-01-12 23:52:17 by wolfgang]
-package Cabal is required whenever $(bootstrapped) is yes, not only
for bootstrapped compiles with GHCi.

19 years ago[project @ 2005-01-12 16:33:54 by simonmar]
simonmar [Wed, 12 Jan 2005 16:33:54 +0000 (16:33 +0000)]
[project @ 2005-01-12 16:33:54 by simonmar]
Fix a bug in mk_switch.

19 years ago[project @ 2005-01-12 15:26:28 by simonmar]
simonmar [Wed, 12 Jan 2005 15:26:28 +0000 (15:26 +0000)]
[project @ 2005-01-12 15:26:28 by simonmar]
Track removal of Distribution.Compat.Error

19 years ago[project @ 2005-01-12 13:44:20 by simonmar]
simonmar [Wed, 12 Jan 2005 13:44:22 +0000 (13:44 +0000)]
[project @ 2005-01-12 13:44:20 by simonmar]
Track removal of Distribution.Compat.Error.

19 years ago[project @ 2005-01-12 13:36:30 by simonmar]
simonmar [Wed, 12 Jan 2005 13:36:34 +0000 (13:36 +0000)]
[project @ 2005-01-12 13:36:30 by simonmar]
Restore splitting at ':' for the -i option, which I broke recently.

19 years ago[project @ 2005-01-12 12:51:57 by simonmar]
simonmar [Wed, 12 Jan 2005 12:51:57 +0000 (12:51 +0000)]
[project @ 2005-01-12 12:51:57 by simonmar]
Yet another STM fix: don't attempt to kick any threads which are ThreadRelocated.

19 years ago[project @ 2005-01-12 12:44:25 by ross]
ross [Wed, 12 Jan 2005 12:44:25 +0000 (12:44 +0000)]
[project @ 2005-01-12 12:44:25 by ross]
fix System.IO.Error breakage

19 years ago[project @ 2005-01-12 12:36:28 by simonmar]
simonmar [Wed, 12 Jan 2005 12:36:30 +0000 (12:36 +0000)]
[project @ 2005-01-12 12:36:28 by simonmar]
Numerous bug fixes to the STM code, mostly from a debugging session
with Tim Harris.  The test that flushed out all the bugs will shortly
be added to the test suite.

19 years ago[project @ 2005-01-12 10:04:00 by simonmar]
simonmar [Wed, 12 Jan 2005 10:04:00 +0000 (10:04 +0000)]
[project @ 2005-01-12 10:04:00 by simonmar]
Issue an error when the stdcall calling convention is requested on
non-x86 platforms.

19 years ago[project @ 2005-01-12 09:46:06 by simonmar]
simonmar [Wed, 12 Jan 2005 09:46:06 +0000 (09:46 +0000)]
[project @ 2005-01-12 09:46:06 by simonmar]
import System.IO.Error

19 years ago[project @ 2005-01-12 05:53:07 by wolfgang]
wolfgang [Wed, 12 Jan 2005 05:53:07 +0000 (05:53 +0000)]
[project @ 2005-01-12 05:53:07 by wolfgang]
Move _srtd and _closure_tbl to read-only data instead of text
(these things contain pointers to other symbols, so they can't go into
.text for position-independent code).

19 years ago[project @ 2005-01-12 05:44:21 by wolfgang]
wolfgang [Wed, 12 Jan 2005 05:44:21 +0000 (05:44 +0000)]
[project @ 2005-01-12 05:44:21 by wolfgang]
PowerPC Linux: Fix a slight ABI bug in genCCall
Double and I64 arguments on the stack were not properly aligned.

19 years ago[project @ 2005-01-11 22:16:07 by wolfgang]
wolfgang [Tue, 11 Jan 2005 22:16:07 +0000 (22:16 +0000)]
[project @ 2005-01-11 22:16:07 by wolfgang]
Cleanup and additional comments for the Mac OS/AIX/powerpc64-linux adjustor
code.

19 years ago[project @ 2005-01-11 16:21:53 by simonmar]
simonmar [Tue, 11 Jan 2005 16:21:53 +0000 (16:21 +0000)]
[project @ 2005-01-11 16:21:53 by simonmar]
ignore OPTIONS_anything_else when looking for OPTIONS_GHC/OPTIONS pragmas.

19 years ago[project @ 2005-01-11 16:06:56 by simonmar]
simonmar [Tue, 11 Jan 2005 16:06:58 +0000 (16:06 +0000)]
[project @ 2005-01-11 16:06:56 by simonmar]
Rename OPTIONS to OPTIONS_GHC.

19 years ago[project @ 2005-01-11 15:59:39 by simonmar]
simonmar [Tue, 11 Jan 2005 15:59:39 +0000 (15:59 +0000)]
[project @ 2005-01-11 15:59:39 by simonmar]
Make GHC accept OPTIONS_GHC.  OPTIONS is also accepted, for now.

19 years ago[project @ 2005-01-11 15:22:04 by simonmar]
simonmar [Tue, 11 Jan 2005 15:22:04 +0000 (15:22 +0000)]
[project @ 2005-01-11 15:22:04 by simonmar]
fix for parsing OPTIONS pragmas: OPTIONS should be followed by a
non-identifier character.

19 years ago[project @ 2005-01-11 14:17:50 by simonmar]
simonmar [Tue, 11 Jan 2005 14:17:50 +0000 (14:17 +0000)]
[project @ 2005-01-11 14:17:50 by simonmar]
wibble: got my endifs mixed up

19 years ago[project @ 2005-01-11 14:14:48 by simonmar]
simonmar [Tue, 11 Jan 2005 14:14:48 +0000 (14:14 +0000)]
[project @ 2005-01-11 14:14:48 by simonmar]
When way=u, turn off split objects by setting SplitObjs=NO, rather
than testing for way=u directly.  Fixes a build wibble.

19 years ago[project @ 2005-01-11 11:32:44 by simonmar]
simonmar [Tue, 11 Jan 2005 11:32:44 +0000 (11:32 +0000)]
[project @ 2005-01-11 11:32:44 by simonmar]
Fix $(StripLibraries) code after ld changes yesterday.

19 years ago[project @ 2005-01-11 07:23:21 by wolfgang]
wolfgang [Tue, 11 Jan 2005 07:23:21 +0000 (07:23 +0000)]
[project @ 2005-01-11 07:23:21 by wolfgang]
Support foreign import "wrapper" with > 6 arguments on PowerPC Linux (32-bit).
This calling convention looks deceptively simple at first, but it turns out
to be hideously complex...

19 years ago[project @ 2005-01-10 23:48:07 by krasimir]
krasimir [Mon, 10 Jan 2005 23:48:07 +0000 (23:48 +0000)]
[project @ 2005-01-10 23:48:07 by krasimir]
createDirectoryIfMissing is added to Compat.Directory and is used in ghc-pkg.
The mingw32_HOST_OS is replaced with mingw32_TARGET_OS. I don't know why but
prior the last commit the tool was working with mingw32_HOST_OS fine but not
it isn't. Maybe I miss something. Simon, could you check whether the patch is
fine?

19 years ago[project @ 2005-01-10 23:00:53 by wolfgang]
wolfgang [Mon, 10 Jan 2005 23:00:53 +0000 (23:00 +0000)]
[project @ 2005-01-10 23:00:53 by wolfgang]
Fix for AIX-like ABIs.

19 years ago[project @ 2005-01-10 19:01:27 by panne]
panne [Mon, 10 Jan 2005 19:01:28 +0000 (19:01 +0000)]
[project @ 2005-01-10 19:01:27 by panne]
Refactored and cleaned up ld-related tests. Only tested mildly under Linux.

19 years ago[project @ 2005-01-10 18:44:38 by wolfgang]
wolfgang [Mon, 10 Jan 2005 18:44:40 +0000 (18:44 +0000)]
[project @ 2005-01-10 18:44:38 by wolfgang]
Handle foreign import wrapper properly for MacOS X, powerpc64-linux and AIX.
Only Mac OS X tested so far.
Pass information about argument types from DsForeign to createAdjustor encoded
as a string ('i' for integers, 'f' for floats, 'd' for doubles and 'l' for
long [64bit] integers).

19 years ago[project @ 2005-01-10 16:24:16 by simonmar]
simonmar [Mon, 10 Jan 2005 16:24:16 +0000 (16:24 +0000)]
[project @ 2005-01-10 16:24:16 by simonmar]
Add *.S to $(C_SRCS).  Seems to do the right thing, including  mkdependC.

19 years ago[project @ 2005-01-10 13:53:14 by simonmar]
simonmar [Mon, 10 Jan 2005 13:53:14 +0000 (13:53 +0000)]
[project @ 2005-01-10 13:53:14 by simonmar]
Obscure bugfix affecting foreign import "wrapper" with non-word-sized
argument types (eg. Double) on Windows.  The list of arguments types
returned by dsFExport was the boxed types, rather than the unboxed
types, so dsFExportDynamic couldn't get the correct sizes of the
argument types to the stub function.

It's more correct now, but not totally correct (see the comment for
details).

Noticed by: Wolfgang Thaller.

19 years ago[project @ 2005-01-10 12:34:21 by simonmar]
simonmar [Mon, 10 Jan 2005 12:34:21 +0000 (12:34 +0000)]
[project @ 2005-01-10 12:34:21 by simonmar]
Remove copied definitions for joinFileName, splitFileName:
System.FilePath is in libghccompat now.

19 years ago[project @ 2005-01-10 11:45:19 by simonmar]
simonmar [Mon, 10 Jan 2005 11:45:24 +0000 (11:45 +0000)]
[project @ 2005-01-10 11:45:19 by simonmar]
Work around problems caused by limit on the length of the command line
in ld, which shows up when building OpenGL on Windows with SplitObjs=YES.

We now pass the names of the input files to ld via a linker script.
This is (probably) only supported by GNU ld, so we now have to detect
GNU ld in the configure script (yawn) and back off to the old method
if we don't have it.

19 years ago[project @ 2005-01-09 00:29:05 by desrt]
desrt [Sun, 9 Jan 2005 00:29:05 +0000 (00:29 +0000)]
[project @ 2005-01-09 00:29:05 by desrt]
Modified the mangler for powerpc64.  This is the last missing piece for supporting
registerised builds on PPC64.

The current state of the mangler is temporary.  We're discussing a better way to take
advantage of the PPC64 ABI's unique features to provide a better way of storing info
tables.

I don't think I've changed anything that affects other platforms.