Bug 271914 - graphics/qt5-imageformats: fix build with clang 16
Summary: graphics/qt5-imageformats: fix build with clang 16
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Some People
Assignee: freebsd-kde (group)
URL:
Keywords:
Depends on:
Blocks: 271047
  Show dependency treegraph
 
Reported: 2023-06-08 17:54 UTC by Dimitry Andric
Modified: 2023-06-11 16:18 UTC (History)
1 user (show)

See Also:
tcberner: maintainer-feedback+


Attachments
graphics/qt5-imageformats: fix build with clang 16 (2.69 KB, patch)
2023-06-08 17:55 UTC, Dimitry Andric
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Dimitry Andric freebsd_committer freebsd_triage 2023-06-08 17:54:37 UTC
Since clang 16 (and gcc 11) the default C++ standard is now gnu++17.
Because graphics/qt5-imageformats 's build infrastructure does not
explicitly set its C++ standard, this leads to an issue detecting libmng
in the configure stage:

  Configure summary:

  Further Image Formats:
    JasPer ................................. yes
    MNG .................................... no
    TIFF ................................... yes
      Using system libtiff ................. yes
    WEBP ................................... yes
      Using system libwebp ................. yes

This is because the small configure test program for libmng includes
libmng.h, which transitively includes lcms.h, and the latter fails due
to 'register' keywords in the header. With lcms2.h there is a special
define CMS_NO_REGISTER_KEYWORD to avoid usage of the register keyword,
but lcms.h is very old and does not support that.

As a workaround, define the register keyword away via a "head" object in
src/imageformats/configure.json, and via CXXFLAGS for the rest of the
build.
Comment 1 Dimitry Andric freebsd_committer freebsd_triage 2023-06-08 17:55:07 UTC
Created attachment 242693 [details]
graphics/qt5-imageformats: fix build with clang 16
Comment 2 Tobias C. Berner freebsd_committer freebsd_triage 2023-06-09 09:45:31 UTC
Moin moin 

Thanks! 
ship it.

mfg Tobias
Comment 3 commit-hook freebsd_committer freebsd_triage 2023-06-11 16:18:09 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=7393af6f4fbab56776eac34830eb81dd7d391f07

commit 7393af6f4fbab56776eac34830eb81dd7d391f07
Author:     Dimitry Andric <dim@FreeBSD.org>
AuthorDate: 2023-06-08 17:48:04 +0000
Commit:     Dimitry Andric <dim@FreeBSD.org>
CommitDate: 2023-06-11 16:15:58 +0000

    graphics/qt5-imageformats: fix build with clang 16

    Since clang 16 (and gcc 11) the default C++ standard is now gnu++17.
    Because graphics/qt5-imageformats 's build infrastructure does not
    explicitly set its C++ standard, this leads to an issue detecting libmng
    in the configure stage:

      Configure summary:

      Further Image Formats:
        JasPer ................................. yes
        MNG .................................... no
        TIFF ................................... yes
          Using system libtiff ................. yes
        WEBP ................................... yes
          Using system libwebp ................. yes

    This is because the small configure test program for libmng includes
    libmng.h, which transitively includes lcms.h, and the latter fails due
    to 'register' keywords in the header. With lcms2.h there is a special
    define CMS_NO_REGISTER_KEYWORD to avoid usage of the register keyword,
    but lcms.h is very old and does not support that.

    As a workaround, define the register keyword away via a "head" object in
    src/imageformats/configure.json, and via CXXFLAGS for the rest of the
    build.

    PR:             271914
    Approved by:    tcberner (maintainer)
    MFH:            2023Q2

 graphics/qt5-imageformats/Makefile                           |  4 +++-
 .../files/patch-src_imageformats_configure.json              | 12 +++++++++++-
 2 files changed, 14 insertions(+), 2 deletions(-)