Compiler flags
Ordinary flags
- -c
Separate compilation flag. Will produce a ``.o'' file
only, without linking.
- -Dname
Define a symbol (this flag is sent to the
preprocessor).
- -Iname
Search for include files in name (this flag is sent
to the preprocessor).
- -static
Link the resulting program statically.
- -o name
Name the executable file name.
- -noflags
Generate a binary that does not decode any flags.
- -S
Produce an assembly file only. This file has suffix ``.s''.
- -T
Produce code to enable runtime tracing. For further information look a the
section on runtime flags.
- -O
Optimize the program for speed at the cost of longer compilation time and a bigger object file.
See further below.
- -p
Enable profiling with prof.
- -pg
Enable profiling with gprof. The information from gprof is difficult
to interpret since the order in which functions are called with lazy evaluation
is rather strange.
- -ph
Enable heap profiling. For further information look at the section on
runtime flags.
- -ipath
Prepend path to the include path. If path is empty the include path is emptied.
A leading ``%'' in a path component will insert the value of the ``HBCDIR'' environment variable.
- -cpp
- -M
Enable preprocessing by the C preprocessor for Haskell.
- -lmlx
Compile a program using the fudgets library.
A shorthand for the flags ``-u LMLX -i%/lmlx'' and the arguments ``-lX11 -lXext'' to the linker.
- -showheap
Link the program with the heap display code, use the ``-xc'' flag
when running the program.
- -noflags
Link the program so that with built-in flag decoding inhibited.
- -u sym
- -llib
- -s
Sent to the linker.
- -v
Make the front end verbose.
Compiler flags can also be given on the first line of a file
using the COMPILERFLAGS pragma.
Code generator related flags
The following subset of the flags that may be of interest to the user.
- -fauto-specialize
Do automatic specialization of functions within a module.
An overloaded function is specialized to whatever particular types it is used at.
- -fconctype
Compile conctypes.
- -fno-eta-expand
Do not do the reverse eta-reduction to saturate applications.
- -fno-evalupdunw
Do not use runtime system code to return the value of a variable.
- -fpat-bin-update
- -fpbu
Use a space leak avoiding compilation of pattern bindings.
- -fshow-top-types
Print the type of all top level definitions in a module, regardless if they are
exported or not. This output can be used with the shell script addsign to merge
it into the source. All of this is performed by the command
``hbcaddsign file''.
This flag can be combined with ``-f-no-Num-overload'' to remove numeric overloading
from a program.
- -fno-zap-redex
Do not overwrite the top application node when entering a function.
This gives somewhat faster, but leakier, programs.
- -finst-with-c-t
Follow the Haskell rule for how instance declarations are
exported.
- -flocal-quant
Allow locally quantified type variables in data type
declarations.
- -fno-syn-expand
Do not expand type synonyms as aggressively in the interface files.
CPU specific flags
- -mfar-jump
Emit code that can do far jumps on the SPARC. This may be necessary for code
that is to be used in the interactive system since normal jumps can only
jump 8 Mbytes.
- -mi486
Emit code which is (just slightly) better for 486 than 386.
- -msparc8
Use the smul/sdiv instructions available on SPARC-8.
- -msolaris
Adapt code generator to Solaris conventions.
- -mlinux
Adapt code generator to Linux conventions.
- -mPOWER
Use the POWER version of the PPC instruction set.
- -mPowerPC
Use the PowerPC version of the PPC instruction set.
Optimization
When the ``-O'' flag is used the following flags are in effect:
-fauto-specialize,
-ffail-strict,
-ffast-gc-check,
-fno-pre-tuple-sel,
-fstrict-call, and
-ftest-eval.
If the program is linked with the ``-O'' flag it will also use the memory
more aggresively (at the expense of a small working set).
Error messages
Syntax analyser messages
NOT YET WRITTEN!!!
Compiler messages
This section is incomplete.
- [1] Varying number of args to id
All lhs for a function binding must have the same number of patterns.
- [2] Different function names at id
LML
- [3] Bad function: id
Should not happen
- [4] Bad identifier in pedantic mode: id
Haskell restricts the use of the first character in identifiers.
- [5] Bad identifiers in pedantic mode: id...
see [4]
- [6] Illegal module name: id
User-defined module names mut not begin with Prelude
- [7] Bad deriving for: id...
Appendix D The requested instances could not be derived
- [8] Redefinition of imported entity: id...
? The module redefines something imported.
- [9] Circular class structure
The superclass relation must not be cyclic
- [10] Extra definitions in class
Only defaults for methods may be declared in a class
- [11] Type variable not in all methods for class
All method types must mention the class variable
- [12] Constrained variable in class
No method type must constrain the class variable
- [13] Malformed class declaration
Should not happen
- [14] Instance declaration contains extra bindings: id...
An instance declaration may only bind the class methods
- [16] Unknown class in instance declaration
The instance declaration is invalid because the class id is not a class
- [17] Multiple type variables in instance declaration
4.3.2 (Pedantic only) The instance declaration must have at most one type variable
- [18] Bad identifiers in pedantic mode: id...
see [4]
- [19] Circular type synonyms.
Mutually recursive type synonyms not allowed
- [20] Unknown id among id...
A type signature non-existing binding
- [21] Multiple definition in binding: id...
Multiply declared identifiers
- [22] Undefined type id
The id is not a type
- [23] Bad type arity
A type constructor was used with the wrong number of arguments
- [24] Bad type synonym arity
A type synonym was used with the wrong number of arguments
- [25] Undefined class id
Undefined class in context
- [26] Not a class id
Non-class in context
- [27] Unbound type var(s) tid
Data type definition contains type vars that are not in the lhs
- [28] Duplicate type var(s) in
Non-linear lhs in a data type definition
- [29] Non-classes in deriving: id...
Non-class in deriving
- [30] Synonym has bad type var:
Synonym has non-linear lhs or unbound var in rhs
- [31] Bad synonym definition:
Rhs in synonym is not a type
- [32] Bad type var
LML, conctype
- [33] Undefined identifier id
Undefined identifier in expression
- [34] Bad conditional pattern (overlap?) near
?
- [35] Constructor with too many arguments:
(Really a type error)
- [36] Constructor with too few arguments in pattern:
Constructor applications in patterns have to be saturated
- [37] Pattern binding does not bind any variables:
Not really an error, but unlikely to be correct
- [38] Bad defaults:
Only numeric classes are allowed as defaults
- [39] More than one default
A module must contain at most one default
- [40] Bad restriction:
see [83]
- [41] Bad synonym:
see [83]
- [42] Bad instance:
see [83]
- [43] Bad type def:
see [83]
- [44] Multiple signatures in
It is illegal to give more than one type signature for one variable.
- [45] Id(s) id... not in scope for signature
It is illegal to give a type signature for a variable bound in an outer scope.
- [46] Identifiers without original names in interface files: id...
- [47] Module does not import: id...
- [48] Multiply defined: id...
- [49] Multiple visible names: id...
- [50] Not a type id
- [51] Exported constructors for
- [52] Exported methods for
- [53] Export id id not defined
- [54] Impossible to resolve ambiguously overloaded tyvar(s) in class(es)
- [55] Ambiguously overloaded tyvar(s) in class(es)
- [56] Not an instance
- [57] Ambiguous instances for
- [58] Type restriction context not compatible with deduced:
- [59] Bad restriction
- [61] occurence
- [62] Bad overloading in exports:
- [63] Cannot unify types (occurence)
- [64] Cannot unify types (occurence)
- [65] Cannot unify types:
Cannot happen(?)
- [66] unify1
- [67] unify1
Cannot happen(?)
- [68] unify arity
Cannot happen(?)
- [70] Later pattern completely overlapped
- [71] Mismatching constructor type
- [72] Variable id leftmost in pattern
- [73] Duplicate id in pattern
- [74] Bad pattern
- [75] No instance for superclass
- [76] Instance context does not imply class context
- [77] Too many superclass instances
- [78] Bad type variables in class declaration:
- [79] Type or class must be in this module:
- [80] Bad type variables in instance declaration:
- [81] Type synonym in instance declaration:
- [83] context not implied
- [84] Unused type var in context:
The context c must only contain type variables referenced in t.
- [85] Export id id not defined
LML
- [86] Bad export specifiers for id...
- [87] Duplicates in export list id...
- [88] Module id should export id...
- [89] Bad import specifiers for id...
- [90] Multiple instance declarations inst...
- [91] Bad renaming: id to id...
The renaming would violate the namespace structure.
- [93] Existential type escapes: type
An existential type must not escape the scope of its introducing variable.
- [94] Existential types not allowed
LML Show functions can only be made for non-existential types.
- [95] Illegal value specialized: id
- [96] Illegal instance specialized: inst
- [97] Not a record constructor: id
- [98] Extra/duplicate fields: id ...
- [99] Unknown field identifier: id
- [100] No updateable constructors: expr
- [101] Duplicate fields: id ...
- [102] No instance inst
- [103] Kind error (kind vs. kind) among definition of: id ...
- [104] Kind error (kind vs. kind) in: type
- [105] Kind error (kind vs. kind) in signature: id ...
- [106] Empty record update
- [107] Name clash for imported module names
- [108] Uninitialized strict field: id
- [109] Type definition 'type' should have Eval context ctx
- [110] Explicit Eval instances not allowed
- [111] Bad fields in record update: id ...
- [112] h.o. unify type type
Linker messages
The linker may complain about undefined symbols. Usually this means
that that you have forgotten to include some files during linking. It
is usually possible to figure out the names of the functions by
looking at the symbols the linker complains about.
If any of the symbols ``_USE_none'', ``_USE_heap'', or ``_USE_time'' are
undefined it means that you have tried to mix files compiled with
different profiling options.
Last modified: Sat Jul 27 18:46:29 MET DST 1996