#3799: undefined symbols and undefined references possibly related to template
haskell
---------------------------------+------------------------------------------
  Reporter:  JeremyShaw          |          Owner:                              
                 
      Type:  bug                 |         Status:  new                         
                 
  Priority:  normal              |      Milestone:                              
                 
 Component:  Compiler            |        Version:  6.12.1                      
                 
Resolution:                      |       Keywords:  undefined symbols 
references template haskell
Difficulty:                      |             Os:  Unknown/Multiple            
                 
  Testcase:                      |   Architecture:  Unknown/Multiple            
                 
   Failure:  Compile-time crash  |  
---------------------------------+------------------------------------------
Comment (by simonpj):

 Another common factor is that all the missing things look like
 {{{
 
sybzmwithzmclasszm0zi6zi1_DataziGenericsziSYBziWithClassziInstances_constrZMad6fZN_closure
 }}}
 Or possibly `dataType` instead of `constr`.  Undoing the z-encoding we
 get:
 {{{
 syb-with-
 class-0.6.1_Data.Generics.SYB.WithClass.Instances_constr[ad6f]_closure
 }}}
 And indeed, I download `syb-with-class` and compile `Instances` with
 `-ddump-splices` I see
 {{{
 Data/Generics/SYB/WithClass/Instances.hs:1:0:
     Data/Generics/SYB/WithClass/Instances.hs:1:0: Splicing declarations
         deriveData ['ByteString]
       ======>
         Data/Generics/SYB/WithClass/Instances.hs:726:3-27
         constr[a2YC] :: Constr
         constr[a2YC] = mkConstr dataType[a2YB] "PS" "" Prefix
         dataType[a2YB] :: DataType
         dataType[a2YB] = mkDataType "ByteString" [constr[a2YC]]
 }}}
 Those are pretty weird names for top-level bindings!  But still, it should
 work fine, because they are only used via the instance declaration.

 But it does make me wonder: could you have compiled syb-with-class twice?
 Each time you compile it you could potentially get different names.

 If it happens repeatably, do
 {{{
 ghc --show-iface Instances.hi
 }}}
 where the `Instances.hi` file is the one from the syb-with-class package.
 Check the names of the top level bindings (as above).  Are they the same
 as you see with `nm Instances.o`?

 Now when compiling `Server.hs` (which gets the offending symbols), use
 `-ddump-if-trace` to see what interface files it is loading, and check
 that it loads the correct `Instances.hi`.

 Does the same thing happen in file-at-a-time batch mode, or just with
 `--make`?

 Somehow or other, I bet that you are getting two different `Instances.hi`
 files, or an `Instances.hi` that does not line up with the `Instances.o`.

 Simon

-- 
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/3799#comment:3>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
_______________________________________________
Glasgow-haskell-bugs mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs

Reply via email to