Nmap Development mailing list archives

Re: nmap doesn't compile on Solaris 9 with Sun Studio Pro


From: Leo Zhadanovsky <leozh () nbcs rutgers edu>
Date: Fri, 15 Dec 2006 14:33:42 -0500

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

I would prefer not to have it depend on libgcc.so and Sun Studio Pro is
more optimized for our platform.

I am not really worried about the warnings, but the thing that killed
the build is ld. What is this file M that is being passed to it?

Andreas Ericsson wrote:
Leo Zhadanovsky wrote:
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

I am trying to compile nmap 4.20 on Solaris 9 with Sun Studio Pro. Here
is my build environment:

PATH="/opt/SUNWspro/bin:${PATH}" \
CC="cc" CXX="CC" CPPFLAGS="-I/usr/local/include" \
LD="/usr/local/gnu/bin/ld" \
LDFLAGS="-L/usr/local/lib -R/usr/local/lib" \
export PATH CC CXX CPPFLAGS LD LDFLAGS
./configure --prefix=/usr/local --with-openssl=/usr/local/ssl
for i in `find . -name '*.cc'`; do mv $i $i.wrong; sed -e 's/__FUNCTION__/__FILE__/g' $i.wrong > $i; done

__FUNCTION__ and __FILE__ are C99 macros that always substitutes to the 
(surprise surprise) function and file (respectively) that they are used 
in. There's also __LINE__, although that doesn't seem to have bitten 
you. I have no idea what C++ standard they appear in.

The easiest way to go about this would probably be to add something 
along the lines of this to a header-file that's included from pretty 
much everywhere:
---%<---%<---
#ifndef __FUNCTION__
# define __FUNCTION__ "__FUNCTION__"
#endif
#ifndef __FILE__
# define __FILE__ "__FILE__"
#endif
---%<---%<---



It compiles, with some warnings and such, but then it dies saying this:

"nmap_dns.cc", line 849: Warning (Anachronism): Formal argument handler of type extern "C" 
void(*)(void*,void*,void*) in call to nsock_connect_udp(void*, void*, extern "C" void(*)(void*,void*,void*), void*, 
sockaddr*, unsigned, unsigned short) is being passed void(*)(void*,void*,void*).
"nmap_dns.cc", line 850: Warning (Anachronism): Formal argument handler of type extern "C" 
void(*)(void*,void*,void*) in call to nsock_read(void*, void*, extern "C" void(*)(void*,void*,void*), int, void*) 
is being passed void(*)(void*,void*,void*).
"nmap_dns.cc", line 1044: Warning: String literal converted to char* in formal argument fname in call to 
parse_etchosts(char*).
8 Warning(s) detected.
ld: fatal: file M: stat failed: No such file or directory
gmake: *** [makefile.dep] Error 1
error: Bad exit status from /var/local/tmp/rpm-tmp.5151 (%build)
How should I go about fixing this?


Seems like Sun Studio Pro doesn't like pure-C functions being passed as 
arguments to C++ functions (or something). I'm not vell-versed enough in 
Sun Studio Pro to give a more detailed analysis, but according to Google 
it appears this problem shows up for more projects than nmap. Any chance 
you can use the gnu tools to build this?


- --
Leo Zhadanovsky
Student Systems Programmer
Open System Solutions
Rutgers University
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.3 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFFgviWJR+ZhPEC9ewRAqukAJ9PTc4lDIiPebBhPjMIbobRdvW2FwCgnqlI
/ojqBixx2W6d8UdbziN+ja4=
=s/LJ
-----END PGP SIGNATURE-----

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


Current thread: