

Reinplace -W $|g" \Īlternatively, sometimes you can just add it to the build line by adding a configure.cxxflags-append - caution though, -stdlib=XYZ is only supported by clang, so you have to test to make sure that the build compiler is clang if you do this. Patchfiles-append patch-compiler_flags.diff \
#MACPORTS NMAP PATCH#
botan does a fix for this, with a patch and then a reinplace: To add the -stdlib to the build line instead, you would need to dig in a bit to the build.
#MACPORTS NMAP INSTALL#
Sudo port -v install nmap piler=macports-clang-5.0 If your clang-5.0 is installed correctly, with the +defaultlibcxx variant on your system, building nmap with clang-5.0 should work correctly, ie do this:

The +defaultlibcxx variant makes clang-5.0 add -stdlib=libc++ if none is specified, rather than -stdlib=libstdc++, which is what you want it to do on your system. It can be seen by the default variants for clang-5.0, which, on your system, should be clang-5.0 +analyzer +defaultlibcxx +libstdcxx. I changed clang-5.0 and newer to do exactly that on systems configured to used libc++ in their nf, like yours. This matches the behaviour of all the newer systems, 10.9 and newer. However, this is a bit of a PITA.Īnother fix is to make clang default to adding -stdlib=libc++ on your libc++ system which is configured that way. The proper fix is to force the stdlib onto the build and link lines. That causes the build to fail because it does not find all the proper symbols that it is looking for, as noted by the std::_1:* errors. By default, clang on systems < 10.9 examines the build and link lines for a -stdlib setting, and if none is found, clang defaults to adding -stdlib=libstdc++. When nmap builds and links, it does not specify a stdlib setting on the build line. :info:build _ZL15filename_to_urlPKc in NmapOps.o :info:build "std::_1::basic_string, std::_1::allocator >::find_first_of(char const*, unsigned long, unsigned long) const", referenced from: :info:build Undefined symbols for architecture x86_64: :info:build /usr/bin/clang++ -L/opt/local/lib -Wl,-headerpad_max_install_names -arch x86_64 -L/opt/local/lib -Lnbase -Lnsock/src/ -o nmap charpool.o FingerPrintResults.o FPEngine.o FPModel.o idle_scan.o MACLookup.o nmap_dns.o nmap_error.o nmap.o nmap_ftp.o NmapOps.o NmapOutputTable.o nmap_tty.o osscan2.o osscan.o output.o payload.o portlist.o portreasons.o protocols.o scan_engine.o scan_engine_connect.o scan_engine_raw.o scan_lists.o service_scan.o services.o NewTargets.o TargetGroup.o Target.o targets.o tcpip.o timing.o traceroute.o utils.o xml.o nse_main.o nse_utility.o nse_nsock.o nse_dnet.o nse_fs.o nse_nmaplib.o nse_debug.o nse_pcrelib.o nse_lpeg.o nse_openssl.o nse_ssl_cert.o nse_libssh2.o nse_zlib.o main.o -lnsock -lnbase -lpcre -lpcap libssh2/lib/libssh2.a -lssl -lcrypto -lz libnetutil/libnetutil.a.
