[PATCH] do not use -rpath-link linker option on Solaris

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


Looks good, just validated and pushed.

On 24 January 2013 13:28, Karel Gardas <karel.gardas at centrum.cz> wrote:
> This patch removes usage of -rpath-link option on Solaris OS since it is
> not supported by the Solaris' linker and its usage causes failures of a lot
> of `dyn' testcases
> ---
>  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..34d045c 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
> +                  rpath-link = if (platformOS platform) == OSSolaris2
> +                               then []
> +                               else ["-Wl,-rpath-link", "-Wl," ++ l]
> +              in ["-L" ++ l] ++ rpath-link ++ rpath
>           | otherwise = ["-L" ++ l]
>
>      let lib_paths = libraryPaths dflags
> --
> 1.7.3.2
>
>
> _______________________________________________
> ghc-devs mailing list
> ghc-devs at haskell.org
> http://www.haskell.org/mailman/listinfo/ghc-devs



More information about the ghc-devs mailing list