[GHC] #9074: GHC 7.8.2's ghci does not track missing symbols when loading non-Haskell object files

GHC ghc-devs at haskell.org
Sun Jul 6 10:38:51 UTC 2014


#9074: GHC 7.8.2's ghci does not track missing symbols when loading non-Haskell
object files
-------------------------------------+------------------------------------
        Reporter:  massysett         |            Owner:
            Type:  bug               |           Status:  new
        Priority:  normal            |        Milestone:
       Component:  Compiler          |          Version:  7.8.2
      Resolution:                    |         Keywords:
Operating System:  Unknown/Multiple  |     Architecture:  Unknown/Multiple
 Type of failure:  None/Unknown      |       Difficulty:  Unknown
       Test Case:                    |       Blocked By:
        Blocking:                    |  Related Tickets:
-------------------------------------+------------------------------------
Changes (by tulcod):

 * cc: tulcod (added)


Comment:

 I have a similar issue. In particular, my cabal project defines a C source
 file which in turn calls a C function from a library (outside of my
 project). But since cabal repl tries to load the in-project .o file first,
 it encounters undefined symbols (in particular, it errors on a struct
 which is declared "extern" by the library).

 This is not influenced by the order of the "c-sources" and "extra-
 libraries" in my .cabal file.


 PS: overview of symbols:
 My C source file (in-project): function myfunc, which calls the C function
 libfunc
 Library C header file (outside project): declares somestruct as "extern";
 defines libfunc "static inline", which uses a pointer to somestruct as an
 argument to libfunc_internal; declares libfunc_internal
 Library .so code: defines libfunc_internal, defines somestruct

 So "cabal repl" errors on "undefined symbol: somestruct"

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


More information about the ghc-tickets mailing list