Created attachment 219097 [details] poudriere log math/py-matplotlib fails to build on 11.4 with the following error: c++ -shared -fstack-protector-strong -O2 -pipe -fstack-protector-strong -isystem /usr/local/include -fno-strict-aliasing -isystem /usr/local/include build/temp.freebsd-11.4-RELEASE-amd64-3.7/src/checkdep_freetype2.o build/temp.freebsd-11.4-RELEASE-amd64-3.7/src/mplutils.o build/temp.freebsd-11.4-RELEASE-amd64-3.7/src/py_converters.o build/temp.freebsd-11.4-RELEASE-amd64-3.7/src/_backend_agg.o build/temp.freebsd-11.4-RELEASE-amd64-3.7/src/_backend_agg_wrapper.o build/temp.freebsd-11.4-RELEASE-amd64-3.7/extern/agg24-svn/src/agg_bezier_arc.o build/temp.freebsd-11.4-RELEASE-amd64-3.7/extern/agg24-svn/src/agg_curves.o build/temp.freebsd-11.4-RELEASE-amd64-3.7/extern/agg24-svn/src/agg_image_filters.o build/temp.freebsd-11.4-RELEASE-amd64-3.7/extern/agg24-svn/src/agg_trans_affine.o build/temp.freebsd-11.4-RELEASE-amd64-3.7/extern/agg24-svn/src/agg_vcgen_contour.o build/temp.freebsd-11.4-RELEASE-amd64-3.7/extern/agg24-svn/src/agg_vcgen_dash.o build/temp.freebsd-11.4-RELEASE-amd64-3.7/extern/agg24-svn/src/agg_vcgen_stroke.o build/temp.freebsd-11.4-RELEASE-amd64-3.7/extern/agg24-svn/src/agg_vpgen_segmentator.o -L/usr/local/lib -lpython3.7m -o build/lib.freebsd-11.4-RELEASE-amd64-3.7/matplotlib/backends/_backend_agg.so -L/usr/local/lib -lfreetype build/temp.freebsd-11.4-RELEASE-amd64-3.7/src/checkdep_freetype2.o: file not recognized: File format not recognized c++: error: linker command failed with exit code 1 (use -v to see invocation) error: command 'c++' failed with exit status 1 *** Error code 1 root@114amd64-default:/wrkdirs/usr/ports/math/py-matplotlib/work-py37/matplotlib-3.3.1/build/temp.freebsd-11.4-RELEASE-amd64-3.7/src # file checkdep_freetype2.o checkdep_freetype2.o: LLVM IR bitcode I'm guessing that the LLVM linker is needed instead of GNU ld? Or turn off -flto?
Setting "LDFLAGS=-fuse-ld=lld" in make.conf for the poudriere jail allows the port to build.
A commit references this bug: Author: fernape Date: Thu Oct 29 07:16:10 UTC 2020 New revision: 553589 URL: https://svnweb.freebsd.org/changeset/ports/553589 Log: math/py-matplotlib: Unbreak in 11.4 Use LLVM linker to build successfully. Quaterly is also broken: https://docs.freebsd.org/cgi/getmsg.cgi?fetch=152802642+0+current/freebsd-pkg-fallout https://docs.freebsd.org/cgi/getmsg.cgi?fetch=152706419+0+current/freebsd-pkg-fallout PR: 250627 Submitted by: bengta@sics.se MFH: 2020Q4 (blanket build fix) Changes: head/math/py-matplotlib/Makefile
A commit references this bug: Author: fernape Date: Thu Oct 29 07:18:01 UTC 2020 New revision: 553590 URL: https://svnweb.freebsd.org/changeset/ports/553590 Log: MFH: r553589 math/py-matplotlib: Unbreak in 11.4 Use LLVM linker to build successfully. Quaterly is also broken: https://docs.freebsd.org/cgi/getmsg.cgi?fetch=152802642+0+current/freebsd-pkg-fallout https://docs.freebsd.org/cgi/getmsg.cgi?fetch=152706419+0+current/freebsd-pkg-fallout PR: 250627 Submitted by: bengta@sics.se Approved by: ports-secteam (blanket, build fix) Changes: _U branches/2020Q4/ branches/2020Q4/math/py-matplotlib/Makefile
Committed and MFHed, Thanks!
Thanks! Will this fix work on non-LLVM architectures? I'm not an expert on this topic, and don't have any such boxes to test, but I thought that a fix similar to this was needed: .if ${/usr/bin/ld:L:tA} != /usr/bin/ld.lld LDFLAGS+= -fuse-ld=lld .endif Perhaps a toolchain expert can advise?
(In reply to Bengt Ahlgren from comment #5) Unfortunately I don't have any non-LLVM machines to test this. games/stockfish does not have the conditional LDFLAGS but graphics/blender does have something like that: # Use LLVM linker where available .if exists(/usr/bin/ld.lld) && (${/usr/bin/ld:L:tA} != /usr/bin/ld.lld) LDFLAGS+= -fuse-ld=lld .endif so I suppose the later is the way to go. I will try to find someone to test this on non-llvm archs. Thanks for pointing this out.