[commit: ghc] master: do not use -rpath-link linker option on Solaris. (5388919)

David Terei davidterei at gmail.com
Fri Jan 25 02:32:04 CET 2013


Repository : ssh://darcs.haskell.org//srv/darcs/ghc

On branch  : master

http://hackage.haskell.org/trac/ghc/changeset/538891939b65d60014aebe7aab6ad5c72825979e

>---------------------------------------------------------------

commit 538891939b65d60014aebe7aab6ad5c72825979e
Author: David Terei <davidterei at gmail.com>
Date:   Thu Jan 24 13:45:56 2013 -0800

    do not use -rpath-link linker option on Solaris.
    
    Patch from Karel Gardas <karel.gardas at centrum.cz>.

>---------------------------------------------------------------

 compiler/main/DriverPipeline.hs |   11 ++++++++++-
 1 files changed, 10 insertions(+), 1 deletions(-)

diff --git a/compiler/main/DriverPipeline.hs b/compiler/main/DriverPipeline.hs
index f47aea7..c24bb51 100644
--- a/compiler/main/DriverPipeline.hs
+++ b/compiler/main/DriverPipeline.hs
@@ -1752,7 +1752,16 @@ linkBinary dflags o_files dep_packages = do
                   rpath = if gopt Opt_RPath dflags
                           then ["-Wl,-rpath",      "-Wl," ++ libpath]
                           else []
-              in ["-L" ++ l, "-Wl,-rpath-link", "-Wl," ++ l] ++ rpath
+                  -- Solaris 11's linker does not support -rpath-link option. It silently
+                  -- ignores it and then complains about next option which is -l<some
+                  -- dir> as being a directory and not expected object file, E.g
+                  -- ld: elf error: file
+                  -- /tmp/ghc-src/libraries/base/dist-install/build:
+                  -- elf_begin: I/O error: region read: Is a directory
+                  rpathlink = if (platformOS platform) == OSSolaris2
+                              then []
+                              else ["-Wl,-rpath-link", "-Wl," ++ l]
+              in ["-L" ++ l] ++ rpathlink ++ rpath
          | otherwise = ["-L" ++ l]
 
     let lib_paths = libraryPaths dflags





More information about the ghc-commits mailing list