Planner & building with --as-needed

Maurice van der Pot <griffon26-bCGDfOjggl9Wk0Htik3J/[email protected]>
Newsgroups gmane.comp.gnome.apps.planner.devel
Message-ID <[email protected]>
Patryk Zawadzki wrote in http://bugzilla.gnome.org/show_bug.cgi?id=528582:
> I am not sure if you are familiar with gcc4's --as-needed switch. Sorry if you
> know all this:
> 
> --as-needed causes the linker to check each linked library for symbols used in
> the object files. If there are none then the library is dropped and the
> resulting binary does not link to it. This is very useful as most projects
> specify only one set of libraries for all the binaries they produce. This
> results in uneeded dependencies in some of them.
> 
> On the other hand when a project forgets to specify all the direct dependencies
> it can happen that without --as-needed one of the linked libraries accidentally
> pulls all the missing deps and linking works fine (in your case some other
> library pulls the libm dependency while it should not). After recompiling the
> library with --as-needed the libm dependency will go away and planner fails to
> link with unresolved symbols.
> 
> In any case if a project uses symbols from a particular library it should
> explicitly link against it, not depending on some other library pulling the
> necessary dependencies and this is what the above patch does.

Yes, I know, but I was expecting my build to fail as well when using
--as-needed. However, I tried your command line and it worked fine.

I noticed that for some reason -lm is added anyway, but I've been
unable to locate any library that caused it. And even if there is such a
library, why would this not happen on your system?

Maurice.

-- 
Maurice van der Pot

Gentoo Linux Developer   [email protected]    http://www.gentoo.org
Gnome Planner Developer  griffon26-bCGDfOjggl9Wk0Htik3J/[email protected]  http://live.gnome.org/Planner

_______________________________________________
Planner-dev-list mailing list
[email protected]
http://mail.gnome.org/mailman/listinfo/planner-dev-list
signature.asc (application/pgp-signature, 189 B)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.7 (GNU/Linux)

iD8DBQFIC2paMGnpIbeahxwRAgSNAJ40qXyJaWEL18x5RrBSEFx77MNDBACdEfLG
0plM0dj8CVgtMg5ybj0r4MA=
=8hpn
-----END PGP SIGNATURE-----
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.