[Bug 265519] devel/libunwind: fix build with clang 15

From: <bugzilla-noreply_at_freebsd.org>
Date: Sat, 30 Jul 2022 13:56:27 UTC
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=265519

            Bug ID: 265519
           Summary: devel/libunwind: fix build with clang 15
           Product: Ports & Packages
           Version: Latest
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Some People
          Priority: ---
         Component: Individual Port(s)
          Assignee: sunpoet@FreeBSD.org
          Reporter: dim@FreeBSD.org
             Flags: maintainer-feedback?(sunpoet@FreeBSD.org)
          Assignee: sunpoet@FreeBSD.org

During an exp-run for llvm 15 (see bug 265425), it turned out that
devel/libunwind fails to build with clang and lld 15, with multiple errors:

    setjmp/siglongjmp.c:111:48: error: incompatible pointer to integer
conversion passing 'unw_word_t *' (aka 'unsigned long *') to parameter of type
'unw_word_t' (aka 'unsigned long'); remove & [-Wint-conversion]
              if (unw_set_reg (&c, UNW_REG_EH + 2, &wp[JB_MASK]) < 0)
                                                   ^~~~~~~~~~~~
    ../include/libunwind-common.h:283:56: note: passing argument to parameter
here
    extern int unw_set_reg (unw_cursor_t *, int, unw_word_t);
                                                           ^

    dwarf/Gparser.c:901:5: error: call to undeclared function
'_Ux86_64_stash_frame'; ISO C99 and later do not support implicit function
declarations [-Wimplicit-function-declaration]
        tdep_stash_frame (c, rs);
        ^
    ../include/tdep-x86_64/libunwind_i.h:246:41: note: expanded from macro
'tdep_stash_frame'
    #define tdep_stash_frame                UNW_OBJ(stash_frame)
                                            ^

The first error is because the syntax is indeed wrong, the '&' should be
removed.

The second error is because tdep_stash_frame() is only declared for
Linux in libunwind_i.h, but it is used in Gparser.c. Declare it
unconditionally to fix the problem.

-- 
You are receiving this mail because:
You are the assignee for the bug.