Opened 5 years ago

Last modified 4 weeks ago

#4451 new bug

Re-linking avoidance is too aggressive

Reported by: simonmar Owned by:
Priority: normal Milestone: 8.0.1
Component: Compiler Version: 7.1
Keywords: Cc: jwlato@…
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: Other Test Case:
Blocked By: Blocking:
Related Tickets: Differential Rev(s):
Wiki Page:


I'm constantly annoyed by having to rm the binary when I want to relink with different options (-rtsopts, -threaded, etc.). We only check the date of the binary against the date of the object files and relink if it is out of date, we should really check whether the options have changed or not too.

Similar problems exist in ordinary .hs recompilation (see #437), but the solutions will be different, so it makes sense to have a separate ticket.

One solution is to store information about what settings were in effect when linking in the binary, perhaps in a special section that isn't loaded during execution. We already compile a C file during linking to support -rtsopts, so we could add some magic asm to it, and then use objdump during linking to extract the information from the existing binary if there is one.

Change History (12)

comment:1 Changed 5 years ago by simonpj

Maybe we should always re-link? Simple, if brutal.

comment:2 Changed 5 years ago by simonmar

We could do that, but if I recall correctly the current relinking avoidance was added because people complained about unnecessary relinking happening every time they said cabal build.

comment:3 Changed 5 years ago by simonmar

  • Priority changed from normal to high

I'm getting more annoyed by the lack of this, so bumping priority.

comment:4 Changed 5 years ago by simonmar

  • Owner set to simonmar

comment:5 Changed 4 years ago by simonmar

Fixed (for Linux). changeset:814edf44433801e37318ce79082ac6991dbc87dd

Still ToDo: Windows, OS X, and add a test.

comment:6 Changed 4 years ago by jwlato

  • Cc jwlato@… added

comment:7 Changed 4 years ago by simonmar

  • Milestone changed from 7.4.1 to 7.6.1
  • Priority changed from high to normal

Not doing anything about this for 7.4.1.

comment:8 Changed 3 years ago by igloo

  • Milestone changed from 7.6.1 to 7.6.2

comment:9 Changed 2 years ago by simonmar

  • Owner simonmar deleted

comment:10 Changed 15 months ago by thoughtpolice

  • Milestone changed from 7.6.2 to 7.10.1

Moving to 7.10.1.

comment:11 Changed 10 months ago by thoughtpolice

  • Milestone changed from 7.10.1 to 7.12.1

Moving to 7.12.1 milestone; if you feel this is an error and should be addressed sooner, please move it back to the 7.10.1 milestone.

comment:12 Changed 4 weeks ago by thoughtpolice

  • Milestone changed from 7.12.1 to 8.0.1

Milestone renamed

Note: See TracTickets for help on using tickets.