From owner-freebsd-ports-bugs@FreeBSD.ORG Fri Oct 5 14:00:15 2012 Return-Path: Delivered-To: freebsd-ports-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id A2C561065672 for ; Fri, 5 Oct 2012 14:00:15 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 69A0B8FC0C for ; Fri, 5 Oct 2012 14:00:15 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.5/8.14.5) with ESMTP id q95E0F8Y059868 for ; Fri, 5 Oct 2012 14:00:15 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.5/8.14.5/Submit) id q95E0F1j059867; Fri, 5 Oct 2012 14:00:15 GMT (envelope-from gnats) Resent-Date: Fri, 5 Oct 2012 14:00:15 GMT Resent-Message-Id: <201210051400.q95E0F1j059867@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-ports-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, arrowdodger <6yearold@gmail.com> Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 1FDD21065742 for ; Fri, 5 Oct 2012 13:50:47 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from red.freebsd.org (red.freebsd.org [IPv6:2001:4f8:fff6::22]) by mx1.freebsd.org (Postfix) with ESMTP id 0AF118FC0C for ; Fri, 5 Oct 2012 13:50:47 +0000 (UTC) Received: from red.freebsd.org (localhost [127.0.0.1]) by red.freebsd.org (8.14.5/8.14.5) with ESMTP id q95DokUC048269 for ; Fri, 5 Oct 2012 13:50:46 GMT (envelope-from nobody@red.freebsd.org) Received: (from nobody@localhost) by red.freebsd.org (8.14.5/8.14.5/Submit) id q95Dokqq048268; Fri, 5 Oct 2012 13:50:46 GMT (envelope-from nobody) Message-Id: <201210051350.q95Dokqq048268@red.freebsd.org> Date: Fri, 5 Oct 2012 13:50:46 GMT From: arrowdodger <6yearold@gmail.com> To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-3.1 Cc: Subject: ports/172358: [PATCH] security/nmap: Fix build with clang. X-BeenThere: freebsd-ports-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Ports bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Oct 2012 14:00:15 -0000 >Number: 172358 >Category: ports >Synopsis: [PATCH] security/nmap: Fix build with clang. >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-ports-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Fri Oct 05 14:00:14 UTC 2012 >Closed-Date: >Last-Modified: >Originator: arrowdodger >Release: >Organization: >Environment: >Description: This patch fixes build with clang and some buildsystem mess, which wasn't allowing me to build nmap with -stdlib=libc++. >How-To-Repeat: >Fix: Patch attached with submission follows: diff -ruN /usr/ports/security/nmap/Makefile ./Makefile --- /usr/ports/security/nmap/Makefile 2012-10-05 17:48:36.428550058 +0400 +++ ./Makefile 2012-10-05 17:46:53.337549058 +0400 @@ -33,7 +33,7 @@ CONFIGURE_ENV= LUA_INCDIR="${LUA_INCDIR}" LUA_LIBDIR="${LUA_LIBDIR}" # fix for gcc from ports -.if ${CC} != "cc" +.if ${CC} != "cc" && ${CC} !="clang" GCCLIBDIR_CMDS= ${CC} -print-file-name=libstdc++.so | ${SED} -e 's/libstdc++.so//' CONFIGURE_ARGS+=LDFLAGS="-L$$(${GCCLIBDIR_CMDS})" NDCC= true diff -ruN /usr/ports/security/nmap/files/patch-Makefile-cxxflags-fix ./files/patch-Makefile-cxxflags-fix --- /usr/ports/security/nmap/files/patch-Makefile-cxxflags-fix 1970-01-01 03:00:00.000000000 +0300 +++ ./files/patch-Makefile-cxxflags-fix 2012-10-05 11:07:04.000000000 +0400 @@ -0,0 +1,11 @@ +--- Makefile.in_ 2012-10-05 10:17:36.037550752 +0400 ++++ Makefile.in 2012-10-05 10:17:08.205548992 +0400 +@@ -46,7 +46,7 @@ + # DEFS += -DMTRACE=1 + CXXFLAGS = @CXXFLAGS@ $(DBGFLAGS) $(CCOPT) + CPPFLAGS = @CPPFLAGS@ $(DEFS) +-export CFLAGS = $(CXXFLAGS) ++export CFLAGS = @CFLAGS@ + # CFLAGS = $(DEFS) $(INCLS) + STATIC = + LDFLAGS = @LDFLAGS@ $(DBGFLAGS) $(STATIC) diff -ruN /usr/ports/security/nmap/files/patch-clang-fixes ./files/patch-clang-fixes --- /usr/ports/security/nmap/files/patch-clang-fixes 1970-01-01 03:00:00.000000000 +0300 +++ ./files/patch-clang-fixes 2012-10-05 17:45:06.143551658 +0400 @@ -0,0 +1,32 @@ +--- scan_engine.cc_ 2012-10-05 11:13:12.003554110 +0400 ++++ scan_engine.cc 2012-10-05 11:14:37.463551910 +0400 +@@ -2904,7 +2904,7 @@ + } + if (o.spoofsource && !bind_failed) { + o.SourceSockAddr(&ss, &sslen); +- if (bind(sd, (struct sockaddr*)&ss, sslen) != 0) { ++ if (::bind(sd, (struct sockaddr*)&ss, sslen) != 0) { + error("%s: Problem binding source address (%s), errno: %d", __func__, inet_socktop(&ss), socket_errno()); + perror("bind"); + bind_failed = 1; +--- traceroute.cc_ 2012-10-05 11:33:54.413552510 +0400 ++++ traceroute.cc 2012-10-05 11:34:15.976550750 +0400 +@@ -169,8 +169,6 @@ + /* A global random token used to distinguish this traceroute's probes from + those of other traceroutes possibly running on the same machine. */ + static u16 global_id; +-/* A global cache of known hops, indexed by TTL and address. */ +-static std::map hop_cache; + /* A list of timedout hops, which are not kept in hop_cache, so we can delete + all hops on occasion. */ + static std::list timedout_hops; +@@ -204,6 +202,9 @@ + } + }; + ++/* A global cache of known hops, indexed by TTL and address. */ ++static std::map hop_cache; ++ + struct Hop { + Hop *parent; + struct sockaddr_storage tag; diff -ruN /usr/ports/security/nmap/files/patch-configure-cxxflags-fix ./files/patch-configure-cxxflags-fix --- /usr/ports/security/nmap/files/patch-configure-cxxflags-fix 1970-01-01 03:00:00.000000000 +0300 +++ ./files/patch-configure-cxxflags-fix 2012-10-05 10:16:50.000000000 +0400 @@ -0,0 +1,11 @@ +--- _configure 2012-10-05 10:15:36.678551512 +0400 ++++ configure 2012-10-05 10:15:45.366548872 +0400 +@@ -2398,7 +2398,7 @@ + fi + if test -d /usr/local/include; then + CFLAGS="$CFLAGS -I/usr/local/include" +- CXXFLAGS="$CFLAGS -I/usr/local/include" ++ CXXFLAGS="$CXXFLAGS -I/usr/local/include" + fi + fi + >Release-Note: >Audit-Trail: >Unformatted: