Bug 268321 - lang/mono: fix build with clang 15 (on i386)
Summary: lang/mono: fix build with clang 15 (on i386)
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: i386 Any
: --- Affects Some People
Assignee: freebsd-mono (Nobody)
URL:
Keywords:
Depends on:
Blocks: 265425
  Show dependency treegraph
 
Reported: 2022-12-11 22:46 UTC by Dimitry Andric
Modified: 2022-12-18 17:48 UTC (History)
1 user (show)

See Also:
bugzilla: maintainer-feedback? (mono)


Attachments
lang/mono: fix build with clang 15 (1.85 KB, patch)
2022-12-11 22:47 UTC, Dimitry Andric
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Dimitry Andric freebsd_committer freebsd_triage 2022-12-11 22:46:39 UTC
During an exp-run for llvm 15 (see bug 265425), it turned out that lang/mono failed to build with clang 15, on i386:

  mini-runtime.c:806:24: error: incompatible pointer to integer conversion assigning to 'guint32' (aka 'unsigned int') from 'MonoLMF *' (aka 'struct MonoLMF *') [-Wint-conversion]
          ext->lmf.previous_lmf = *lmf_addr;
                                ^ ~~~~~~~~~
  mini-runtime.c:808:24: error: incompatible pointer to integer conversion assigning to 'guint32' (aka 'unsigned int') from 'gpointer' (aka 'void *') [-Wint-conversion]
          ext->lmf.previous_lmf = (gpointer)(((gssize)ext->lmf.previous_lmf) | 2);
                                ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

As noted, this is because on i386 the previous_lmf field is declared as guint32, while other architectures use gpointer.

Upstream changed the field to gpointer in <https://github.com/mono/mono/pull/8308/commits/1c43a8476b5>, which got merged into main in <https://github.com/mono/mono/commit/384c4a4e2ea>.
Comment 1 Dimitry Andric freebsd_committer freebsd_triage 2022-12-11 22:47:13 UTC
Created attachment 238716 [details]
lang/mono: fix build with clang 15
Comment 2 commit-hook freebsd_committer freebsd_triage 2022-12-18 17:44:23 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=b5a6298f4d4643abb129962934fcefc4a832eb80

commit b5a6298f4d4643abb129962934fcefc4a832eb80
Author:     Dimitry Andric <dim@FreeBSD.org>
AuthorDate: 2022-12-11 22:12:36 +0000
Commit:     Dimitry Andric <dim@FreeBSD.org>
CommitDate: 2022-12-18 17:33:30 +0000

    lang/mono: fix build with clang 15

    During an exp-run for llvm 15 (see bug 265425), it turned out that
    lang/mono failed to build with clang 15, on i386:

      mini-runtime.c:806:24: error: incompatible pointer to integer conversion assigning to 'guint32' (aka 'unsigned int') from 'MonoLMF *' (aka 'struct MonoLMF *') [-Wint-conversion]
              ext->lmf.previous_lmf = *lmf_addr;
                                    ^ ~~~~~~~~~
      mini-runtime.c:808:24: error: incompatible pointer to integer conversion assigning to 'guint32' (aka 'unsigned int') from 'gpointer' (aka 'void *') [-Wint-conversion]
              ext->lmf.previous_lmf = (gpointer)(((gssize)ext->lmf.previous_lmf) | 2);
                                    ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    As noted, this is because on i386 the previous_lmf field is declared as
    guint32, while other architectures use gpointer.

    Upstream changed the field to gpointer in
    <https://github.com/mono/mono/pull/8308/commits/1c43a8476b5>, which got
    merged into main in <https://github.com/mono/mono/commit/384c4a4e2ea>.

    PR:             268321
    Approved by:    portmgr (tcberner)
    MFH:            2022Q4

 lang/mono/files/patch-mono_mini_mini-x86.h (new) | 11 +++++++++++
 1 file changed, 11 insertions(+)