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

#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

#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 Resolution: | 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: | -------------------------------------+------------------------------------ Description changed by ezyang: Old description:
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
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.
New description:
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, prog003, T8696 and ghci058 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

#9875: ld -l:filename.dylib does not appear to be portable -------------------------------------+------------------------------------ Reporter: ezyang | Owner: trommler Type: bug | Status: new Priority: high | Milestone: 7.10.1 Component: GHCi | Version: 7.9 Resolution: | Keywords: Operating System: MacOS X | Architecture: Unknown/Multiple Type of failure: GHCi crash | Difficulty: Unknown Test Case: T2276_ghci | Blocked By: Blocking: 9845 | Related Tickets: Differential Revisions: | -------------------------------------+------------------------------------ Changes (by trommler): * owner: => trommler Comment: I'll take care of that. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9875#comment:3 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9875: ld -l:filename.dylib does not appear to be portable -------------------------------------+------------------------------------ Reporter: ezyang | Owner: trommler Type: bug | Status: patch Priority: high | Milestone: 7.10.1 Component: GHCi | Version: 7.9 Resolution: | Keywords: Operating System: MacOS X | Architecture: Unknown/Multiple Type of failure: GHCi crash | Difficulty: Unknown Test Case: T2276_ghci | Blocked By: Blocking: 9845 | Related Tickets: Differential Revisions: Phab:D579 | -------------------------------------+------------------------------------ Changes (by trommler): * status: new => patch * differential: => Phab:D579 Comment: I changed the linking as suggested and validated on Linux amd64. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9875#comment:4 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9875: ld -l:filename.dylib does not appear to be portable -------------------------------------+------------------------------------ Reporter: ezyang | Owner: Type: bug | Status: patch Priority: high | Milestone: 7.10.1 Component: GHCi | Version: 7.9 Resolution: | Keywords: Operating System: MacOS X | Architecture: Unknown/Multiple Type of failure: GHCi crash | Difficulty: Unknown Test Case: T2276_ghci | Blocked By: Blocking: 9845 | Related Tickets: Differential Revisions: Phab:D579 | -------------------------------------+------------------------------------ Changes (by trommler): * owner: trommler => -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9875#comment:5 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9875: ld -l:filename.dylib does not appear to be portable -------------------------------------+------------------------------------ Reporter: ezyang | Owner: Type: bug | Status: patch Priority: high | Milestone: 7.10.1 Component: GHCi | Version: 7.9 Resolution: | Keywords: Operating System: MacOS X | Architecture: Unknown/Multiple Type of failure: GHCi crash | Difficulty: Unknown Test Case: T2276_ghci | Blocked By: Blocking: 9845 | Related Tickets: Differential Revisions: Phab:D579 | -------------------------------------+------------------------------------ Comment (by ezyang): That's no good, we need to validate it on Mac OS X! ;) -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9875#comment:6 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9875: ld -l:filename.dylib does not appear to be portable -------------------------------------+------------------------------------ Reporter: ezyang | Owner: Type: bug | Status: patch Priority: high | Milestone: 7.10.1 Component: GHCi | Version: 7.9 Resolution: | Keywords: Operating System: MacOS X | Architecture: Unknown/Multiple Type of failure: GHCi crash | Difficulty: Unknown Test Case: T2276_ghci | Blocked By: Blocking: 9845 | Related Tickets: Differential Revisions: Phab:D579 | -------------------------------------+------------------------------------ Comment (by trommler): Replying to [comment:6 ezyang]:
That's no good, we need to validate it on Mac OS X! ;) Well, at least I did not introduce a regression on Linux :-)
Could you help out validating on Mac OS X? -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9875#comment:7 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9875: ld -l:filename.dylib does not appear to be portable -------------------------------------+------------------------------------ Reporter: ezyang | Owner: Type: bug | Status: patch Priority: high | Milestone: 7.10.1 Component: GHCi | Version: 7.9 Resolution: | Keywords: Operating System: MacOS X | Architecture: Unknown/Multiple Type of failure: GHCi crash | Difficulty: Unknown Test Case: T2276_ghci | Blocked By: Blocking: 9845 | Related Tickets: Differential Revisions: Phab:D579 | -------------------------------------+------------------------------------ Comment (by ezyang): OK, I validated on OS X. We just need to address the CR comments. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9875#comment:8 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9875: ld -l:filename.dylib does not appear to be portable -------------------------------------+------------------------------------ Reporter: ezyang | Owner: Type: bug | Status: patch Priority: high | Milestone: 7.10.1 Component: GHCi | Version: 7.9 Resolution: | Keywords: Operating System: MacOS X | Architecture: Unknown/Multiple Type of failure: GHCi crash | Difficulty: Unknown Test Case: T2276_ghci | Blocked By: Blocking: 9845 | Related Tickets: Differential Revisions: Phab:D579 | -------------------------------------+------------------------------------ Comment (by trommler): Replying to [comment:8 ezyang]:
OK, I validated on OS X. Thanks a lot! We just need to address the CR comments. Done.
-- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9875#comment:9 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9875: ld -l:filename.dylib does not appear to be portable
-------------------------------+-------------------------------------------
Reporter: ezyang | Owner:
Type: bug | Status: patch
Priority: high | Milestone: 7.10.1
Component: GHCi | Version: 7.9
Resolution: | Keywords:
Operating System: MacOS X | Architecture: Unknown/Multiple
Type of failure: GHCi crash | Test Case: T2276_ghci
Blocked By: | Blocking: 9845
Related Tickets: | Differential Revisions: Phab:D579
-------------------------------+-------------------------------------------
Comment (by Edward Z. Yang

#9875: ld -l:filename.dylib does not appear to be portable -------------------------------+------------------------------------------- Reporter: ezyang | Owner: Type: bug | Status: merge Priority: high | Milestone: 7.10.1 Component: GHCi | Version: 7.9 Resolution: | Keywords: Operating System: MacOS X | Architecture: Unknown/Multiple Type of failure: GHCi crash | Test Case: T2276_ghci Blocked By: | Blocking: 9845 Related Tickets: | Differential Revisions: Phab:D579 -------------------------------+------------------------------------------- Changes (by ezyang): * status: patch => merge -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9875#comment:11 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9875: ld -l:filename.dylib does not appear to be portable -------------------------------+------------------------------------------- Reporter: ezyang | Owner: Type: bug | Status: closed Priority: high | Milestone: 7.10.1 Component: GHCi | Version: 7.9 Resolution: fixed | Keywords: Operating System: MacOS X | Architecture: Unknown/Multiple Type of failure: GHCi crash | Test Case: T2276_ghci Blocked By: | Blocking: 9845 Related Tickets: | Differential Revisions: Phab:D579 -------------------------------+------------------------------------------- Changes (by hvr): * status: merge => closed * resolution: => fixed Comment: merged with ee20cbf547e8d7651f94ce7516f088dabc872a3e -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9875#comment:12 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC