Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 27 Oct 2019 23:35:55 -0700
From:      Mark Millard <marklmi@yahoo.com>
To:        ports-list freebsd <freebsd-ports@freebsd.org>, Jan Beich <jbeich@FreeBSD.org>
Subject:   Re: security/nss (from head -r515742): build failure for  poudriere-devel based amd64->armv7 (cortex-a7) cross build, it tried to  build aes-armv8.c and failed
Message-ID:  <E80BA381-F7CE-44AA-8F31-B1806EBA3111@yahoo.com>

next in thread | raw e-mail | index | archive | help
> Mark Millard <marklmi at yahoo.com> writes:
>=20
> > For some reason security/nss tried to build "-march=3Darmv8-a =
-mfpu=3Dcrypto-neon-fp-armv8 aes-armv8.c"
> > material when targeting armv7 (cortex-a7). This did not go well . . =
.
>=20
> ARMv8 isn't limited to 64-bit mode. NSS 3.47 builds fine on 12.0 =
armv7, see
> =
http://www.ipv6proxy.net/go.php?u=3Dhttp://beefy13.nyi.freebsd.org/data/12=
0armv7-quarterly/515271/logs/nss-3.47.log
>=20
> $ clang -target armv7-unknown-freebsd13.0-gnueabihf \
>   -march=3Darmv8-a -mfpu=3Dcrypto-neon-fp-armv8 \
>   -dM -E -</dev/null | fgrep -i feature
> #define __ARM_FEATURE_CLZ 1
> #define __ARM_FEATURE_CRC32 1
> #define __ARM_FEATURE_CRYPTO 1   <-- Required by NSS
> #define __ARM_FEATURE_DIRECTED_ROUNDING 1
> #define __ARM_FEATURE_DSP 1
> #define __ARM_FEATURE_FMA 1
> #define __ARM_FEATURE_IDIV 1
> #define __ARM_FEATURE_LDREX 0xf
> #define __ARM_FEATURE_NUMERIC_MAXMIN 1
> #define __ARM_FEATURE_QBIT 1
> #define __ARM_FEATURE_SAT 1
> #define __ARM_FEATURE_SIMD32 1
>=20
> > /nxb-bin/usr/bin/cc ... -O2 -pipe -mcpu=3Dcortex-a7 ...
> > aes-armv8.c:13:2: error: "Compiler option is invalid"
> > #error "Compiler option is invalid"
> >  ^
> > aes-armv8.c:65:17: error: implicit declaration of function =
'vaeseq_u8' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
> >         state =3D vaeseq_u8(state, key1);
> >                 ^
>=20
> -mcpu=3Dcortex-a7 is not part of vendor CFLAGS. Did you define CPUTYPE =
or
> similar in make.conf(5) ?
>=20

Sure enough, -mcpu=3Dcortex-a7 removes:

#define __ARM_FEATURE_CRC32 1
#define __ARM_FEATURE_CRYPTO 1
#define __ARM_FEATURE_DIRECTED_ROUNDING 1
#define __ARM_FEATURE_NUMERIC_MAXMIN 1

As shown:

# clang -target armv7-unknown-freebsd13.0-gnueabihf -mcpu=3Dcortex-a7 =
-march=3Darmv8-a -mfpu=3Dcrypto-neon-fp-armv8 -dM -E - < /dev/null | =
fgrep -i feature
#define __ARM_FEATURE_CLZ 1
#define __ARM_FEATURE_DSP 1
#define __ARM_FEATURE_FMA 1
#define __ARM_FEATURE_IDIV 1
#define __ARM_FEATURE_LDREX 0xf
#define __ARM_FEATURE_QBIT 1
#define __ARM_FEATURE_SAT 1
#define __ARM_FEATURE_SIMD32 1

(This was under the interactive stage of: poudriere bulk =
-jFBSDFSSDjailArmV7 -w -i ports-mgmt/pkg
used for cross building, just in case the context mattered.)

I did use (and have for some years):

# more /usr/local/etc/poudriere.d/FBSDFSSDjailArmV7-make.conf
CFLAGS+=3D -mcpu=3Dcortex-a7
CXXFLAGS+=3D -mcpu=3Dcortex-a7
CPPFLAGS+=3D -mcpu=3Dcortex-a7

I also do such in /etc/make.conf on the actual cortex-a7
contexts that I have access to.

And my buildworld buildkernel cross-build context also does
such:

/root/src.configs/src.conf.armv7-clang-bootstrap.aarch64-host:XCFLAGS+=3D =
-mcpu=3Dcortex-a7
=
/root/src.configs/src.conf.armv7-clang-bootstrap.aarch64-host:XCXXFLAGS+=3D=
 -mcpu=3Dcortex-a7

(There is no XCPPFLAGS to set, last I checked.)

I've done such specific matching for low end machines
historically. (And for armv7, I only deal with cortex-a7
contexts.)

If disallowing such specific targeting is to happen, then
I'll have to figure out what I'm going to do. The security/nss
is involved indirectly, not because I've directly tried to
use it. So its failure under my contextual oddities blocks
other things in my context.


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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?E80BA381-F7CE-44AA-8F31-B1806EBA3111>