Nmap Development mailing list archives

Re: [BUG] configure: lua version check is done with C++ compiler


From: John Spencer <maillist-nmap () barfooze de>
Date: Fri, 21 Sep 2012 03:26:02 +0200

On 09/12/2012 07:08 AM, David Fifield wrote:

> >
> > For some reason we are explicitly requesting a C++ compiler in the
> > liblua test, while we use a C compiler for almost everything else. Does
> > anyone know why? (See AC_LANG_PUSH and AC_LANG_POP.)


what does git blame say ?


> >
> > https://www.gnu.org/software/autoconf/manual/autoconf.html#Language-Choice
> >
> >      AC_LANG_PUSH(C++)
> >      AC_MSG_CHECKING([for lua version>= 502])
> >      AC_RUN_IFELSE([ AC_LANG_PROGRAM(
> >          [[#include<lua.h>]],
> >          [[if(LUA_VERSION_NUM<  502) return 1;]])],
> > have_lua=yes, have_lua=no, AC_MSG_RESULT(cross-compiling -- assuming yes); have_lua=yes)
> >      AC_LANG_POP(C++)
> >
>> >> it should be compiled with $(CC), not $(CXX)
>> >> it is a pure C library, and having it linked to libstdc++.so.6 is
>> >> undesirable
> >
> > You may have a point. But aren't you ultimately going to have to link
> > with libstdc++ when you link Nmap? Are you able to get a working binary
> > in your configuration?

yes, since parts of nmap are written in C++.
this is still a bug though.
if $CXX will be used to compile the embedded lua as well, it'll have an
entirely pointless dependency on libstdc++, which does nothing else than increasing memory commit pressure and slows down the startup of the component using it.

imo the best thing to do is to remove the LANG_PUSH and POP, and test if it still builds. if so, it is safe to commit.


_______________________________________________
Sent through the nmap-dev mailing list
http://cgi.insecure.org/mailman/listinfo/nmap-dev
Archived at http://seclists.org/nmap-dev/


Current thread: