Opened 7 years ago

Last modified 17 months ago

#4451 new bug

Re-linking avoidance is too aggressive

Reported by: simonmar Owned by:
Priority: normal Milestone:
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 (13)

comment:1 Changed 7 years ago by simonpj

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

comment:2 Changed 7 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 6 years ago by simonmar

Priority: normalhigh

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

comment:4 Changed 6 years ago by simonmar

Owner: set to simonmar

comment:5 Changed 6 years ago by simonmar

Fixed (for Linux). changeset:814edf44433801e37318ce79082ac6991dbc87dd

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

comment:6 Changed 6 years ago by jwlato

Cc: jwlato@… added

comment:7 Changed 6 years ago by simonmar

Priority: highnormal

Not doing anything about this for 7.4.1.

comment:8 Changed 5 years ago by igloo


comment:9 Changed 4 years ago by simonmar

Owner: simonmar deleted

comment:10 Changed 3 years ago by thoughtpolice


Moving to 7.10.1.

comment:11 Changed 3 years ago by thoughtpolice


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 22 months ago by thoughtpolice


Milestone renamed

comment:13 Changed 17 months ago by thomie

Milestone: 8.0.1
Note: See TracTickets for help on using tickets.