Bug 232547

Summary: graphics/exiv2: improvements for GCC architectures
Product: Ports & Packages Reporter: Piotr Kubaj <pkubaj>
Component: Individual Port(s)Assignee: Thomas Zander <riggs>
Status: Closed FIXED    
Severity: Affects Only Me CC: linimon, pkubaj, riggs
Priority: --- Keywords: needs-qa, patch
Version: LatestFlags: riggs: maintainer-feedback+
Hardware: Any   
OS: Any   
Attachments:
Description Flags
patch
none
v2
none
v2
none
v3
none
v4 none

Description Piotr Kubaj freebsd_committer freebsd_triage 2018-10-22 21:50:42 UTC
Created attachment 198483 [details]
patch

GCC architectures currently use GCC7 from ports to build many ports dependent on exiv2, but GCC7 can't link againts libraries compiled with GCC4.2. Switch to GCC7 to fix it.

Since ports GCC is not available on mips*, don't add USES=compiler:c++11-lang globally, since it will break mips*.

powerpc64 compiles ok without -mminimal-toc, so remove that since it introduces performance penalty.

Additionally, when building with GCC7, linking against libintl is necessary, so add that for GCC architectures, besides mips*.

Tested on powerpc64 and amd64.

Hardware sponsored by IntegriCloud.
Comment 1 Piotr Kubaj freebsd_committer freebsd_triage 2018-10-23 19:01:56 UTC
Created attachment 198508 [details]
v2

Better fix - don't link to libintl and pass a flag to disable NLS.
Comment 2 Piotr Kubaj freebsd_committer freebsd_triage 2018-10-27 11:10:41 UTC
Created attachment 198689 [details]
v2

Since gettext is used in USES, we can add LDFLAGS+=-lintl.
Comment 3 Piotr Kubaj freebsd_committer freebsd_triage 2018-11-03 00:34:40 UTC
Created attachment 198902 [details]
v3

There should also be USES=localbase:ldflags.
Comment 4 Thomas Zander freebsd_committer freebsd_triage 2018-11-18 07:13:54 UTC
(In reply to Piotr Kubaj from comment #0)

You note that
> Since ports GCC is not available on mips*, don't add USES=compiler:c++11-lang globally, since it will break mips*.

However, exiv2 uses cmake to build, and the cmake port currently contains USES=compiler:c++11-lang, subsequently trying to build exiv2 on mips also fails. Did you get cmake to build on mips without this?
Comment 5 Piotr Kubaj freebsd_committer freebsd_triage 2018-11-18 13:15:14 UTC
Created attachment 199314 [details]
v4

(In reply to Thomas Zander from comment #4)
No, I didn't check whether cmake needs new compiler.

That simplifies things, then.
Comment 6 commit-hook freebsd_committer freebsd_triage 2018-11-24 08:38:58 UTC
A commit references this bug:

Author: riggs
Date: Sat Nov 24 08:38:11 UTC 2018
New revision: 485731
URL: https://svnweb.freebsd.org/changeset/ports/485731

Log:
  Fix build on gcc-based architectures, remove -mminimal-toc on powerpc64

  PR:		232547
  Submitted by:	pkubaj@anongoth.pl

Changes:
  head/graphics/exiv2/Makefile