Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 13 Nov 2021 00:56:16 +0200
From:      Konstantin Belousov <kostikbel@gmail.com>
To:        Yasuhiro Kimura <yasu@freebsd.org>
Cc:        freebsd-current@freebsd.org, kde@freebsd.org, gerald@freebsd.org
Subject:   Re: Build of devel/ninja and lang/gcc11 fails with latest 14-CURRENT amd64
Message-ID:  <YY7xEDOd7XOrrAGj@kib.kiev.ua>
In-Reply-To: <20211113.053153.925491349721631675.yasu@FreeBSD.org>
References:  <20211113.053153.925491349721631675.yasu@FreeBSD.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Sat, Nov 13, 2021 at 05:31:53AM +0900, Yasuhiro Kimura wrote:
> Hello,
>=20
> I made regular weekly update of my 14-CURRENT amd64 host and poudriere
> jail from main-n250481-517e52b6c21 to main-n250619-b39a93b18ef. And
> after that build of devel/ninja and lang/gcc11 fails as following.
>=20
> devel/ninja:
> ----------------------------------------------------------------------
> =3D=3D=3D>  Building for ninja-1.10.2,2
> ESC[1m./src/util.cc:492:3: ESC[0mESC[0;1;31merror: ESC[0mESC[1munknown ty=
pe name 'cpu_set_t'; did you mean 'cpuset_t'?E
> ESC[0m
>   cpu_set_t set;
> ESC[0;1;32m  ^~~~~~~~~
> ESC[0mESC[0;32m  cpuset_t
> ESC[0mESC[1m/usr/include/sys/_cpuset.h:50:24: ESC[0mESC[0;1;30mnote: ESC[=
0m'cpuset_t' declared hereESC[0m
> typedef struct _cpuset cpuset_t;
> ESC[0;1;32m                       ^
> ESC[0m1 error generated.
> bootstrapping ninja...
> warning: A compatible version of re2c (>=3D 0.11.3) was not found; change=
s to src/*.in.cc will not affect your build.
> when running:  c++ -MMD -MT build/util.o -MF build/util.o.d -Wall -Wextra=
 -Wno-deprecated -Wno-missing-field-initializers -Wno-unused-parameter -fno=
-rtti -fno-exceptions -fvisibility=3Dhidden -pipe '-DNINJA_PYTHON=3D"python=
3.8"' -O2 -DNDEBUG -fdiagnostics-color -I/usr/local/include -DUSE_PPOLL -DN=
INJA_HAVE_BROWSE -I. -O2 -pipe -fstack-protector-strong -fno-strict-aliasin=
g   -c ./src/util.cc -o build/util.o
> Traceback (most recent call last):
>   File "configure.py", line 519, in <module>
>     objs +=3D cxx(name, variables=3Dcxxvariables)
>   File "configure.py", line 287, in cxx
>     return n.build(built(name + objext), 'cxx', src(name + '.cc'), **kwar=
gs)
>   File "configure.py", line 169, in build
>     self._run_command(self._expand(cmd, local_vars))
>   File "configure.py", line 194, in _run_command
>     subprocess.check_call(cmdline, shell=3DTrue)
>   File "/usr/local/lib/python3.8/subprocess.py", line 364, in check_call
>     raise CalledProcessError(retcode, cmd)
> subprocess.CalledProcessError: Command 'c++ -MMD -MT build/util.o -MF bui=
ld/util.o.d -Wall -Wextra -Wno-deprecated -Wno-missing-field-initializers -=
Wno-unused-parameter -fno-rtti -fno-exceptions -fvisibility=3Dhidden -pipe =
'-DNINJA_PYTHON=3D"python3.8"' -O2 -DNDEBUG -fdiagnostics-color -I/usr/loca=
l/include -DUSE_PPOLL -DNINJA_HAVE_BROWSE -I. -O2 -pipe -fstack-protector-s=
trong -fno-strict-aliasing   -c ./src/util.cc -o build/util.o' returned non=
-zero exit status 1.
> *** Error code 1
>=20
> Stop.
> make: stopped in /usr/ports/devel/ninja
> ----------------------------------------------------------------------
>=20
> lang/gcc11:
> ----------------------------------------------------------------------
> /wrkdirs/usr/ports/lang/gcc11/work/.build/./prev-gcc/xg++ -B/wrkdirs/usr/=
ports/lang/gcc11/work/.build/./prev-gcc/ -B/usr/local/x86_64-portbld-freebs=
d14.0/bin/ -nostdinc++ -B/wrkdirs/usr/ports/lang/gcc11/work/.build/prev-x86=
_64-portbld-freebsd14.0/libstdc++-v3/src/.libs -B/wrkdirs/usr/ports/lang/gc=
c11/work/.build/prev-x86_64-portbld-freebsd14.0/libstdc++-v3/libsupc++/.lib=
s  -isystem /wrkdirs/usr/ports/lang/gcc11/work/.build/prev-x86_64-portbld-f=
reebsd14.0/libstdc++-v3/include/x86_64-portbld-freebsd14.0  -isystem /wrkdi=
rs/usr/ports/lang/gcc11/work/.build/prev-x86_64-portbld-freebsd14.0/libstdc=
++-v3/include  -isystem /wrkdirs/usr/ports/lang/gcc11/work/gcc-11.2.0/libst=
dc++-v3/libsupc++ -L/wrkdirs/usr/ports/lang/gcc11/work/.build/prev-x86_64-p=
ortbld-freebsd14.0/libstdc++-v3/src/.libs -L/wrkdirs/usr/ports/lang/gcc11/w=
ork/.build/prev-x86_64-portbld-freebsd14.0/libstdc++-v3/libsupc++/.libs  -f=
no-PIE -c  -DIN_GCC_FRONTEND -g -O2 -fno-checking -gtoggle -DIN_GCC -fPIC  =
  -fno-exceptions -fno-rtti -fasynchronous-unwind-tables -W -Wall -Wno-narr=
owing -Wwrite-strings -Wcast-qual -Wno-error=3Dformat-diag -Wmissing-format=
-attribute -Woverloaded-virtual -pedantic -Wno-long-long -Wno-variadic-macr=
os -Wno-overlength-strings   -DHAVE_CONFIG_H -I. -Ijit -I/wrkdirs/usr/ports=
/lang/gcc11/work/gcc-11.2.0/gcc -I/wrkdirs/usr/ports/lang/gcc11/work/gcc-11=
=2E2.0/gcc/jit -I/wrkdirs/usr/ports/lang/gcc11/work/gcc-11.2.0/gcc/../inclu=
de -I/wrkdirs/usr/ports/lang/gcc11/work/gcc-11.2.0/gcc/../libcpp/include -I=
/wrkdirs/usr/ports/lang/gcc11/work/gcc-11.2.0/gcc/../libcody -I/usr/local/i=
nclude  -I/wrkdirs/usr/ports/lang/gcc11/work/gcc-11.2.0/gcc/../libdecnumber=
 -I/wrkdirs/usr/ports/lang/gcc11/work/gcc-11.2.0/gcc/../libdecnumber/dpd -I=
=2E./libdecnumber -I/wrkdirs/usr/ports/lang/gcc11/work/gcc-11.2.0/gcc/../li=
bbacktrace  -DLIBICONV_PLUG -o jit/libgccjit.o -MT jit/libgccjit.o -MMD -MP=
 -MF jit/.deps/libgccjit.TPo /wrkdirs/usr/ports/lang/gcc11/work/gcc-11.2.0/=
gcc/jit/libgccjit.c
> In file included from /usr/include/sys/cpuset.h:39,
>                  from /usr/include/sched.h:36,
>                  from /usr/include/pthread.h:48,
>                  from /wrkdirs/usr/ports/lang/gcc11/work/gcc-11.2.0/gcc/j=
it/libgccjit.c:27:
> /usr/include/sys/bitset.h:314:41: error: attempt to use poisoned "malloc"
>   314 | #define BITSET_ALLOC(_s, mt, mf)        malloc(BITSET_SIZE((_s)),=
 mt, (mf))
>       |                                         ^
> gmake[4]: *** [Makefile:1142: jit/libgccjit.o] Error 1
> gmake[4]: *** Waiting for unfinished jobs....
> rm gcc.pod gfortran.pod
> gmake[4]: Leaving directory '/wrkdirs/usr/ports/lang/gcc11/work/.build/gc=
c'
> gmake[3]: *** [Makefile:4819: all-stage2-gcc] Error 2
> gmake[3]: Leaving directory '/wrkdirs/usr/ports/lang/gcc11/work/.build'
> gmake[2]: *** [Makefile:24753: stage2-bubble] Error 2
> gmake[2]: Leaving directory '/wrkdirs/usr/ports/lang/gcc11/work/.build'
> gmake[1]: *** [Makefile:24976: bootstrap-lean] Error 2
> gmake[1]: Leaving directory '/wrkdirs/usr/ports/lang/gcc11/work/.build'
> =3D=3D=3D> Compilation failed unexpectedly.
> Try to set MAKE_JOBS_UNSAFE=3Dyes and rebuild before reporting the failur=
e to
> the maintainer.
> *** Error code 1
>=20
> Stop.
> make: stopped in /usr/ports/lang/gcc11
> ----------------------------------------------------------------------
>=20
> Full build logs:
> https://www.utahime.org/FreeBSD/poudriere/data/logs/bulk/curamd64-default=
/2021-11-13_04h10m35s/logs/ninja-1.10.2,2.log
> https://www.utahime.org/FreeBSD/poudriere/data/logs/bulk/curamd64-default=
/2021-11-13_04h18m54s/logs/gcc11-11.2.0.log
>=20
> I checked commit messages between 517e52b6c21 and b39a93b18ef and
> found following commit.
>=20
> ----------------------------------------------------------------------
> commit 160b4b922b6
> Author: Konstantin Belousov <kib@FreeBSD.org>
> Date:   Sat Oct 23 00:17:21 2021
>=20
>     Add real sched.h
>=20
>     It is required by IEEE Std 1003.1-2008 AKA POSIX.
>=20
>     Put some Linux compatibility stuff under BSD_VISIBLE namespace, in
>     particular, sys/cpuset.h definitions.  Also, if user really want
>     Linux compatibility, she can request cpu_set_t typedef with
>     _WITH_CPU_SET_T define.
>=20
>     Reviewed by:    jhb
>     Sponsored by:   The FreeBSD Foundation
>     MFC after:      1 week
>     Differential revision:  https://reviews.freebsd.org/D32901
> ----------------------------------------------------------------------
>=20
> It seems likely this is the cause of build error.
>=20
Ninja builds with the following patch, other failing ports have a chance
as well.

commit 1acaa4bb838c074c29926cb34b7827efb26cdc85
Author: Konstantin Belousov <kib@FreeBSD.org>
Date:   Thu Nov 11 10:01:54 2021 +0200

    sched.h: Make cpu_set_t compat typedef visible unconditionally
   =20
    or rather, visible if BSD namespace is enabled, instead of requiring
    _WITH_CPU_SET_T define to expose it.  It seems a lot of code assumes
    that presence of sched_getaffinity() implies existence of cpu_set_t.
   =20
    Reported by:    portmgr (antoine)
    Sponsored by:   The FreeBSD Foundation
    MFC after:      1 week

diff --git a/include/sched.h b/include/sched.h
index 1c41cda79046..2d4f301c9718 100644
--- a/include/sched.h
+++ b/include/sched.h
@@ -34,13 +34,8 @@
 #include <sys/sched.h>
 #if __BSD_VISIBLE
 #include <sys/cpuset.h>
-#endif /* __BSD_VISIBLE */
-
-#if __BSD_VISIBLE
-#ifdef _WITH_CPU_SET_T
 struct _cpuset;
 typedef struct _cpuset cpu_set_t;
-#endif /* _WITH_CPU_SET_T */
 #endif /* __BSD_VISIBLE */
=20
 __BEGIN_DECLS



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?YY7xEDOd7XOrrAGj>