Skip to content

GitLab

  • Menu
Projects Groups Snippets
    • Loading...
  • 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 4,841
    • Issues 4,841
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
  • Merge requests 456
    • Merge requests 456
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
    • Test Cases
  • Deployments
    • Deployments
    • Releases
  • Analytics
    • Analytics
    • CI/CD
    • Code review
    • Insights
    • Issue
    • Repository
    • Value stream
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Glasgow Haskell Compiler
  • GHCGHC
  • Issues
  • #11495

Closed
Open
Created Jan 26, 2016 by Thomas Miedema@thomie

TH_spliceE5_prof is failing with release candidate 8.0.1

TH_spliceE5_prof looks like this:

TH_spliceE5_prof::
	$(RM) TH_spliceE5_prof*.o TH_spliceE5_prof*.hi TH_spliceE5_prof*.dyn_o TH_spliceE5_prof*.dyn_hi TH_spliceE5_prof
	'$(TEST_HC)' $(TEST_HC_OPTS) $(HC_OPTS) $(ghcThWayFlags) --make -v0 TH_spliceE5_prof.hs -c
	'$(TEST_HC)' $(TEST_HC_OPTS) $(HC_OPTS) --make -v0 TH_spliceE5_prof.hs -prof -auto-all -osuf .p.o -o $@
	./$@

In 4905b83a, Simon added that $(ghcThWayFlags) to the first compilation command. With a release compiler, ghcThWayFlags defaults to -dynamic. But compiling with -dynamic doesn't produce .dyn_o files (you need -dynamic-too for that, which is enabled by -XTemplateHaskell, but **not** when compiling with -dynamic), so the second compilation results in:

TH_spliceE5_prof.hs:8:17: fatal:
    cannot find object file ‘./TH_spliceE5_prof_Lib.dyn_o’
    while linking an interpreted expression
make[1]: *** [TH_spliceE5_prof] Error 1

*** unexpected failure for TH_spliceE5_prof(normal)

Not passing -dynamic fixes the test. But in the function failNonStd in compiler/ghci/Linker.hs Simon suggests that passing -dynamic is necessary:

    Cannot load -prof objects when GHC is built with -dynamic
    To fix this, either:
      (1) Use -fexternal-interprter, or
      (2) Build the program twice: once with -dynamic, and then
          with -prof using -osuf to set a different object file suffix.

Some ideas for a solution:

  • change that message to not mention -dynamic
  • always turn on -dynamic-too when -XTemplateHaskell is on, also when using -dynamic
  • find the place where .dyn_o is expected, and teach it that .o might also be ok.
  • make -fexternal-interpreter the default. Delete the test and a whole bunch of other stuff.

It's all such a mess.

Edited Mar 10, 2019 by Thomas Miedema
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
Time tracking