Changes between Version 2 and Version 3 of Commentary/PositionIndependentCode


Ignore:
Timestamp:
Jun 27, 2007 10:45:49 AM (7 years ago)
Author:
clemens
Comment:

Add Linking on ELF, and mangling dynamic library names

Legend:

Unmodified
Added
Removed
Modified
  • Commentary/PositionIndependentCode

    v2 v3  
    282282 
    283283'''To be done:''' powerpc-linux, AIX/powerpc64-linux 
     284 
     285== Linking on ELF == 
     286 
     287To generate a DSO on ELF platform, we use GNU ld. Except for `-Bsymbolic`, ld is invoked regularly with the `-shared` option, and `-o` pointing to the output DSO file followed objects that in its sum compose an entire package. In Haskell, we assume that there is a one-to-one mapping from packages to DSOs. So, all parts of the base package will end up in a libHSbase.so. As intra-package references are not generated as PIC code, we have to supply all objects that make up a package, so that ld is able to resolve these references before writing a (.text) relocation free DSO library file. To enable these cross-object relocations GNU ld needs `-Bsymbolic`. 
     288 
     289== Mangling dynamic library names == 
     290 
     291As Haskell DSOs might end up in standard library paths, and as they might not be compatible among compilers and compiler version, we need to mangle their names to include the compiler and its version. 
     292 
     293The scheme is libHS''<package>''-''<package-version>''-''<compiler><compilerversion>''.so. E.g. libHSbase-2.1-ghc6.6.so