Bug 273677 - emulators/higan: Fails to build with GCC 13: error: 'runtime_error' is not a member of 'std'
Summary: emulators/higan: Fails to build with GCC 13: error: 'runtime_error' is not a ...
Status: Open
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Lorenzo Salvadore
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-09-10 07:24 UTC by Lorenzo Salvadore
Modified: 2023-12-06 15:21 UTC (History)
1 user (show)

See Also:
cyberbotx: maintainer-feedback+


Attachments
0001-emulators-higan-Update-to-v110.patch (16.66 KB, text/plain)
2023-12-06 13:33 UTC, Lorenzo Salvadore
cyberbotx: maintainer-approval+
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Lorenzo Salvadore freebsd_committer freebsd_triage 2023-09-10 07:24:45 UTC
This bug report blocks the update of GCC_DEFAULT to 13. This webpage can help finding ta fix: https://gcc.gnu.org/gcc-13/porting_to.html

===>  Building for higan-106_12
gmake[1]: Entering directory '/wrkdirs/usr/ports/emulators/higan/work/higan_v106-source/higan'
g++13 -x c++ -std=c++14 -O3 -fno-strict-aliasing -fwrapv -I/usr/local/include -I. -I.. -fopenmp -DSFC_SUPERGAMEBOY -c target-tomoko/tomoko.cpp -o obj/ui-tomoko.o
g++13 -x c++ -std=c++14 -O3 -fno-strict-aliasing -fwrapv -I/usr/local/include -I. -I.. -fopenmp -DSFC_SUPERGAMEBOY -c target-tomoko/program/program.cpp -o obj/ui-program.o
g++13 -x c++ -std=c++14 -O3 -fno-strict-aliasing -fwrapv -I/usr/local/include -I. -I.. -fopenmp -DSFC_SUPERGAMEBOY -c target-tomoko/configuration/configuration.cpp -o obj/ui-configuration.o
In file included from ../nall/arithmetic.hpp:26,
                 from ../nall/nall.hpp:18,
                 from target-tomoko/configuration/../tomoko.hpp:1,
                 from target-tomoko/configuration/configuration.cpp:1:
../nall/arithmetic/natural.hpp: In function 'void nall::div(const uint256_t&, const uint256_t&, uint256_t&, uint256_t&)':
../nall/arithmetic/natural.hpp:240:23: error: 'runtime_error' is not a member of 'std'
  240 |   if(!rhs) throw std::runtime_error("division by zero");
      |                       ^~~~~~~~~~~~~
../nall/arithmetic/natural.hpp:1:1: note: 'std::runtime_error' is defined in header '<stdexcept>'; did you forget to '#include <stdexcept>'?

Full log: https://pkg-status.freebsd.org/package18/data/124amd64-default-foo/2023-09-06_17h55m19s/logs/errors/higan-106_12.log
Comment 1 Lorenzo Salvadore freebsd_committer freebsd_triage 2023-09-10 07:27:54 UTC
This bug looks similar to bug #273678.
Comment 2 Naram Qashat 2023-09-10 16:47:48 UTC
I don't currently have the time to fix this, but if someone wants to, I think they'll need to add a #include <stdexcept> at the top of nall/arithmetic.hpp. It seems that it wasn't added to that file until 3 months ago in the GitHub repo, and the latest release version (115, as opposed to the port's 106) wouldn't have the fix.

The fix is basically the one done here: https://github.com/higan-emu/higan/commit/127bb97c44db4c54ce0a3604aa8e325c0b6d0925

(And yes, the port probably should be updated from 106 to 115, but I haven't had the time to do so.)
Comment 3 Lorenzo Salvadore freebsd_committer freebsd_triage 2023-11-18 08:25:26 UTC
More logs:

https://pkg-status.freebsd.org/package23/data/132i386-default-foo/2023-11-10_07h46m19s/logs/errors/higan-106_12.log
https://pkg-status.freebsd.org/package23/data/132i386-default-foo/2023-11-10_07h46m19s/logs/errors/higan-106_12.log

Thanks Nathan for your feedback. I will try to submit a patch following your suggestions if you cannot manage to find the time to solve this issue.
Comment 4 Lorenzo Salvadore freebsd_committer freebsd_triage 2023-12-06 13:33:55 UTC
Created attachment 246819 [details]
0001-emulators-higan-Update-to-v110.patch
Comment 5 Lorenzo Salvadore freebsd_committer freebsd_triage 2023-12-06 13:37:59 UTC
Comment on attachment 246819 [details]
0001-emulators-higan-Update-to-v110.patch

I have managed to update the port and remove the dependency on GCC.
It would still be nice to have it build with GCC 13, but removing the dependency is sufficient as far as the GCC exp run is concerned (actually, it is even better).

I have tested successfully the build with the default compiler and lang/gcc12. I have not tested the build with GCC 13.

Naram: Do you approve?
Comment 6 Naram Qashat 2023-12-06 14:54:02 UTC
Comment on attachment 246819 [details]
0001-emulators-higan-Update-to-v110.patch

Looks good to me.
Comment 7 Lorenzo Salvadore freebsd_committer freebsd_triage 2023-12-06 15:21:54 UTC
Commit: https://cgit.freebsd.org/ports/commit/?id=597ca5a01e3893880470afdd10a9cc4a0cdaa93a
(I have mistyped the PR number in the commit message).

I remove the exp run block. The bug stays open however: I have tested building with GCC 13 and the issue persists, although it is not very important any more.