Date: Tue, 7 Aug 2018 09:41:16 -0700 From: Mark Millard <marklmi@yahoo.com> To: Konstantin Belousov <kostikbel@gmail.com>, freebsd-stable@freebsd.org Subject: Re: Heads up: OFED build by default Message-ID: <E735F0E2-6550-4F77-B739-67E7D4DC1837@yahoo.com>
next in thread | raw e-mail | index | archive | help
OFED in head lead to the following in order for ci.freebsd.org's FreeBSD-head-amd64-gcc builds to not fail/stop in all_subdir_lib/ofed : Author: jhb Date: Mon Aug 6 23:51:08 2018 New Revision: 337399 URL:=20 https://svnweb.freebsd.org/changeset/base/337399 Log: Make the system C11 atomics headers fully compatible with external = GCC. =20 The <sys/cdefs.h> and <stdatomic.h> headers already included support = for C11 atomics via intrinsincs in modern versions of GCC, but these = versions tried to "hide" atomic variables inside a wrapper structure. This = wrapper is not compatible with GCC's internal <stdatomic.h> header, so that if GCC's <stdatomic.h> was used together with <sys/cdefs.h>, use of C11 atomics would fail to compile. Fix this by not hiding atomic = variables in a structure for modern versions of GCC. The headers already avoid using a wrapper structure on clang. =20 Note that this wrapper was only used if C11 was not enabled (e.g. via -std=3Dc99), so this also fixes compile failures if a modern = version of GCC was used with -std=3Dc11 but with FreeBSD's <stdatomic.h> = instead of GCC's <stdatomic.h> and this change fixes that case as well. =20 Reported by: Mark Millard Reviewed by: kib Differential Revision:=09 https://reviews.freebsd.org/D16585 Modified: head/sys/sys/cdefs.h head/sys/sys/stdatomic.h Without this FreeBSD-head-amd64-gcc was getting: --- all_subdir_lib/ofed --- In file included from /workspace/src/contrib/ofed/librdmacm/cma.h:43:0, from /workspace/src/contrib/ofed/librdmacm/acm.c:42: /workspace/src/contrib/ofed/librdmacm/cma.h: In function = 'fastlock_init': /workspace/src/contrib/ofed/librdmacm/cma.h:60:2: error: invalid = initializer atomic_store(&lock->cnt, 0); ^ In file included from /workspace/src/contrib/ofed/librdmacm/acm.c:42:0: /workspace/src/contrib/ofed/librdmacm/cma.h: In function = 'fastlock_acquire': /workspace/src/contrib/ofed/librdmacm/cma.h:68:2: error: operand type = 'struct <anonymous> *' is incompatible with argument 1 of = '__atomic_fetch_add' if (atomic_fetch_add(&lock->cnt, 1) > 0) ^~ /workspace/src/contrib/ofed/librdmacm/cma.h: In function = 'fastlock_release': /workspace/src/contrib/ofed/librdmacm/cma.h:73:2: error: operand type = 'struct <anonymous> *' is incompatible with argument 1 of = '__atomic_fetch_sub' if (atomic_fetch_sub(&lock->cnt, 1) > 1) ^~ . . . --- all_subdir_lib/ofed --- *** [acm.o] Error code 1 Side notes: A modern enough /usr/ports avoids the devel/*-gcc the separate float.h problem: -r476273 fixed /devel/powerpc64-gcc (the master port for devel/*-gcc ports) to avoid this. With both fixes in place I was able to buildworld buildkernel via amd64's xtoolchain ( so via its use of devel/amd64-gcc ). (The build servers likely do not have -r476273 yet.) =3D=3D=3D Mark Millard marklmi at yahoo.com ( dsl-only.net went away in early 2018-Mar)
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?E735F0E2-6550-4F77-B739-67E7D4DC1837>
