| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Switch over to the new hierarchical libraries
---------------------------------------------
This commit reorganises our libraries to use the new hierarchical
module namespace extension.
The basic story is this:
- fptools/libraries contains the new hierarchical libraries.
Everything in here is "clean", i.e. most deprecated stuff has
been removed.
- fptools/libraries/base is the new base package
(replacing "std") and contains roughly what was previously
in std, lang, and concurrent, minus deprecated stuff.
Things that are *not allowed* in libraries/base include:
Addr, ForeignObj, ByteArray, MutableByteArray,
_casm_, _ccall_, ``'', PrimIO
For ByteArrays and MutableByteArrays we use UArray and
STUArray/IOUArray respectively now.
Modules previously called PrelFoo are now under
fptools/libraries/GHC. eg. PrelBase is now GHC.Base.
- fptools/libraries/haskell98 provides the Haskell 98 std.
libraries (Char, IO, Numeric etc.) as a package. This
package is enabled by default.
- fptools/libraries/network is a rearranged version of
the existing net package (the old package net is still
available; see below).
- Other packages will migrate to fptools/libraries in
due course.
NB. you need to checkout fptools/libraries as well as
fptools/hslibs now. The nightly build scripts will need to be
tweaked.
- fptools/hslibs still contains (almost) the same stuff as before.
Where libraries have moved into the new hierarchy, the hslibs
version contains a "stub" that just re-exports the new version.
The idea is that code will gradually migrate from fptools/hslibs
into fptools/libraries as it gets cleaned up, and in a version or
two we can remove the old packages altogether.
- I've taken the opportunity to make some changes to the build
system, ripping out the old hslibs Makefile stuff from
mk/target.mk; the new package building Makefile code is in
mk/package.mk (auto-included from mk/target.mk).
The main improvement is that packages now register themselves at
make boot time using ghc-pkg, and the monolithic package.conf
in ghc/driver is gone.
I've updated the standard packages but haven't tested win32,
graphics, xlib, object-io, or OpenGL yet. The Makefiles in
these packages may need some further tweaks, and they'll need
pkg.conf.in files added.
- Unfortunately all this rearrangement meant I had to bump the
interface-file version and create a bunch of .hi-boot-6 files :-(
|
|
|
|
|
| |
Ho-hum, readdir() and readdir_r() with GNU libc doesn't
flag the end of the directory stream the same way. Cope.
|
|
|
|
| |
fix pathconf() usage
|
|
|
|
| |
prel_readdir: tidied
|
|
|
|
|
| |
getDirectoryContents: use the re-entrant readdir_r() to get at directory
entries, if available.
|
|
|
|
| |
prel_sizeof_{termios,sigset_t}: sync up proto and impl
|
|
|
|
| |
struct sigset_t -> sigset_t
|
|
|
|
|
|
|
|
|
|
| |
Get rid of uses of #const, #peek, #poke and #ptr from PrelPosix.hsc
(this leaves just uses of #type in PrelPosix) - provide constant and
accessor wrappers via PrelIOUtils.c instead.
Who knows, we might just be able to bootstrap via .hc files again..?
Only compiled & tested under Win32.
|
|
|
|
|
|
|
|
|
| |
Move some small inline-in-C functions out of PrelPosix.hsc and into
the supporting cbits sources, where they belong.
Following this change, can you now compile the entire Prelude on
x86-linux with the native code generator, and get something which
actually works properly.
|
|
|
|
|
|
|
|
|
|
| |
Now that we can derive arbitrary classes for newtypes, use this to
derive all the classes we need for the types in PrelCTypes and
PrelCTypesISO, instead of the previous hack of explicitly coercing the
methods.
This should improve the quality of code using these types too; the
coercions were surely getting in the way of optimisations before.
|
|
|
|
| |
slightly clearer fix for previous bogon, and re-indent the function
|
|
|
|
| |
Fix ifdefery bracketing bug on Win32
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Change the story on shifting primops: SllOp, SrlOp, ISllOp, ISraOp, ISrlOp.
In the old primop story, these were implemented by C macros which
checked that the shift amount did not exceed the word size, and if so
returns a suitable value (0 or -1). This gives consistent, defined
behaviour for any shift amount. However, these checks were not
implemented on the NCG route, an inconsistency.
New story: these primops do NOT check their args; they just do the shift.
Shift values >= word size give undefined results. To reflect this, their
Haskell names have been prefixed with 'unchecked'.
The checks are now done on the Bits instances in the Prelude. This means
all code generation routes are consistently checked, and hopefully the
simplifier will remove the checks for literal shift amounts.
I have tried to fix up the implementation for 64-bit platforms too, but
not having one to hand, I don't know if it will work as-is.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
--------------------------------------------
Translate out PrimOps at the AbstractC level
--------------------------------------------
This is the first in what might be a series of changes intended
to make GHC less dependent on its C back end. The main change is
to translate PrimOps into vanilla abstract C inside the compiler,
rather than having to duplicate that work in each code generation
route. The main changes are:
* A new type, MachOp, in compiler/absCSyn/MachOp.hs. A MachOp
is a primitive operation which we can reasonably expect the
native code generators to implement. The set is quite small
and unlikely to change much, if at all.
* Translations from PrimOps to MachOps, at the end of
absCSyn/AbsCUtils. This should perhaps be moved to a different
module, but it is hard to see how to do this without creating
a circular dep between it and AbsCUtils.
* The x86 insn selector has been updated to track these changes. The
sparc insn selector remains to be done.
As a result of this, it is possible to compile much more code via the
NCG than before. Almost all the Prelude can be compiled with it.
Currently it does not know how to do 64-bit code generation. Once
this is fixed, the entire Prelude should be compilable that way.
I also took the opportunity to clean up the NCG infrastructure.
The old Stix data type has been split into StixStmt (statements)
and StixExpr (now denoting values only). This removes a class
of impossible constructions and clarifies the NCG.
Still to do, in no particular order:
* String and literal lifting, currently done in the NCG at the top
of nativeGen/MachCode, should be done in the AbstractC flattener,
for the benefit of all targets.
* Further cleaning up of Stix assignments.
* Remove word-size dependency from Abstract C. (should be easy).
* Translate out MagicIds in the AbsC -> Stix translation, not
in the Stix constant folder. (!)
Testsuite failures caused by this:
* memo001 - fails (segfaults) for some unknown reason now.
* arith003 - wrong answer in gcdInt boundary cases.
* arith011 - wrong answer for shifts >= word size.
* cg044 - wrong answer for some FP boundary cases.
These should be fixed, but I don't think they are mission-critical for
anyone.
|
|
|
|
| |
unbreak inputReady().
|
|
|
|
| |
added closing bracket at end of file
|
|
|
|
| |
Use the message queue friendly MsgWaitForMultipleObjects()
|
|
|
|
| |
Support IO.hWaitForInput on Win32 platforms (on file and socket handles).
|
|
|
|
|
|
|
| |
Hmmm, we probably should install HsStd.h, too. PackageSrc.hs mentions
it, and "make boot" in ghc/utils/hsc2hs fails without it. Perhaps this
should be fixed differently, but I can't figure out how to do this
correctly...
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Make the IO implementation work with WinSock once again.
When creating sockets with WinSock, you don't get back
a file descriptor, but a SOCKET (which just so happens
to map to the same type as a 'normal' file descriptor).
This SOCKET value cannot be used with the CRT ops
read(), write(), close(), but you have to use the
socket-specific operations (recv(), send(), and closesocket(),
respectively) instead.
To keep track of this distinction between file and
socket file descriptors, the following changes were
made:
* a Handle__ has got a new field, haIsStream, which is True
for sockets / streams.
(this field is essentially unused in non-Win32 settings,
but I decided not to conditionalise its presence).
* PrelHandle.openFd now takes an extra (Maybe FDType) argument,
which lets you force what type of FD we're converting into
a Handle (this is crucial for WinSock SOCKETs, since we don't
want to attempt fstat()ing them).
Fixes breakage that was introduced with May 2001 (or earlier)
rewrite of the IO layer. This commit build upon recent IO changes
to HEAD, so merging it to STABLE will require importing those
changes too (I'll let others be the judge whether this should
be done or not).
|
|
|
|
|
|
| |
Have prototypes and implementation of prel_PrelHandle_{write,read}() match
up with the stated Haskell FFI type in PrelHandle.hs, i.e., the size
parameter is a CInt, not an Int.
|
|
|
|
| |
prel_PrelHandle_read(): de-hebetudified.
|
|
|
|
| |
minor simplification
|
|
|
|
| |
made to work on Unices
|
|
|
|
| |
bring writeErrString__() proto into scope
|
|
|
|
|
|
| |
prev. commit didn't introduce these two files correctly - PrelIOUtils.{c,h}
contain simple C wrappers to handle some aspects of OS I/O in a
plat-indep. manner.
|
|
|
|
| |
cbits/PrelIOUtils.c
|
|
|
|
| |
Function wrappers for misc error codes
|
|
|
|
| |
Wrapper functions reqd to implement Directory
|
|
|
|
| |
Fix utterly bogus implementation of system on Windoze.
|
|
|
|
|
|
|
| |
Add a dummy function _ErrorHdrHook to return the address of ErrorHdrHook.
Dunno how this ever compiled before. Maybe this is just a special Friday
effect. Maybe I shouldn't be committing stuff today. Maybe I should just
give up now.
|
|
|
|
| |
include <string.h>
|
|
|
|
| |
Use EXCLUDED_SRCS to handle ilxstubs.c
|
|
|
|
| |
SRC_CC_OPTS: add GHC_{INCLUDE,RUNTIME}_DIR to include path
|
|
|
|
| |
argc and argv no longer need faking; System.lhs copes
|
|
|
|
| |
Fake argc & argv
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Change the story about POSIX headers in C compilation.
Until now, all C code in the RTS and library cbits has by default been
compiled with settings for POSIXness enabled, that is:
#define _POSIX_SOURCE 1
#define _POSIX_C_SOURCE 199309L
#define _ISOC9X_SOURCE
If you wanted to negate this, you'd have to define NON_POSIX_SOURCE
before including headers.
This scheme has some bad effects:
* It means that ccall-unfoldings exported via interfaces from a
module compiled with -DNON_POSIX_SOURCE may not compile when
imported into a module which does not -DNON_POSIX_SOURCE.
* It overlaps with the feature tests we do with autoconf.
* It seems to have caused borkage in the Solaris builds for some
considerable period of time.
The New Way is:
* The default changes to not-being-in-Posix mode.
* If you want to force a C file into Posix mode, #include as
the **first** include the new file ghc/includes/PosixSource.h.
Most of the RTS C sources have this include now.
* NON_POSIX_SOURCE is almost totally expunged. Unfortunately
we have to retain some vestiges of it in ghc/compiler so that
modules compiled via C on Solaris using older compilers don't
break.
|
|
|
|
|
| |
Revert to shell-based method on Windows; the raw CreateProcess method is now
in hslibs/lang/SystemExts.
|
|
|
|
|
|
|
|
| |
Grrr. Do not #include "Stg.h" in plain C code, because that enables
all the global register variables. #include "Rts.h" directly instead.
This was correct in the original StgLongLong.c, why on earth it was
changed is beyond me.
|
|
|
|
|
|
|
|
| |
Add stubs for ILXized cbits DLL.
Don't call resetNonBlockingFd when DLLized; this stops the cbits DLL
depending on the RTS, which ILX needs; it doesn't matter for Windows, as
that doesn't have non-blocking IO implemented anyway.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Heal HEID
- eqForeignObjZh in include/PrimOps.h didn't have quite the right
shape (the result is a macro arg). hslibs/lang/ForeignObj
wasn't up on the change to eqForeignObj now being a primop.
- recent ghc/compiler/deSugar/ changes broke the handling of
CCall & FFI decls quite a bit. Backed out most the rewrites
of Type.splitFoo to TcType.tcSplitFoo (i.e., now back to using
TcType.tcSplitFoo).
The backed-out newtype-related changes were by no means accidental.
But, I don't profess to understand their intention to make the
proper fix, so my change is just a stop-gap measure to get HEAD
back to the land of the living.
- recent changes to the behaviour of 'hiding' & qualified names
broke hslibs/lang/CString hslibs/data/edison/Seq/ListSeq,
hslibs/data/edison/Coll/TestOrdBag, hslibs/data/edison/Coll/UnbalancedSet,
hslibs/data/edison/Coll/TestOrdSet, hslibs/data/edison/Seq/TestSeq
- rename 64-bit 'primop' funs that now live in lib/std/cbits/longlong.c
back to what they used to be called (i.e., prefixed with "stg_").
Why?
- less likely they'll clash with other (user supplied) entry points
at link-time.
- matches protos in ghc/includes/PrimOp.h
|
|
|
|
| |
Function stubs for ILX
|
|
|
|
| |
Add StgPrimFloat.c for ILX
|
|
|
|
| |
Explain why errno is imported via a function
|
|
|
|
|
| |
Move 64-bit arithmetic support into std_cbits; there's no reason for it to
be in the RTS.
|
|
|
|
|
|
|
|
|
|
| |
Remove addrOf_ErrorHdrHook, as the NCG now can (or should) cope with
foreign labels, and in any case, we don't use the NCG to build the
standard library.
The motivation for this fix is preventing HSstd_cbits depending on the
RTS, so that it can be built as a DLL (for .NET) without needing to
get the RTS built as a DLL (that way lies madness).
|
|
|
|
| |
get rid off gcc warning
|
|
|
|
|
|
| |
Change HSLIB to PACKAGE and HSLIB_DEPS to PACKAGE_DEPS, which makes more
sense. Also unbreaks the build system, in an arse-about-face sort of way
(or, if you prefer, cart-before-horse).
|
|
|
|
| |
Share handles with creator so that error messages come out
|
|
|
|
| |
Add comments
|