Port-arm archive

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

Re: NetBSD-7 build issues with earmv7hf



On Sun, 10 Jul 2016 08:39:14 +0100
Sad Clouds <cryintothebluesky%googlemail.com@localhost> wrote:

> On Sun, 10 Jul 2016 09:36:24 +0200
> Martin Husemann <martin%duskware.de@localhost> wrote:
> 
> > On Sun, Jul 10, 2016 at 08:30:40AM +0100, Sad Clouds wrote:
> > > From mk.conf(5) there is warning that CFLAGS should never be set
> > > in mk.conf
> > > 
> > > COPTS          Extra options for the C compiler.  Should be
> > > appended to (e.g., COPTS+=-g), rather than explicitly set.  Note
> > > that CPUFLAGS, not COPTS, should be used for compiler flags that
> > > select CPU-related options.  Also note that CFLAGS should never be
> > > set in mk.conf.
> > 
> > Yes, I know I'm in unsupported terrritory there, but -pipe does not
> > change generated code and there is no real harm done if it sometimes
> > is not added due to CFLAGS being reset elsewhere.
> > 
> > In general you are right, and the advice in mk.conf(5) is correct.
> > 
> > Now let's try to spot the bogus COPTS comparison that breaks your
> > build (should be easy to reproduce locally now).
> > 
> > Martin
> 
> My machine is a bit slow, but I'm doing exactly what you suggested,
> running two builds and looking at the difference between compiler
> options 

OK, so I think I managed to figure out what's breaking it

Without setting COPTS in mk.conf results in "-O2" being passed to GCC,
which builds correctly

When setting COPTS+=-pipe in mk.conf this results "-pipe" being passed
to GCC, at the same time as "-O2" being lost. The fact that no
optimization flag is passed to GCC, results in assembler errors.

I think this is a makefile processing bug or something similar.

So trying to build vfp_init.c without GCC optimization flags will fail
for some reason:

# pwd
/opt/obj.evbarm/sys/arch/evbarm/compile/BCM5301X

# /opt/tools.evbarm/bin/armv7--netbsdelf-eabihf-gcc -mfpu=vfp -mfloat-abi=soft -ffreestanding -fno-zero-initialized-in-bss -fno-strict-aliasing -fno-common -mfpu=vfp -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-sign-compare --sysroot=/opt/obj.evbarm/destdir.evbarm -mcpu=cortex-a9 -mfpu=neon -DKERNEL_BASES_EQUAL -DKERNEL_BASE_VOFFSET=0 -I. -I/opt/src/sys/../common/include -I/opt/src/sys/arch -I/opt/src/sys -nostdinc -DCHILD_MAX=1024 -DOPEN_MAX=1024 -D__HAVE_MM_MD_DIRECT_MAPPED_PHYS -D__HAVE_MM_MD_CACHE_ALIASING -D__HAVE_FAST_SOFTINTS -D__HAVE_CPU_UAREA_ALLOC_IDLELWP -D__HAVE_CPU_COUNTER -D__HAVE_PCI_CONF_HOOK -DKERNEL_BASE_EXT=0x80000000 -DARM_GENERIC_TODR -DRNDVERBOSE -DDIAGNOSTIC -DDEBUG -DMAXUSERS=32 -D_KERNEL -D_KERNEL_OPT -std=gnu99 -I/opt/src/sys/lib/libkern/../../../common/lib/lib
 c/quad -I/opt/src/sys/lib/libkern/../../../common/lib/libc/string -I/opt/src/sys/lib/libkern/../../../common/lib/libc/arch/arm/string -c /opt/src/sys/arch/arm/vfp/vfp_init.c
/var/tmp//cct0egf6.s: Assembler messages:
/var/tmp//cct0egf6.s:623: Error: selected processor does not support ARM mode `vmrs r3,fpsid'
/var/tmp//cct0egf6.s:650: Error: selected processor does not support ARM mode `vmrs r3,fpscr'
/var/tmp//cct0egf6.s:679: Error: selected processor does not support ARM mode `vmsr fpscr,r3'
/var/tmp//cct0egf6.s:703: Error: selected processor does not support ARM mode `vmrs r3,mvfr1'
/var/tmp//cct0egf6.s:730: Error: selected processor does not support ARM mode `vmrs r3,mvfr0'
/var/tmp//cct0egf6.s:757: Error: selected processor does not support ARM mode `vmrs r3,fpexc'
/var/tmp//cct0egf6.s:786: Error: selected processor does not support ARM mode `vmsr fpexc,r3'
/var/tmp//cct0egf6.s:810: Error: selected processor does not support ARM mode `fmrx r3,fpinst'
/var/tmp//cct0egf6.s:839: Error: selected processor does not support ARM mode `fmxr fpinst,r3'
/var/tmp//cct0egf6.s:863: Error: selected processor does not support ARM mode `fmrx r3,fpinst2'
/var/tmp//cct0egf6.s:892: Error: selected processor does not support ARM mode `fmxr fpinst2,r3'


Home | Main Index | Thread Index | Old Index