Bug 261412 - [exp-run] With llvm-unwind headers placed in /usr/include
Summary: [exp-run] With llvm-unwind headers placed in /usr/include
Status: Closed Overcome By Events
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Ports Framework (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Many People
Assignee: Port Management Team
URL:
Keywords:
Depends on:
Blocks: 261397
  Show dependency treegraph
 
Reported: 2022-01-23 10:41 UTC by Dimitry Andric
Modified: 2022-02-13 13:33 UTC (History)
5 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Dimitry Andric freebsd_committer 2022-01-23 10:41:36 UTC
As reported in bug 261397, we are currently missing unwind.h and related headers in /usr/include, so some programs can't find them. We do have these headers in /usr/include/c++/v1, as part of the libcxxrt and libc++ installation, but this does not seem to be a standard location.

In https://reviews.freebsd.org/D34005 I have a patch that accomplishes two things:
* It moves unwind headers to /usr/include
* It uses the llvm-libunwind headers instead of the older libcxxrt ones

Please perform an exp-run with this patch applied, making sure that the obsolete files are deleted (to get rid of the unwind headers in /usr/include/c++/v1).
Comment 1 Antoine Brodin freebsd_committer 2022-02-02 18:41:05 UTC
Here are the new failure logs:

http://gohan04.nyi.freebsd.org/data/main-amd64-PR261412-default/2022-01-31_21h03m46s/logs/errors/google-perftools-2.9.1_3.log
http://gohan04.nyi.freebsd.org/data/main-amd64-PR261412-default/2022-01-31_21h03m46s/logs/errors/libreoffice-7.2.5.2.log
http://gohan04.nyi.freebsd.org/data/main-amd64-PR261412-default/2022-01-31_21h03m46s/logs/errors/libreoffice6-6.4.7_19.log
http://gohan04.nyi.freebsd.org/data/main-amd64-PR261412-default/2022-01-31_21h03m46s/logs/errors/apache-openoffice-4.1.11.log
http://gohan04.nyi.freebsd.org/data/main-amd64-PR261412-default/2022-01-31_21h03m46s/logs/errors/apache-openoffice-devel-4.2.1633255994,4.log
http://gohan04.nyi.freebsd.org/data/main-amd64-PR261412-default/2022-01-31_21h03m46s/logs/errors/open-vm-tools-nox11-11.3.5_1,2.log
http://gohan04.nyi.freebsd.org/data/main-amd64-PR261412-default/2022-01-31_21h03m46s/logs/errors/open-vm-tools-11.3.5_1,2.log
http://gohan04.nyi.freebsd.org/data/main-amd64-PR261412-default/2022-01-31_21h03m46s/logs/errors/virtualbox-ose-additions-6.1.32.log
http://gohan04.nyi.freebsd.org/data/main-amd64-PR261412-default/2022-01-31_21h03m46s/logs/errors/virtualbox-ose-additions-legacy-5.2.44_3.log
http://gohan04.nyi.freebsd.org/data/main-amd64-PR261412-default/2022-01-31_21h03m46s/logs/errors/virtualbox-ose-additions-nox11-6.1.32.log
http://gohan04.nyi.freebsd.org/data/main-amd64-PR261412-default/2022-01-31_21h03m46s/logs/errors/virtualbox-ose-additions-nox11-legacy-5.2.44_3.log
http://gohan04.nyi.freebsd.org/data/main-amd64-PR261412-default/2022-01-31_21h03m46s/logs/errors/tvheadend-4.2.8_5.log
http://gohan04.nyi.freebsd.org/data/main-amd64-PR261412-default/2022-01-31_21h03m46s/logs/errors/ltrace-0.6.0.log

google-perftools and ltrace seem related to unwind,  the others look strange
Comment 2 Ed Maste freebsd_committer 2022-02-02 19:36:07 UTC
google-perftools:

ld: error: ./.libs/libtcmalloc_debug.so: undefined reference to unw_getcontext [--no-allow-shlib-undefined]
ld: error: ./.libs/libtcmalloc_debug.so: undefined reference to unw_init_local [--no-allow-shlib-undefined]
ld: error: ./.libs/libtcmalloc_debug.so: undefined reference to unw_step [--no-allow-shlib-undefined]
ld: error: ./.libs/libtcmalloc_debug.so: undefined reference to unw_get_reg [--no-allow-shlib-undefined]
c++: error: linker command failed with exit code 1 (use -v to see invocation)

presumably just exposed by HAVE_LIBUNWIND_H being true now



ltrace:

execute_program.c:4:10: fatal error: 'libunwind-ptrace.h' file not found
#include <libunwind-ptrace.h>
         ^~~~~~~~~~~~~~~~~~~~
1 error generated.

which comes from:

#if defined(HAVE_LIBUNWIND)
#include <libunwind-ptrace.h>
#endif /* defined(HAVE_LIBUNWIND) */

Interestingly they have a check for libunwind-ptrace.h specifically:

/* Define to 1 if you have the <libunwind-ptrace.h> header file. */
#undef HAVE_LIBUNWIND_PTRACE_H
Comment 3 Dimitry Andric freebsd_committer 2022-02-02 20:55:51 UTC
Also not related to libunwind are the errors of the form:

error: implicit declaration of function 'insmntque1' is invalid in C99 [-Werror,-Wimplicit-function-declaration]

E.g. likely some kernel API change. These are in the logs:

open-vm-tools-11.3.5_1,2.log
open-vm-tools-nox11-11.3.5_1,2.log
virtualbox-ose-additions-6.1.32.log
virtualbox-ose-additions-legacy-5.2.44_3.log
virtualbox-ose-additions-nox11-6.1.32.log
virtualbox-ose-additions-nox11-legacy-5.2.44_3.log
Comment 4 Ed Maste freebsd_committer 2022-02-09 21:58:11 UTC
CC google-perftools and ltrace maintainers
Comment 5 Dimitry Andric freebsd_committer 2022-02-13 13:33:10 UTC
commit c00d345665366a89aaba7244d6f078dc756f4c53
Author: John Baldwin <jhb@FreeBSD.org>
Date:   Thu Feb 10 18:57:49 2022 +0100

    Install unwind.h into /usr/include

    Install headers from LLVM's libunwind in place of the headers from
    libcxxrt and allow C applications to use the library.

    As part of this, remove include/unwind.h and switch libthr over to
    using the installed unwind.h.

    Reviewed by:    dim, emaste
    MFC after:      10 days
    Differential Revision: https://reviews.freebsd.org/D34065