[GHC] #9348: "Symbol not found" when using a shared library

GHC ghc-devs at haskell.org
Wed Jul 1 15:51:04 UTC 2015


#9348: "Symbol not found" when using a shared library
-------------------------------------+-----------------------------------
        Reporter:  alex.davis        |                   Owner:  simonmar
            Type:  bug               |                  Status:  new
        Priority:  normal            |               Milestone:
       Component:  Documentation     |                 Version:  7.8.3
      Resolution:                    |                Keywords:
Operating System:  Unknown/Multiple  |            Architecture:  x86
 Type of failure:  None/Unknown      |               Test Case:
      Blocked By:                    |                Blocking:
 Related Tickets:                    |  Differential Revisions:
-------------------------------------+-----------------------------------
Changes (by thomie):

 * cc: simonmar (removed)
 * os:  MacOS X => Unknown/Multiple
 * component:  Runtime System => Documentation


Comment:

 Replying to [comment:3 alex.davis]:
 > This represents a mismatch between the behavior of the compiler and its
 documentation. People looking to make shared libraries will read
 [https://www.haskell.org/ghc/docs/latest/html/users_guide/using-shared-
 libs.html#idp12506320 section 4.13.3 of the GHC user's guide]. They will
 see "To build Haskell modules that export a C API into a shared library
 use the -dynamic, -fPIC and -shared flag". No mention of linking the
 runtime system.

 The next sentence does say:
     "As before, the -dynamic flag specifies that this library links
 against the shared library versions of the rts and base package."

 And after that:
     "In principle you can use -shared without -dynamic in the link step.
 That means to statically link the rts all the base libraries into your new
 shared library. This would make a very big, but standalone shared library.
 On most platforms however that would require all the static libraries to
 have been built with -fPIC so that the code is suitable to include into a
 shared library and we do not do that at the moment."

 Improvements to the documentation are always welcome.

--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/9348#comment:4>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler


More information about the ghc-tickets mailing list