Created attachment 150683 [details] Patch to add test for nxb-bin Fix similar to 193478, this time for native-xtools cross compile tools used by poudriere to build package for arm or mips, CC is defined as /nxb-bin/usr/bin/cc build log on armv6: http://mikael.urankar.free.fr/FreeBSD/arm/build_logs/nmap-6.47.log
Auto-assigned to maintainer ohauer@FreeBSD.org
This will only work on architectures where /nxb-bin/usr/bin/cc is really clang. I'll have to modify this to not break the cross build for mips. Probably something along the lines of an arch check.
(In reply to Sean Bruno from comment #2) > This will only work on architectures where /nxb-bin/usr/bin/cc is really > clang. > > I'll have to modify this to not break the cross build for mips. > > Probably something along the lines of an arch check. Hi Sean, feel free to to adjust the nmap port directly (you have my approval ;). If possible add a comment about the addition directly to port so it is clear which platform needs the adjustment.
Created attachment 150772 [details] use CHOSEN_COMPILER_TYPE Maybe we can use the CHOSEN_COMPILER_TYPE feature we have in the ports infrastructure (see attached patch)?
(In reply to mikael.urankar from comment #4) > Created attachment 150772 [details] > use CHOSEN_COMPILER_TYPE > > Maybe we can use the CHOSEN_COMPILER_TYPE feature we have in the ports > infrastructure (see attached patch)? Hm, looks promising but I suspect 8.x will run into the wrong .if statement. I'm not sure about 9.x which has gcc and clang in the base OS.
build logs with CHOSEN_COMPILER_TYPE patch: 8.4-amd64: http://mikael.urankar.free.fr/FreeBSD/arm/build_logs/84-amd64_nmap-6.47.log 9.3-amd64: http://mikael.urankar.free.fr/FreeBSD/arm/build_logs/93-amd64_nmap-6.47.log 10.1-amd64: http://mikael.urankar.free.fr/FreeBSD/arm/build_logs/101-amd64_nmap-6.47.log 11-amd64, port built with env CC=gcc49 CXX=g++49 CPP=cpp49 make -C /usr/ports/security/nmap (this is not a poudriere build log) http://mikael.urankar.free.fr/FreeBSD/arm/build_logs/11-amd64_nmap-6.47.log 11-mips: http://mikael.urankar.free.fr/FreeBSD/arm/build_logs/11-mips32_nmap-6.47.log 11-armv6: http://mikael.urankar.free.fr/FreeBSD/arm/build_logs/11-armv6_nmap-6.47.log
A commit references this bug: Author: ohauer Date: Thu Dec 25 13:29:30 UTC 2014 New revision: 375549 URL: https://svnweb.freebsd.org/changeset/ports/375549 Log: - fix build on arm/mips PR: 196065 Submitted by: mikael.urankar Changes: head/security/nmap/Makefile
Patch was committed, Thanks to Mikael for testing and providing the patch!
Hi Mikael and Sean, could you do a functional test with nmap? It seems something on the FreeBSD stack has changed on current. There is the following constrict in nmap/libnetutil/netutil.cc that seems to be no longer valid for current and generates corrupt IP checksums. snippet from nmap/libnetutil/netutil.cc: #if FREEBSD || BSDI || NETBSD || DEC || MACOSX ip->ip_len = ntohs(ip->ip_len); ip->ip_off = ntohs(ip->ip_off); #endif res = Sendto("send_ip_packet_sd", sd, packet, packetlen, 0, ... #if FREEBSD || BSDI || NETBSD || DEC || MACOSX ip->ip_len = htons(ip->ip_len); ip->ip_off = htons(ip->ip_off); #endif Simple patch to disable http://people.freebsd.org/~ohauer/diffs/patch-libnetutil_netutil.cc
I confirm the issue on head (r277215): sendto in send_ip_packet_sd: sendto(5, packet, 44, 0, 192.168.0.254, 16) => Invalid argument Offending packet: TCP 192.168.0.22:49911 > 192.168.0.254:21 S ttl=58 id=18569 iplen=11264 seq=2240940697 win=1024 <mss 1460> It goes away with your patch.
(In reply to Olli Hauer from comment #9) I think this should be good to commit no? Or is this being upstreamed?
It is send to upstream, and a fix is included in BETA5 (but I think with the wrong __FreeBSD_version) I will commit BETA5 with the proper fix [1], also remove the gcc/clang workarounds [2] 1) PR 202139 2) PR 200558
A commit references this bug: Author: ohauer Date: Sun Sep 27 10:32:33 UTC 2015 New revision: 398033 URL: https://svnweb.freebsd.org/changeset/ports/398033 Log: - update to 6.49BETA5 - use DOCS instead PORTDOCS - remove gcc workaround [1] - (hopefully) use the correct __FreeBSD_version for SOCK_RAW Changelog: https://nmap.org/changelog.html PR: 196065 [1] PR: 200558 [2] PR: 202139 [3] Submitted by: sbruno@ , mikael.urankar@gmail.com [1] Submitted by: truckman@ [2] Submitted by: trasz@ [3] Changes: head/security/nmap/Makefile head/security/nmap/distinfo head/security/nmap/files/patch-Makefile.in head/security/nmap/files/patch-configure head/security/nmap/files/patch-libdnet-stripped__configure head/security/nmap/files/patch-libdnet-stripped__src__eth-bsd.c head/security/nmap/files/patch-liblua-lua523 head/security/nmap/files/patch-liblua__Makefile head/security/nmap/files/patch-liblua__liolib.c head/security/nmap/files/patch-libnetutil_netutil.cc head/security/nmap/files/patch-nmap.cc head/security/nmap/files/patch-output.cc head/security/nmap/files/patch-tcpip.cc head/security/nmap/pkg-plist
Both issues should be solved with the last commit. Hopefully the fix from PR 200558 (removing all the compiler stuff) was the right thing.