Bug 231872

Summary: emulators/open-vm-tools-nox11 build fails with error: unused function 'RecordRoutingInfo'
Product: Ports & Packages Reporter: Olli Hauer <ohauer>
Component: Individual Port(s)Assignee: Josh Paetzel <jpaetzel>
Status: Closed FIXED    
Severity: Affects Some People CC: gmn, john.wolfe, mchretien, mni, w.schwarzenfeld
Priority: --- Flags: bugzilla: maintainer-feedback? (jpaetzel)
Version: Latest   
Hardware: Any   
OS: Any   

Description Olli Hauer freebsd_committer freebsd_triage 2018-10-02 05:56:27 UTC
haven't looked deeper into the issue, but it seems 10.3.0 does not build the -nox11 port on 11.2 amd64 in poudriere

The last lines of the log:

...
/bin/sh ../../libtool  --tag=CC   --mode=compile cc -DPACKAGE_NAME=\"open-vm-tools\" -DPACKAGE_TARNAME=\"open-vm-tools\" -DPACKAGE_VERSION=\"10.3.0\" -DPACKAGE_STRING=\"open-vm-tools\ 10.3.0\" -DPACKAGE_BUGREPORT=\"open-vm-tools-devel@lists.sourceforge.net\" -DPACKAGE_URL=\"\" -DX_DISPLAY_MISSING=1 -DPACKAGE=\"open-vm-tools\" -DVERSION=\"10.3.0\" -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_DLFCN_H=1 -DLT_OBJDIR=\".libs/\" -DHAVE_DLOPEN=1 -DNO_DNET=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_WCHAR_H=1 -DHAVE_SYS_PARAM_H=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_USER_H=1 -DHAVE__BOOL=1 -DHAVE_STDBOOL_H=1 -DHAVE_STRUCT_STAT_ST_RDEV=1 -DTIME_WITH_SYS_TIME=1 -DNO_XSM=1 -DNO_XCOMPOSITE=1 -DNO_MULTIMON=1 -I.  -I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include -I/usr/local/include      -I/wrkdirs/usr/ports/emulators/open-vm-tools-nox11/work/open-vm-tools-stable-10.3.0/open-vm-tools/lib/include -I/wrkdirs/usr/ports/emulators/open-vm-tools-nox11/work/open-vm-tools-stable-10.3.0/open-vm-tools/lib/include -Wno-deprecated-declarations -isystem /usr/local/include -DUSING_AUTOCONF=1 -DOPEN_VM_TOOLS -DNO_ICU -DVMX86_TOOLS  -O2 -pipe  -isystem /usr/local/include -fno-strict-aliasing  -Wall -Werror -Wno-address-of-packed-member -Wno-pointer-sign -Wno-unused-value -fno-strict-aliasing -Wno-unknown-pragmas -Wno-uninitialized -Wno-deprecated-declarations -Wno-unused-const-variable -MT libNicInfo_la-nicInfoPosix.lo -MD -MP -MF .deps/libNicInfo_la-nicInfoPosix.Tpo -c -o libNicInfo_la-nicInfoPosix.lo `test -f 'nicInfoPosix.c' || echo './'`nicInfoPosix.c
libtool: compile:  cc -DPACKAGE_NAME=\"open-vm-tools\" -DPACKAGE_TARNAME=\"open-vm-tools\" -DPACKAGE_VERSION=\"10.3.0\" "-DPACKAGE_STRING=\"open-vm-tools 10.3.0\"" -DPACKAGE_BUGREPORT=\"open-vm-tools-devel@lists.sourceforge.net\" -DPACKAGE_URL=\"\" -DX_DISPLAY_MISSING=1 -DPACKAGE=\"open-vm-tools\" -DVERSION=\"10.3.0\" -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_DLFCN_H=1 -DLT_OBJDIR=\".libs/\" -DHAVE_DLOPEN=1 -DNO_DNET=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_WCHAR_H=1 -DHAVE_SYS_PARAM_H=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_USER_H=1 -DHAVE__BOOL=1 -DHAVE_STDBOOL_H=1 -DHAVE_STRUCT_STAT_ST_RDEV=1 -DTIME_WITH_SYS_TIME=1 -DNO_XSM=1 -DNO_XCOMPOSITE=1 -DNO_MULTIMON=1 -I. -I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include -I/usr/local/include -I/wrkdirs/usr/ports/emulators/open-vm-tools-nox11/work/open-vm-tools-stable-10.3.0/open-vm-tools/lib/include -I/wrkdirs/usr/ports/emulators/open-vm-tools-nox11/work/open-vm-tools-stable-10.3.0/open-vm-tools/lib/include -Wno-deprecated-declarations -isystem /usr/local/include -DUSING_AUTOCONF=1 -DOPEN_VM_TOOLS -DNO_ICU -DVMX86_TOOLS -O2 -pipe -isystem /usr/local/include -fno-strict-aliasing -Wall -Werror -Wno-address-of-packed-member -Wno-pointer-sign -Wno-unused-value -fno-strict-aliasing -Wno-unknown-pragmas -Wno-uninitialized -Wno-deprecated-declarations -Wno-unused-const-variable -MT libNicInfo_la-nicInfoPosix.lo -MD -MP -MF .deps/libNicInfo_la-nicInfoPosix.Tpo -c nicInfoPosix.c  -fPIC -DPIC -o .libs/libNicInfo_la-nicInfoPosix.o
nicInfoPosix.c:1177:1: error: unused function 'RecordRoutingInfo' [-Werror,-Wunused-function]
RecordRoutingInfo(unsigned int maxIPv4Routes,
^
1 error generated.
*** Error code 1

Stop.
make[3]: stopped in /wrkdirs/usr/ports/emulators/open-vm-tools-nox11/work/open-vm-tools-stable-10.3.0/open-vm-tools/lib/nicInfo
*** Error code 1

Stop.
make[2]: stopped in /wrkdirs/usr/ports/emulators/open-vm-tools-nox11/work/open-vm-tools-stable-10.3.0/open-vm-tools/lib
*** Error code 1

Stop.
make[1]: stopped in /wrkdirs/usr/ports/emulators/open-vm-tools-nox11/work/open-vm-tools-stable-10.3.0/open-vm-tools
*** Error code 1

Stop.
make: stopped in /usr/ports/emulators/open-vm-tools-nox11
=>> Cleaning up wrkdir
===>  Cleaning for open-vm-tools-nox11-10.3.0,2
build of emulators/open-vm-tools-nox11 | open-vm-tools-nox11-10.3.0,2 ended at Tue Oct  2 07:41:32 CEST 2018
build time: 00:01:43
!!! build failure encountered !!!


PS:
any change to get at last 'kldstat -qn' improvement from bug #226204 into the port?
Comment 1 Matt Chretien 2018-10-22 21:40:32 UTC
I've had the same issue in my Poudriere environment.

However when I set the port to use the DNET dependency, it compiles without issue.
Comment 2 Walter Schwarzenfeld 2018-10-22 22:08:23 UTC
Compiles with DNET=on fine.
If I try it without on 11.2-RELEASE-amd64 with off, I got:

--- vmmemctl ---
In file included from /ram/usr/ports/emulators/open-vm-tools-nox11/work/open-vm-tools-stable-10.3.0/open-vm-tools/modules/shared/vmmemctl/vmballoon.c:80:
/ram/usr/ports/emulators/open-vm-tools-nox11/work/open-vm-tools-stable-10.3.0/open-vm-tools/modules/shared/vmmemctl/os.h:67:10: fatal error: 'vm_basic_types.h' file not found
#include "vm_basic_types.h"
         ^~~~~~~~~~~~~~~~~~
1 error generated.
--- vmballoon.o ---
*** [vmballoon.o] Error code 1

make[4]: stopped in /ram/usr/ports/emulators/open-vm-tools-nox11/work/open-vm-tools-stable-10.3.0/open-vm-tools/modules/freebsd/vmmemctl
--- vmblock ---
--- block.o ---
cc -Wno-unused-function -c /ram/usr/ports/emulators/open-vm-tools-nox11/work/open-vm-tools-stable-10.3.0/open-vm-tools/modules/shared/vmblock/block.c -o block.o
/ram/usr/ports/emulators/open-vm-tools-nox11/work/open-vm-tools-stable-10.3.0/open-vm-tools/modules/shared/vmblock/block.c:65:10: fatal error: 'os.h' file not found
#include "os.h"
         ^~~~~~
1 error generated.
*** [block.o] Error code 1

make[4]: stopped in /ram/usr/ports/emulators/open-vm-tools-nox11/work/open-vm-tools-stable-10.3.0/open-vm-tools/modules/freebsd/vmblock
1 error

make[4]: stopped in /ram/usr/ports/emulators/open-vm-tools-nox11/work/open-vm-tools-stable-10.3.0/open-vm-tools/modules/freebsd/vmblock
*** [vmblock] Error code 2

make[3]: stopped in /ram/usr/ports/emulators/open-vm-tools-nox11/work/open-vm-tools-stable-10.3.0/open-vm-tools/modules
--- vmmemctl ---
os.c:36:10: fatal error: 'vm_basic_types.h' file not found
#include "vm_basic_types.h"
         ^~~~~~~~~~~~~~~~~~
1 error generated.
--- os.o ---
*** [os.o] Error code 1

make[4]: stopped in /ram/usr/ports/emulators/open-vm-tools-nox11/work/open-vm-tools-stable-10.3.0/open-vm-tools/modules/freebsd/vmmemctl
2 errors

make[4]: stopped in /ram/usr/ports/emulators/open-vm-tools-nox11/work/open-vm-tools-stable-10.3.0/open-vm-tools/modules/freebsd/vmmemctl
*** [vmmemctl] Error code 2

make[3]: stopped in /ram/usr/ports/emulators/open-vm-tools-nox11/work/open-vm-tools-stable-10.3.0/open-vm-tools/modules
--- vmxnet ---
In file included from if_vxn.c:20:
/usr/include/sys/systm.h:305:30: error: unknown type name 'uintfptr_t'; did you mean 'uintptr_t'?
void    hardclock(int usermode, uintfptr_t pc);
                                ^
/usr/include/sys/_stdint.h:78:22: note: 'uintptr_t' declared here
typedef __uintptr_t             uintptr_t;
                                ^
In file included from if_vxn.c:20:
/usr/include/sys/systm.h:312:30: error: unknown type name 'uintfptr_t'; did you mean 'uintptr_t'?
void    profclock(int usermode, uintfptr_t pc);
                                ^
/usr/include/sys/_stdint.h:78:22: note: 'uintptr_t' declared here
typedef __uintptr_t             uintptr_t;
                                ^
In file included from if_vxn.c:20:
/usr/include/sys/systm.h:313:43: error: unknown type name 'uintfptr_t'; did you mean 'uintptr_t'?
void    profclock_cnt(int cnt, int usermode, uintfptr_t pc);
                                             ^
/usr/include/sys/_stdint.h:78:22: note: 'uintptr_t' declared here
typedef __uintptr_t             uintptr_t;
                                ^
In file included from if_vxn.c:20:
In file included from /usr/include/sys/systm.h:357:
/usr/include/sys/libkern.h:56:15: error: unknown type name 'bool'
static inline bool
              ^
In file included from if_vxn.c:20:
/usr/include/sys/systm.h:380:17: error: unknown type name 'intrmask_t'; did you mean 'intmax_t'?
static __inline intrmask_t      splbio(void)            { return 0; }
                ^
/usr/include/sys/_stdint.h:82:21: note: 'intmax_t' declared here
typedef __intmax_t              intmax_t;
                                ^
In file included from if_vxn.c:20:
/usr/include/sys/systm.h:381:17: error: unknown type name 'intrmask_t'; did you mean 'intmax_t'?
static __inline intrmask_t      splcam(void)            { return 0; }
                ^
/usr/include/sys/_stdint.h:82:21: note: 'intmax_t' declared here
typedef __intmax_t              intmax_t;
                                ^
In file included from if_vxn.c:20:
/usr/include/sys/systm.h:382:17: error: unknown type name 'intrmask_t'; did you mean 'intmax_t'?
static __inline intrmask_t      splclock(void)          { return 0; }
                ^
/usr/include/sys/_stdint.h:82:21: note: 'intmax_t' declared here
typedef __intmax_t              intmax_t;
                                ^
In file included from if_vxn.c:20:
/usr/include/sys/systm.h:383:17: error: unknown type name 'intrmask_t'; did you mean 'intmax_t'?
static __inline intrmask_t      splhigh(void)           { return 0; }
                ^
/usr/include/sys/_stdint.h:82:21: note: 'intmax_t' declared here
typedef __intmax_t              intmax_t;
                                ^
In file included from if_vxn.c:20:
/usr/include/sys/systm.h:384:17: error: unknown type name 'intrmask_t'; did you mean 'intmax_t'?
static __inline intrmask_t      splimp(void)            { return 0; }
                ^
/usr/include/sys/_stdint.h:82:21: note: 'intmax_t' declared here
typedef __intmax_t              intmax_t;
                                ^
In file included from if_vxn.c:20:
/usr/include/sys/systm.h:385:17: error: unknown type name 'intrmask_t'; did you mean 'intmax_t'?
static __inline intrmask_t      splnet(void)            { return 0; }
                ^
/usr/include/sys/_stdint.h:82:21: note: 'intmax_t' declared here
typedef __intmax_t              intmax_t;
                                ^
In file included from if_vxn.c:20:
/usr/include/sys/systm.h:386:17: error: unknown type name 'intrmask_t'; did you mean 'intmax_t'?
static __inline intrmask_t      spltty(void)            { return 0; }
                ^
/usr/include/sys/_stdint.h:82:21: note: 'intmax_t' declared here
typedef __intmax_t              intmax_t;
                                ^
In file included from if_vxn.c:20:
/usr/include/sys/systm.h:387:28: error: unknown type name 'intrmask_t'; did you mean 'intmax_t'?
static __inline void            splx(intrmask_t ipl __unused)   { return; }
                                     ^
/usr/include/sys/_stdint.h:82:21: note: 'intmax_t' declared here
typedef __intmax_t              intmax_t;
                                ^
if_vxn.c:73:10: fatal error: 'dev/pci/pcivar.h' file not found
#include <dev/pci/pcivar.h>
         ^~~~~~~~~~~~~~~~~~
13 errors generated.
*** [if_vxn.o] Error code 1

---------------------------

If it is only error: unused function 'RecordRoutingInfo' [-Werror,-Wunused-function]
RecordRoutingInfo(unsigned int maxIPv4Routes

unused function should normally only a warning.

You can try it with CFLAGS+=-Wno-unused-function or CFLAGS+=-Wno-error.

(But I think more errors will also following on your system).
Comment 3 Walter Schwarzenfeld 2018-10-22 22:27:53 UTC
Got it (maybe,   there is a better solution)

in 
/usr/ports/emulators/open-vm-tools-nox11/work/open-vm-tools-stable-10.3.0/open-vm-tools/modules/shared/vmmemctl/os.h

I replaced
#include "wm_basic_types.h"

with
#include "../../../lib/include/vm_basic_types.h"

after this it compiles fine.
Comment 4 Josh Paetzel freebsd_committer freebsd_triage 2018-10-25 15:47:14 UTC
DNET is a port option however it stopped being optional a long time ago.

I'm going to remove the ability to turn it off in the port.  Even if you get it to compile there are things that won't work anymore at runtime.
Comment 5 commit-hook freebsd_committer freebsd_triage 2018-10-30 19:18:04 UTC
A commit references this bug:

Author: jpaetzel
Date: Tue Oct 30 19:17:35 UTC 2018
New revision: 483517
URL: https://svnweb.freebsd.org/changeset/ports/483517

Log:
  Remove DNET option and hardwire the libdnet dependency

  It hasn't actually been optional for a
  very long time.

  PR:	231872
  Reported by:	Olli Hauer

Changes:
  head/emulators/open-vm-tools/Makefile