Index | Thread | Search

From:
Daniel Dickman <didickman@gmail.com>
Subject:
Re: [sparc64] fix py-matplotlib build
To:
Theo Buehler <tb@theobuehler.org>
Cc:
ports@openbsd.org, kmos@openbsd.org
Date:
Sat, 28 Mar 2026 18:07:04 -0400

Download raw body.

Thread
I don't have a problem with this if it fixes sparc.

Should the test be for any platform using ports-gcc or just sparc though?

I am fine either way, please feel free to move this forward any way you 
like and thanks for investigating it.

On Thu, 26 Mar 2026, Theo Buehler wrote:

> as(1) does not understand things emitted by gcc/15 with -flto=auto,
> which is enabled by b_lto=true in meson.build, resulting in this:
> 
> c++ -Iextern/agg24-svn/libagg.a.p -Iextern/agg24-svn -I../extern/agg24-svn -I../extern/agg24-svn/include -fvisibility=hidden -fvisibility-inlines-hidden -flto=auto -fdiagnostics-color=always -DNDEBUG -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -std=c++17 -O3 -fPIC -MD -MQ extern/agg24-svn/libagg.a.p/src_agg_bezier_arc.cpp.o -MF extern/agg24-svn/libagg.a.p/src_agg_bezier_arc.cpp.o.d -o extern/agg24-svn/libagg.a.p/src_agg_bezier_arc.cpp.o -c ../extern/agg24-svn/src/agg_bezier_arc.cpp
> /tmp//ccNoBMVq.s: Assembler messages:
> /tmp//ccNoBMVq.s:2: Fatal error: unrecognized .section attribute: want a,w,x,M,S,G,T
> ninja: build stopped: subcommand failed.
> 
> The offending line is
> 
> .section        .gnu.lto_.profile.5712db33fb59d8ee,"e",@progbits
> 
> and the "e" (exclude section from linking) is what trips up as(1), see
> obj_elf_parse_section_letters() in gas/config/obj-elf.c.
> 
> The below isn't pretty but fixes the build on sparc64. If there are
> better ideas, I'm all ears.
> 
> Index: Makefile
> ===================================================================
> RCS file: /cvs/ports/graphics/py-matplotlib/Makefile,v
> diff -u -p -r1.109 Makefile
> --- Makefile	13 Mar 2026 21:57:15 -0000	1.109
> +++ Makefile	26 Mar 2026 05:48:43 -0000
> @@ -70,3 +70,9 @@ post-install:
>  	cd ${WRKSRC}/galleries/examples && pax -rw * ${EXAMPLESDIR}
>  
>  .include <bsd.port.mk>
> +
> +.if ${CHOSEN_COMPILER} == "ports-gcc"
> +# as(1) can't deal with port-gcc's output of -flto=auto
> +# Fatal error: unrecognized .section attribute: want a,w,x,M,S,G,T
> +MODPY_PYBUILD_ARGS+=--config-setting=setup-args=-Db_lto=false
> +.endif
>