Bug 221065

Summary: [PATCH] graphics/GraphicsMagick: Use C++03 with the OPENMP option
Product: Ports & Packages Reporter: Raphael Kubo da Costa <rakuco>
Component: Individual Port(s)Assignee: Po-Chuan Hsieh <sunpoet>
Status: Closed FIXED    
Severity: Affects Only Me CC: gerald, jbeich, sunpoet
Priority: --- Keywords: patch
Version: LatestFlags: bugzilla: maintainer-feedback? (sunpoet)
Hardware: Any   
OS: Any   
See Also: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=219489
Bug Depends on:    
Bug Blocks: 219275, 219486, 219487, 219488, 219490    
Attachments:
Description Flags
Proposed patch rakuco: maintainer-approval? (sunpoet)

Description Raphael Kubo da Costa freebsd_committer freebsd_triage 2017-07-28 09:24:19 UTC
The OPENMP option forces GraphicsMagick to be built with GCC via USES=compiler:gcc-c++11-lib.

GCC 6 builds C++ code with -std=gnu++14 by default instead of -std=gnu++98 it used before. This causes libGraphicsMagick++.so to be generated with a relocation for `operator delete(void*, size_t)', which is new in C++14, instead of the traditional `operator delete(void*)'.

This works fine for GraphicsMagick itself, but not for ports that depend on it, which are generally built with base's clang (which does not default to C++14 at least at the moment), which leads to linking errors such as the ones in the bugs this one is marked as blocking. For example, graphics/cimg:

/usr/local/lib/libGraphicsMagick++.so: undefined reference to `operator delete(void*, unsigned long)'
c++: error: linker command failed with exit code 1 (use -v to see invocation)
Comment 1 Raphael Kubo da Costa freebsd_committer freebsd_triage 2017-07-28 09:26:48 UTC
Created attachment 184792 [details]
Proposed patch

The attached patch forces the use of C++03 (which was the default before) when the OPENMP option is enabled. This generates a relocation for the older `operator delete' overload in libGraphicsMagick++.so.

graphics/cimg, graphics/photivo and textproc/htmltolatex all built fine on HEAD-amd64 with clang after building GraphicsMagick with GCC 6.
Comment 2 commit-hook freebsd_committer freebsd_triage 2017-07-30 13:17:18 UTC
A commit references this bug:

Author: sunpoet
Date: Sun Jul 30 13:16:46 UTC 2017
New revision: 446932
URL: https://svnweb.freebsd.org/changeset/ports/446932

Log:
  Use C++03 for OPENMP option

  PR:		221065
  Submitted by:	rakuco

Changes:
  head/graphics/GraphicsMagick/Makefile
Comment 3 Po-Chuan Hsieh freebsd_committer freebsd_triage 2017-07-30 13:21:32 UTC
Committed. Thanks!