Re: head -r336568 and -r336570 appears to have made ci.freebsg.org's FreeBSD-head-amd64-gcc fail either than it had been (error: operand type 'struct <anonymous> *' is incompatible with argument 1 of '__atomic_fetch_add')

From: Mark Millard <marklmi_at_yahoo.com>
Date: Fri, 27 Jul 2018 00:12:06 -0700
On 2018-Jul-26, at 11:29 PM, Mark Millard <marklmi at yahoo.com> wrote:

> On 2018-Jul-26, at 9:06 PM, Mark Millard <marklmi at yahoo.com> wrote:
> 
>> On 2018-Jul-26, at 6:14 PM, Mark Millard <marklmi at yahoo.com> wrote:
>> 
>>> On 2018-Jul-26, at 11:21 AM, John Baldwin <jhb at freebsd.org> wrote:
>>> 
>>>> On 7/26/18 10:55 AM, Mark Millard wrote:
>>>>> . . .
>>>> 
>>>> Yes, but the -E from above was when compiled with external GCC and it didn't change
>>>> _Atomic(int).  Here's part of the source of bar.c:
>>>> 
>>>> #include <sys/cdefs.h>
>>>> #include <stdatomic.h>
>>>> 
>>>> struct foo {
>>>>     _Atomic(int) one;
>>>>     _Atomic int two;
>>>>     atomic_int three;
>>>> };
>>>> 
>>>> And here is what that became after -E:
>>>> 
>>>> # 4 "bar.c"
>>>> struct foo {
>>>> _Atomic(int) one;
>>>> _Atomic int two;
>>>> atomic_int three;
>>>> };
>>>> 
>>>> So cdefs.h did not define _Atomic.
>>>> 
>>>> Ah, if I add '-std=c99' then it does break.  Code that wants to use
>>>> C11 atomics via <stdatomic.h> should not be using -std=c99.  Try this:
>>>> 
>>>> Index: lib/ofed/librdmacm/Makefile
>>>> ===================================================================
>>>> --- lib/ofed/librdmacm/Makefile (revision 335896)
>>>> +++ lib/ofed/librdmacm/Makefile (working copy)
>>>> _at__at_ -8,6 +8,7 _at__at_
>>>> SHLIB_MAJOR=   1
>>>> MK_PROFILE=    no
>>>> CFLAGS+=       -I${_spath}
>>>> +CSTD=          gnu11
>>>> 
>>>> SRCS= \
>>>> acm.c \
>>>> 
>>>> If this works then we should probably mark OFED as a BROKEN_OPTION when
>>>> building with ancient GCC for now as well.
>>> 
>>> I've "unreverted" to set up a context for testing this.
>>> 
>>> So far I'll I've done is to test that I can still reproduce the failure
>>> in my environment, same sort of error reports as ci.freebsd.org's
>>> FreeBSD-head-amd64-gcc . This is without your patch.
>>> 
>>> But I've done this with gcc being given -v so that I've the exact commands
>>> and search order and the like. It  does show: -std=gnu99 . I list the
>>> filemon data from the .meta as well, showing the exact mix of
>>> FreeBSD and gcc headers used. (I could also provide such for with
>>> the reverted Makefile.{inc1,libcompat} [so non-failing] build if you
>>> care.)
>>> 
>>> 
>>> For now I just report the failure *without your patch*:
>>> (I'll build again with your patch next.)
>>> 
>>> . . .
>>> --- all_subdir_lib/ofed ---
>>> Building /usr/obj/amd64_xtoolchain-gcc/amd64.amd64/usr/src/amd64.amd64/lib/ofed/librdmacm/acm.o
>>> --- acm.o ---
>>> Using built-in specs.
>>> COLLECT_GCC=/usr/local/bin/x86_64-unknown-freebsd12.0-gcc
>>> Target: x86_64-unknown-freebsd12.0
>>> Configured with: /wrkdirs/usr/ports/devel/amd64-gcc/work/gcc-6.4.0/configure --target=x86_64-unknown-freebsd12.0 --disable-nls --enable-languages=c,c++ --enable-gnu-indirect-function --without-headers --with-gmp=/usr/local --with-pkgversion='FreeBSD Ports Collection for amd64' --with-system-zlib --with-gxx-include-dir=/usr/include/c++/v1/ --with-sysroot=/ --with-as=/usr/local/bin/x86_64-unknown-freebsd12.0-as --with-ld=/usr/local/bin/x86_64-unknown-freebsd12.0-ld --enable-initfini-array --prefix=/usr/local --localstatedir=/var --mandir=/usr/local/man --infodir=/usr/local/info/ --build=x86_64-unknown-freebsd12.0
>>> Thread model: posix
>>> gcc version 6.4.0 (FreeBSD Ports Collection for amd64) 
>>> COLLECT_GCC_OPTIONS='-B' '/usr/local/x86_64-unknown-freebsd12.0/bin/' '-O2' '-pipe' '-I' '/usr/src/contrib/ofed/librdmacm' '-g' '-std=gnu99' '-fstack-protector-strong' '-Wno-error=address' '-Wno-error=array-bounds' '-Wno-error=attributes' '-Wno-error=bool-compare' '-Wno-error=cast-align' '-Wno-error=clobbered' '-Wno-error=enum-compare' '-Wno-error=extra' '-Wno-error=inline' '-Wno-error=logical-not-parentheses' '-Wno-error=strict-aliasing' '-Wno-error=uninitialized' '-Wno-error=unused-but-set-variable' '-Wno-error=unused-function' '-Wno-error=unused-value' '-Wno-error=misleading-indentation' '-Wno-error=nonnull-compare' '-Wno-error=shift-negative-value' '-Wno-error=tautological-compare' '-Wno-error=unused-const-variable' '-v' '-c' '-o' 'acm.o' '-mtune=generic' '-march=x86-64'
>>> /usr/local/libexec/gcc/x86_64-unknown-freebsd12.0/6.4.0/cc1 -quiet -v -I /usr/src/contrib/ofed/librdmacm -isysroot /usr/obj/amd64_xtoolchain-gcc/amd64.amd64/usr/src/amd64.amd64/tmp /usr/src/contrib/ofed/librdmacm/acm.c -quiet -dumpbase acm.c -mtune=generic -march=x86-64 -auxbase-strip acm.o -g -O2 -Wno-error=address -Wno-error=array-bounds -Wno-error=attributes -Wno-error=bool-compare -Wno-error=cast-align -Wno-error=clobbered -Wno-error=enum-compare -Wno-error=extra -Wno-error=inline -Wno-error=logical-not-parentheses -Wno-error=strict-aliasing -Wno-error=uninitialized -Wno-error=unused-but-set-variable -Wno-error=unused-function -Wno-error=unused-value -Wno-error=misleading-indentation -Wno-error=nonnull-compare -Wno-error=shift-negative-value -Wno-error=tautological-compare -Wno-error=unused-const-variable -std=gnu99 -version -fstack-protector-strong -o - |
>>> /usr/local/bin/x86_64-unknown-freebsd12.0-as -v -I /usr/src/contrib/ofed/librdmacm -o acm.o
>>> GNU C99 (FreeBSD Ports Collection for amd64) version 6.4.0 (x86_64-unknown-freebsd12.0)
>>> 	compiled by GNU C version 4.2.1 Compatible FreeBSD Clang 6.0.0 (tags/RELEASE_600/final 326565), GMP version 6.1.2, MPFR version 4.0.1, MPC version 1.1.0, isl version none
>>> GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
>>> ignoring nonexistent directory "/usr/local/lib/gcc/x86_64-unknown-freebsd12.0/6.4.0/include-fixed"
>>> ignoring nonexistent directory "/usr/local/lib/gcc/x86_64-unknown-freebsd12.0/6.4.0/../../../../x86_64-unknown-freebsd12.0/include"
>>> #include "..." search starts here:
>>> #include <...> search starts here:
>>> /usr/src/contrib/ofed/librdmacm
>>> /usr/local/lib/gcc/x86_64-unknown-freebsd12.0/6.4.0/include
>>> /usr/obj/amd64_xtoolchain-gcc/amd64.amd64/usr/src/amd64.amd64/tmp/usr/include
>>> End of search list.
>>> GNU assembler version 2.30 (x86_64-unknown-freebsd12.0) using BFD version (GNU Binutils) 2.30
>>> GNU C99 (FreeBSD Ports Collection for amd64) version 6.4.0 (x86_64-unknown-freebsd12.0)
>>> 	compiled by GNU C version 4.2.1 Compatible FreeBSD Clang 6.0.0 (tags/RELEASE_600/final 326565), GMP version 6.1.2, MPFR version 4.0.1, MPC version 1.1.0, isl version none
>>> GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
>>> Compiler executable checksum: 0b55436e4202650149cc2feb351f4e0e
>>> In file included from /usr/src/contrib/ofed/librdmacm/cma.h:43:0,
>>>               from /usr/src/contrib/ofed/librdmacm/acm.c:42:
>>> /usr/src/contrib/ofed/librdmacm/cma.h: In function 'fastlock_init':
>>> /usr/src/contrib/ofed/librdmacm/cma.h:60:2: error: invalid initializer
>>> atomic_store(&lock->cnt, 0);
>>> ^
>>> In file included from /usr/src/contrib/ofed/librdmacm/acm.c:42:0:
>>> /usr/src/contrib/ofed/librdmacm/cma.h: In function 'fastlock_acquire':
>>> /usr/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)
>>> ^~
>>> /usr/src/contrib/ofed/librdmacm/cma.h: In function 'fastlock_release':
>>> /usr/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)
>>> ^~
>>> *** [acm.o] Error code 1
>>> 
>>> make[6]: stopped in /usr/src/lib/ofed/librdmacm
>>> .ERROR_TARGET='acm.o'
>>> .ERROR_META_FILE='/usr/obj/amd64_xtoolchain-gcc/amd64.amd64/usr/src/amd64.amd64/lib/ofed/librdmacm/acm.o.meta'
>>> .MAKE.LEVEL='6'
>>> MAKEFILE=''
>>> .MAKE.MODE='meta missing-filemon=yes missing-meta=yes silent=yes verbose'
>>> _ERROR_CMD='/usr/local/bin/x86_64-unknown-freebsd12.0-gcc --sysroot=/usr/obj/amd64_xtoolchain-gcc/amd64.amd64/usr/src/amd64.amd64/tmp -B/usr/local/x86_64-unknown-freebsd12.0/bin/  -O2 -pipe -I/usr/src/contrib/ofed/librdmacm   -g -std=gnu99 -fstack-protector-strong -Wno-error=address -Wno-error=array-bounds -Wno-error=attributes -Wno-error=bool-compare -Wno-error=cast-align -Wno-error=clobbered -Wno-error=enum-compare -Wno-error=extra -Wno-error=inline -Wno-error=logical-not-parentheses -Wno-error=strict-aliasing -Wno-error=uninitialized -Wno-error=unused-but-set-variable -Wno-error=unused-function -Wno-error=unused-value -Wno-error=misleading-indentation -Wno-error=nonnull-compare -Wno-error=shift-negative-value -Wno-error=tautological-compare -Wno-error=unused-const-variable   -v  -c /usr/src/contrib/ofed/librdmacm/acm.c -o acm.o; ;'
>>> .CURDIR='/usr/src/lib/ofed/librdmacm'
>>> .MAKE='make'
>>> .OBJDIR='/usr/obj/amd64_xtoolchain-gcc/amd64.amd64/usr/src/amd64.amd64/lib/ofed/librdmacm'
>>> .TARGETS='all'
>>> DESTDIR='/usr/obj/amd64_xtoolchain-gcc/amd64.amd64/usr/src/amd64.amd64/tmp'
>>> LD_LIBRARY_PATH=''
>>> MACHINE='amd64'
>>> MACHINE_ARCH='amd64'
>>> MAKEOBJDIRPREFIX=''
>>> MAKESYSPATH='/usr/src/share/mk'
>>> MAKE_VERSION='20180512'
>>> PATH='/usr/obj/amd64_xtoolchain-gcc/amd64.amd64/usr/src/amd64.amd64/tmp/legacy/usr/sbin:/usr/obj/amd64_xtoolchain-gcc/amd64.amd64/usr/src/amd64.amd64/tmp/legacy/usr/bin:/usr/obj/amd64_xtoolchain-gcc/amd64.amd64/usr/src/amd64.amd64/tmp/legacy/bin:/usr/obj/amd64_xtoolchain-gcc/amd64.amd64/usr/src/amd64.amd64/tmp/usr/sbin:/usr/obj/amd64_xtoolchain-gcc/amd64.amd64/usr/src/amd64.amd64/tmp/usr/bin:/sbin:/bin:/usr/sbin:/usr/bin'
>>> SRCTOP='/usr/src'
>>> OBJTOP='/usr/obj/amd64_xtoolchain-gcc/amd64.amd64/usr/src/amd64.amd64'
>>> .MAKE.MAKEFILES='/usr/src/share/mk/sys.mk /usr/src/share/mk/local.sys.env.mk /usr/src/share/mk/src.sys.env.mk /root/src.configs/src.conf.amd64-xtoolchain-gcc.amd64-host /usr/src/share/mk/bsd.mkopt.mk /usr/src/share/mk/src.sys.obj.mk /usr/src/share/mk/auto.obj.mk /usr/src/share/mk/bsd.suffixes.mk /root/src.configs/make.conf /usr/src/share/mk/local.sys.mk /usr/src/share/mk/src.sys.mk /dev/null /usr/src/lib/ofed/librdmacm/Makefile /usr/src/share/mk/bsd.lib.mk /usr/src/share/mk/bsd.init.mk /usr/src/share/mk/bsd.opts.mk /usr/src/share/mk/bsd.cpu.mk /usr/src/share/mk/local.init.mk /usr/src/share/mk/src.init.mk /usr/src/lib/ofed/librdmacm/../Makefile.inc /usr/src/share/mk/bsd.own.mk /usr/src/share/mk/bsd.compiler.mk /usr/src/share/mk/bsd.linker.mk /usr/src/share/mk/bsd.libnames.mk /usr/src/share/mk/src.libnames.mk /usr/src/share/mk/src.opts.mk /usr/src/share/mk/bsd.symver.mk /usr/src/share/mk/bsd.nls.mk /usr/src/share/mk/bsd.confs.mk /usr/src/share/mk/bsd.files.mk /usr/src/share/mk/bsd.dirs.mk /usr/src/share/mk/bsd.incs.mk /usr/src/share/mk/bsd.links.mk /usr/src/share/mk/bsd.dep.mk /usr/src/share/mk/bsd.clang-analyze.mk /usr/src/share/mk/bsd.obj.mk /usr/src/share/mk/bsd.subdir.mk /usr/src/share/mk/bsd.sys.mk'
>>> .PATH='. /usr/src/lib/ofed/librdmacm /usr/src/contrib/ofed/librdmacm /usr/src/contrib/ofed/librdmacm/man'
>>> 1 error
>>> 
>>> From /usr/obj/amd64_xtoolchain-gcc/amd64.amd64/usr/src/amd64.amd64/lib/ofed/librdmacm/acm.o.meta
>>> is the filemon data:
>>> 
>>> -- filemon acquired metadata --
>>> # filemon version 5
>>> # Target pid 95011
>>> # Start 1532652684.414953
>>> V 5
>>> E 95033 /bin/sh
>>> R 95033 /etc/libmap.conf
>>> R 95033 /var/run/ld-elf.so.hints
>>> R 95033 /lib/libedit.so.7
>>> R 95033 /lib/libc.so.7
>>> R 95033 /lib/libncursesw.so.8
>>> F 95033 95034
>>> E 95034 /usr/local/bin/x86_64-unknown-freebsd12.0-gcc
>>> R 95034 /etc/libmap.conf
>>> R 95034 /var/run/ld-elf.so.hints
>>> R 95034 /usr/lib/libc++.so.1
>>> R 95034 /lib/libcxxrt.so.1
>>> R 95034 /lib/libm.so.5
>>> R 95034 /lib/libc.so.7
>>> R 95034 /lib/libgcc_s.so.1
>>> F 95034 95035
>>> E 95035 /usr/local/libexec/gcc/x86_64-unknown-freebsd12.0/6.4.0/cc1
>>> F 95034 95036
>>> R 95035 /etc/libmap.conf
>>> R 95035 /var/run/ld-elf.so.hints
>>> R 95035 /usr/local/lib/libmpc.so.3
>>> R 95035 /usr/local/lib/libmpfr.so.6
>>> R 95035 /usr/local/lib/libgmp.so.10
>>> R 95035 /lib/libz.so.6
>>> R 95035 /usr/lib/libc++.so.1
>>> R 95035 /lib/libcxxrt.so.1
>>> R 95035 /lib/libm.so.5
>>> R 95035 /lib/libc.so.7
>>> R 95035 /lib/libgcc_s.so.1
>>> R 95035 /dev/urandom
>>> R 95035 /usr/src/contrib/ofed/librdmacm/acm.c
>>> E 95036 /usr/local/bin/x86_64-unknown-freebsd12.0-as
>>> R 95036 /etc/libmap.conf
>>> R 95036 /var/run/ld-elf.so.hints
>>> R 95036 /lib/libc.so.7
>>> R 95036 acm.o
>>> W 95036 acm.o
>>> R 95035 /usr/src/contrib/ofed/librdmacm/config.h
>>> R 95035 /usr/obj/amd64_xtoolchain-gcc/amd64.amd64/usr/src/amd64.amd64/tmp/usr/include/stdio.h
>>> R 95035 /usr/src/sys/sys/cdefs.h
>>> R 95035 /usr/src/sys/sys/_null.h
>>> R 95035 /usr/src/sys/sys/_types.h
>>> R 95035 /usr/src/sys/amd64/include/_types.h
>>> R 95035 /usr/src/sys/x86/include/_types.h
>>> R 95035 /usr/src/sys/amd64/include/_limits.h
>>> R 95035 /usr/src/sys/x86/include/_limits.h
>>> R 95035 /usr/obj/amd64_xtoolchain-gcc/amd64.amd64/usr/src/amd64.amd64/tmp/usr/include/inttypes.h
>>> R 95035 /usr/src/sys/amd64/include/_inttypes.h
>>> R 95035 /usr/src/sys/x86/include/_inttypes.h
>>> R 95035 /usr/src/sys/sys/stdint.h
>>> R 95035 /usr/src/sys/amd64/include/_stdint.h
>>> R 95035 /usr/src/sys/x86/include/_stdint.h
>>> R 95035 /usr/src/sys/amd64/include/_limits.h
>>> R 95035 /usr/src/sys/sys/_stdint.h
>>> R 95035 /usr/src/sys/sys/types.h
>>> R 95035 /usr/src/sys/amd64/include/endian.h
>>> R 95035 /usr/src/sys/x86/include/endian.h
>>> R 95035 /usr/src/sys/sys/_pthreadtypes.h
>>> R 95035 /usr/src/sys/sys/select.h
>>> R 95035 /usr/src/sys/sys/_sigset.h
>>> R 95035 /usr/src/sys/sys/_timeval.h
>>> R 95035 /usr/src/sys/sys/timespec.h
>>> R 95035 /usr/src/sys/sys/_timespec.h
>>> R 95035 /usr/src/sys/sys/socket.h
>>> R 95035 /usr/src/sys/sys/_iovec.h
>>> R 95035 /usr/src/sys/amd64/include/_align.h
>>> R 95035 /usr/src/sys/x86/include/_align.h
>>> R 95035 /usr/src/sys/sys/_sockaddr_storage.h
>>> R 95035 /usr/obj/amd64_xtoolchain-gcc/amd64.amd64/usr/src/amd64.amd64/tmp/usr/include/netdb.h
>>> R 95035 /usr/obj/amd64_xtoolchain-gcc/amd64.amd64/usr/src/amd64.amd64/tmp/usr/include/unistd.h
>>> R 95035 /usr/src/sys/sys/unistd.h
>>> R 95035 /usr/src/contrib/ofed/librdmacm/cma.h
>>> R 95035 /usr/src/contrib/ofed/librdmacm/config.h
>>> R 95035 /usr/obj/amd64_xtoolchain-gcc/amd64.amd64/usr/src/amd64.amd64/tmp/usr/include/stdlib.h
>>> R 95035 /usr/src/sys/sys/errno.h
>>> R 95035 /usr/obj/amd64_xtoolchain-gcc/amd64.amd64/usr/src/amd64.amd64/tmp/usr/include/infiniband/endian.h
>>> R 95035 /usr/src/sys/sys/endian.h
>>> R 95035 /usr/src/sys/amd64/include/endian.h
>>> R 95035 /usr/obj/amd64_xtoolchain-gcc/amd64.amd64/usr/src/amd64.amd64/tmp/usr/include/semaphore.h
>>> R 95035 /usr/src/sys/sys/_umtx.h
>>> R 95035 /usr/src/sys/amd64/include/_limits.h
>>> R 95035 /usr/local/lib/gcc/x86_64-unknown-freebsd12.0/6.4.0/include/stdatomic.h
>>> R 95035 /usr/obj/amd64_xtoolchain-gcc/amd64.amd64/usr/src/amd64.amd64/tmp/usr/include/rdma/rdma_cma.h
>>> R 95035 /usr/src/sys/netinet/in.h
>>> R 95035 /usr/src/sys/amd64/include/endian.h
>>> R 95035 /usr/src/sys/netinet6/in6.h
>>> R 95035 /usr/obj/amd64_xtoolchain-gcc/amd64.amd64/usr/src/amd64.amd64/tmp/usr/include/infiniband/verbs.h
>>> R 95035 /usr/local/lib/gcc/x86_64-unknown-freebsd12.0/6.4.0/include/stdint.h
>>> R 95035 /usr/src/sys/sys/stdint.h
>>> R 95035 /usr/obj/amd64_xtoolchain-gcc/amd64.amd64/usr/src/amd64.amd64/tmp/usr/include/pthread.h
>>> R 95035 /usr/src/sys/amd64/include/_limits.h
>>> R 95035 /usr/src/sys/amd64/include/_types.h
>>> R 95035 /usr/src/sys/sys/sched.h
>>> R 95035 /usr/obj/amd64_xtoolchain-gcc/amd64.amd64/usr/src/amd64.amd64/tmp/usr/include/time.h
>>> R 95035 /usr/obj/amd64_xtoolchain-gcc/amd64.amd64/usr/src/amd64.amd64/tmp/usr/include/xlocale/_time.h
>>> R 95035 /usr/local/lib/gcc/x86_64-unknown-freebsd12.0/6.4.0/include/stddef.h
>>> R 95035 /usr/obj/amd64_xtoolchain-gcc/amd64.amd64/usr/src/amd64.amd64/tmp/usr/include/string.h
>>> R 95035 /usr/obj/amd64_xtoolchain-gcc/amd64.amd64/usr/src/amd64.amd64/tmp/usr/include/strings.h
>>> R 95035 /usr/obj/amd64_xtoolchain-gcc/amd64.amd64/usr/src/amd64.amd64/tmp/usr/include/xlocale/_strings.h
>>> R 95035 /usr/obj/amd64_xtoolchain-gcc/amd64.amd64/usr/src/amd64.amd64/tmp/usr/include/xlocale/_string.h
>>> R 95035 /usr/obj/amd64_xtoolchain-gcc/amd64.amd64/usr/src/amd64.amd64/tmp/usr/include/infiniband/types.h
>>> R 95035 /usr/obj/amd64_xtoolchain-gcc/amd64.amd64/usr/src/amd64.amd64/tmp/usr/include/infiniband/sa.h
>>> R 95035 /usr/obj/amd64_xtoolchain-gcc/amd64.amd64/usr/src/amd64.amd64/tmp/usr/include/infiniband/ib.h
>>> R 95035 /usr/src/contrib/ofed/librdmacm/cma.h
>>> X 95036 0 0
>>> X 95035 1 0
>>> D 95034 acm.o
>>> X 95034 1 0
>>> X 95033 1 0
>>> # Stop 1532652684.494688
>>> # Bye bye
>>> 
>>> 
>>> 
>>> For reference the amd64-gcc is:
>>> 
>>> # pkg info amd64-gcc
>>> amd64-gcc-6.4.0_1
>>> Name           : amd64-gcc
>>> Version        : 6.4.0_1
>>> Installed on   : Sun Jul 15 09:15:38 2018 PDT
>>> Origin         : devel/amd64-gcc
>>> Architecture   : FreeBSD:12:amd64
>>> Prefix         : /usr/local
>>> Categories     : devel
>>> Licenses       : GPLv3, GPLv3RLE
>>> Maintainer     : kan_at_FreeBSD.org
>>> WWW            : http://gcc.gnu.org/
>>> Comment        : Cross GNU Compiler Collection for amd64
>>> Shared Libs required:
>>> 	libmpc.so.3
>>> 	libgmp.so.10
>>> 	libmpfr.so.6
>>> Shared Libs provided:
>>> 	liblto_plugin.so.0
>>> Annotations    :
>>> 	FreeBSD_version: 1200069
>>> 	repo_type      : binary
>>> 	repository     : custom
>>> Flat size      : 338MiB
>>> Description    :
>>> GCC, the GNU Compiler Collection supporting C and C++ for targetting crossbuilding.
>>> 
>>> WWW: http://gcc.gnu.org/
>> 
>> With your patch it gets past that point of build failure.
>> 
>> But my devel/amd64-gcc predates the removal of float.h from
>> the installed devel/amd64-gcc so the following may not be as
>> it would be in such a context:
>> 
>> --- lib/msun__L ---
>> /usr/src/lib/msun/src/catrigl.c:90:2: error: #error "Unsupported long double format"
>> #error "Unsupported long double format"
>> ^~~~~
>> . . .
>> --- lib/msun__L ---
>> /usr/src/lib/msun/src/catrigl.c: In function 'casinhl':
>> /usr/src/lib/msun/src/catrigl.c:190:35: error: 'm_ln2' undeclared (first use in this function)
>>   w = clog_for_large_values(z) + m_ln2;
>>                                  ^~~~~
>> /usr/src/lib/msun/src/catrigl.c:190:35: note: each undeclared identifier is reported only once for each function it appears in
>> /usr/src/lib/msun/src/catrigl.c:202:11: error: 'SQRT_6_EPSILON' undeclared (first use in this function)
>> if (ax < SQRT_6_EPSILON / 4 && ay < SQRT_6_EPSILON / 4)
>>          ^~~~~~~~~~~~~~
>> /usr/src/lib/msun/src/catrigl.c: In function 'cacosl':
>> /usr/src/lib/msun/src/catrigl.c:250:20: error: 'm_ln2' undeclared (first use in this function)
>>  ry = creall(w) + m_ln2;
>>                   ^~~~~
>> /usr/src/lib/msun/src/catrigl.c:261:11: error: 'SQRT_6_EPSILON' undeclared (first use in this function)
>> if (ax < SQRT_6_EPSILON / 4 && ay < SQRT_6_EPSILON / 4)
>>          ^~~~~~~~~~~~~~
>> In file included from /usr/src/lib/msun/src/catrigl.c:45:0:
>> 
>> 
>> 
>> I can remove float.h and see what happens.
> 
> While the build without gcc's float.h goes on, here are some small
> experiments with interesting results (mostly these are with
> -std=gnu11):
> 
> # more AtomicTest.c 
> // x86_64-unknown-freebsd12.0-gcc -v -E AtomicTest.c
> 
> #include <sys/cdefs.h>
> #include <stdatomic.h>
> 
> struct foo {
>       _Atomic(int) one;
>       _Atomic int two;
>       atomic_int three;
> };
> 
> 
> 
> # x86_64-unknown-freebsd12.0-gcc -dM -std=gnu11 -E AtomicTest.c | grep has_
> #define __has_include(STR) __has_include__(STR)
> #define __has_include_next(STR) __has_include_next__(STR)
> #define __has_extension __has_feature
> #define __has_builtin(x) 0
> #define __has_feature(x) 0
> 
> (-std=gnu99 matches the above)
> 
> 
> # x86_64-unknown-freebsd12.0-gcc -dM -std=gnu11 -E AtomicTest.c | grep atomic_fetch
> #define atomic_fetch_or(PTR,VAL) __atomic_fetch_or ((PTR), (VAL), __ATOMIC_SEQ_CST)
> #define atomic_fetch_or_explicit(PTR,VAL,MO) __atomic_fetch_or ((PTR), (VAL), (MO))
> #define atomic_fetch_and_explicit(PTR,VAL,MO) __atomic_fetch_and ((PTR), (VAL), (MO))
> #define atomic_fetch_sub_explicit(PTR,VAL,MO) __atomic_fetch_sub ((PTR), (VAL), (MO))
> #define atomic_fetch_xor_explicit(PTR,VAL,MO) __atomic_fetch_xor ((PTR), (VAL), (MO))
> #define atomic_fetch_add(PTR,VAL) __atomic_fetch_add ((PTR), (VAL), __ATOMIC_SEQ_CST)
> #define atomic_fetch_sub(PTR,VAL) __atomic_fetch_sub ((PTR), (VAL), __ATOMIC_SEQ_CST)
> #define atomic_fetch_and(PTR,VAL) __atomic_fetch_and ((PTR), (VAL), __ATOMIC_SEQ_CST)
> #define atomic_fetch_xor(PTR,VAL) __atomic_fetch_xor ((PTR), (VAL), __ATOMIC_SEQ_CST)
> #define atomic_fetch_add_explicit(PTR,VAL,MO) __atomic_fetch_add ((PTR), (VAL), (MO))
> 
> (-std=gnu99 matches the above)
> 
> 
> The following shows -std=gnu99 vs. -std=gnu11 results that do not
> match:
> 
> # x86_64-unknown-freebsd12.0-gcc -E -std=gnu99 AtomicTest.c | more
> . . .
> # 6 "AtomicTest.c"
> struct foo {
> 
> # 7 "AtomicTest.c" 3 4
>      struct { 
> # 7 "AtomicTest.c"
>      int 
> # 7 "AtomicTest.c" 3 4
>      volatile __val; } 
> # 7 "AtomicTest.c"
>                   one;
>       _Atomic int two;
>       atomic_int three;
> };
> . . .
> 
> # x86_64-unknown-freebsd12.0-gcc -E -std=gnu11 AtomicTest.c | more
> . . .
> 
> # 6 "AtomicTest.c"
> struct foo {
>       _Atomic(int) one;
>       _Atomic int two;
>       atomic_int three;
> };
> . . .
> 
> I will add a #warning where FreeBSD's cdefs.h has the #define _Atomic(T)
> to report on if the #define _Atomic(T) is being processed (but possibly
> ignored) for -std=gnu11 . (But after the ongoing build stops.)
> 

