GMP dyn link dependencies in binary distributions
A binary distribution contains a couple of ghc compiled binaries (most notably pwd
and ghc-pkg
from the utils/
directory) that are linked by the bootstrap compiler (i.e., the compiler also used to compile stage1). As result, these binaries include dependencies on those versions of dynamic libraries used by the bootstrap compiler. This can be fatal if the build machine has dynamic libraries that the machine where the binary distribution is installed doesn't have (in particular, this can be a problem with gmp on Mac OS X).
Here an example:
- Machine A has a macports installation of GHC 6.6.1 that is dependent on and uses macport's gmp.
- Machine A is used to generate a binary distribution for GHC 6.8.1, where the 6.6.1 compiler is used as the bootstrap compiler. The resulting GHC compiled binaries in the
utils/
directory of the generated distribution will now depend on the macports version of gmp. - Machine B has no gmp installed (which should be ok as the binary distribution has a version of gmp embedded which the newly installed compiler will use).
- When invoking
./configure
on Machine B,utils/pwd
of the binary distribution will be invoked which looks for the macports version of gmp in vain and fails.
This is a fundamental problem with dynlib dependencies, esp on gmp, which will affect all architectures to varying degrees. However, it is especially bad for Mac OS X, as the obvious solution - to link the binaries generated by the bootstrap compiler statically - does not work on Mac OS X (at least it does not on 10.5). It the flag -optl-static
is supplied, linking fails complaining that a library crt.o
could not be found.
Trac metadata
Trac field | Value |
---|---|
Version | 6.8.1 |
Type | Bug |
TypeOfFailure | OtherFailure |
Priority | normal |
Resolution | Unresolved |
Component | Build System |
Test case | |
Differential revisions | |
BlockedBy | |
Related | |
Blocking | |
CC | |
Operating system | MacOS X |
Architecture | Unknown |