Bug 221065 - [PATCH] graphics/GraphicsMagick: Use C++03 with the OPENMP option
Summary: [PATCH] graphics/GraphicsMagick: Use C++03 with the OPENMP option
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: Po-Chuan Hsieh
Keywords: patch
Depends on:
Blocks: 219275 219486 219487 219488 219490
  Show dependency treegraph
Reported: 2017-07-28 09:24 UTC by Raphael Kubo da Costa
Modified: 2017-07-30 13:21 UTC (History)
3 users (show)

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

Proposed patch (778 bytes, patch)
2017-07-28 09:26 UTC, Raphael Kubo da Costa
rakuco: maintainer-approval? (sunpoet)
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Raphael Kubo da Costa freebsd_committer 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 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 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

  Use C++03 for OPENMP option

  PR:		221065
  Submitted by:	rakuco

Comment 3 Po-Chuan Hsieh freebsd_committer 2017-07-30 13:21:32 UTC
Committed. Thanks!