Bug 283126 - emulators/mame: fix build with clang 18 and 19
Summary: emulators/mame: fix build with clang 18 and 19
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: freebsd-ports-bugs (Nobody)
URL:
Keywords:
Depends on:
Blocks: 283013
  Show dependency treegraph
 
Reported: 2024-12-04 15:00 UTC by Dimitry Andric
Modified: 2024-12-04 19:55 UTC (History)
1 user (show)

See Also:
agh: maintainer-feedback+


Attachments
emulators/mame: fix build with clang 18 and 19 (3.13 KB, patch)
2024-12-04 15:01 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 2024-12-04 15:00:28 UTC
During the exp-run for bug 283013 ("update LLVM_DEFAULT to 18") it
turned out that emulators/mame fails to compile, with an error similar
to:

  ../../../../../3rdparty/sol2/sol/sol.hpp:19875:31: error: address of overloaded function 'call' does not match required type 'int (lua_State *)'
   19875 |                                 lua_CFunction freefunc = &function_detail::upvalue_this_member_variable<C, Fx>::template call<is_yielding, no_trampoline>;
         |                                                           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Upstream fixed this with [1] and [2].

Similarly, compiling it with clang 19, we run into another error:

  ../../../../../3rdparty/sol2/sol/sol.hpp:6755:10: error: no member named 'construct' in 'optional<type-parameter-0-0 &>'
   2191 |                         this->construct(std::forward<Args>(args)...);
        |                         ~~~~  ^

Upstream fixed this with [3].

Apply these upstream fixes using PATCH_SITES and PATCHFILES.

[1] https://github.com/mamedev/mame/commit/4da99a13f5c
[2] https://github.com/mamedev/mame/commit/b7e0fa72b92
[3] https://github.com/mamedev/mame/commit/c75845b1ef0
Comment 1 Dimitry Andric freebsd_committer freebsd_triage 2024-12-04 15:01:36 UTC
Created attachment 255627 [details]
emulators/mame: fix build with clang 18 and 19
Comment 2 Alastair Hogge 2024-12-04 19:52:04 UTC
LGTM, thanks.
Comment 3 commit-hook freebsd_committer freebsd_triage 2024-12-04 19:52:45 UTC
A commit in branch main references this bug:

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

commit d76e4adce969f7a3da6e7398cca26dca70cec559
Author:     Dimitry Andric <dim@FreeBSD.org>
AuthorDate: 2024-12-03 09:22:18 +0000
Commit:     Dimitry Andric <dim@FreeBSD.org>
CommitDate: 2024-12-04 19:51:46 +0000

    emulators/mame: fix build with clang 18 and 19

    During the exp-run for bug 283013 ("update LLVM_DEFAULT to 18") it
    turned out that emulators/mame fails to compile, with an error similar
    to:

      ../../../../../3rdparty/sol2/sol/sol.hpp:19875:31: error: address of overloaded function 'call' does not match required type 'int (lua_State *)'
       19875 |                                 lua_CFunction freefunc = &function_detail::upvalue_this_member_variable<C, Fx>::template call<is_yielding, no_trampoline>;
             |                                                           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    Upstream fixed this with [1] and [2].

    Similarly, compiling it with clang 19, we run into another error:

      ../../../../../3rdparty/sol2/sol/sol.hpp:6755:10: error: no member named 'construct' in 'optional<type-parameter-0-0 &>'
       2191 |                         this->construct(std::forward<Args>(args)...);
            |                         ~~~~  ^

    Upstream fixed this with [3].

    Apply these upstream fixes using PATCH_SITES and PATCHFILES.

    [1] https://github.com/mamedev/mame/commit/4da99a13f5c
    [2] https://github.com/mamedev/mame/commit/b7e0fa72b92
    [3] https://github.com/mamedev/mame/commit/c75845b1ef0

    PR:             283126
    Approved by:    agh@riseup.net (maintainer)
    MFH:            2024Q4

 emulators/mame/Makefile | 5 +++++
 emulators/mame/distinfo | 8 +++++++-
 2 files changed, 12 insertions(+), 1 deletion(-)
Comment 4 commit-hook freebsd_committer freebsd_triage 2024-12-04 19:53:46 UTC
A commit in branch 2024Q4 references this bug:

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

commit a001371cb49df4681ab9429e4d3e76f15a0e568a
Author:     Dimitry Andric <dim@FreeBSD.org>
AuthorDate: 2024-12-03 09:22:18 +0000
Commit:     Dimitry Andric <dim@FreeBSD.org>
CommitDate: 2024-12-04 19:53:33 +0000

    emulators/mame: fix build with clang 18 and 19

    During the exp-run for bug 283013 ("update LLVM_DEFAULT to 18") it
    turned out that emulators/mame fails to compile, with an error similar
    to:

      ../../../../../3rdparty/sol2/sol/sol.hpp:19875:31: error: address of overloaded function 'call' does not match required type 'int (lua_State *)'
       19875 |                                 lua_CFunction freefunc = &function_detail::upvalue_this_member_variable<C, Fx>::template call<is_yielding, no_trampoline>;
             |                                                           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    Upstream fixed this with [1] and [2].

    Similarly, compiling it with clang 19, we run into another error:

      ../../../../../3rdparty/sol2/sol/sol.hpp:6755:10: error: no member named 'construct' in 'optional<type-parameter-0-0 &>'
       2191 |                         this->construct(std::forward<Args>(args)...);
            |                         ~~~~  ^

    Upstream fixed this with [3].

    Apply these upstream fixes using PATCH_SITES and PATCHFILES.

    [1] https://github.com/mamedev/mame/commit/4da99a13f5c
    [2] https://github.com/mamedev/mame/commit/b7e0fa72b92
    [3] https://github.com/mamedev/mame/commit/c75845b1ef0

    PR:             283126
    Approved by:    agh@riseup.net (maintainer)
    MFH:            2024Q4

    (cherry picked from commit d76e4adce969f7a3da6e7398cca26dca70cec559)

 emulators/mame/Makefile | 5 +++++
 emulators/mame/distinfo | 8 +++++++-
 2 files changed, 12 insertions(+), 1 deletion(-)