Clean `.buildinfo` only if `.buildinfo.in` exists

Signed-off-by: Herbert Valerio Riedel <hvr@gnu.org>
Add a tiny bit more tracing
Be more careful when iterating the constraint-simpifier loop (fixes Trac #8474)

We were (uselessly) iterating the simplification loop an exponential
number of times.  Lovely simple test case showed this up.

See Note [Cutting off simpl_loop] in TcSimplify
Remove canSolve in favour of canRewrite

There was no useful distinction; a simple refactoring.
Untabify and remove trailing whitespace

... plus a couple of unused variables in TcSMonad
rts: Add getPhysicalMemorySize
rts: Print correct stack size on stack overflow

This requires that stackOverflow() in RtsUtils.c be passed a reference
to the current TSO. This requires a small change in libraries/base.
rts: Fix typo in comment
rts: Allow for infinite stack size

This is encoded as RtsFlags.GcFlags.maxStkSize == 0.
users_guide: Document zero stack size limit
rts: Set default maximum stack size to 80% of physical memory
users_guide: Update default maximum stack size
Correctly set relative rpath for OS X (#8266)

This includes both executables (by correcly setting the rpath to the
topDir) and libffi, and GHC itself, so that everything works with no
build tree.

Authored-by: Christiaan Baaj <christiaan.baaij@gmail.com>
Signed-off-by: Austin Seipp <austin@well-typed.com>
Placate clang (#8444, #8445)

Once again the whitespace rules (and the rules concerning expansion of
tokens) have bitten us.

Authored-by: Authored-by: Luke Iannini <lukexi@me.com>
Signed-off-by: Austin Seipp <austin@well-typed.com>
Add build.mk.sample entry for Cross Compilation

This is suitable e.g. for iOS.

Authored-by: Authored-by: Luke Iannini <lukexi@me.com>
Signed-off-by: Austin Seipp <austin@well-typed.com>
Make SpecConstr also check for GHC.Types.SPEC

SpecConstr has for a while now looked for types with the built
in ForceSpecConstr annotation, in order to know where to be particularly
aggressive.

Unfortunately using an annotation has a number of downsides, the most
prominent two being:

  A) ForceSpecConstr is vital for efficiency (even if it's
     a hack), but it means users of it must have GHCI - even though
     stage2 features are not required for anything but the annotation.

  B) Any user who might need it (read: vector) has to duplicate the same
     piece of code. In general there are few people actually doing this,
     but it's unclear why they should have to.

This patch makes SpecConstr look for functions applied to the new
GHC.Types.SPEC type - a copy of the already-extant 'SPEC' type - as well
as look for annotations, in the stage2 compiler.

In particular, this means `vector` can now be built with a stage1
compiler, since it no longer depends on stage2 for anything else. This
is particularly important for e.g. iOS cross-compilers.

This also means we should be able to build `vector` earlier in the build
process too, but this patch doesn't address that.

This requires an accompanying bump in ghc-prim.

Signed-off-by: Austin Seipp <austin@well-typed.com>
Linker.c: remove stablehash, which is no longer used

Signed-off-by: Austin Seipp <austin@well-typed.com>
ghci: add support for ELF weak symbols

Signed-off-by: Austin Seipp <austin@well-typed.com>
Linker.c: add dso_handle to the symbol table

Signed-off-by: Austin Seipp <austin@well-typed.com>
Make sure to #include Stable.h in Linker.c

It needs freeStablePtr, which tripped my validate build, due to an
implicit declaration warning. I'm quite surprised this somehow did not
trip the build before.

Signed-off-by: Austin Seipp <austin@well-typed.com>