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

#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 Keywords: | Operating System: Unknown/Multiple Architecture: Unknown/Multiple | Type of failure: None/Unknown Difficulty: Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | ------------------------------------+------------------------------------- I have a package that bundles in C library sources. I never had a problem with this when using GHC 7.6. In GHC 7.8, the order of the c-sources in the cabal file now matters. Sources must be listed earlier if they have symbols that subsequently loaded object files will need. If the c-sources are in the wrong order, when running "cabal repl" I get Loading object (static) dist/build/decnumber/src/decQuad.o ... ghc: panic! (the 'impossible' happened) (GHC version 7.8.2 for x86_64-unknown-linux): Loading temp shared object failed: /tmp/ghc14294_0/ghc14294_1.so: undefined symbol: DECSTICKYTAB Please report this as a GHC bug: http://www.haskell.org/ghc/reportabug When using the same code and cabal file with GHC 7.6, "cabal repl" works fine: GHCi loads each static object (regardless of ordering in the cabal file), links up the necessary symbols, and launches successfully. Haskell Cafe discussion here: http://www.haskell.org/pipermail/haskell-cafe/2014-May/114041.html -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9074 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#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 choenerzs): * cc: choener@… (added) -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9074#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#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

#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: -------------------------------------+------------------------------------ Comment (by mietek): '''tulcod''', I opened #9277 to track an issue which appears similar to yours. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9074#comment:3 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#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: | Architecture: Unknown/Multiple Unknown/Multiple | Difficulty: Unknown Type of failure: | Blocked By: None/Unknown | Related Tickets: Test Case: | Blocking: | Differential Revisions: | -------------------------------------+------------------------------------- Comment (by crockeea): I'm also experiencing this problem. The problem affects GHC 7.8.2 and GHCi. I'm loading files using: : ghci[i] Foo Objects/*.o which fails: ghc: panic! (the 'impossible' happened) (GHC version 7.8.2 for x86_64-unknown-linux): Loading temp shared object failed: /tmp/ghc20682_0/ghc20682_3.so: undefined symbol: foo If I explicitly list out each object file in the "correct" order, I can get GHC to compile. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9074#comment:4 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#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: | Architecture: Unknown/Multiple Unknown/Multiple | Difficulty: Unknown Type of failure: | Blocked By: None/Unknown | Related Tickets: Test Case: | Blocking: | Differential Revisions: | -------------------------------------+------------------------------------- Changes (by crockeea): * cc: crockeea (added) -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9074#comment:5 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9074: GHC 7.8.2's ghci does not track missing symbols when loading non-Haskell object files -------------------------------------+------------------------------------- Reporter: massysett | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.8.2 (Linking) | Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Description changed by bgamari: Old description:
I have a package that bundles in C library sources. I never had a problem with this when using GHC 7.6.
In GHC 7.8, the order of the c-sources in the cabal file now matters. Sources must be listed earlier if they have symbols that subsequently loaded object files will need. If the c-sources are in the wrong order, when running "cabal repl" I get
Loading object (static) dist/build/decnumber/src/decQuad.o ... ghc: panic! (the 'impossible' happened) (GHC version 7.8.2 for x86_64-unknown-linux): Loading temp shared object failed: /tmp/ghc14294_0/ghc14294_1.so: undefined symbol: DECSTICKYTAB
Please report this as a GHC bug: http://www.haskell.org/ghc/reportabug
When using the same code and cabal file with GHC 7.6, "cabal repl" works fine: GHCi loads each static object (regardless of ordering in the cabal file), links up the necessary symbols, and launches successfully.
Haskell Cafe discussion here:
http://www.haskell.org/pipermail/haskell-cafe/2014-May/114041.html
New description: I have a package that bundles in C library sources. I never had a problem with this when using GHC 7.6. In GHC 7.8, the order of the c-sources in the cabal file now matters. Sources must be listed earlier if they have symbols that subsequently loaded object files will need. If the c-sources are in the wrong order, when running "cabal repl" I get {{{ Loading object (static) dist/build/decnumber/src/decQuad.o ... ghc: panic! (the 'impossible' happened) (GHC version 7.8.2 for x86_64-unknown-linux): Loading temp shared object failed: /tmp/ghc14294_0/ghc14294_1.so: undefined symbol: DECSTICKYTAB Please report this as a GHC bug: http://www.haskell.org/ghc/reportabug }}} When using the same code and cabal file with GHC 7.6, "cabal repl" works fine: GHCi loads each static object (regardless of ordering in the cabal file), links up the necessary symbols, and launches successfully. Haskell Cafe discussion here: http://www.haskell.org/pipermail/haskell-cafe/2014-May/114041.html -- -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9074#comment:7 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC