Bug 227490 - net/libdnet: compilation error
Summary: net/libdnet: compilation error
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: onatan
URL:
Keywords: patch-ready
Depends on:
Blocks:
 
Reported: 2018-04-13 10:48 UTC by oz42
Modified: 2018-04-18 10:55 UTC (History)
2 users (show)

See Also:
eugen: maintainer-feedback-


Attachments
build.log (3.86 KB, application/x-zip-compressed)
2018-04-16 08:42 UTC, oz42
no flags Details
disable non-working ipfw1 support (826 bytes, patch)
2018-04-16 11:33 UTC, Eugene Grosbein
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description oz42 2018-04-13 10:48:09 UTC
On FreeBSD 11.1-RELEASE-p9 amd64, compilation fails:


--- ip.lo ---
/bin/sh ../libtool --mode=compile cc -DHAVE_CONFIG_H -I. -I. -I../include   -I../include   -O2 -pipe  -fstack-protector -fno-strict-aliasing -Wall -c -o ip.lo `test -f 'ip.c' || echo './'`ip.c
--- fw-ipfw.lo ---
fw-ipfw.c:52:14: error: no member named 'fw_in_if' in 'struct ip_fw'
                            ipfw->fw_in_if.fu_via_if.name,
                            ~~~~  ^
fw-ipfw.c:53:15: error: no member named 'fw_in_if' in 'struct ip_fw'
                            &ipfw->fw_in_if.fu_via_if.unit);
                             ~~~~  ^
fw-ipfw.c:54:10: error: no member named 'fw_flg' in 'struct ip_fw'
                        ipfw->fw_flg |= IP_FW_F_IIFNAME;
                        ~~~~  ^
fw-ipfw.c:54:20: error: use of undeclared identifier 'IP_FW_F_IIFNAME'
                        ipfw->fw_flg |= IP_FW_F_IIFNAME;
                                        ^
fw-ipfw.c:56:9: error: no member named 'fw_flg' in 'struct ip_fw'
                ipfw->fw_flg |= IP_FW_F_IN;
                ~~~~  ^
fw-ipfw.c:56:19: error: use of undeclared identifier 'IP_FW_F_IN'
                ipfw->fw_flg |= IP_FW_F_IN;
                                ^
fw-ipfw.c:60:14: error: no member named 'fw_out_if' in 'struct ip_fw'
                            ipfw->fw_out_if.fu_via_if.name,
                            ~~~~  ^
fw-ipfw.c:61:15: error: no member named 'fw_out_if' in 'struct ip_fw'
                            &ipfw->fw_out_if.fu_via_if.unit);
                             ~~~~  ^
fw-ipfw.c:62:10: error: no member named 'fw_flg' in 'struct ip_fw'
                        ipfw->fw_flg |= IP_FW_F_OIFNAME;
                        ~~~~  ^
fw-ipfw.c:62:20: error: use of undeclared identifier 'IP_FW_F_OIFNAME'
                        ipfw->fw_flg |= IP_FW_F_OIFNAME;
                                        ^
fw-ipfw.c:64:9: error: no member named 'fw_flg' in 'struct ip_fw'
                ipfw->fw_flg |= IP_FW_F_OUT;
                ~~~~  ^
fw-ipfw.c:64:19: error: use of undeclared identifier 'IP_FW_F_OUT'
                ipfw->fw_flg |= IP_FW_F_OUT;
                                ^
fw-ipfw.c:67:9: error: no member named 'fw_flg' in 'struct ip_fw'
                ipfw->fw_flg |= IP_FW_F_ACCEPT;
                ~~~~  ^
fw-ipfw.c:67:19: error: use of undeclared identifier 'IP_FW_F_ACCEPT'
                ipfw->fw_flg |= IP_FW_F_ACCEPT;
                                ^
fw-ipfw.c:69:9: error: no member named 'fw_flg' in 'struct ip_fw'
                ipfw->fw_flg |= IP_FW_F_DENY;
                ~~~~  ^
fw-ipfw.c:69:19: error: use of undeclared identifier 'IP_FW_F_DENY'
                ipfw->fw_flg |= IP_FW_F_DENY;
                                ^
fw-ipfw.c:71:8: error: no member named 'fw_prot' in 'struct ip_fw'
        ipfw->fw_prot = fr->fw_proto;
        ~~~~  ^
fw-ipfw.c:72:8: error: no member named 'fw_src' in 'struct ip_fw'
        ipfw->fw_src.s_addr = fr->fw_src.addr_ip;
        ~~~~  ^
fw-ipfw.c:73:8: error: no member named 'fw_dst' in 'struct ip_fw'
        ipfw->fw_dst.s_addr = fr->fw_dst.addr_ip;
        ~~~~  ^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
Comment 1 oz42 2018-04-13 10:49:40 UTC
My make.conf:

KERNCONF=OZ
MODULES_OVERRIDE=accf_http accf_data tmpfs

OPTIONS_UNSET= NIS
OPTIONS_UNSET+= X11
OPTIONS_UNSET+= DOCS
OPTIONS_UNSET+= DEBUG

DEFAULT_VERSIONS+= ssl=libressl
Comment 2 Eugene Grosbein freebsd_committer freebsd_triage 2018-04-14 22:15:51 UTC
Please share version of net/libdnet you are trying to build.

Do you build it in a jail?

Please attach full log of "make clean all" in port's directory because something wrong happens at your side as it should not even try to compile fw-ipfw.c for FreeBSD 11.1.
Comment 3 oz42 2018-04-16 08:42:31 UTC
Created attachment 192549 [details]
build.log

attached build.log
Comment 4 Eugene Grosbein freebsd_committer freebsd_triage 2018-04-16 09:05:45 UTC
From your build log:

checking net/pfvar.h presence... no
checking for net/pfvar.h... no
checking netinet/ip_compat.h presence... no
checking for netinet/ip_compat.h... no
checking netinet/ip_fil.h presence... no
checking for netinet/ip_fil.h... no

That's bad and suspicious as it should state 'yes' for all these lines.
Is your system built with some non-default /etc/src.conf and/or /etc/make.conf contents like WITHOUT_* variables set? If so, please share contents of src.conf and make.conf.
Comment 5 oz42 2018-04-16 11:00:13 UTC
make.conf: please see https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=227490#c1


src.conf:

WITH_SYSTEM_COMPILER=YES
#
WITHOUT_ACCT=YES
WITHOUT_AMD=YES
WITHOUT_ATM=YES
WITHOUT_AUDIT=YES
WITHOUT_AUTHPF=YES
WITHOUT_AUTOFS=YES
WITHOUT_BHYVE=YES
WITHOUT_BLUETOOTH=YES
WITHOUT_BOOTPD=YES
WITHOUT_BSNMP=YES
WITHOUT_CALENDAR=YES
WITHOUT_CAPSICUM=YES
WITHOUT_CASPER=YES
WITHOUT_CCD=YES
WITHOUT_CDDL=YES
WITHOUT_CLANG_BOOTSTRAP=YES
WITHOUT_CLANG_FULL=YES
WITHOUT_CLANG_EXTRAS=YES
WITHOUT_CROSS_COMPILER=YES
# WITHOUT_CRYPT=YES
WITHOUT_CTM=YES
WITHOUT_CUSE=YES
WITHOUT_DEBUG_FILES=YES
WITHOUT_DICT=YES
WITHOUT_DMAGENT=YES
WITHOUT_ED_CRYPTO=YES
WITHOUT_EXAMPLES=YES
WITHOUT_FINGER=YES
WITHOUT_FLOPPY=YES
# WITHOUT_FORTH=YES
WITHOUT_FTP=YES
WITHOUT_GAMES=YES
WITHOUT_GCC=YES
WITHOUT_GCOV=YES
WITHOUT_GDB=YES
WITHOUT_GSSAPI=YES
WITHOUT_HAST=YES
WITHOUT_HTML=YES
WITHOUT_HYPERV=YES
# WITHOUT_INET6=YES
WITHOUT_IPFILTER=YES
# WITHOUT_IPFW=YES
WITHOUT_ISCSI=YES
WITHOUT_JAIL=YES
WITHOUT_KDUMP=YES
WITHOUT_KERBEROS=YES
WITHOUT_KERNEL_SYMBOLS=YES
WITHOUT_KVM=YES
# WITHOUT_LEGACY_CONSOLE=YES
# -- only on x64
WITHOUT_LIB32=YES
WITHOUT_LLDB=YES
WITHOUT_LPR=YES
WITHOUT_MAILWRAPPER=YES
WITHOUT_NDIS=YES
WITHOUT_NETGRAPH=YES
WITHOUT_NIS=YES
WITHOUT_OPENSSH=YES
# WITHOUT_OPENSSL=YES
WITHOUT_PF=YES
WITHOUT_PMC=YES
WITHOUT_PPP=YES
WITHOUT_PROFILE=YES
WITHOUT_QUOTAS=YES
WITHOUT_RADIUS_SUPPORT=YES
WITHOUT_RBOOTD=YES
WITHOUT_RCMDS=YES
WITHOUT_RCS=YES
WITHOUT_RESCUE=YES
WITHOUT_ROUTED=YES
WITHOUT_SENDMAIL=YES
WITHOUT_SHAREDOCS=YES
WITHOUT_TALK=YES
WITHOUT_TCP_WRAPPERS=YES
WITHOUT_TESTS=YES
WITHOUT_TFTP=YES
WITHOUT_TIMED=YES
WITHOUT_USB=YES
WITHOUT_WIRELESS=YES
WITHOUT_WPA_SUPPLICANT_EAPOL=YES
WITHOUT_ZFS=YES
Comment 6 Eugene Grosbein freebsd_committer freebsd_triage 2018-04-16 11:33:09 UTC
Created attachment 192555 [details]
disable non-working ipfw1 support
Comment 7 Eugene Grosbein freebsd_committer freebsd_triage 2018-04-16 11:34:06 UTC
(In reply to oz42 from comment #5)

Well, the problem is libdnet's support of ipfw is basically non-existent these days. It had ipfw1 support that we had in times of 4.11-RELEASE and next production release 5.3 had ipfw2 and now we have ipfw3 instead. libdnet never catched up with changes.

The problem does not manifest with default build of FreeBSD that contains pf(4) because libdnet's configure prefers it over ipfw1 and does not try to build its staled ipfw1 support code but you have excluded all packet filters other than ipfw from your build, hence this bug manifested.

Please make directory /usr/ports/net/libdnet/files and place attached patch-configure there, then run "make clean all" to test it. The patch should fix the problem by disabling libdnet's non-functional ipfw1 support code.
Comment 8 oz42 2018-04-18 10:09:14 UTC
The patch has worked, compilation finishes successfully.
Comment 9 commit-hook freebsd_committer freebsd_triage 2018-04-18 10:53:06 UTC
A commit references this bug:

Author: eugen
Date: Wed Apr 18 10:52:19 UTC 2018
New revision: 467703
URL: https://svnweb.freebsd.org/changeset/ports/467703

Log:
  net/libdnet: unbreak compilation for non-default FreeBSD builds

  libdnet fails to compile for non-default FreeBSD build with
  pf/ipfilter excluded but ipfw included because its ipfw support
  staled from ipfw1 times and does not apply to modern ipfw implementation.

  PORTREVISION not changed because the change is effectively 'no-op'
  for default build.

  PR:		227490

Changes:
  head/net/libdnet/files/
  head/net/libdnet/files/patch-configure
Comment 10 Eugene Grosbein freebsd_committer freebsd_triage 2018-04-18 10:54:47 UTC
Committed, thanks for report and testing!