https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107469
Bug ID: 107469 Summary: Build of GDC on FreeBSD 14 fails due to outdated value of __FreeBSD_version Product: gcc Version: 11.3.1 Status: UNCONFIRMED Severity: normal Priority: P3 Component: d Assignee: ibuclaw at gdcproject dot org Reporter: developer at lorenzosalvadore dot it Target Milestone: --- Build of GDC on FreeBSD 14 (CURRENT) fails. Here is the error message I get checking command to parse /wrkdirs/usr/ports/lang/gcc11-devel/work/.build/./gcc/nm output from /wrkdirs/usr/ports/lang/gcc11-devel/work/.build/./gcc/xgcc -B/wrkdirs/usr/ports/lang/gcc11-devel /work/.build/./gcc/ -B/usr/local/x86_64-portbld-freebsd14.0/bin/ -B/usr/local/x86_64-portbld-freebsd14.0/lib/ -isystem /usr/local/x86_64-portbld-freebsd14.0/include -isystem /usr/local/x86_64 -portbld-freebsd14.0/sys-include -fchecking=1 -m32 object... /wrkdirs/usr/ports/lang/gcc11-devel/work/gcc-11-20221007/libphobos/libdruntime/core/sys/posix/sys/types.d:201:16: error: undefine d identifier '__FreeBSD_version' 201 | static if (__FreeBSD_version >= 1200000) | ^ /wrkdirs/usr/ports/lang/gcc11-devel/work/gcc-11-20221007/libphobos/libdruntime/core/sys/freebsd/config.d:22:6: error: static assert "Unsupported version of FreeBSD" 22 | else static assert(false, "Unsupported version of FreeBSD"); | ^ gmake[5]: *** [Makefile:2338: core/runtime.lo] Error 1 gmake[5]: Leaving directory '/wrkdirs/usr/ports/lang/gcc11-devel/work/.build/x86_64-portbld-freebsd14.0/libphobos/libdruntime' gmake[4]: *** [Makefile:484: all-recursive] Error 1 gmake[4]: Leaving directory '/wrkdirs/usr/ports/lang/gcc11-devel/work/.build/x86_64-portbld-freebsd14.0/libphobos' gmake[3]: *** [Makefile:411: all] Error 2 gmake[3]: Leaving directory '/wrkdirs/usr/ports/lang/gcc11-devel/work/.build/x86_64-portbld-freebsd14.0/libphobos' gmake[2]: *** [Makefile:21902: all-target-libphobos] Error 2 gmake[2]: *** Waiting for unfinished jobs.... I managed to fix the issue for the FreeBSD ports by updating the values of __FreeBSD_version in libphobos/libdruntime/core/sys/freebsd/config.d. Please see the patch in https://cgit.freebsd.org/ports/diff/lang/gcc11-devel/files/patch-libphobos_libdruntime_core_sys_freebsd_config.d?id=f61fb49b2e76fd4f7a5b7a11510b5109206c19f2 , which introduces a new value for FreeBSD_14 and, while here, updates the values for the other supported FreeBSD version.