Bug 232934 - security/nmap: Fix build with libc++ 7.0
Summary: security/nmap: Fix build with libc++ 7.0
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Some People
Assignee: Li-Wen Hsu
URL:
Keywords:
Depends on:
Blocks: 230355
  Show dependency treegraph
 
Reported: 2018-11-03 14:09 UTC by Dimitry Andric
Modified: 2018-12-27 08:52 UTC (History)
2 users (show)

See Also:
bugzilla: maintainer-feedback? (ohauer)


Attachments
Use ::bind instead plain bind (2.73 KB, patch)
2018-11-03 14:09 UTC, Dimitry Andric
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Dimitry Andric freebsd_committer freebsd_triage 2018-11-03 14:09:52 UTC
Created attachment 198913 [details]
Use ::bind instead plain bind

Building security/nmap on the clang700-import branch results in a bunch of errors due to std::bind conflicting with the good old bind(2):

EchoServer.cc -o EchoServer.o
EchoServer.cc:284:81: error: invalid operands to binary expression ('__bind<int &, sockaddr *, unsigned long>' and 'int')
    if( bind(master_sd, (struct sockaddr *)&server_addr6, sizeof(server_addr6)) != 0 ){
        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^  ~
/usr/include/c++/v1/utility:566:1: note: candidate template ignored: could not match 'pair' against '__bind'
operator!=(const pair<_T1,_T2>& __x, const pair<_T1,_T2>& __y)
^
[... much more of this ...]

See also http://package18.nyi.freebsd.org/data/headamd64PR230355-default/2018-10-09_18h22m03s/logs/errors/nmap-7.70.log

This is because nmap puts "using namespace std" in its headers.

Attached is a patch to replace the calls to bind(2) with ::bind.
Comment 1 commit-hook freebsd_committer freebsd_triage 2018-12-27 08:51:44 UTC
A commit references this bug:

Author: lwhsu
Date: Thu Dec 27 08:51:32 UTC 2018
New revision: 488514
URL: https://svnweb.freebsd.org/changeset/ports/488514

Log:
  - Fix build with libc++ 7.0

  PR:		232934
  Submitted by:	dim
  Approved by:	maintainer timeout
  Sponsored by:	The FreeBSD Foundation

Changes:
  head/security/nmap/files/patch-nping_EchoServer.cc