TemplateHaskell leads to an "unknown symbol" error
Code:
{-# LANGUAGE TemplateHaskell #-}
module M where
import System.Console.Editline
import Data.Lens.Template
data S = S { _a :: EditLine }
makeLens ''S
When compiled with ghc link.hs
, everything is fine;
[1 of 1] Compiling M ( link.hs, link.o )
Loading package ghc-prim ... linking ... done.
Loading package integer-gmp ... linking ... done.
Loading package base ... linking ... done.
Loading package array-0.4.0.1 ... linking ... done.
Loading package deepseq-1.3.0.1 ... linking ... done.
Loading package containers-0.5.0.0 ... linking ... done.
Loading package bytestring-0.10.0.2 ... linking ... done.
Loading package tagged-0.7.1 ... linking ... done.
Loading package transformers-0.3.0.0 ... linking ... done.
Loading package transformers-compat-0.1.1.1 ... linking ... done.
Loading package contravariant-0.4.4 ... linking ... done.
Loading package distributive-0.4.3.1 ... linking ... done.
Loading package mtl-2.1.3.1 ... linking ... done.
Loading package text-1.1.0.1 ... linking ... done.
Loading package hashable-1.2.1.0 ... linking ... done.
Loading package nats-0.1.2 ... linking ... done.
Loading package unordered-containers-0.2.3.3 ... linking ... done.
Loading package semigroups-0.12.2 ... linking ... done.
Loading package comonad-4.0.1 ... linking ... done.
Loading package semigroupoids-4.0.1 ... linking ... done.
Loading package data-lens-2.10.4 ... linking ... done.
Loading package pretty-1.1.1.0 ... linking ... done.
Loading package template-haskell ... linking ... done.
Loading package data-lens-template-2.1.8 ... linking ... done.
However, when compiling with ghc -package-id editline-0.2.1.1-ef91ae78e7ea1b9142c2fb0b84e85c11 link.hs
, I get
[1 of 1] Compiling M ( link.hs, link.o )
Loading package ghc-prim ... linking ... done.
Loading package integer-gmp ... linking ... done.
Loading package base ... linking ... done.
Loading package editline-0.2.1.1 ... linking ... ghc: /home/feuerbach/work/.cabal-sandbox/lib/i386-linux-ghc-7.6.3/editline-0.2.1.1/HSeditline-0.2.1.1.o: unknown symbol `el_reset'
ghc: unable to load package `editline-0.2.1.1'
This is a problem because that's how cabal invokes ghc.
This looks similar to #4899, except there's nothing "non-standard" here (no profiling or dynamic linking).
Trac metadata
Trac field | Value |
---|---|
Version | 7.6.3 |
Type | Bug |
TypeOfFailure | OtherFailure |
Priority | normal |
Resolution | Unresolved |
Component | Compiler |
Test case | |
Differential revisions | |
BlockedBy | |
Related | |
Blocking | |
CC | |
Operating system | |
Architecture |