Date: Sat, 29 Jul 2023 10:27:44 +0200 From: Dimitry Andric <dim@FreeBSD.org> To: KIRIYAMA Kazuhiko <kiri@truefc.org> Cc: FreeBSD Ports <ports@freebsd.org> Subject: Re: www/nginx-full failed with src/cxx_supportlib/IOTools/IOUtils.cpp:288:3: error: use of undeclared identifier 'random_shuffle' Message-ID: <65161EC0-D96C-4420-8B65-A03DE584F724@FreeBSD.org> In-Reply-To: <202307290809.36T89dkn045945@kx.truefc.org> References: <202307280145.36S1jdl3007993@kx.truefc.org> <FD0C471E-3764-4FC4-A430-7E5E23DAFA65@FreeBSD.org> <202307290809.36T89dkn045945@kx.truefc.org>
next in thread | previous in thread | raw e-mail | index | archive | help
--Apple-Mail=_974A9679-1B5B-46B5-AF84-59077088EE7D Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii On 29 Jul 2023, at 10:09, KIRIYAMA Kazuhiko <kiri@truefc.org> wrote: >=20 >=20 > On Fri, 28 Jul 2023 17:37:42 +0900, > Dimitry Andric wrote: >>=20 >> [1 <text/plain; us-ascii (quoted-printable)>] >> On 28 Jul 2023, at 03:45, KIRIYAMA Kazuhiko <kiri@truefc.org> wrote: >>> www/nginx-full failed with >>> "src/cxx_supportlib/IOTools/IOUtils.cpp:288:3: error: use of >>> undeclared identifier 'random_shuffle'" : >>=20 >> std::random_shuffle has been removed from C++17, so either the code = must be adjusted to use std::shuffle, or the port has to be compiled = with C++14 or lower. Typically, you can add a line: >>=20 >> USE_CXXSTD=3D c++14 >>=20 >> to the port's Makefile, if the program respects CXXFLAGS. >=20 > Unfortunatelly faild module (passenger) was in rake system > and CXXFLAGS must has been passed with EXTRA_PRE_CXXFLAGS : >=20 > diff -urN /usr/ports/www/nginx/Makefile nginx/Makefile > --- /usr/ports/www/nginx/Makefile 2023-07-15 21:00:03.000000000 +0900 > +++ nginx/Makefile 2023-07-29 16:53:49.048687000 +0900 > @@ -240,6 +240,10 @@ > CFLAGS+=3D -DNDEBUG > .endif >=20 > +.if ${PORT_OPTIONS:MPASSENGER} > +CONFIGURE_ENV+=3D EXTRA_PRE_CXXFLAGS=3D"-std=3Dc++14" > +.endif > + > # Fix build failure on clang >=3D 12 > .if ${PORT_OPTIONS:MHTTP_PERL} && ${OSVERSION} >=3D 1301000 > CFLAGS+=3D -Wno-compound-token-split-by-macro >=20 > But this prefer to be done when CXX over c++14 so may be > changed like this : >=20 > .if ${PORT_OPTIONS:MPASSENGER} && ${OSVERSION} >=3D xxxxxxx > CONFIGURE_ENV+=3D EXTRA_PRE_CXXFLAGS=3D"-std=3Dc++14" > .endif >=20 > What should be take xxxxxxx number ? 1400091 (this is also documented on = https://docs.freebsd.org/en/books/porters-handbook/versions/#versions-14),= but in this case there is no real need to check the clang version or the operating system version. There is no harm in always compiling C++ code that was made for an earlier standard with -std=3Dc++14. It also works = for gcc. -Dimitry --Apple-Mail=_974A9679-1B5B-46B5-AF84-59077088EE7D Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP -----BEGIN PGP SIGNATURE----- Version: GnuPG/MacGPG2 v2.2 iF0EARECAB0WIQR6tGLSzjX8bUI5T82wXqMKLiCWowUCZMTNgQAKCRCwXqMKLiCW owJoAKC9RKgrSlO7Fx+lXeWh+DfmeKx/5wCg2eO6YUVBKynOXr5fZLPrfHlenKg= =kzP3 -----END PGP SIGNATURE----- --Apple-Mail=_974A9679-1B5B-46B5-AF84-59077088EE7D--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?65161EC0-D96C-4420-8B65-A03DE584F724>