Bug 233888 - graphics/opencolorio: fix build with GCC-based architectures
Summary: graphics/opencolorio: fix build with GCC-based architectures
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: Piotr Kubaj
Depends on:
Reported: 2018-12-09 13:44 UTC by Piotr Kubaj
Modified: 2019-04-30 14:27 UTC (History)
2 users (show)

See Also:
FreeBSD: maintainer-feedback+

patch (928 bytes, patch)
2018-12-09 13:44 UTC, Piotr Kubaj
no flags Details | Diff
v2 (1.15 KB, patch)
2018-12-14 12:30 UTC, Piotr Kubaj
no flags Details | Diff
maintainer update for graphics/opencolorio (1009 bytes, patch)
2018-12-16 09:19 UTC, Shane
FreeBSD: maintainer-approval+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Piotr Kubaj freebsd_committer 2018-12-09 13:44:01 UTC
Created attachment 199980 [details]

GCC needs -Wno-unused-function in CXXFLAGS to build this port.

While here, add USES=localbase:ldflags.

Tested on powerpc64 and amd64.

Hardware sponsored by IntegriCloud.
Comment 1 Piotr Kubaj freebsd_committer 2018-12-09 18:32:31 UTC
After update to 1.1.0, USES alone is not enough.
Comment 2 Shane 2018-12-10 04:37:29 UTC
I don't see an issue, though maybe a cleaner approach can be used, there is momentum to use variables rather than conditional tests.

Currently we can use CXXFLAGS_${ARCH}, which might be enough in this situation. Maybe using CXXFLAGS_${CHOSEN_COMPILER_TYPE} is something that could also be added to the infrastructure.

You could manually be arch/compiler specific - based on usage from devel/godot -

CXXFLAGS_powerpc64_gcc=	-Wno-unused-function
Comment 3 Piotr Kubaj freebsd_committer 2018-12-14 12:30:26 UTC
Created attachment 200114 [details]

After upgrade to GCC 8, there are additional errors and -Wno-error for GCC builds is necessary.
Comment 4 Shane 2018-12-16 09:19:52 UTC
Created attachment 200144 [details]
maintainer update for graphics/opencolorio

Testing the existence of libstdc++.so installed by the base system isn't foolproof, a user can configure to use GCC for building ports (FAVORITE_COMPILER=gcc). Not sure how popular this is, or reliable, I found the need to manually set CC/CXX to get gcc used on amd64.

Does setting CXXFLAGS this way work on gcc built ARCHs?

I doubt that any of these flags need adjusting based on ARCH or base compiler, it is really about chosen compiler at build time.

If this fails, I think testing chosen compiler in place of the lib test would be better.
Comment 5 commit-hook freebsd_committer 2019-04-30 14:25:10 UTC
A commit references this bug:

Author: pkubaj
Date: Tue Apr 30 14:24:33 UTC 2019
New revision: 500495
URL: https://svnweb.freebsd.org/changeset/ports/500495

  graphics/opencolorio: fix build with GCC-based architectures

  Add -Wno-unused-function -Wno-error to CXXFLAGS when using GCC.

  While here, add USES=localbase:ldflags.

  PR:		233888
  Approved by:	FreeBSD@ShaneWare.Biz (maintainer), mat (mentor)
  Differential Revision:	https://reviews.freebsd.org/D20089