Bug 220591

Summary: graphics/graphviz: fails to build on armv6 (451 ports skipped)
Product: Ports & Packages Reporter: Jan Beich <jbeich>
Component: Individual Port(s)Assignee: Dirk Meyer <dinoex>
Status: Closed FIXED    
Severity: Affects Only Me CC: linimon, mikael, toolchain
Priority: --- Keywords: needs-patch
Version: LatestFlags: dinoex: maintainer-feedback+
Hardware: Any   
OS: Any   
See Also: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=220590
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=221182
Attachments:
Description Flags
patch-lib-common-shapes.c none

Description Jan Beich freebsd_committer freebsd_triage 2017-07-10 06:12:00 UTC
./../lib/gvc/.libs/libgvc.so: undefined reference to `sincos'
cc: error: linker command failed with exit code 1 (use -v to see invocation)

https://lists.freebsd.org/pipermail/freebsd-pkg-fallout/Week-of-Mon-20170703/498271.html
Comment 1 Dirk Meyer freebsd_committer freebsd_triage 2017-07-10 09:10:35 UTC
Created attachment 184219 [details]
patch-lib-common-shapes.c

patch for sincos
Comment 2 Dirk Meyer freebsd_committer freebsd_triage 2017-07-10 09:11:39 UTC
Please try the attached patch
Comment 3 Jan Beich freebsd_committer freebsd_triage 2017-07-10 12:22:50 UTC
Comment on attachment 184219 [details]
patch-lib-common-shapes.c

Doesn't help:

  $ make
  checking for sincos... no
  [...]
  ../../lib/gvc/.libs/libgvc.so: undefined reference to `sincos'
  cc: error: linker command failed with exit code 1 (use -v to see invocation)
  [...]
  ../../plugin/neato_layout/.libs/libgvplugin_neato_layout.so: undefined reference to `sincos'
  cc: error: linker command failed with exit code 1 (use -v to see invocation)

I've also tried adding

  # Bug 220590: -ffast-math is broken without sincos in libm
  CFLAGS_armv6=	-fno-unsafe-math-optimizations

but it doesn't help due to the order of CFLAGS on command line.
Comment 4 Mikael Urankar freebsd_committer freebsd_triage 2017-07-10 14:19:05 UTC
You can add CFLAGS+= -fno-builtin-sincos -fno-builtin-sin -fno-builtin-cos -fno-builtin-sincosf -fno-builtin-sinf -fno-builtin-cosf -fno-builtin-sincosl -fno-builtin-sinl -fno-builtin-cosl

or ask mmel@ to mfc base r319047
Comment 5 Mikael Urankar freebsd_committer freebsd_triage 2017-07-10 14:20:31 UTC
We build package for 11.0 on armv6 now?
Comment 6 commit-hook freebsd_committer freebsd_triage 2017-07-11 08:29:13 UTC
A commit references this bug:

Author: dinoex
Date: Tue Jul 11 08:28:44 UTC 2017
New revision: 445473
URL: https://svnweb.freebsd.org/changeset/ports/445473

Log:
  - fix build on armv6
  PR:		220591
  Submitted by:	Mikael Urankar

Changes:
  head/graphics/graphviz/Makefile
Comment 7 Mikael Urankar freebsd_committer freebsd_triage 2017-07-11 13:37:52 UTC
The CFLAGS must be set globally (in make.conf), a lot of multimedia and graphics ports are affected by this issue (on 11.0 and 11.1 at least), 12-CURRENT is not affected.

I don't think it's a good idea to pollute every ports with this cflags.