Bug 250627 - math/py-matplotlib: does not build on 11.4 - llvm linker needed?
Summary: math/py-matplotlib: does not build on 11.4 - llvm linker needed?
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: freebsd-ports-bugs (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-10-26 10:39 UTC by Bengt Ahlgren
Modified: 2020-10-29 15:26 UTC (History)
3 users (show)

See Also:
bugzilla: maintainer-feedback? (mainland)


Attachments
poudriere log (119.13 KB, text/plain)
2020-10-26 10:39 UTC, Bengt Ahlgren
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Bengt Ahlgren 2020-10-26 10:39:29 UTC
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?
Comment 1 Bengt Ahlgren 2020-10-26 11:26:31 UTC
Setting "LDFLAGS=-fuse-ld=lld" in make.conf for the poudriere jail allows the port to build.
Comment 2 commit-hook freebsd_committer freebsd_triage 2020-10-29 07:16:18 UTC
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
Comment 3 commit-hook freebsd_committer freebsd_triage 2020-10-29 07:18:21 UTC
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
Comment 4 Fernando Apesteguía freebsd_committer freebsd_triage 2020-10-29 07:22:10 UTC
Committed and MFHed,

Thanks!
Comment 5 Bengt Ahlgren 2020-10-29 11:13:00 UTC
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?
Comment 6 Fernando Apesteguía freebsd_committer freebsd_triage 2020-10-29 15:26:43 UTC
(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.