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
The following reply was made to PR kern/57514; it has been noted by GNATS.
From: Rin Okuyama <rokuyama.rk%gmail.com@localhost>
To: gnats-bugs%netbsd.org@localhost
Cc: kern-bug-people%netbsd.org@localhost, gnats-admin%netbsd.org@localhost, netbsd-bugs%netbsd.org@localhost
Subject: Re: kern/57514: Self build fails on evbarm-aarch64
Date: Mon, 10 Jul 2023 16:25:03 +0900
Hi,
Where did you set ``-march=3Darmv8-a+nofp+nosimd''? For this purpose, you s=
hould
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=E5=B9=B47=E6=9C=888=E6=97=A5(=E5=9C=9F) 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 o=
f
> UTM 4.3.0 / qemu 8.0.0.)
>
> % sh build.sh -X /usr/xsrc -x -D /data/current/evbarm/tree -O /data/curre=
nt/evbarm/obj -R /data/current/release -N1 -a aarch64 -m evbarm -U -x -u -j=
1 kernel=3DGENERIC64
> ...
> =3D=3D=3D> Building kernel without building new tools
> =3D=3D=3D> 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=3Dstack-usage=3D]
> 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=3Dstack-usage=3D]
> 740 | ubc_uiomove(struct uvm_object *uobj, struct uio *uio, vsize_t tod=
o, 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=3Dstack-usage=3D]
> 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=3Dstack-usage=3D]
> 980 | ubc_uiomove_direct(struct uvm_object *uobj, struct uio *uio, vsiz=
e_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=3Dstack-usage=3D]
> 1050 | ubc_zerorange_direct(struct uvm_object *uobj, off_t off, size_t t=
odo, int flags)
> | ^~~~~~~~~~~~~~~~~~~~
> cc1: all warnings being treated as errors
>
> *** Failed target: uvm_bio.o
> *** Failed commands:
> ${NORMAL_C}
> =3D> @echo ' ' "compile GENERIC64/uvm_bio.o" && : echo /data/=
current/evbarm/obj/tooldir-NetBSD-10.99.4-evbarm/bin/aarch64--netbsd-gcc -W=
no-stack-protector -march=3Darmv8-a+nofp+nosimd -fno-omit-frame-pointer -=
mno-omit-leaf-frame-pointer -ffreestanding -fno-zero-initialized-in-bss -f=
no-delete-null-pointer-checks -g -pipe -pipe -fstack-usage -Wstack-usage=
=3D3584 -fno-strict-aliasing -fno-common -Wno-stack-protector -std=3Dg=
nu99 -Werror -Wall -Wno-main -Wno-format-zero-length -Wpointer-arith -Wmi=
ssing-prototypes -Wstrict-prototypes -Wold-style-definition -Wswitch -Wshad=
ow -Wcast-qual -Wwrite-strings -Wno-unreachable-code -Wno-pointer-sign -Wno=
-attributes -Wno-type-limits -Wno-sign-compare -Wno-address-of-packed-me=
mber -Walloca --sysroot=3D/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_TO=
DR -DFPU_VFP -D__HAVE_PCI_CONF_HOOK -D__HAVE_PCI_MSI_MSIX -DCOMPAT_44 =
-DDIAGNOSTIC -DARMV81_PAN -D_KERNEL -D_KERNEL_OPT -std=3Dgnu99 -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/li=
b/libc/arch/aarch64/string -I/usr/src/sys/lib/libkern/../../../common/lib/l=
ibc/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/s=
ys/external/bsd/common/include -DVCOS_VERIFY_BKPTS=3D1 -DUSE_VCHIQ_ARM -D__=
VCCOREVER__=3D0x04000000 -DVCHIQ_ENABLE_DEBUG=3D1 -DVCHIQ_LOG_DEFAULT=3D5 -=
c /usr/src/sys/uvm/uvm_bio.c -o uvm
> _bio.o && /data/current/evbarm/obj/tooldir-NetBSD-10.99.4-evbarm/bin/a=
arch64--netbsd-gcc -Wno-stack-protector -march=3Darmv8-a+nofp+nosimd -fno=
-omit-frame-pointer -mno-omit-leaf-frame-pointer -ffreestanding -fno-zero-i=
nitialized-in-bss -fno-delete-null-pointer-checks -g -pipe -pipe -fstack=
-usage -Wstack-usage=3D3584 -fno-strict-aliasing -fno-common -Wno-stack-pr=
otector -std=3Dgnu99 -Werror -Wall -Wno-main -Wno-format-zero-length =
-Wpointer-arith -Wmissing-prototypes -Wstrict-prototypes -Wold-style-defini=
tion -Wswitch -Wshadow -Wcast-qual -Wwrite-strings -Wno-unreachable-code -W=
no-pointer-sign -Wno-attributes -Wno-type-limits -Wno-sign-compare -Wno-=
address-of-packed-member -Walloca --sysroot=3D/data/current/evbarm/tre=
e -I. -I/usr/src/sys/external/bsd/libnv/dist -I/usr/src/sys/external/bsd/ac=
pica/dist -I/usr/src/sys/../common/lib/libx86emu -I/usr/src/sys/../common/l=
ib/libc/misc -I/usr/src/sys/../common/include -I/usr/src/sys/arch -I/usr/s=
rc/sys -nostdinc -DCOMPAT_UTILS
> -DAARCH64 -DARM_GENERIC_TODR -DFPU_VFP -D__HAVE_PCI_CONF_HOOK -D__HA=
VE_PCI_MSI_MSIX -DCOMPAT_44 -DDIAGNOSTIC -DARMV81_PAN -D_KERNEL -D_KERNE=
L_OPT -std=3Dgnu99 -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/li=
bkern/../../../common/lib/libc/hash/sha3 -I/usr/src/sys/external/bsd -I/u=
sr/src/sys/external/bsd/common/include -I/usr/src/sys/external/bsd/dwc2/dis=
t -I/usr/src/sys/external/bsd/libfdt/dist -I/usr/src/sys/external/bsd/acpic=
a/dist/include -I/usr/src/sys/external/bsd/libnv/dist -I/usr/src/sys/extern=
al/bsd/vchiq/dist -I/usr/src/sys/external/bsd/common/include -DVCOS_VERIFY_=
BKPTS=3D1 -DUSE_VCHIQ_ARM -D__VCCOREVER__=3D0x04000000 -DVCHIQ_ENABLE_DEBUG=
=3D1 -DVCHIQ_LOG_DEFAULT=3D5 -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/nbctfconver=
t -g -L VERSION -g uvm_bio.o
> *** [uvm_bio.o] Error code 1
>
> nbmake: stopped in /data/current/evbarm/obj/sys/arch/evbarm/compile/GENER=
IC64
> 1 error
>
> nbmake: stopped in /data/current/evbarm/obj/sys/arch/evbarm/compile/GENER=
IC64
>
> ERROR: Failed to make all in "/data/current/evbarm/obj/sys/arch/evbarm/co=
mpile/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+=3D -D_LOCORE -Wa,--fatal-warnings
> # find . -name \*.su | xargs awk '{ printf "%6d %s\n", $2, $1 }' | so=
rt -n
> .if ${MACHINE} !=3D "vax"
> # GCC/vax 8.4 does not support -fstack-usage.
> -CFLAGS+=3D ${${ACTIVE_CC} =3D=3D "gcc":? -fstack-usage -Wstack-usa=
ge=3D3584 :}
> +#CFLAGS+=3D ${${ACTIVE_CC} =3D=3D "gcc":? -fstack-usage -Wstack-usa=
ge=3D3584 :}
> .endif
> CWARNFLAGS+=3D -Walloca
>
>
> >Unformatted:
>
>
>
Home |
Main Index |
Thread Index |
Old Index