Bug 218884 - emulators/open-vm-tools*: breaks if libunwind installed
Summary: emulators/open-vm-tools*: breaks if libunwind installed
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: Steve Wills
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-04-26 12:00 UTC by John Hein
Modified: 2017-08-12 20:36 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description John Hein 2017-04-26 12:00:32 UTC
I get the following error when building open-vm-tools{,-nox11}:

================
utilBacktrace.c:156:20: error: implicit declaration of function '_Unwind_GetCFA' is invalid in C99
      [-Werror,-Wimplicit-function-declaration]
   uintptr_t cfa = _Unwind_GetCFA(ctx);
                   ^
utilBacktrace.c:358:4: error: implicit declaration of function '_Unwind_Backtrace' is invalid in C99
      [-Werror,-Wimplicit-function-declaration]
   _Unwind_Backtrace(UtilBacktraceFromPointerCallback, &data);
================

This happens if the build detects libunwind (and adds -DHAVE_LIBUNWIND_H=1 during build).  Reproduce by installing the libunwind port and trying to build open-vm-tools*.

If unwind.h is not available, you don't get the error.

Or if the libunwind port is installed, and you add -D_GNU_SOURCE, then you don't get the error.

Or if the unwind.h is detected and you build with gcc5 or gcc6, then you don't get the error.  Those gcc ports both have an internal version of unwind.h

See also https://lists.freebsd.org/pipermail/freebsd-virtualization/2017-January/005186.html

I don't think it's vital for a working open-vm-tools to have unwind enabled.  So disabling unwind at configure time seems right until all supported compilers support unwind.  There's no configure switch for --without-unwind or anything, so it'd be a patch against configure.

Alternately, we could pass in -D_GNU_SOURCE.

I can put together a patch.  Let me know what you think about the above and which option seems best.
Comment 1 John Hein 2017-04-26 12:01:35 UTC
Added pi@ to CC since he reported it on virtualization@.
Comment 2 John Hein 2017-04-26 12:03:42 UTC
CC maintainer, too.
Comment 3 Mark Linimon freebsd_committer freebsd_triage 2017-04-26 16:43:57 UTC
Over to maintainer.
Comment 4 John Hein 2017-04-26 17:38:47 UTC
Support for the unity plugin was removed in 2011:

https://github.com/vmware/open-vm-tools/commit/8fd3fde9d38f4be48957cdde9d7b9f0a2e9aeed9#diff-d9f1252c6a07ec34df8b2134b05d2646

If fixing the unwind issue, we can whack the UNITY option while we're here.
Comment 5 Steve Wills freebsd_committer freebsd_triage 2017-08-12 20:36:31 UTC
This was fixed in r444773.