Changes between Version 2 and Version 3 of SharedLibraries

Aug 2, 2007 9:27:37 AM (10 years ago)



  • SharedLibraries

    v2 v3  
    11= Shared Libraries: distribution and build-system issues =
     3This page is for discussing and documenting our strategy for
     5 * How shared libraries are found
     6 * How the build system works
     7 * How distributions (of GHC and programs built by GHC) work
     8 * Issues that affect Cabal
     10== Goals/Scenarios ==
     12First of all, we take it as a given that a normal GHC installation will be a good citizen on its host platform: shared libraries will go in the standard locations, and we'll use the system's normal method for finding them at link time and runtime.  Windows is an exception: there is no standard location for installing shared libraries on Windows.
     14So that we can support having multiple versions of GHC installed, shared libraries will have the GHC version number embedded, e.g. ``.
     16Here is what else we'd like to do:
     18 1. Support installing GHC outside of the standard location (e.g. in a home directory), and build
     19    binaries using that installation.  Multiple such installations should be supported.
     21 2. We need to build a distribution that supports choosing the install location at install time, for
     22    use in (1).
     24 3. Binaries that are built as part of the GHC build (e.g. stage2/ghc-inplace) need to run from
     25    the build tree.
     27= Proposed strategies =
     29== 1. Static linking ==
     31(1,2) Installations of GHC that are not in the standard locations use static linking and come with static libraries only.
     33(3) stage2/ghc-inplace is linked statically.
     35This is attractive, but there are some drawbacks:
     37 * we still need to build a distribution that uses shared libs.  Presumably we have to build both
     38   shared and static libs then.
     40 * the testsuite needs to build binaries against the shared libs for testing, without installing GHC.
     42 * we want the GHC binary in a shared-library installation to be dynamically linked, not statically linked.
     44== 2. Dynamic linking ==
    346= Platform support for locating shared libraries =