Build fails with GCC 14. This blocks GCC_DEFAULT update to GCC 14. gcc14 -c -isystem /usr/local/include -Demacs -I. -I. -I../lib -I../lib -I/usr/local/include -I/usr/local/include/gtk-3.0 -I/usr/local/include/pango-1.0 -I/usr/local/include -I/usr/local/include/cairo -I/usr/local/include/gdk-pixbuf-2.0 -I/usr/local/include/at-spi2-atk/2.0 -I/usr/local/include/at-spi-2.0 -I/usr/local/include/atk-1.0 -I/usr/local/libdata/pkgconfig/../../include/dbus-1.0 -I/usr/local/libdata/pkgconfig/../../lib/dbus-1.0/include -I/usr/local/include/libepoll-shim -I/usr/local/include/fribidi -D_THREAD_SAFE -I/usr/local/include/pixman-1 -I/usr/local/include/harfbuzz -I/usr/local/include/freetype2 -I/usr/local/include/libpng16 -I/usr/local/include/gio-unix-2.0 -pthread -I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include -I/usr/local/include/librsvg-2.0 -I/usr/local/include/gdk-pixbuf-2.0 -I/usr/local/include/cairo -I/usr/local/include -I/usr/local/include/libxml2 -I/usr/local/include/pango-1.0 -I/usr/local/include/fribidi -D_THREAD_SAFE -I/usr/local/include/pixman-1 -I/usr/local/include/harfbuzz -I/usr/local/include/freetype2 -I/usr/local/include/libpng16 -pthread -I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include -I/usr/local/include/libpng16 -I/usr/local/include/libxml2 -I/usr/local/libdata/pkgconfig/../../include/dbus-1.0 -I/usr/local/libdata/pkgconfig/../../lib/dbus-1.0/include -I/usr/local/include -D_THREAD_SAFE -I/usr/local/include -D_THREAD_SAFE -I/usr/local/include -D_THREAD_SAFE -I/usr/local/include -D_THREAD_SAFE -I/usr/local/include -I/usr/local/include/webp -I/usr/local/include -I/usr/local/include -pthread -I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include -I/usr/local/include -I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include -I/usr/local/include/freetype2 -I/usr/local/include/libpng16 -I/usr/local/include -I/usr/local/include -I/usr/local/include/freetype2 -I/usr/local/include/libpng16 -I/usr/local/include/harfbuzz -I/usr/local/include/freetype2 -I/usr/local/include/libpng16 -I/usr/local/include -I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include -MMD -MF deps/canna.d -MP -I/usr/local/include -I/usr/local/include -I/usr/local/include/p11-kit-1 -I/usr/local/include/cairo -I/usr/local/include -I/usr/local/include/freetype2 -I/usr/local/include/libpng16 -D_THREAD_SAFE -I/usr/local/include/pixman-1 -O2 -pipe -fstack-protector-strong -Wl,-rpath=/usr/local/lib/gcc14 -isystem /usr/local/include -fno-strict-aliasing canna.c canna.c: In function 'storeResults': canna.c:279:20: error: passing argument 5 of 'count_char' from incompatible pointer type [-Wincompatible-pointer-types] 279 | &canna_henkan_length, &canna_henkan_revPos, canna.c:214:39: note: expected 'EMACS_INT *' {aka 'int *'} but argument is of type 'intmax_t *' {aka 'long long int *'} 214 | int, int, int, EMACS_INT *, EMACS_INT *, EMACS_INT *); | ^~~~~~~~~~~ canna.c:279:42: error: passing argument 6 of 'count_char' from incompatible pointer type [-Wincompatible-pointer-types] 279 | &canna_henkan_length, &canna_henkan_revPos, canna.c:214:52: note: expected 'EMACS_INT *' {aka 'int *'} but argument is of type 'intmax_t *' {aka 'long long int *'} 214 | int, int, int, EMACS_INT *, EMACS_INT *, EMACS_INT *); | ^~~~~~~~~~~ canna.c:280:20: error: passing argument 7 of 'count_char' from incompatible pointer type [-Wincompatible-pointer-types] 280 | &canna_henkan_revLen); canna.c:214:65: note: expected 'EMACS_INT *' {aka 'int *'} but argument is of type 'intmax_t *' {aka 'long long int *'} 214 | int, int, int, EMACS_INT *, EMACS_INT *, EMACS_INT *); | ^~~~~~~~~~~ canna.c:289:54: error: passing argument 5 of 'count_char' from incompatible pointer type [-Wincompatible-pointer-types] 289 | ks->gline.revPos, ks->gline.revLen, &canna_ichiran_length, canna.c:214:39: note: expected 'EMACS_INT *' {aka 'int *'} but argument is of type 'intmax_t *' {aka 'long long int *'} 214 | int, int, int, EMACS_INT *, EMACS_INT *, EMACS_INT *); | ^~~~~~~~~~~ canna.c:290:18: error: passing argument 6 of 'count_char' from incompatible pointer type [-Wincompatible-pointer-types] 290 | &canna_ichiran_revPos, &canna_ichiran_revLen); canna.c:214:52: note: expected 'EMACS_INT *' {aka 'int *'} but argument is of type 'intmax_t *' {aka 'long long int *'} 214 | int, int, int, EMACS_INT *, EMACS_INT *, EMACS_INT *); | ^~~~~~~~~~~ canna.c:290:41: error: passing argument 7 of 'count_char' from incompatible pointer type [-Wincompatible-pointer-types] 290 | &canna_ichiran_revPos, &canna_ichiran_revLen); canna.c:214:65: note: expected 'EMACS_INT *' {aka 'int *'} but argument is of type 'intmax_t *' {aka 'long long int *'} 214 | int, int, int, EMACS_INT *, EMACS_INT *, EMACS_INT *); | ^~~~~~~~~~~ gmake[2]: *** [Makefile:463: canna.o] Error 1 gmake[2]: *** Waiting for unfinished jobs.... gmake[2]: Leaving directory '/wrkdirs/usr/ports/editors/emacs/work-canna/emacs-30.1/src' gmake[1]: *** [Makefile:554: src] Error 2 gmake[1]: Leaving directory '/wrkdirs/usr/ports/editors/emacs/work-canna/emacs-30.1' gmake[1]: Entering directory '/wrkdirs/usr/ports/editors/emacs/work-canna/emacs-30.1' *** *** "make all" failed with exit status 2. *** *** You could try to: *** - run "make bootstrap", which might fix the problem *** - run "make V=1", which displays the full commands invoked by make, *** to further investigate the problem *** gmake[1]: *** [Makefile:418: advice-on-failure] Error 2 gmake[1]: Leaving directory '/wrkdirs/usr/ports/editors/emacs/work-canna/emacs-30.1' gmake: *** [Makefile:374: all] Error 2 Full log: https://pkg-status.freebsd.org/gohan05/data/135i386-default-foo/2025-07-17_20h45m44s/logs/errors/emacs-canna-30.1_5,3.log Useful link: https://gcc.gnu.org/gcc-14/porting_to.html
Bug affects i386 only.
The port has been updated to Emacs 30.2 last week where release notes talk about various platforms/compatibility issues. It may be worth checking whether this issue is gone now.
I tried building editors/emacs with following conditions. Host: 14.3-RELEASE amd64 poudriere: 3.4.3 Jail: 14.3-RELEASE i386 Ports tree: ports baf31b124266 (main branch) make.conf: "DEFAULT_VERSIONS+=gcc=14" And it finished successfully as below. https://people.freebsd.org/~yasu/poudriere/data/logs/bulk/143i386-default-emacs/2025-08-28_09h02m28s/logs/emacs-30.2,3.log So it seems the problem is fixed with Emacs 30.2.
I also tried building editors/emacs with following conditions. Host: 15.0-PRERELEASE main-n279797-03221b189a48 amd64 poudriere: 3.4.3 Jail: Same as host Ports tree: ports baf31b124266 (main branch) make.conf: "DEFAULT_VERSIONS+=gcc=14" And it failed with different error from comment #0 as below Backtrace: 0x57f747 <emacs_backtrace+0x57> at /wrkdirs/usr/ports/editors/emacs/work-full/emacs-30.2/src/emacs 0x425c6d <terminate_due_to_signal+0x7e> at /wrkdirs/usr/ports/editors/emacs/work-full/emacs-30.2/src/emacs 0x42616d <deliver_thread_signal.constprop.0.cold> at /wrkdirs/usr/ports/editors/emacs/work-full/emacs-30.2/src/emacs 0x426174 <Fget_internal_run_time.cold> at /wrkdirs/usr/ports/editors/emacs/work-full/emacs-30.2/src/emacs 0x57d9ff <handle_sigsegv+0x3f> at /wrkdirs/usr/ports/editors/emacs/work-full/emacs-30.2/src/emacs 0x83cac880a <_pthread_sigmask+0x50a> at /lib/libthr.so.3 0x83cac7e0b <pthread_signals_unblock_np+0x5bb> at /lib/libthr.so.3 gmake[4]: *** [Makefile:445: isearchb.eln] Segmentation fault (core dumped) gmake[4]: *** Waiting for unfinished jobs.... gmake[4]: Leaving directory '/wrkdirs/usr/ports/editors/emacs/work-full/emacs-30.2/lisp' gmake[3]: *** [Makefile:457: compile-eln-aot] Error 2 gmake[3]: Leaving directory '/wrkdirs/usr/ports/editors/emacs/work-full/emacs-30.2/lisp' gmake[2]: *** [Makefile:972: ../native-lisp] Error 2 gmake[2]: Leaving directory '/wrkdirs/usr/ports/editors/emacs/work-full/emacs-30.2/src' gmake[1]: *** [Makefile:554: src] Error 2 gmake[1]: Leaving directory '/wrkdirs/usr/ports/editors/emacs/work-full/emacs-30.2' gmake[1]: Entering directory '/wrkdirs/usr/ports/editors/emacs/work-full/emacs-30.2' *** *** "make all" failed with exit status 2. *** *** You could try to: *** - run "make bootstrap", which might fix the problem *** - run "make V=1", which displays the full commands invoked by make, *** to further investigate the problem *** gmake[1]: *** [Makefile:418: advice-on-failure] Error 2 gmake[1]: Leaving directory '/wrkdirs/usr/ports/editors/emacs/work-full/emacs-30.2' gmake: *** [Makefile:374: all] Error 2 ===> Compilation failed unexpectedly. Try to set MAKE_JOBS_UNSAFE=yes and rebuild before reporting the failure to the maintainer. *** Error code 1 Full build log: https://people.freebsd.org/~yasu/poudriere/data/logs/bulk/curamd64-default-emacs/2025-08-29_11h13m05s/logs/emacs-30.2,3.log
(In reply to Yasuhiro Kimura from comment #4) Build with GCC 15 also fails with SEGV. Just FYI.
(In reply to Yasuhiro Kimura from comment #4) I tried build with 14.3-RELEASE amd64 and 15.0-PRERELEASE i386 jails and it finished successfully with both of them. So the build error seems to happen only with 15.0-PRERELEASE amd64.
This is the last PR to fix before GCC_DEFAULT can be updated to 14. Is there anything I can do to help here? Considering that the only platform affected seems to be i386 (which is a tier 2 platform) can USE_GCC=13 be used as a temporary solution?
Created attachment 265205 [details] Disable NATIVECOMP on i386 I have looked into this. I have tested emacs with gcc14 on FreeBSD 13.5 i386 and FreeBSD 14.3 amd64: - on FreeBSD 13.5 i386 build is successful as long as NATIVECOMP is disabled. Indeed, GCC ports do not come with jit on i386, which is necessary for NATIVCOMP. I attach a patch to exclude the option; - the build is successful on FreeBSD 14.3 amd64. I still have to test a FreeBSD 15 version, I need to update my machine first. I would have ignored a CURRENT version normally and proceeded with the GCC_DEFAULT update directly (especially since we are very late), but since the first 15 RELEASE is close, I think checking it works correctly is wiser.
I tested in a 15amd64 jail (a bit old, from July) and the build failed with a similar error to what yasu encountered. 0x57d9ff <handle_sigsegv+0x3f> at /wrkdirs/usr/ports/editors/emacs/work-full/emacs-30.2/src/emacs 0x83cac880a <_pthread_sigmask+0x50a> at /lib/libthr.so.3 0x83cac7e0b <pthread_signals_unblock_np+0x5bb> at /lib/libthr.so.3 gmake[4]: *** [Makefile:445: isearchb.eln] Segmentation fault (core dumped) Full log: https://pkg.ftfl.ca/data/15amd64-default/2025-11-06_10h20m04s/logs/errors/emacs-30.2,3.log
(In reply to Joseph Mingrone from comment #9) I am still unable to look into this thoroughly. I am going to set USE_GCC=13 for now so that we can finally set GCC_DEFAULT=14 and start an exp-run for GCC_DEFAULT=15 (GCC 15 has been released for a while now). Could you please test if the same bug affects emacs-devel too? If you prefer, you can set USE_GCC=13 dependent on the FreeBSD version (we saw that emacs builds fine on FreeBSD 14 with GCC 14), but if I commit the change I am going to keep it simple setting USE_GCC=13 for all versions, as I have not tested all versions thoroughly. As for the patch I have attached about disabling NATIVECOMP on i386, I am not going to commit it yet. The port still builds fine with lang/gcc13 and the patch won't be needed until it switches to lang/gcc14. A similar update will be needed for emacs-devel.
I'll spend some time looking into this today. More to come.
(In reply to Joseph Mingrone from comment #11) Friendly ping Could someone please test if emacs-devel builds fine on current with GCC 14? If nobody can test it (I am still unable to do it myself, sorry), then I am going to set USE_GCC=13 for both emacs and emacs-devel in the next few days, so that we can safely finally upgrade GCC_DEFAULT to 14.
Sorry for the delay. I tested editors/emacs-devel on CURRENT/main with GCC 14. It also failed to build with a segmentation fault. '../src/emacs' -batch --no-site-file --no-site-lisp --eval "(setq load-prefer-newer t byte-compile-warnings 'all)" --eval "(setq org--inhibit-version-check t)" \ -l comp -f batch-byte+native-compile informat.el Backtrace: 0x536b07 <emacs_backtrace+0x57> at /wrkdirs/usr/ports/editors/emacs-devel/work-full/emacs-ef903e0f5ac/src/emacs 0x420dbf <terminate_due_to_signal+0x7e> at /wrkdirs/usr/ports/editors/emacs-devel/work-full/emacs-ef903e0f5ac/src/emacs 0x4212ca <deliver_thread_signal.constprop.0.cold> at /wrkdirs/usr/ports/editors/emacs-devel/work-full/emacs-ef903e0f5ac/src/emacs 0x4212d1 <Fget_internal_run_time.cold> at /wrkdirs/usr/ports/editors/emacs-devel/work-full/emacs-ef903e0f5ac/src/emacs 0x534dff <handle_sigsegv+0x3f> at /wrkdirs/usr/ports/editors/emacs-devel/work-full/emacs-ef903e0f5ac/src/emacs 0x83450b82a <_pthread_sigmask+0x50a> at /lib/libthr.so.3 0x83450ae2b <pthread_signals_unblock_np+0x5bb> at /lib/libthr.so.3 0x8215882d3 <__vdso_sigcode+0x3> at [vdso] 0x839fb10a0 <gcc_jit_block_end_with_switch+0x15d40> at /usr/local/lib/gcc14/libgccjit.so.0 0x839f9ff99 <gcc_jit_block_end_with_switch+0x4c39> at /usr/local/lib/gcc14/libgccjit.so.0 0x839f90969 <gcc_jit_context_release+0xa9> at /usr/local/lib/gcc14/libgccjit.so.0 0x5f6f15 <Fcomp__release_ctxt+0x15> at /wrkdirs/usr/ports/editors/emacs-devel/work-full/emacs-ef903e0f5ac/src/emacs 0x5aab4f <Ffuncall+0x10f> at /wrkdirs/usr/ports/editors/emacs-devel/work-full/emacs-ef903e0f5ac/src/emacs 0x5f6bf7 <bcall0+0x27> at /wrkdirs/usr/ports/editors/emacs-devel/work-full/emacs-ef903e0f5ac/src/emacs 0x5a71c2 <unbind_to+0x142> at /wrkdirs/usr/ports/editors/emacs-devel/work-full/emacs-ef903e0f5ac/src/emacs 0x8919efb7d <F636f6d702d2d66696e616c31_comp__final1_0+0xad> at /wrkdirs/usr/ports/editors/emacs-devel/work-full/emacs-ef903e0f5ac/native-lisp/31.0.50-fd037996/comp-7672a6ed-c56d3c67.eln 0x5aab4f <Ffuncall+0x10f> at /wrkdirs/usr/ports/editors/emacs-devel/work-full/emacs-ef903e0f5ac/src/emacs 0x8919efda9 <F636f6d702d2d66696e616c_comp__final_0+0xa9> at /wrkdirs/usr/ports/editors/emacs-devel/work-full/emacs-ef903e0f5ac/native-lisp/31.0.50-fd037996/comp-7672a6ed-c56d3c67.eln 0x5aab4f <Ffuncall+0x10f> at /wrkdirs/usr/ports/editors/emacs-devel/work-full/emacs-ef903e0f5ac/src/emacs 0x8919f2404 <F636f6d702d2d6e61746976652d636f6d70696c65_comp__native_compile_0+0x754> at /wrkdirs/usr/ports/editors/emacs-devel/work-full/emacs-ef903e0f5ac/native-lisp/31.0.50-fd037996/comp-7672a6ed-c56d3c67.eln 0x5aab4f <Ffuncall+0x10f> at /wrkdirs/usr/ports/editors/emacs-devel/work-full/emacs-ef903e0f5ac/src/emacs 0x8919f32a3 <F62617463682d6e61746976652d636f6d70696c65_batch_native_compile_0+0x1a3> at /wrkdirs/usr/ports/editors/emacs-devel/work-full/emacs-ef903e0f5ac/native-lisp/31.0.50-fd037996/comp-7672a6ed-c56d3c67.eln 0x5aab4f <Ffuncall+0x10f> at /wrkdirs/usr/ports/editors/emacs-devel/work-full/emacs-ef903e0f5ac/src/emacs 0x8919f3651 <F62617463682d627974652b6e61746976652d636f6d70696c65_batch_bytenative_compile_0+0x151> at /wrkdirs/usr/ports/editors/emacs-devel/work-full/emacs-ef903e0f5ac/native-lisp/31.0.50-fd037996/comp-7672a6ed-c56d3c67.eln 0x5aab4f <Ffuncall+0x10f> at /wrkdirs/usr/ports/editors/emacs-devel/work-full/emacs-ef903e0f5ac/src/emacs 0x8857028d5 <F636f6d6d616e642d6c696e652d31_command_line_1_0+0xd65> at ../src/../native-lisp/31.0.50-fd037996/preloaded/startup-bbc6ea72-2b6dbf5f.eln 0x5aab4f <Ffuncall+0x10f> at /wrkdirs/usr/ports/editors/emacs-devel/work-full/emacs-ef903e0f5ac/src/emacs 0x8856f912c <F636f6d6d616e642d6c696e65_command_line_0+0x138c> at ../src/../native-lisp/31.0.50-fd037996/preloaded/startup-bbc6ea72-2b6dbf5f.eln 0x5aab4f <Ffuncall+0x10f> at /wrkdirs/usr/ports/editors/emacs-devel/work-full/emacs-ef903e0f5ac/src/emacs 0x8856f5019 <F6e6f726d616c2d746f702d6c6576656c_normal_top_level_0+0xf69> at ../src/../native-lisp/31.0.50-fd037996/preloaded/startup-bbc6ea72-2b6dbf5f.eln 0x5a98dd <eval_sub+0x90d> at /wrkdirs/usr/ports/editors/emacs-devel/work-full/emacs-ef903e0f5ac/src/emacs 0x5aa060 <Feval+0x40> at /wrkdirs/usr/ports/editors/emacs-devel/work-full/emacs-ef903e0f5ac/src/emacs 0x514663 <top_level_2+0x53> at /wrkdirs/usr/ports/editors/emacs-devel/work-full/emacs-ef903e0f5ac/src/emacs 0x5a5de6 <internal_condition_case+0x66> at /wrkdirs/usr/ports/editors/emacs-devel/work-full/emacs-ef903e0f5ac/src/emacs 0x515072 <top_level_1+0x22> at /wrkdirs/usr/ports/editors/emacs-devel/work-full/emacs-ef903e0f5ac/src/emacs 0x5a5d3f <internal_catch+0x3f> at /wrkdirs/usr/ports/editors/emacs-devel/work-full/emacs-ef903e0f5ac/src/emacs 0x51457b <command_loop+0x7b> at /wrkdirs/usr/ports/editors/emacs-devel/work-full/emacs-ef903e0f5ac/src/emacs 0x51c5a4 <recursive_edit_1+0x94> at /wrkdirs/usr/ports/editors/emacs-devel/work-full/emacs-ef903e0f5ac/src/emacs 0x51c926 <Frecursive_edit+0xd6> at /wrkdirs/usr/ports/editors/emacs-devel/work-full/emacs-ef903e0f5ac/src/emacs 0x429d73 <main+0x1f13> at /wrkdirs/usr/ports/editors/emacs-devel/work-full/emacs-ef903e0f5ac/src/emacs '../src/emacs' -batch --no-site-file --no-site-lisp --eval "(setq load-prefer-newer t byte-compile-warnings 'all)" --eval "(setq org--inhibit-version-check t)" \ -l comp -f batch-byte+native-compile isearchb.el gmake[3]: *** [Makefile:331: ibuf-ext.elc] Segmentation fault (core dumped)
A commit in branch main references this bug: URL: https://cgit.FreeBSD.org/ports/commit/?id=6b9daae5590abd2644dd2a96f53c376816226de5 commit 6b9daae5590abd2644dd2a96f53c376816226de5 Author: Lorenzo Salvadore <salvadore@FreeBSD.org> AuthorDate: 2025-12-21 17:50:50 +0000 Commit: Lorenzo Salvadore <salvadore@FreeBSD.org> CommitDate: 2025-12-21 17:50:50 +0000 editors/emacs: Pin to GCC 13 Build fails on some FreeBSD versions with GCC 14, which is about to become GCC_DEFAULT. Pin to GCC 13 until the issue is fixed. PR: 288303 Reported by: yasu Tested by: yasu, jrm editors/emacs/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
A commit in branch main references this bug: URL: https://cgit.FreeBSD.org/ports/commit/?id=2e240088965295b3c9a1279051d41777f6bdebcf commit 2e240088965295b3c9a1279051d41777f6bdebcf Author: Lorenzo Salvadore <salvadore@FreeBSD.org> AuthorDate: 2025-12-21 17:55:04 +0000 Commit: Lorenzo Salvadore <salvadore@FreeBSD.org> CommitDate: 2025-12-21 17:55:04 +0000 editors/emacs-devel: Pin to GCC 13 Build fails on some FreeBSD versions with GCC 14, which is about to become GCC_DEFAULT. Pin to GCC 13 until the issue is fixed. PR: 288303 Tested by: jrm editors/emacs-devel/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
This does not block GCC_DEFAULT (PR 281091) update anymore.
I am closing this bug because salvadore@ committed a workaround pinning editors/emacs and editors/emacs-devel to GCC 13 (USE_GCC=13), unblocking the GCC_DEFAULT=14 transition. The original i386 canna.c issue was fixed in Emacs 30.2. The remaining libgccjit segfault on FreeBSD 15 with GCC 14 is an upstream issue that does not block the port.
The problem started when gcc14 switched to using posix_spawn to launch the assembler. After src 2767a1f3686e (MFCed to stable/15 in 10ed74b1b94e), Emacs builds with gcc14. We'll have to keep gcc=13 in the port until 15.1 goes EoL.