Nmap Development mailing list archives

Re: FC4 compilation issue


From: Will Cladek <william.cladek () nrl navy mil>
Date: Wed, 18 Jan 2006 12:37:20 -0500

I have looked into this issue a bit further and found that it is related to the file 
/usr/include/c++/4.0.2/i386-redhat-linux/bits/gthr-default.h in gcc 4.0.2.  Specifically, the 
compilation problem is with the functions __gthrw_pthread_cancel and __gthrw_pthread_once, which are 
undefined as the error messages state.

Comparing it against version 4.0.0-8, which was able to compile it previously, the problem seems to 
be with the way these functions are declared.  In the earlier versions, the functions are simply 
referred to as pthread_cancel and pthread_once, with the labels declared as #pragma weak such that 
the linker shouldn't complain if it doesn't find the definition.  However, in the new version, these 
are defined as extern with a macro, and apparently never finding that function's definition, it 
craps out.

Anyway, my solution was to just edit this file and comment out the references to those functions, so 
that it never complains about them not being defined.  It compiles and appears to work normally.  I 
should also note that gcc was upgraded using the yum command, getting the Fedora rpms.  The problem 
may be resolved by just compiling and installing gcc from source, but I haven't tried that.

-Will

-------- Original Message --------
Subject: FC4 compilation issue
Date: Fri, 13 Jan 2006 13:21:23 -0500
From: Will Cladek <william.cladek () nrl navy mil>
To: nmap-dev () insecure org

I am attempting to compile the nmap source code on a Fedora Core 4 machine.  I was able to do so
successfully up until recently, when the sys admin grabbed the most recent updates which supposedly
included an update to gcc.  Now, when I try to compile, I get a series of error messages that are
triggered by:

g++ -Llibpcap  -Lnbase -Lnsock/src/  -o nmap main.o nmap.o targets.o tcpip.o nmap_error.o utils.o
idle_scan.o osscan.o output.o scan_engine.o timing.o charpool.o services.o protocols.o nmap_rpc.o
portlist.o NmapOps.o TargetGroup.o Target.o FingerPrintResults.o service_scan.o NmapOutputTable.o
MACLookup.o tty.o nmap_dns.o  -lnbase -lnsock libpcre/libpcre.a -lpcap -lssl -lcrypto
libdnet-stripped/src/.libs/libdnet.a -lm
nmap.o(.rodata+0x17c): undefined reference to `__gthrw_pthread_cancel(unsigned long)'

The version of gcc I'm using is version 4.0.2 20051125 (Red Hat 4.0.2-8), and I have tried this with
both versions 3.95 and 3.96 Beta 3, with each producing the same error when trying to compile.  Has
anyone else experienced this issue?

-Will



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


Current thread: