Skip to content

Duplicate symbols generated when Generics flag and syb-with-class "derive" used simultaneously

Attached file Foo.hs compiles fine using

ghc -c Foo.hs

But compiling using the -XGenerics flag yields duplicate symbols errors from the assembler:

jcheney@oreb:~/src/FreshLib/bug$ ghc -c -v -XGenerics Foo.hs
Glasgow Haskell Compiler, Version 6.10.1, for Haskell 98, stage 2 booted by GHC version 6.6
Using package config file: /usr/local/lib/ghc-6.10.1/./package.conf
Using package config file: /home/jcheney/.ghc/i386-linux-6.10.1/package.conf
hiding package base-3.0.3.0 to avoid conflict with later version base-4.0.0.0
wired-in package ghc-prim mapped to ghc-prim-0.1.0.0
wired-in package integer mapped to integer-0.1.0.0
wired-in package base mapped to base-4.0.0.0
wired-in package rts mapped to rts-1.0
wired-in package haskell98 mapped to haskell98-1.0.1.0
wired-in package syb mapped to syb-0.1.0.0
wired-in package template-haskell mapped to template-haskell-2.3.0.0
wired-in package dph-seq mapped to dph-seq-0.3
wired-in package dph-par mapped to dph-par-0.3
Hsc static flags: -static
Created temporary directory: /tmp/ghc15945_0
*** Checking old interface for main:Foo:
*** Parser:
*** Renamer/typechecker:
*** Simplify:
*** CorePrep:
*** ByteCodeGen:
Loading package ghc-prim ... linking ... done.
Loading package integer ... linking ... done.
Loading package base ... linking ... done.
Loading package syb ... linking ... done.
Loading package base-3.0.3.0 ... linking ... done.
Loading package array-0.2.0.0 ... linking ... done.
Loading package packedstring-0.1.0.1 ... linking ... done.
Loading package containers-0.2.0.0 ... linking ... done.
Loading package pretty-1.0.1.0 ... linking ... done.
Loading package template-haskell ... linking ... done.
Loading package bytestring-0.9.1.4 ... linking ... done.
Loading package syb-with-class-0.4 ... linking ... done.
*** Desugar:
    Result size = 230
*** Simplify:
    Result size = 141
    Result size = 141
*** Tidy Core:
    Result size = 141
writeBinIface: 9 Names
writeBinIface: 42 dict entries
*** CorePrep:
    Result size = 187
*** Stg2Stg:
*** CodeGen:
*** CodeOutput:
*** Assembler:
gcc -I. -c /tmp/ghc15945_0/ghc15945_0.s -o Foo.o
/tmp/ghc15945_0/ghc15945_0.s: Assembler messages:

/tmp/ghc15945_0/ghc15945_0.s:224:0:
     Error: symbol `Foo_zdgtoFoo_closure' is already defined

/tmp/ghc15945_0/ghc15945_0.s:233:0:
     Error: symbol `Foo_zdgtoFoo_info' is already defined

/tmp/ghc15945_0/ghc15945_0.s:273:0:
     Error: symbol `Foo_zdgfromFoo_closure' is already defined

/tmp/ghc15945_0/ghc15945_0.s:291:0:
     Error: symbol `Foo_zdgfromFoo_info' is already defined
*** Deleting temp files:
Deleting: /tmp/ghc15945_0/ghc15945_0.s
*** Deleting temp dirs:
Deleting: /tmp/ghc15945_0
Trac metadata
Trac field Value
Version 6.10.1
Type Bug
TypeOfFailure OtherFailure
Priority normal
Resolution Unresolved
Component Compiler
Test case
Differential revisions
BlockedBy
Related
Blocking
CC
Operating system
Architecture
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information