Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Sign in / Register
  • GHC GHC
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 5,250
    • Issues 5,250
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
  • Merge requests 561
    • Merge requests 561
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
    • Test Cases
  • Deployments
    • Deployments
    • Releases
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Code review
    • Insights
    • Issue
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Glasgow Haskell CompilerGlasgow Haskell Compiler
  • GHCGHC
  • Issues
  • #5554
Closed
Open
Issue created Oct 13, 2011 by Iustin Pop@iustinContributor

Strange interaction between "-osuf", profiling and TemplateHaskell

I see a strange behaviour of profiling + TemplateHaskell and the -osuf option.

I'm trying to compile (any) TemplateHaskell code with profiling in the following way:

$ ghc --make -O example

[1 of 2] Compiling Th               ( Th.hs, Th.o )
[2 of 2] Compiling Main             ( example.hs, example.o )
Loading package ghc-prim ... linking ... done.
Loading package integer-gmp ... linking ... done.
Loading package base ... linking ... done.
Loading package array-0.3.0.0 ... linking ... done.
Loading package containers-0.3.0.0 ... linking ... done.
Loading package pretty-1.0.1.1 ... linking ... done.
Loading package template-haskell ... linking ... done.
Linking example ...

$ ghc --make -O -prof -auto-all -osuf .prof.o example
[1 of 2] Compiling Th               ( Th.hs, Th.prof.o )
[2 of 2] Compiling Main             ( example.hs, example.prof.o )
Loading package ghc-prim ... linking ... done.
Loading package integer-gmp ... linking ... done.
Loading package base ... linking ... done.
Loading package array-0.3.0.0 ... linking ... done.
Loading package containers-0.3.0.0 ... linking ... done.
Loading package pretty-1.0.1.1 ... linking ... done.
Loading package template-haskell ... linking ... done.
ghc: ./Th.prof.o: unknown symbol `CCCS'

However, if in the second invocation the -osuf .prof.o is changed to -osuf prof_o, then everything works fine:

$ ghc --make -O -prof -auto-all -osuf .prof_o example
[1 of 2] Compiling Th               ( Th.hs, Th.prof_o )
[2 of 2] Compiling Main             ( example.hs, example.prof_o )
Loading package ghc-prim ... linking ... done.
Loading package integer-gmp ... linking ... done.
Loading package base ... linking ... done.
Loading package array-0.3.0.0 ... linking ... done.
Loading package containers-0.3.0.0 ... linking ... done.
Loading package pretty-1.0.1.1 ... linking ... done.
Loading package template-haskell ... linking ... done.
Linking example ...

Sadly I don't know how to debug this, but it should be reproduceable with any TH code, with all of 6.12, 7.0.3 and 7.2.1.

If the .o suffix is speciall (even in the form of .prof.o), then it would be good to document this; the GHC doc says right now “you can choose any suffix that isn't the normal object suffix here”.

Trac metadata
Trac field Value
Version 7.2.1
Type Bug
TypeOfFailure OtherFailure
Priority normal
Resolution Unresolved
Component Template Haskell
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
Assignee
Assign to
Time tracking