Saturday, May 26, 2018

Re: [armv7 fix] security/botan2

On Sat, May 26, 2018 at 01:57:06PM +0200, Markus Hennecke wrote:
> On Mon, 30 Apr 2018, Markus Hennecke wrote:
>
> > Fixed building on armv7 by disabling neon support in configure. This has
> > no effect on amd64. I tested a build there and all tests passed. 16 tests
> > failed on armv7, all unable to allocate lzma memory if I remember
> > correctly.
> >
> > Index: Makefile
> > ===================================================================
> > RCS file: /cvs/ports/security/botan2/Makefile,v
> > retrieving revision 1.16
> > diff -u -p -r1.16 Makefile
> > --- Makefile 12 Apr 2018 09:53:54 -0000 1.16
> > +++ Makefile 30 Apr 2018 07:28:24 -0000
> > @@ -39,6 +39,7 @@ CONFIGURE_ARGS = --with-build-dir=${WRKB
> > --prefix=${PREFIX} \
> > --distribution-info="`uname -sr`" \
> > --mandir=${PREFIX}/man \
> > + --disable-neon \
> > --with-bzip2 \
> > --with-lzma \
> > --with-openssl \
> >
> >
>
> After seeing some mails regarding NEON support on armv7 another approach
> would be to pass --cc-abi-flags="-mfloat-abi=softfp" to configure which
> fixes the build on armv7 as well. Going that way the port has to be
> updated after the switch to hard fp abi. Running with --disable-neon
> results in a little slower regression test, 1105 seconds vs 1135 seconds.

softfp ABI is the default since a few weeks ago

https://marc.info/?l=openbsd-cvs&m=152554719006083&w=2

>
> For 64 bit arm we can pass --disable-armv8crypto. With that it will build
> ok on aarch64 because we don't have __ARM_FEATURE_CRYPTO defined.
>
> If both --disable-{neon,armv8crypto} are used we could at them to
> CONFIGURE_ARGS because archs not affected would ignore them.
>
> As there are already .if ${MACHINE_ARCH} == conditions in the makefile
> this diff works for me on armv7 and aarch64:
>
>
> Index: Makefile
> ===================================================================
> RCS file: /cvs/ports/security/botan2/Makefile,v
> retrieving revision 1.16
> diff -u -p -r1.16 Makefile
> --- Makefile 12 Apr 2018 09:53:54 -0000 1.16
> +++ Makefile 26 May 2018 09:10:31 -0000
> @@ -45,6 +45,14 @@ CONFIGURE_ARGS = --with-build-dir=${WRKB
> --with-zlib \
> --without-sphinx
>
> +.if ${MACHINE_ARCH} == "armv7"
> +CONFIGURE_ARGS += --cc-abi-flags="-mfloat-abi=softfp"
> +.endif
> +
> +.if ${MACHINE_ARCH} == "aarch64"
> +CONFIGURE_ARGS += --disable-armv8crypto
> +.endif
> +
> .if ${MACHINE_ARCH} == "i386" || ${MACHINE_ARCH} == "amd64"
> PKG_ARGS = -Dx86=1
> .else
>

No comments:

Post a Comment