libtool
[Top][All Lists]
Advanced

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

Re: libtool C++ link bug with -lm functions with Sun Workshop compiler


From: Tim Mooney
Subject: Re: libtool C++ link bug with -lm functions with Sun Workshop compiler
Date: Thu, 20 Mar 2008 00:29:03 -0500 (CDT)
User-agent: Alpine 1.10 (SOC 962 2008-03-14)

In regard to: Re: libtool C++ link bug with -lm functions with Sun Workshop...:

On Wed, 19 Mar 2008, Tim Mooney wrote:
That means that doing something like


AC_INIT(lttest, 0.60.5)
AC_CONFIG_SRCDIR(configure.ac)
AC_PROG_CXX
AC_LANG([C++])

AC_CHECK_FUNCS(sqrt)
AC_OUTPUT


will always detect sqrt(), because the C++ compiler added `-lm -lc'
behind the scenes.

Then it seems like you did something wrong and libtool is not to blame.

I don't think so.  I discovered the problem with GNU aspell.  The snippet
I show above is just to illustrate the problem.

Perhaps it is not best to run most of your configure script using the C++ compiler. Only run the C++ compiler to test C++ things.

I don't disagree, but at the same time, if everything a project is going
to build is going to be compiled by the C++ compiler, doesn't it make
sense for the C++ compiler to actually do the tests?  If it's the C++
compiler that needs to see the prototype for sqrt(), and it's the C++
compiler that's going to initiate the link, it doesn't make a lot of
sense for the tests to be conducted by the C compiler.  That's hardly a
good test; there are several reasons why what the C compiler can see for
prototypes or test link might differ from what the C++ compiler would.

There are projects out there, beyond GNU aspell, that are using the C++
compiler for many of the configure tests.  Are they all wrong to do so?

Tim
--
Tim Mooney                              address@hidden
Information Technology Services         (701) 231-1076 (Voice)
Room 242-J6, IACC Building              (701) 231-8541 (Fax)
North Dakota State University, Fargo, ND 58105-5164




reply via email to

[Prev in Thread] Current Thread [Next in Thread]