Build of devel/ninja and lang/gcc11 fails with latest 14-CURRENT amd64

Konstantin Belousov kostikbel at gmail.com
Fri Nov 12 22:56:16 GMT 2021


On Sat, Nov 13, 2021 at 05:31:53AM +0900, Yasuhiro Kimura wrote:
> Hello,
> 
> 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.
> 
> devel/ninja:
> ----------------------------------------------------------------------
> ===>  Building for ninja-1.10.2,2
> ESC[1m./src/util.cc:492:3: ESC[0mESC[0;1;31merror: ESC[0mESC[1munknown type 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 (>= 0.11.3) was not found; changes 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=hidden -pipe '-DNINJA_PYTHON="python3.8"' -O2 -DNDEBUG -fdiagnostics-color -I/usr/local/include -DUSE_PPOLL -DNINJA_HAVE_BROWSE -I. -O2 -pipe -fstack-protector-strong -fno-strict-aliasing   -c ./src/util.cc -o build/util.o
> Traceback (most recent call last):
>   File "configure.py", line 519, in <module>
>     objs += cxx(name, variables=cxxvariables)
>   File "configure.py", line 287, in cxx
>     return n.build(built(name + objext), 'cxx', src(name + '.cc'), **kwargs)
>   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=True)
>   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 build/util.o.d -Wall -Wextra -Wno-deprecated -Wno-missing-field-initializers -Wno-unused-parameter -fno-rtti -fno-exceptions -fvisibility=hidden -pipe '-DNINJA_PYTHON="python3.8"' -O2 -DNDEBUG -fdiagnostics-color -I/usr/local/include -DUSE_PPOLL -DNINJA_HAVE_BROWSE -I. -O2 -pipe -fstack-protector-strong -fno-strict-aliasing   -c ./src/util.cc -o build/util.o' returned non-zero exit status 1.
> *** Error code 1
> 
> Stop.
> make: stopped in /usr/ports/devel/ninja
> ----------------------------------------------------------------------
> 
> 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-freebsd14.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/gcc11/work/.build/prev-x86_64-portbld-freebsd14.0/libstdc++-v3/libsupc++/.libs  -isystem /wrkdirs/usr/ports/lang/gcc11/work/.build/prev-x86_64-portbld-freebsd14.0/libstdc++-v3/include/x86_64-portbld-freebsd14.0  -isystem /wrkdirs/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/libstdc++-v3/libsupc++ -L/wrkdirs/usr/ports/lang/gcc11/work/.build/prev-x86_64-portbld-freebsd14.0/libstdc++-v3/src/.libs -L/wrkdirs/usr/ports/lang/gcc11/work/.build/prev-x86_64-portbld-freebsd14.0/libstdc++-v3/libsupc++/.libs  -fno-PIE -c  -DIN_GCC_FRONTEND -g -O2 -fno-checking -gtoggle -DIN_GCC -fPIC    -fno-exceptions -fno-rtti -fasynchronous-unwind-tables -W -Wall -Wno-narrowing -Wwrite-strings -Wcast-qual -Wno-error=format-diag -Wmissing-format-attribute -Woverloaded-virtual -pedantic -Wno-long-long -Wno-variadic-macros -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.2.0/gcc/jit -I/wrkdirs/usr/ports/lang/gcc11/work/gcc-11.2.0/gcc/../include -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/include  -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../libdecnumber -I/wrkdirs/usr/ports/lang/gcc11/work/gcc-11.2.0/gcc/../libbacktrace  -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/jit/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/gcc'
> 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'
> ===> Compilation failed unexpectedly.
> Try to set MAKE_JOBS_UNSAFE=yes and rebuild before reporting the failure to
> the maintainer.
> *** Error code 1
> 
> Stop.
> make: stopped in /usr/ports/lang/gcc11
> ----------------------------------------------------------------------
> 
> 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
> 
> I checked commit messages between 517e52b6c21 and b39a93b18ef and
> found following commit.
> 
> ----------------------------------------------------------------------
> commit 160b4b922b6
> Author: Konstantin Belousov <kib at FreeBSD.org>
> Date:   Sat Oct 23 00:17:21 2021
> 
>     Add real sched.h
> 
>     It is required by IEEE Std 1003.1-2008 AKA POSIX.
> 
>     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.
> 
>     Reviewed by:    jhb
>     Sponsored by:   The FreeBSD Foundation
>     MFC after:      1 week
>     Differential revision:  https://reviews.freebsd.org/D32901
> ----------------------------------------------------------------------
> 
> It seems likely this is the cause of build error.
> 
Ninja builds with the following patch, other failing ports have a chance
as well.

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

    sched.h: Make cpu_set_t compat typedef visible unconditionally
    
    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.
    
    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 */
 
 __BEGIN_DECLS


More information about the kde-freebsd mailing list