[GHC] #9875: ld -l:filename.dylib does not appear to be portable

GHC ghc-devs at haskell.org
Wed Dec 10 01:57:29 UTC 2014


#9875: ld -l:filename.dylib does not appear to be portable
------------------------------------+-------------------------------------
       Reporter:  ezyang            |                   Owner:
           Type:  bug               |                  Status:  new
       Priority:  high              |               Milestone:  7.10.1
      Component:  GHCi              |                 Version:  7.9
       Keywords:                    |        Operating System:  MacOS X
   Architecture:  Unknown/Multiple  |         Type of failure:  GHCi crash
     Difficulty:  Unknown           |               Test Case:  T2276_ghci
     Blocked By:                    |                Blocking:
Related Tickets:                    |  Differential Revisions:
------------------------------------+-------------------------------------
 In GHCi, we seem to use `-l:` to ask the linker to link a specific
 filename, instead of munging the filename.  Unfortunately, this does not
 appear to be universally supported by all versions of `ld`. Here is the
 manpage `ld` that comes with Mac OS X 10.10.1:

 {{{
    Options that control libraries
      -lx         This option tells the linker to search for libx.dylib or
 libx.a in
                  the library search path.  If string x is of the form y.o,
 then that
                  file is searched for in the same places, but without
 prepending
                  `lib' or appending `.a' or `.dylib' to the filename.
 }}}

 It causes T2276_ghci to fail:

 {{{
 --- /dev/null   2014-12-09 20:57:29.000000000 -0500
 +++ ./T2276_ghci.run.stderr     2014-12-09 20:57:30.000000000 -0500
 @@ -0,0 +1,3 @@
 +ld: library not found for -l:ghc75404_1.dylib
 +clang: error: linker command failed with exit code 1 (use -v to see
 invocation)
 +phase `Linker' failed (exitcode = 1)
 *** unexpected failure for T2276_ghci(ghci
 }}}

 Regression seems to have been introduced by:

 {{{
 commit 383733b9191a36e2d3f757700842dbc3855911d9
 Author: Peter Trommler <ptrommler at acm.org>
 Date:   Sun Nov 30 12:00:39 2014 -0600

     Fix obscure problem with using the system linker (#8935)
 }}}

 Probably we can fix it by not using colon and making sure the libraries we
 generate have the right file format.

--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/9875>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler


More information about the ghc-tickets mailing list