NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: kern/57514: Self build fails on evbarm-aarch64



Hi,

Where did you set ``-march=armv8-a+nofp+nosimd''? For this purpose, you should
use CPUFLAGS; see mk.conf(5) for more details. In this case, standard
optimization
flags seem to be override by this MD flag.

Note that diagnostic features of GCC precisely depend on optimization
flags, target
machines, etc., etc., and untested combination often results in
surprising result...

Thanks,
rin

2023年7月8日(土) 16:35 <taca%back-street.net@localhost>:
>
> >Number:         57514
> >Category:       kern
> >Synopsis:       Self build fails on evbarm-aarch64
> >Confidential:   no
> >Severity:       serious
> >Priority:       medium
> >Responsible:    kern-bug-people
> >State:          open
> >Class:          sw-bug
> >Submitter-Id:   net
> >Arrival-Date:   Sat Jul 08 07:35:00 +0000 2023
> >Originator:     Takahiro Kambe
> >Release:        NetBSD 10.99.4
> >Organization:
>
> >Environment:
>
>
> System: NetBSD m2utm.a.back-street.net 10.99.4 NetBSD 10.99.4 (GENERIC64) #6: Fri Jul 7 23:40:33 JST 2023 taca%m2utm.a.back-street.net@localhost:/data/current/evbarm/obj/sys/arch/evbarm/compile/GENERIC64 evbarm
> Architecture: aarch64
> Machine: evbarm
> >Description:
>         Self build fails on evbarm-aarch64.
>
> >How-To-Repeat:
>         Build kernel on NetBSD-10.99.4-evbarm.
>
>         I tested NetBSD 10.99.4 running on UTM 4.3.0 (https://getutm.app/)
>         under macOS 13.4.1 / MacBook Air M2.  (Yes, it might be problem of
>         UTM 4.3.0 / qemu 8.0.0.)
>
> % sh build.sh -X /usr/xsrc -x -D /data/current/evbarm/tree -O /data/current/evbarm/obj -R /data/current/release -N1 -a aarch64 -m evbarm -U -x -u -j1 kernel=GENERIC64
> ...
> ===> Building kernel without building new tools
> ===> Building kernel:     GENERIC64
> ...
>     compile  GENERIC64/uvm_bio.o
> /usr/src/sys/uvm/uvm_bio.c: In function 'ubc_fault':
> /usr/src/sys/uvm/uvm_bio.c:308:1: error: stack usage might be unbounded [-Werror=stack-usage=]
>   308 | ubc_fault(struct uvm_faultinfo *ufi, vaddr_t ign1, struct vm_page **ign2,
>       | ^~~~~~~~~
> /usr/src/sys/uvm/uvm_bio.c: In function 'ubc_uiomove':
> /usr/src/sys/uvm/uvm_bio.c:740:1: error: stack usage might be unbounded [-Werror=stack-usage=]
>   740 | ubc_uiomove(struct uvm_object *uobj, struct uio *uio, vsize_t todo, int advice,
>       | ^~~~~~~~~~~
> /usr/src/sys/uvm/uvm_bio.c: In function 'ubc_zerorange':
> /usr/src/sys/uvm/uvm_bio.c:807:1: error: stack usage might be unbounded [-Werror=stack-usage=]
>   807 | ubc_zerorange(struct uvm_object *uobj, off_t off, size_t len, int flags)
>       | ^~~~~~~~~~~~~
> /usr/src/sys/uvm/uvm_bio.c: In function 'ubc_uiomove_direct':
> /usr/src/sys/uvm/uvm_bio.c:980:1: error: stack usage might be unbounded [-Werror=stack-usage=]
>   980 | ubc_uiomove_direct(struct uvm_object *uobj, struct uio *uio, vsize_t todo, int advice,
>       | ^~~~~~~~~~~~~~~~~~
> /usr/src/sys/uvm/uvm_bio.c: In function 'ubc_zerorange_direct':
> /usr/src/sys/uvm/uvm_bio.c:1050:1: error: stack usage might be unbounded [-Werror=stack-usage=]
>  1050 | ubc_zerorange_direct(struct uvm_object *uobj, off_t off, size_t todo, int flags)
>       | ^~~~~~~~~~~~~~~~~~~~
> cc1: all warnings being treated as errors
>
> *** Failed target: uvm_bio.o
> *** Failed commands:
>         ${NORMAL_C}
>         => @echo '   ' "compile  GENERIC64/uvm_bio.o" &&  : echo /data/current/evbarm/obj/tooldir-NetBSD-10.99.4-evbarm/bin/aarch64--netbsd-gcc -Wno-stack-protector   -march=armv8-a+nofp+nosimd -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -ffreestanding -fno-zero-initialized-in-bss  -fno-delete-null-pointer-checks  -g -pipe -pipe  -fstack-usage -Wstack-usage=3584  -fno-strict-aliasing -fno-common -Wno-stack-protector     -std=gnu99   -Werror -Wall -Wno-main -Wno-format-zero-length -Wpointer-arith -Wmissing-prototypes -Wstrict-prototypes -Wold-style-definition -Wswitch -Wshadow -Wcast-qual -Wwrite-strings -Wno-unreachable-code -Wno-pointer-sign -Wno-attributes -Wno-type-limits -Wno-sign-compare    -Wno-address-of-packed-member  -Walloca     --sysroot=/data/current/evbarm/tree -I. -I/usr/src/sys/external/bsd/libnv/dist -I/usr/src/sys/external/bsd/acpica/dist -I/usr/src/sys/../common/lib/libx86emu -I/usr/src/sys/../common/lib/libc/misc -I/usr/src/sys/../common/include -I/usr/src/sys/ar
>  ch  -I/usr/src/sys -nostdinc -DCOMPAT_UTILS  -DAARCH64  -DARM_GENERIC_TODR  -DFPU_VFP  -D__HAVE_PCI_CONF_HOOK  -D__HAVE_PCI_MSI_MSIX  -DCOMPAT_44  -DDIAGNOSTIC  -DARMV81_PAN -D_KERNEL -D_KERNEL_OPT -std=gnu99 -I/usr/src/sys/lib/libkern/../../../common/lib/libc/quad -I/usr/src/sys/lib/libkern/../../../common/lib/libc/string -I/usr/src/sys/lib/libkern/../../../common/lib/libc/arch/aarch64/string -I/usr/src/sys/lib/libkern/../../../common/lib/libc/arch/aarch64/atomic -I/usr/src/sys/lib/libkern/../../../common/lib/libc/hash/sha3   -I/usr/src/sys/external/bsd -I/usr/src/sys/external/bsd/common/include -I/usr/src/sys/external/bsd/dwc2/dist -I/usr/src/sys/external/bsd/libfdt/dist -I/usr/src/sys/external/bsd/acpica/dist/include -I/usr/src/sys/external/bsd/libnv/dist -I/usr/src/sys/external/bsd/vchiq/dist -I/usr/src/sys/external/bsd/common/include -DVCOS_VERIFY_BKPTS=1 -DUSE_VCHIQ_ARM -D__VCCOREVER__=0x04000000 -DVCHIQ_ENABLE_DEBUG=1 -DVCHIQ_LOG_DEFAULT=5 -c /usr/src/sys/uvm/uvm_bio.c -o uvm
>  _bio.o  &&  /data/current/evbarm/obj/tooldir-NetBSD-10.99.4-evbarm/bin/aarch64--netbsd-gcc -Wno-stack-protector   -march=armv8-a+nofp+nosimd -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -ffreestanding -fno-zero-initialized-in-bss  -fno-delete-null-pointer-checks  -g -pipe -pipe  -fstack-usage -Wstack-usage=3584  -fno-strict-aliasing -fno-common -Wno-stack-protector     -std=gnu99   -Werror -Wall -Wno-main -Wno-format-zero-length -Wpointer-arith -Wmissing-prototypes -Wstrict-prototypes -Wold-style-definition -Wswitch -Wshadow -Wcast-qual -Wwrite-strings -Wno-unreachable-code -Wno-pointer-sign -Wno-attributes -Wno-type-limits -Wno-sign-compare    -Wno-address-of-packed-member  -Walloca     --sysroot=/data/current/evbarm/tree -I. -I/usr/src/sys/external/bsd/libnv/dist -I/usr/src/sys/external/bsd/acpica/dist -I/usr/src/sys/../common/lib/libx86emu -I/usr/src/sys/../common/lib/libc/misc -I/usr/src/sys/../common/include -I/usr/src/sys/arch  -I/usr/src/sys -nostdinc -DCOMPAT_UTILS
>  -DAARCH64  -DARM_GENERIC_TODR  -DFPU_VFP  -D__HAVE_PCI_CONF_HOOK  -D__HAVE_PCI_MSI_MSIX  -DCOMPAT_44  -DDIAGNOSTIC  -DARMV81_PAN -D_KERNEL -D_KERNEL_OPT -std=gnu99 -I/usr/src/sys/lib/libkern/../../../common/lib/libc/quad -I/usr/src/sys/lib/libkern/../../../common/lib/libc/string -I/usr/src/sys/lib/libkern/../../../common/lib/libc/arch/aarch64/string -I/usr/src/sys/lib/libkern/../../../common/lib/libc/arch/aarch64/atomic -I/usr/src/sys/lib/libkern/../../../common/lib/libc/hash/sha3   -I/usr/src/sys/external/bsd -I/usr/src/sys/external/bsd/common/include -I/usr/src/sys/external/bsd/dwc2/dist -I/usr/src/sys/external/bsd/libfdt/dist -I/usr/src/sys/external/bsd/acpica/dist/include -I/usr/src/sys/external/bsd/libnv/dist -I/usr/src/sys/external/bsd/vchiq/dist -I/usr/src/sys/external/bsd/common/include -DVCOS_VERIFY_BKPTS=1 -DUSE_VCHIQ_ARM -D__VCCOREVER__=0x04000000 -DVCHIQ_ENABLE_DEBUG=1 -DVCHIQ_LOG_DEFAULT=5 -c /usr/src/sys/uvm/uvm_bio.c -o uvm_bio.o  &&  : echo /data/current/evbarm/obj/t
>  ooldir-NetBSD-10.99.4-evbarm/bin/nbctfconvert -g -L VERSION -g uvm_bio.o &&  /data/current/evbarm/obj/tooldir-NetBSD-10.99.4-evbarm/bin/nbctfconvert -g -L VERSION -g uvm_bio.o
> *** [uvm_bio.o] Error code 1
>
> nbmake: stopped in /data/current/evbarm/obj/sys/arch/evbarm/compile/GENERIC64
> 1 error
>
> nbmake: stopped in /data/current/evbarm/obj/sys/arch/evbarm/compile/GENERIC64
>
> ERROR: Failed to make all in "/data/current/evbarm/obj/sys/arch/evbarm/compile/GENERIC64"
>
> *** BUILD ABORTED ***
>
> >Fix:
>         Below change solve the problem.
>         I don't know where come from a magic number 3584...
>
> diff --git a/sys/conf/Makefile.kern.inc b/sys/conf/Makefile.kern.inc
> index 210c1739b2..4b53913b7c 100644
> --- a/sys/conf/Makefile.kern.inc
> +++ b/sys/conf/Makefile.kern.inc
> @@ -113,7 +113,7 @@ AFLAGS+=    -D_LOCORE -Wa,--fatal-warnings
>  #    find . -name \*.su | xargs awk '{ printf "%6d %s\n", $2, $1 }' | sort -n
>  .if ${MACHINE} != "vax"
>  # GCC/vax 8.4 does not support -fstack-usage.
> -CFLAGS+=       ${${ACTIVE_CC} == "gcc":? -fstack-usage -Wstack-usage=3584 :}
> +#CFLAGS+=      ${${ACTIVE_CC} == "gcc":? -fstack-usage -Wstack-usage=3584 :}
>  .endif
>  CWARNFLAGS+=   -Walloca
>
>
> >Unformatted:
>
>
>


Home | Main Index | Thread Index | Old Index