Skip to content

GitLab

  • Menu
Projects Groups Snippets
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Sign in / Register
  • GHC GHC
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 4,829
    • Issues 4,829
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
  • Merge requests 447
    • Merge requests 447
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
    • Test Cases
  • Deployments
    • Deployments
    • Releases
  • Analytics
    • Analytics
    • CI/CD
    • Code review
    • Insights
    • Issue
    • Repository
    • Value stream
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Glasgow Haskell Compiler
  • GHCGHC
  • Issues
  • #1860

Closed
Open
Created Nov 09, 2007 by Manuel M T Chakravarty@mchakravartyReporter

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:

  1. Machine A has a macports installation of GHC 6.6.1 that is dependent on and uses macport's gmp.
  2. 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.
  3. 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).
  4. 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
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
Time tracking