Opened 5 years ago

Closed 5 years ago

Last modified 5 years ago

#7315 closed bug (fixed)

Link error while compiling executables

Reported by: bgamari Owned by:
Priority: normal Milestone:
Component: Compiler Version: 7.7
Keywords: Cc:
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: None/Unknown Test Case:
Blocked By: Blocking:
Related Tickets: Differential Rev(s):
Wiki Page:

Description (last modified by igloo)

On GHC master (ef786b6cbc5f67a673bf8c10be5311317c1e7b88) attempting to build any executable results in a linker error. For instance, cabal install cmdargs results in,

     [37 of 37] Compiling Main             ( Main.hs, dist/build/cmdargs/cmdargs-tmp/Main.o )
     Linking dist/build/cmdargs/cmdargs ...
     /usr/bin/ld: cannot find -lHStransformers-
     collect2: error: ld returned 1 exit status
     cabal: Error: some packages failed to install:
     cmdargs-0.10 failed during the building phase. The exception was:
     ExitFailure 1

Yet transformers appears to be installed (although the version suffix doesn't appear to match),

     $ ls ~/.cabal/lib/transformers-
     Control  Data  HStransformers-  libHStransformers-  libHStransformers-

Change History (3)

comment:1 Changed 5 years ago by igloo

Description: modified (diff)
difficulty: Unknown

comment:2 Changed 5 years ago by igloo

Resolution: fixed
Status: newclosed

Ah, your GHC defaults to using dynamic libraries, but the cabal you have doesn't know that, so it isn't building the dynamic library of the program's dependencies. If you use the --enable-shared flag to cabal then it should work. Alternatively, building cabal against the HEAD Cabal library should do so by default.

comment:3 Changed 5 years ago by bgamari

Indeed that did the trick. Thanks.

Note: See TracTickets for help on using tickets.