[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Linker flags --hash-style=both --no-copy-dt-needed-entries --as-needed



On 10/31/2011 05:46 PM, Joachim Breitner wrote:
> Dear GHC team,
> 
> Ubuntu applies the following patch to the ghc package¹:
> 
> diff -pruN 7.0.4-8/aclocal.m4 7.0.4-8ubuntu1/aclocal.m4
> --- 7.0.4-8/aclocal.m4	2011-10-31 16:22:09.000000000 +0000
> +++ 7.0.4-8ubuntu1/aclocal.m4	2011-10-31 16:22:20.000000000 +0000
> @@ -109,6 +109,10 @@ AC_DEFUN([FPTOOLS_SET_C_LD_FLAGS],
>          $4="$$4 -arch x86_64"
>          $5="$$5 -m64"
>          ;;
> +    *-linux*)
> +        $3="$$3 -Wl,--hash-style=both,--no-copy-dt-needed-entries,--as-needed"
> +        $4="$$4 --hash-style=both --no-copy-dt-needed-entries --as-needed"
> +        ;;
>      esac
>  
>      # If gcc knows about the stack protector, turn it off.
> 
> and it was requested² that this should be done in Debian as well. I
> generally feel uneasy diverging from upstream, as it could make
> debugging harder, so I’m contacting you first whether you might be
> interested in applying the change to ghc proper.
> 
> I did not dig deep into the reason behind the patch, but
> http://wiki.debian.org/ToolChain/DSOLinking seems to give some reasons,
> and the author of the patch, Matthias Klose, is CCed.

--no-copy-dt-needed-entries is now the default, it's not needed anymore.
--as-needed isn't the default for Debian, you should not add it. Leaves you with
-Wl,--hash-style=both for the architectures that support it.

I see that --build-id is still missing from this list.

>From my point of view, this is not related to upstream, but a decision by the
distribution which flags to use by default.

  Matthias


Reply to: