One concern is that -Wl,--as-needed requires greater accuracy with the ordering of objects and
libraries as you link. Also, if a package uses a library indirectly, i.e. A uses C via B: A -> B -> C,
--as-needed will peel away C and break A unless A explicitly mentions its need for C. Of course
that should be the case already, but you're going to see a number of weaknesses in the various
packages revealed by adding --as-needed.
On Monday, November 13, 2017 5:48 PM, Tomasz Kłoczko <kloczko.tomasz@xxxxxxxxx> wrote:
On 13 November 2017 at 22:01, Tomasz Kłoczko <kloczko.tomasz@xxxxxxxxx> wrote:
[..]
> In other words -Wl,--as-needed should be used everywhere WITHOUT exceptions.
> Easiest way apply this globally in Fedora is add --as-needed in
> /usr/lib/rpm/redhat/redhat-hardened-ld spec file by apply patch:
>
> --- /usr/lib/rpm/redhat/redhat-hardened-ld.orig
> +++ /usr/lib/rpm/redhat/redhat-hardened-ld
> @@ -2,4 +2,4 @@
> + %{!static:%{!shared:%{!r:-pie}}}
>
> *link:
> -+ -z now
> ++ -z now --as-needed
Just created pull request with above change:
https://src.fedoraproject.org/rpms/redhat-rpm-config/pull-request/3#request_diff
kloczek
--
Tomasz Kłoczko | LinkedIn: http://lnkd.in/FXPWxH
_______________________________________________
devel mailing list -- devel@xxxxxxxxxxxxxxxxxxxxxxx
To unsubscribe send an email to devel-leave@xxxxxxxxxxxxxxxxxxxxxxx
[..]
> In other words -Wl,--as-needed should be used everywhere WITHOUT exceptions.
> Easiest way apply this globally in Fedora is add --as-needed in
> /usr/lib/rpm/redhat/redhat-hardened-ld spec file by apply patch:
>
> --- /usr/lib/rpm/redhat/redhat-hardened-ld.orig
> +++ /usr/lib/rpm/redhat/redhat-hardened-ld
> @@ -2,4 +2,4 @@
> + %{!static:%{!shared:%{!r:-pie}}}
>
> *link:
> -+ -z now
> ++ -z now --as-needed
Just created pull request with above change:
https://src.fedoraproject.org/rpms/redhat-rpm-config/pull-request/3#request_diff
kloczek
--
Tomasz Kłoczko | LinkedIn: http://lnkd.in/FXPWxH
_______________________________________________
devel mailing list -- devel@xxxxxxxxxxxxxxxxxxxxxxx
To unsubscribe send an email to devel-leave@xxxxxxxxxxxxxxxxxxxxxxx
_______________________________________________ devel mailing list -- devel@xxxxxxxxxxxxxxxxxxxxxxx To unsubscribe send an email to devel-leave@xxxxxxxxxxxxxxxxxxxxxxx