This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug other/32411] GCC Collect2 adds extra "-lm"'s to link commands even when not linking with "-lm".
- From: "rob1weld at aol dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 20 Jun 2007 22:26:50 -0000
- Subject: [Bug other/32411] GCC Collect2 adds extra "-lm"'s to link commands even when not linking with "-lm".
- References: <bug-32411-13830@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #4 from rob1weld at aol dot com 2007-06-20 22:26 -------
My complaint is that collect2 hitlers-in a couple of "-lm"s when I try to link
without it. Since I modifed __my__ copy of GCC source to not use "-lm" I wish
that collect2 did not add the extra library.
I should have to add "-lm" to _my_ GCC command line to make collect2 add "-lm"
- it ought not to do so on it's own. That is all I am bug-reporting about here.
---
On the other issue (which I do not complain about in this bug report) I noticed
that GCC is very lax about the contents of libm. An example is in the file
gcc-4_3-trunk/libstdc++-v3/linkage.m4 - it will let libm be _any_ version and
contain _any_ functions it cares to.
Line 501-503 of gcc-4_3-trunk/libstdc++-v3/linkage.m4 says:
dnl Check for complex versions of math functions of platform. This will
dnl always pass if libm is available, and fail if it isn't. If it is
dnl available, we assume we'll need it later, so add it to LIBS.
This is why _I_ am trying to standardize the math and attempt to create a patch
for consideration. If I can show that it works _correctly_ and _accurately_ on
all platforms then it would be a great benefit. GCC on Cygwin does have
accurate math, I would like to see the same on Linux. This is why I am fiddling
with this.
I accept that FSF has no formal plans to remove the usage of unknown versions
of libm being linked with GCC, resulting in unknown results.
My most recent test results are here. It works as well as it did 2 weeks ago.
http://gcc.gnu.org/ml/gcc-testresults/2007-06/msg00942.html
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32411