The recent versions of devel/ncurses break the build editors/nano, because the configure script adds bogus options to CFLAGS. This had already been patched out (https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=223578), but the patch was removed again with this commit: https://svnweb.freebsd.org/ports?view=revision&revision=486883 The reason for the removal of the patch might have been, that the relevant part of the configure script got changed upstream (they added a midnightbsd option). That means that the patch probably has to be updated before it can be reintroduced. The editors/nano build fails, because the ncurses CFLAGS force an old C header version, which makes the type "max_align_t" unavailable.
This also affect sysutils/htop, see https://github.com/hishamhm/htop/issues/870
Created attachment 200380 [details] Updated patch which fixes the problem (In reply to Étienne Simon from comment #1) Thanks for linking the htop issue, this segfault looks even nastier to track down than the nano build error. A few more details about the CFLAGS: * thy come from the configure file (line 8789) * they get stored in "/usr/local/libdata/pkgconfig/ncursesw.pc" * they are queried with "pkg-config --cflags ncursesw" I've attached an updated version of the old patch, but it would probably be better to get this fixed upstream. The patch excludes DragonFly and MidnightBSD, is this the right way to go here?
I sent this to the ncurses mailing list: http://lists.gnu.org/archive/html/bug-ncurses/2018-12/msg00031.html
What's needed is a suggested patch which references a release version of FreeBSD with whatever turns on the header features needed to compile ncurses, xterm lynx. That chunk of configure script is used in more than one program.
I see that FreeBSD 12 is available for download. I'll put together an update for configure script which takes that into account.
There's some history of this issue affecting other ports, too. https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=214484 In that case, the port was modified to use pkg-config --cflags-only-I (instead of pkg-config --cflags) to avoid pulling in the -D flags. It's hard to define flags like -D_POSIX_C_SOURCE=XXX specially for the headers in a particular package (e.g., ncurses) in such a way that they might not interfere with headers of a different package that might want a different value for XXX.
(In reply to John Hein from comment #6) > It's hard to define flags like -D_POSIX_C_SOURCE=XXX specially for the headers in a particular package (e.g., ncurses) in such a way that they might not interfere with headers of a different package that might want a different value for XXX. For portability, one might argue you should support multiple versions of XXX in one's library. But that can be tedious, error prone, and a maintenance burden.
(In reply to John Hein from comment #7) See also this thread: http://lists.gnu.org/archive/html/bug-ncurses/2016-11/threads.html
(In reply to John Hein from comment #8) More specifically: http://lists.gnu.org/archive/html/bug-ncurses/2016-11/msg00012.html
A commit references this bug: Author: swills Date: Mon Dec 31 23:55:56 UTC 2018 New revision: 488848 URL: https://svnweb.freebsd.org/changeset/ports/488848 Log: devel/ncurses: update to 6.1.20181229 While here: * Fix bogus CFLAGS by putting back configure patch [1] * Add MANPAGES option [2] PR: 234049 [1] PR: 186249 [2] Submitted by: Daniel Eisele <daniel_eisele@gmx.de> [1] Submitted by: Zsolt Udvari <uzsolt@uzsolt.hu> [2] Changes: head/devel/ncurses/Makefile head/devel/ncurses/distinfo head/devel/ncurses/files/ head/devel/ncurses/files/patch-configure head/devel/ncurses/pkg-plist
Committed, thanks for the explanation.
Patch can be removed again, problem was solved with ncurses version 20190105.