devel/xtoolchain-llvm70 based buildkernel for head -r338675 fails: if_fxp.c:1630:3: error: array index -1 is before the beginning of the array

Mark Millard marklmi at yahoo.com
Thu Sep 20 20:03:57 UTC 2018


This was targeting amd64.

--- if_fxp.o ---
/usr/src/sys/dev/fxp/if_fxp.c:1630:3: error: array index -1 is before the beginning of the array [-Werror,-Warray-bounds]
                cbp->tbd[-1].tb_size = htole32(m->m_pkthdr.tso_segsz << 16);
                ^        ~~
/usr/src/sys/dev/fxp/if_fxpreg.h:297:3: note: array 'tbd' declared here
                struct fxp_tbd tbd[FXP_NTXSEG + 1];
                ^
1 error generated.
*** [if_fxp.o] Error code 1

make[4]: stopped in /usr/src/sys/modules/fxp
.ERROR_TARGET='if_fxp.o'
.ERROR_META_FILE='/usr/obj/amd64_xtoolchain-llvm/amd64.amd64/usr/src/amd64.amd64/sys/GENERIC-NODBG/modules/usr/src/sys/modules/fxp/if_fxp.o.meta'
.MAKE.LEVEL='4'
MAKEFILE=''
.MAKE.MODE='meta missing-filemon=yes missing-meta=yes silent=yes verbose'
_ERROR_CMD='/usr/local/bin/clang70 -target x86_64-unknown-freebsd12.0 --sysroot=/usr/obj/amd64_xtoolchain-llvm/amd64.amd64/usr/src/amd64.amd64/tmp -B/var/empty  -O2 -pipe  -fno-strict-aliasing -Werror -D_KERNEL -DKLD_MODULE -DKLD_TIED -nostdinc   -DHAVE_KERNEL_OPTION_HEADERS -include /usr/obj/amd64_xtoolchain-llvm/amd64.amd64/usr/src/amd64.amd64/sys/GENERIC-NODBG/opt_global.h -I. -I/usr/src/sys -I/usr/src/sys/contrib/ck/include -fno-common -g -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -I/usr/obj/amd64_xtoolchain-llvm/amd64.amd64/usr/src/amd64.amd64/sys/GENERIC-NODBG   -mcmodel=kernel -mno-red-zone -mno-mmx -mno-sse -msoft-float  -fno-asynchronous-unwind-tables -ffreestanding -fwrapv -fstack-protector -gdwarf-2 -Wall -Wredundant-decls -Wnested-externs -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Wcast-qual -Wundef -Wno-pointer-sign -D__printf__=__freebsd_kprintf__ -Wmissing-include-dirs -fdiagnostics-show-option -Wno-unknown-pragmas -Wno-error-tautological-compare -Wno-error-empty-body -Wno-error-parentheses-equality -Wno-error-unused-function -Wno-error-pointer-sign -Wno-error-shift-negative-value -Wno-address-of-packed-member  -mno-aes -mno-avx  -std=iso9899:1999 -c /usr/src/sys/dev/fxp/if_fxp.c -o if_fxp.o; ctfconvert -L VERSION -g if_fxp.o;'
.CURDIR='/usr/src/sys/modules/fxp'
.MAKE='make'
.OBJDIR='/usr/obj/amd64_xtoolchain-llvm/amd64.amd64/usr/src/amd64.amd64/sys/GENERIC-NODBG/modules/usr/src/sys/modules/fxp'
.TARGETS='all'
DESTDIR=''
LD_LIBRARY_PATH=''
MACHINE='amd64'
MACHINE_ARCH='amd64'
MAKEOBJDIRPREFIX='/usr/obj/amd64_xtoolchain-llvm/amd64.amd64/usr/src/amd64.amd64/sys/GENERIC-NODBG/modules'
MAKESYSPATH='/usr/src/share/mk'
MAKE_VERSION='20180512'
PATH='/usr/obj/amd64_xtoolchain-llvm/amd64.amd64/usr/src/amd64.amd64/tmp/legacy/usr/sbin:/usr/obj/amd64_xtoolchain-llvm/amd64.amd64/usr/src/amd64.amd64/tmp/legacy/usr/bin:/usr/obj/amd64_xtoolchain-llvm/amd64.amd64/usr/src/amd64.amd64/tmp/legacy/bin:/usr/obj/amd64_xtoolchain-llvm/amd64.amd64/usr/src/amd64.amd64/tmp/usr/sbin:/usr/obj/amd64_xtoolchain-llvm/amd64.amd64/usr/src/amd64.amd64/tmp/usr/bin:/sbin:/bin:/usr/sbin:/usr/bin'
SRCTOP='/usr/src'
OBJTOP='/usr/obj/amd64_xtoolchain-llvm/amd64.amd64/usr/src/amd64.amd64/sys/GENERIC-NODBG/modules/usr/src'
.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-llvm.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/sys/modules/fxp/Makefile /usr/src/share/mk/bsd.kmod.mk /usr/src/sys/conf/kmod.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/sys/modules/fxp/../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/sys/conf/kern.opts.mk /usr/src/sys/conf/config.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/sys/conf/kern.mk'
.PATH='. /usr/src/sys/modules/fxp /usr/src/sys/dev/fxp /usr/obj/amd64_xtoolchain-llvm/amd64.amd64/usr/src/amd64.amd64/sys/GENERIC-NODBG'
1 error



/usr/src/sys/dev/fxp/if_fxpreg.h:297 is in:

struct fxp_cb_tx {
        uint16_t cb_status;
        uint16_t cb_command;
        uint32_t link_addr;
        uint32_t tbd_array_addr;
        uint16_t byte_count;
        uint8_t tx_threshold;
        uint8_t tbd_number;
 
        /*
         * The following structure isn't actually part of the TxCB,
         * unless the extended TxCB feature is being used.  In this
         * case, the first two elements of the structure below are
         * fetched along with the TxCB.
         */
        union {
                struct fxp_ipcb ipcb;
                struct fxp_tbd tbd[FXP_NTXSEG + 1];
        } tx_cb_u;
};


/usr/src/sys/dev/fxp/if_fxp.c:1630 is in:

        /* Configure TSO. */
        if (m->m_pkthdr.csum_flags & CSUM_TSO) {
                cbp->tbd[-1].tb_size = htole32(m->m_pkthdr.tso_segsz << 16);
                cbp->tbd[1].tb_size |= htole32(tcp_payload << 16);
                cbp->ipcb_ip_schedule |= FXP_IPCB_LARGESEND_ENABLE |
                    FXP_IPCB_IP_CHECKSUM_ENABLE |
                    FXP_IPCB_TCP_PACKET |
                    FXP_IPCB_TCPUDP_CHECKSUM_ENABLE;
        }



===
Mark Millard
marklmi at yahoo.com
( dsl-only.net went
away in early 2018-Mar)



More information about the freebsd-toolchain mailing list