Bug 272436

Summary: emulators/vmips: fix build with clang 16
Product: Ports & Packages Reporter: Brian R. Gaeke <brg>
Component: Individual Port(s)Assignee: Robert Clausecker <fuz>
Status: Closed FIXED    
Severity: Affects Some People CC: fuz
Priority: ---    
Version: Latest   
Hardware: Any   
OS: Any   
Attachments:
Description Flags
emulators/vmips patch: fix build with clang 16 brg: maintainer-approval+

Description Brian R. Gaeke 2023-07-09 20:39:06 UTC
Created attachment 243324 [details]
emulators/vmips patch: fix build with clang 16

Error message reported by pkg-fallout:

c++ -DHAVE_CONFIG_H -I.    -I./libopcodes_mips -DSYSCONFDIR=\"/usr/local/etc\" -DPKGDATADIR=\"/usr/local/share/vmips\"
-fno-strict-aliasing -O2 -pipe -fstack-protector-strong -fno-strict-aliasing   -MT vmips.o -MD -MP -MF .deps/vmips.Tpo
-c -o vmips.o vmips.cc
[...]
vmips.cc:605:7: error: no type named 'set_unexpected' in namespace 'std'
        std::set_unexpected(vmips_unexpected);
        ~~~~~^
1 error generated.
gmake[3]: *** [Makefile:508: vmips.o] Error 1
gmake[3]: *** Waiting for unfinished jobs....

Fix:

- patch out code that sets the unexpected handler. It is not strictly necessary for normal functionality.

- apply C++ and C standards appropriate to this program in the port Makefile.
Comment 1 Robert Clausecker freebsd_committer freebsd_triage 2023-07-11 08:22:13 UTC
Will commit with a PORTREVISION bump.
Do you want this fix to be merged into 2023Q3?
Comment 2 commit-hook freebsd_committer freebsd_triage 2023-07-11 22:09:53 UTC
A commit in branch main references this bug:

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

commit 1072f555f4303b06fc936c59597ce47407e97e2f
Author:     Brian R. Gaeke <brg@dgate.ORG>
AuthorDate: 2023-07-11 08:22:23 +0000
Commit:     Robert Clausecker <fuz@FreeBSD.org>
CommitDate: 2023-07-11 22:07:22 +0000

    emulators/vmips: fix build with clang 16

     - patch out code that sets the unexpected handler.
       It is not strictly necessary for normal functionality.
     - apply C++ and C standards appropriate to this program in the port Makefile.

    PR:             272436

 emulators/vmips/Makefile                   |  4 +++-
 emulators/vmips/files/patch-vmips.cc (new) | 24 ++++++++++++++++++++++++
 2 files changed, 27 insertions(+), 1 deletion(-)
Comment 3 Robert Clausecker freebsd_committer freebsd_triage 2023-07-11 22:12:38 UTC
Thank you for your contribution.
This can still be merged into 2023Q3 if desired.
Comment 4 Brian R. Gaeke 2023-07-15 23:18:57 UTC
Hi Robert,

You asked:
>Do you want this fix to be merged into 2023Q3?

I am not sure about the policy regarding these clang 16-related fixes.

So far, I am only getting package build failure notifications for
FreeBSD 14.0-CURRENT; no other obvious branch is indicated.

I spun up a 14.0 snapshot VM and it seemed to use clang 15 by default,
so I couldn't even reproduce the problem locally.

If we expect people to use clang 16 with ports r2023Q3, on 14.0-CURRENT
or otherwise, it seems wise to merge the fix to the branch.

Thank you for working on this.

-Brian Gaeke