Friday, November 13, 2020

Re: assembler error on trying to port OpenBLAS

On 2020/10/30 23:14, Brad Smith wrote:
> On Fri, Oct 30, 2020 at 04:55:53PM +0000, Stuart Henderson wrote:
> > On 2020/10/29 20:25, Aisha Tammy wrote:
> > > I'm trying to port OpenBLAS to the tree and am currently getting
> > > some weird assembler errors (port makefile is attached at end math/openblas)
> >
> > not that weird, the source code has inline asm, it is passed to
> > /usr/bin/as which is pretty old and pre-dates support for this
> > being added
> >
> > > Presumably this is happening due to the assembler being used is
> > > the one from base as we don't build the ports egcc with gas for
> > > anything except aarch64 and arm.
> > > I'm kind of stumped here as it seems like using gfortran sets the
> > > compiler to egcc (compiling the above file with cc works).
> > > Is it possible to mix gfortran with base-clang C compiler?
> > > Another (possible) solution would be to build egcc all archs with
> > > the new gas assembler, but that sounds a lot more dangerous and I
> > > don't know enough to know if that is possible/or even a good idea/
> > > or if it will even work :-/
> >
> > I think ports/lang/gcc should start using the newer version of gas
> > from ports on i386 and amd64.
> >
> > On these archs it doesn't affect many ports (fortran things,
> > asterisk, seabios [vmm-firmware], maybe one or two others).
> >
> > For other archs there is higher risk as large parts of the ports
> > tree use ports-gcc on most of these. But there's probably less need
> > for the newer assembler on those too.
>
> I had sent a diff like the following to Pascal last year. Since in the
> past we had run into issues with inline asm and our GNU as being too old.
>
>
> Index: Makefile
> ===================================================================
> RCS file: /home/cvs/ports/lang/gcc/8/Makefile,v
> retrieving revision 1.34
> diff -u -p -u -p -r1.34 Makefile
> --- Makefile 4 Sep 2020 09:55:34 -0000 1.34
> +++ Makefile 31 Oct 2020 03:08:05 -0000
> @@ -18,6 +18,7 @@ DPB_PROPERTIES = parallel
> V = 8.4.0
> FULL_VERSION = $V
> FULL_PKGVERSION = $V
> +REVISION = 0
>
> ADASTRAP-amd64 = adastrap-amd64-8.3.0-2.tar.xz
> ADASTRAP-arm = adastrap-arm-4.9.4-0.tar.xz
> @@ -65,7 +66,8 @@ EXTRACT_ONLY = ${DISTNAME}.tar.xz
> BUILD_DEPENDS += devel/bison \
> devel/libexecinfo
>
> -.if ${MACHINE_ARCH} == "aarch64" || ${MACHINE_ARCH} == "arm"
> +.if ${MACHINE_ARCH} == "aarch64" || ${MACHINE_ARCH} == "amd64" || \
> + ${MACHINE_ARCH} == "arm" || ${MACHINE_ARCH} == "i386"
> BUILD_DEPENDS += devel/gas
> RUN_DEPENDS += devel/gas
> RUN_DEPENDS-main += devel/gas
>

Committed but I have backed it out again. Turns out this fails when
linking the produced objects with ld.bfd, which is needed by at least
seabios (sysutils/firmware/vmm) on amd64/i386, and asterisk on i386
(USE_LLD=No in ports).

No comments:

Post a Comment