I was looking too locally: the overall context has an outer #if
as well that skips the section:

/*
 * Keywords added in C11.
 */
 
#if !defined(__STDC_VERSION__) || __STDC_VERSION__ < 201112L
. . .
#if !defined(__cplusplus) && !__has_extension(c_atomic) && \
    !__has_extension(cxx_atomic)
/*
 * No native support for _Atomic(). Place object in structure to prevent
 * most forms of direct non-atomic access.
 */
#define _Atomic(T)              struct { T volatile __val; }
#endif
. . .
#endif /* __STDC_VERSION__ || __STDC_VERSION__ < 201112L */




The build with gcc's float.h also removed did complete instead of
stopping early.



As for what x86_64-unknown-freebsd12.0 .h files were used:
(some may do include_next back into FreeBSD headers)


# find /usr/obj/amd64_xtoolchain-gcc/ -name "*.meta" -exec grep "^R .*/x86_64-unknown-freebsd12.0/.*\.h" {} \; | sort -k 3 | uniq -f 2 | more
R 1595 /usr/local/lib/gcc/x86_64-unknown-freebsd12.0/6.4.0/include/adxintrin.h
R 1595 /usr/local/lib/gcc/x86_64-unknown-freebsd12.0/6.4.0/include/ammintrin.h
R 1520 /usr/local/lib/gcc/x86_64-unknown-freebsd12.0/6.4.0/include/avx2intrin.h
R 1520 /usr/local/lib/gcc/x86_64-unknown-freebsd12.0/6.4.0/include/avx512bwintrin.h
R 1520 /usr/local/lib/gcc/x86_64-unknown-freebsd12.0/6.4.0/include/avx512cdintrin.h
R 1520 /usr/local/lib/gcc/x86_64-unknown-freebsd12.0/6.4.0/include/avx512dqintrin.h
R 1520 /usr/local/lib/gcc/x86_64-unknown-freebsd12.0/6.4.0/include/avx512erintrin.h
R 1520 /usr/local/lib/gcc/x86_64-unknown-freebsd12.0/6.4.0/include/avx512fintrin.h
R 1520 /usr/local/lib/gcc/x86_64-unknown-freebsd12.0/6.4.0/include/avx512ifmaintrin.h
R 1520 /usr/local/lib/gcc/x86_64-unknown-freebsd12.0/6.4.0/include/avx512ifmavlintrin.h
R 1520 /usr/local/lib/gcc/x86_64-unknown-freebsd12.0/6.4.0/include/avx512pfintrin.h
R 1520 /usr/local/lib/gcc/x86_64-unknown-freebsd12.0/6.4.0/include/avx512vbmiintrin.h
R 1520 /usr/local/lib/gcc/x86_64-unknown-freebsd12.0/6.4.0/include/avx512vbmivlintrin.h
R 1520 /usr/local/lib/gcc/x86_64-unknown-freebsd12.0/6.4.0/include/avx512vlbwintrin.h
R 1520 /usr/local/lib/gcc/x86_64-unknown-freebsd12.0/6.4.0/include/avx512vldqintrin.h
R 1520 /usr/local/lib/gcc/x86_64-unknown-freebsd12.0/6.4.0/include/avx512vlintrin.h
R 1520 /usr/local/lib/gcc/x86_64-unknown-freebsd12.0/6.4.0/include/avxintrin.h
R 1520 /usr/local/lib/gcc/x86_64-unknown-freebsd12.0/6.4.0/include/bmi2intrin.h
R 1520 /usr/local/lib/gcc/x86_64-unknown-freebsd12.0/6.4.0/include/bmiintrin.h
R 1595 /usr/local/lib/gcc/x86_64-unknown-freebsd12.0/6.4.0/include/clflushoptintrin.h
R 1595 /usr/local/lib/gcc/x86_64-unknown-freebsd12.0/6.4.0/include/clwbintrin.h
R 1595 /usr/local/lib/gcc/x86_64-unknown-freebsd12.0/6.4.0/include/clzerointrin.h
R 56022 /usr/local/lib/gcc/x86_64-unknown-freebsd12.0/6.4.0/include/cpuid.h
R 1222 /usr/local/lib/gcc/x86_64-unknown-freebsd12.0/6.4.0/include/emmintrin.h
R 1520 /usr/local/lib/gcc/x86_64-unknown-freebsd12.0/6.4.0/include/f16cintrin.h
R 1595 /usr/local/lib/gcc/x86_64-unknown-freebsd12.0/6.4.0/include/fma4intrin.h
R 1520 /usr/local/lib/gcc/x86_64-unknown-freebsd12.0/6.4.0/include/fmaintrin.h
R 1595 /usr/local/lib/gcc/x86_64-unknown-freebsd12.0/6.4.0/include/fxsrintrin.h
R 1595 /usr/local/lib/gcc/x86_64-unknown-freebsd12.0/6.4.0/include/ia32intrin.h
R 1520 /usr/local/lib/gcc/x86_64-unknown-freebsd12.0/6.4.0/include/immintrin.h
R 1595 /usr/local/lib/gcc/x86_64-unknown-freebsd12.0/6.4.0/include/lwpintrin.h
R 1520 /usr/local/lib/gcc/x86_64-unknown-freebsd12.0/6.4.0/include/lzcntintrin.h
R 1595 /usr/local/lib/gcc/x86_64-unknown-freebsd12.0/6.4.0/include/mm3dnow.h
R 1222 /usr/local/lib/gcc/x86_64-unknown-freebsd12.0/6.4.0/include/mm_malloc.h
R 1222 /usr/local/lib/gcc/x86_64-unknown-freebsd12.0/6.4.0/include/mmintrin.h
R 1595 /usr/local/lib/gcc/x86_64-unknown-freebsd12.0/6.4.0/include/mwaitxintrin.h
R 1595 /usr/local/lib/gcc/x86_64-unknown-freebsd12.0/6.4.0/include/pkuintrin.h
R 1336 /usr/local/lib/gcc/x86_64-unknown-freebsd12.0/6.4.0/include/pmmintrin.h
R 1485 /usr/local/lib/gcc/x86_64-unknown-freebsd12.0/6.4.0/include/popcntintrin.h
R 1595 /usr/local/lib/gcc/x86_64-unknown-freebsd12.0/6.4.0/include/prfchwintrin.h
R 1595 /usr/local/lib/gcc/x86_64-unknown-freebsd12.0/6.4.0/include/rdseedintrin.h
R 1520 /usr/local/lib/gcc/x86_64-unknown-freebsd12.0/6.4.0/include/rtmintrin.h
R 1520 /usr/local/lib/gcc/x86_64-unknown-freebsd12.0/6.4.0/include/shaintrin.h
R 1485 /usr/local/lib/gcc/x86_64-unknown-freebsd12.0/6.4.0/include/smmintrin.h
R 10000 /usr/local/lib/gcc/x86_64-unknown-freebsd12.0/6.4.0/include/stdarg.h
R 27622 /usr/local/lib/gcc/x86_64-unknown-freebsd12.0/6.4.0/include/stdatomic.h
R 10000 /usr/local/lib/gcc/x86_64-unknown-freebsd12.0/6.4.0/include/stdbool.h
R 10025 /usr/local/lib/gcc/x86_64-unknown-freebsd12.0/6.4.0/include/stddef.h
R 10000 /usr/local/lib/gcc/x86_64-unknown-freebsd12.0/6.4.0/include/stdint.h
R 68604 /usr/local/lib/gcc/x86_64-unknown-freebsd12.0/6.4.0/include/stdnoreturn.h
R 1595 /usr/local/lib/gcc/x86_64-unknown-freebsd12.0/6.4.0/include/tbmintrin.h
R 1336 /usr/local/lib/gcc/x86_64-unknown-freebsd12.0/6.4.0/include/tmmintrin.h
R 1520 /usr/local/lib/gcc/x86_64-unknown-freebsd12.0/6.4.0/include/wmmintrin.h
R 1595 /usr/local/lib/gcc/x86_64-unknown-freebsd12.0/6.4.0/include/x86intrin.h
R 1222 /usr/local/lib/gcc/x86_64-unknown-freebsd12.0/6.4.0/include/xmmintrin.h
R 1595 /usr/local/lib/gcc/x86_64-unknown-freebsd12.0/6.4.0/include/xopintrin.h
R 1595 /usr/local/lib/gcc/x86_64-unknown-freebsd12.0/6.4.0/include/xsavecintrin.h
R 1595 /usr/local/lib/gcc/x86_64-unknown-freebsd12.0/6.4.0/include/xsaveintrin.h
R 1595 /usr/local/lib/gcc/x86_64-unknown-freebsd12.0/6.4.0/include/xsaveoptintrin.h
R 1595 /usr/local/lib/gcc/x86_64-unknown-freebsd12.0/6.4.0/include/xsavesintrin.h
R 1520 /usr/local/lib/gcc/x86_64-unknown-freebsd12.0/6.4.0/include/xtestintrin.h




===
Mark Millard
marklmi at yahoo.com
( dsl-only.net went
away in early 2018-Mar)
Received on Fri Jul 27 2018 - 05:12:17 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:41:17 UTC