On Mon, 2017-11-27 at 09:46 +0100, Jakub Jelinek wrote:

> There are several problems with forceful --as-needed:
> 1) forcing it everywhere is a workaround to broken tools that add -l*
> options just in case (like auto*, libtool, pkg-config)

pkg-config isn't broken here. Individual pc files might be.

It'd be pleasant if ld could warn you about excess linkage.

> 2) until recently, there was no way to enable the option for just one
> library and restore it afterwards, so many spots, including, but not limited
> to, gcc driver itself, do --as-needed -lgcc_s --no-as-needed, which if
> somebody forces --as-needed at the start of the linker command line has the
> effect that everything up to the -lgcc_s on the command line behaves
> --as-needed, and everything after it doesn't.  Since 3 years ago ld
> offers the --push-state/--pop-state options, so one can use
> --push-state --as-needed -lgcc_s --pop-state instead and that at the end
> restores the previous --as-needed behavior.  So, before turning it by
> default, you'd need to check everywhere where --no-as-needed is used and
> see if it is something where --push-state/--pop-state should be used.

libtool will throw away your attempts to use --as-needed and --push-
state anyway, because libtool is trash.

- ajax
_______________________________________________
devel mailing list -- devel@lists.fedoraproject.org
To unsubscribe send an email to devel-le...@lists.fedoraproject.org

Reply via email to