Bug 273682 - graphics/rawtherapee: Fails to build with GCC 13: error: expected identifier before '__is_convertible'
Summary: graphics/rawtherapee: Fails to build with GCC 13: error: expected identifier ...
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: Lorenzo Salvadore
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-09-10 07:42 UTC by Lorenzo Salvadore
Modified: 2024-04-14 21:55 UTC (History)
2 users (show)

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


Attachments
prototypical patch to remove GCC dependency from rawtherapee (2.23 KB, patch)
2023-09-11 19:29 UTC, Matthias Andree
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Lorenzo Salvadore freebsd_committer freebsd_triage 2023-09-10 07:42:53 UTC
This bug report blocks the update of GCC_DEFAULT to 13. This webpage can help finding a fix: https://gcc.gnu.org/gcc-13/porting_to.html

FAILED: rtexif/CMakeFiles/rtexif.dir/fujiattribs.cc.o 
/usr/local/bin/g++13 -DAUTO_GDK_FLUSH=0 -DMYFILE_MMAP -DNDEBUG -DRT_FFTW3F_OMP -DSTRICT_MUTEX=1 -DTRACE_MYRWMUTEX=0 -DUSE_CANBERRA -D_DNDEBUG -I/wrkdirs/usr/ports/graphics/rawtherapee/work/.build/rtexif -I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include -I/usr/local/include/glibmm-2.4 -I/usr/local/lib/glibmm-2.4/include -I/usr/local/include/sigc++-2.0 -I/usr/local/lib/sigc++-2.0/include -I/usr/local/include/gtk-3.0 -I/usr/local/include/pango-1.0 -I/usr/local/include/cairo -I/usr/local/include/gdk-pixbuf-2.0 -I/usr/local/include/freetype2 -I/usr/local/include/harfbuzz -I/usr/local/include/dbus-1.0 -I/usr/local/lib/dbus-1.0/include -I/usr/local/include/atk-1.0 -I/usr/local/include/pixman-1 -I/usr/local/include/libpng16 -I/usr/local/include/gio-unix-2.0 -I/usr/local/include/fribidi -I/usr/local/include/libepoll-shim -I/usr/local/include/at-spi2-atk/2.0 -I/usr/local/include/at-spi-2.0 -I/usr/local/include/gtkmm-3.0 -I/usr/local/lib/gtkmm-3.0/include -I/usr/local/include/atkmm-1.6 -I/usr/local/include/gtk-3.0/unix-print -I/usr/local/include/gdkmm-3.0 -I/usr/local/lib/gdkmm-3.0/include -I/usr/local/include/giomm-2.4 -I/usr/local/lib/giomm-2.4/include -I/usr/local/include/pangomm-1.4 -I/usr/local/lib/pangomm-1.4/include -I/usr/local/include/cairomm-1.0 -I/usr/local/lib/cairomm-1.0/include -O2 -pipe  -I/usr/local/include -fPIC -flto=3 -O3 -funroll-loops -fstack-protector-strong -Wl,-rpath=/usr/local/lib/gcc13  -stdlib=libc++ -Wl,-rpath=/usr/local/lib/gcc13 -isystem /usr/local/include -std=c++11 -ffp-contract=off -mtune=generic -Werror=unused-label -Werror=delete-incomplete -fno-math-errno -Wno-attributes -Wall -Wuninitialized -Wcast-qual -Wno-deprecated-declarations -Wno-unused-result -Wunused-macros -fopenmp -Werror=unknown-pragmas -O2 -pipe  -I/usr/local/include -fPIC -flto=3 -O3 -funroll-loops -fstack-protector-strong -Wl,-rpath=/usr/local/lib/gcc13  -stdlib=libc++ -Wl,-rpath=/usr/local/lib/gcc13 -isystem /usr/local/include  -DNDEBUG  -fPIC -MD -MT rtexif/CMakeFiles/rtexif.dir/fujiattribs.cc.o -MF rtexif/CMakeFiles/rtexif.dir/fujiattribs.cc.o.d -o rtexif/CMakeFiles/rtexif.dir/fujiattribs.cc.o -c /wrkdirs/usr/ports/graphics/rawtherapee/work/rawtherapee-5.9/rtexif/fujiattribs.cc
In file included from /usr/include/c++/v1/math.h:309,
                 from /usr/include/c++/v1/cmath:308,
                 from /wrkdirs/usr/ports/graphics/rawtherapee/work/rawtherapee-5.9/rtexif/rtexif.h:21,
                 from /wrkdirs/usr/ports/graphics/rawtherapee/work/rawtherapee-5.9/rtexif/fujiattribs.cc:20:
/usr/include/c++/v1/type_traits:1770:8: error: expected identifier before '__is_convertible'
 1770 | struct __is_convertible
      |        ^~~~~~~~~~~~~~~~

Full log: https://pkg-status.freebsd.org/package18/data/124amd64-default-foo/2023-09-06_17h55m19s/logs/errors/rawtherapee-5.9_3.log

There are other bugs similar to this one, such as bug #273671 or bug #273674.
Comment 1 Matthias Andree freebsd_committer freebsd_triage 2023-09-10 10:12:36 UTC
Hi Lorenzo, thanks, I will have a look.
Comment 2 Matthias Andree freebsd_committer freebsd_triage 2023-09-10 20:46:33 UTC
I am testing if the default base compilers or some LLVM version from ports would be good enough these days.  Hoisting libc++ into GCC is cumbersome but necessary.
Comment 3 Matthias Andree freebsd_committer freebsd_triage 2023-09-11 19:29:02 UTC
Created attachment 244775 [details]
prototypical patch to remove GCC dependency from rawtherapee

To me this looks as though the new built-in "__is_convertible" (new as of GCC13) and the clang-based header file clashed.

The thing is, most of our requisite libraries are built based on libc++, not libstdc++, so how could we fix that without incurring linker errors from Glibmm and thereabouts?

Barring a solution for that problem, I would propose the attached patch - but does that cover all relevant architectures (those that can address sufficient RAM, and have practically fast CPUs with SIMD and OpenMP support so that rawtherapee would be useful. None of the 32-bit museum or embedded hardware is worthy.)  Are all remaining platforms good with LLVM/clang?
Comment 4 commit-hook freebsd_committer freebsd_triage 2023-10-09 16:21:31 UTC
A commit in branch main references this bug:

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

commit fff0cd6cf3ae5141f7f588e27b8e71839ee742be
Author:     Matthias Andree <mandree@FreeBSD.org>
AuthorDate: 2023-09-11 19:07:14 +0000
Commit:     Matthias Andree <mandree@FreeBSD.org>
CommitDate: 2023-10-09 16:19:43 +0000

    graphics/rawtherapee: drop USE_GCC...

    ...to unblock the GCC-13-as-default upgrade.

    PR:             273682
    Reported by:    salvadore@

 graphics/rawtherapee/Makefile | 21 ++++-----------------
 1 file changed, 4 insertions(+), 17 deletions(-)
Comment 5 Matthias Andree freebsd_committer freebsd_triage 2023-10-09 16:23:18 UTC
Let's not depend on GCC for now, but it would seem that the base compiler's includes need to be made compatible with the new GCC intrinsics.
Comment 6 Lorenzo Salvadore freebsd_committer freebsd_triage 2023-11-18 10:27:35 UTC
I remove the block for GCC default version update: latest test on FreeBSD 13.2 did not report any issue with this port. The bug report can probably be safely closed once FreeBSD 12 goes EOL.
Comment 7 Lorenzo Salvadore freebsd_committer freebsd_triage 2023-12-23 08:44:58 UTC
(In reply to Lorenzo Salvadore from comment #6)

Really remove the block this time.
Comment 8 Lorenzo Salvadore freebsd_committer freebsd_triage 2024-02-03 11:30:44 UTC
Put back the block for GCC default version update: something is still broken. Tested on FreeBSD 14.

https://pkg-status.freebsd.org/package18/data/140amd64-default-foo/2024-01-29_17h34m15s/logs/errors/rawtherapee-5.9_6.log

FAILED: lib/darktable/rawspeed/CMakeFiles/rawspeed.dir/src/librawspeed/decompressors/SamsungV0Decompressor.cpp.o 
/usr/local/bin/g++13 -DGDK_DISABLE_DEPRECATED -DGTK_DISABLE_DEPRECATED -DGTK_DISABLE_SINGLE_INCLUDES -DNDEBUG -D_RELEASE -I/wrkdirs/usr/ports/graphics/darktable/work/.build/lib/darktable/rawspeed -I/wrkdirs/usr/ports/graphics/darktable/work/darktable-4.6.0/src/external/rawspeed -I/wrkdirs/usr/ports/graphics/darktable/work/.build/lib/darktable/rawspeed/src -I/wrkdirs/usr/ports/graphics/darktable/work/darktable-4.6.0/src/external/rawspeed/src/librawspeed -isystem /wrkdirs/usr/ports/graphics/darktable/work/darktable-4.6.0/src/external/rawspeed/src/external -O2 -pipe  -fopenmp -I/usr/local/include/Imath -fstack-protector-strong -Wl,-rpath=/usr/local/lib/gcc13  -stdlib=libc++ -Wl,-rpath=/usr/local/lib/gcc13 -Wall -Wformat -Wformat-security -Wshadow -Wtype-limits -Wvla -Wmaybe-uninitialized -Wno-unknown-pragmas -Wno-error=varargs -Wno-format-truncation -Wno-error=address-of-packed-member -w -Wall -Wextra -Wcast-qual -Wextra -Wextra-semi -Wformat=2 -Wpointer-arith -Wvla -Wmissing-format-attribute -Wsuggest-attribute=format -Wno-unused-parameter -Wstack-usage=4096 -Wframe-larger-than=4096 -Wlarger-than=32768 -Werror -O2 -pipe  -fopenmp -I/usr/local/include/Imath -fstack-protector-strong -Wl,-rpath=/usr/local/lib/gcc13  -stdlib=libc++ -Wl,-rpath=/usr/local/lib/gcc13  -DNDEBUG -O3 -std=c++20 -fPIC -fvisibility=hidden -fvisibility-inlines-hidden   -mtune=generic -g3 -ggdb3 -fopenmp -MD -MT lib/darktable/rawspeed/CMakeFiles/rawspeed.dir/src/librawspeed/decompressors/SamsungV0Decompressor.cpp.o -MF lib/darktable/rawspeed/CMakeFiles/rawspeed.dir/src/librawspeed/decompressors/SamsungV0Decompressor.cpp.o.d -o lib/darktable/rawspeed/CMakeFiles/rawspeed.dir/src/librawspeed/decompressors/SamsungV0Decompressor.cpp.o -c /wrkdirs/usr/ports/graphics/darktable/work/darktable-4.6.0/src/external/rawspeed/src/librawspeed/decompressors/SamsungV0Decompressor.cpp
In file included from /wrkdirs/usr/ports/graphics/darktable/work/darktable-4.6.0/src/external/rawspeed/src/librawspeed/adt/AlignedAllocator.h:24,
                 from /wrkdirs/usr/ports/graphics/darktable/work/darktable-4.6.0/src/external/rawspeed/src/librawspeed/common/RawImage.h:25,
                 from /wrkdirs/usr/ports/graphics/darktable/work/darktable-4.6.0/src/external/rawspeed/src/librawspeed/decompressors/AbstractSamsungDecompressor.h:23,
                 from /wrkdirs/usr/ports/graphics/darktable/work/darktable-4.6.0/src/external/rawspeed/src/librawspeed/decompressors/SamsungV0Decompressor.h:23,
                 from /wrkdirs/usr/ports/graphics/darktable/work/darktable-4.6.0/src/external/rawspeed/src/librawspeed/decompressors/SamsungV0Decompressor.cpp:23:
/wrkdirs/usr/ports/graphics/darktable/work/darktable-4.6.0/src/external/rawspeed/src/librawspeed/common/Common.h: In instantiation of 'constexpr std::__1::make_signed_t<T> rawspeed::signExtend(T, unsigned int) [with T = unsigned int]':
/wrkdirs/usr/ports/graphics/darktable/work/darktable-4.6.0/src/external/rawspeed/src/librawspeed/common/Common.h:220:23: error: use of built-in trait '__remove_cv(_Tp)' in function signature; use library traits instead
  220 |     RAWSPEED_READNONE signExtend(T value, unsigned int nBits) {
      |                       ^~~~~~~~~~
Comment 9 Matthias Andree freebsd_committer freebsd_triage 2024-02-23 17:14:02 UTC
I am trying to get things to work with GCC 13, with Rawtherapee 5.10, which has been released recently.

In order to get this working, I remove the compiler:gcc-c++11-lib from USES because it would overwrite USE_GCC=yes, and I can't get GCC 13 in. 

Doing so, compilation succeeds on FreeBSD 14.0 but the final link fails with lots of unresolved functions, starting with Glib, say:

: && /usr/local/bin/g++13 -O2 -pipe -march=znver1  -I/usr/local/include -fPIC -O3 -funroll-loops -flto=16 -fstack-protector-strong -Wl,-rpath=/usr/local/lib/gcc13  -Wl,-rpath=/usr/local/lib/gcc13 -isystem /usr/local/include -std=c++11 -ffp-contract=off -march=native -Werror=unused-label -Werror=delete-incomplete -fno-math-errno -Wno-attributes -Wall -Wuninitialized -Wcast-qual -Wno-deprecated-declarations -Wno-unused-result -Wunused-macros -fopenmp -Werror=unknown-pragmas -O2 -pipe -march=znver1  -I/usr/local/include -fPIC -O3 -funroll-loops -flto=16 -fstack-protector-strong -Wl,-rpath=/usr/local/lib/gcc13  -Wl,-rpath=/usr/local/lib/gcc13 -isystem /usr/local/include  -DNDEBUG -Wl,--as-needed -lpthread -O3 -funroll-loops -flto=16 -lm -lomp -fstack-protector-strong -Wl,-rpath=/usr/local/lib/gcc13 -L/usr/local/lib/gcc13 -L/usr/local/lib -march=native rtgui/CMakeFiles/rth-cli.dir/alignedmalloc.cc.o rtgui/CMakeFiles/rth-cli.dir/editcallbacks.cc.o rtgui/CMakeFiles/rth-cli.dir/main-cli.cc.o rtgui/CMakeFiles/rth-cli.dir/multilangmgr.cc.o rtgui/CMakeFiles/rth-cli.dir/options.cc.o rtgui/CMakeFiles/rth-cli.dir/paramsedited.cc.o rtgui/CMakeFiles/rth-cli.dir/pathutils.cc.o rtgui/CMakeFiles/rth-cli.dir/threadutils.cc.o -o rtgui/rawtherapee-cli  rtengine/librtengine.a  -lcairomm-1.0  -lcairo  -lsigc-2.0  -lexpat  -lfftw3f  /usr/local/lib/libfftw3f_omp.so  -lgiomm-2.4  -lgio-2.0  -lglib-2.0  -lintl  -lglibmm-2.4  -lgobject-2.0  -lsigc-2.0  -lgio-2.0  -lgobject-2.0  -lglib-2.0  -lintl  -lglib-2.0  -lintl  -lglibmm-2.4  -lgobject-2.0  -lglib-2.0  -lintl  -lsigc-2.0  -lgobject-2.0  -lglib-2.0  -lintl  -lgthread-2.0  -lglib-2.0  -lintl  -liptcdata  /usr/local/lib/libjpeg.so  -llcms2  -llcms2_fast_float  -llcms2_threaded  /usr/local/lib/libpng.so  /usr/lib/libz.so  /usr/local/lib/libtiff.so  /usr/lib/libz.so  -llensfun  -lrsvg-2  -lm  -lgio-2.0  -lglib-2.0  -lintl  -lgdk_pixbuf-2.0  -lgobject-2.0  -lcairo  /usr/local/lib/libexiv2.so  /usr/local/lib/gcc13/libgomp.so  -lsigc-2.0  -lgio-2.0  -lglib-2.0  -lintl  -lglibmm-2.4  -lgthread-2.0  -liptcdata  /usr/local/lib/libjpeg.so  -llcms2  -llcms2_fast_float  -llcms2_threaded  /usr/local/lib/libpng.so  /usr/lib/libz.so  /usr/local/lib/libtiff.so  -llensfun  -lrsvg-2  -lm  -lgdk_pixbuf-2.0  -lcairo && :
/usr/local/bin/ld: /tmp//ccQ2Rb2v.ltrans0.ltrans.o: in function `processLineParams(int, char**)':
<artificial>:(.text+0x36ca): undefined reference to `Glib::operator<<(std::ostream&, Glib::ustring const&)'
/usr/local/bin/ld: <artificial>:(.text+0x397d): undefined reference to `Glib::file_test(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, Glib::FileTest)'
/usr/local/bin/ld: <artificial>:(.text+0x39be): undefined reference to `Glib::operator<<(std::ostream&, Glib::ustring const&)'
/usr/local/bin/ld: <artificial>:(.text+0x3af2): undefined reference to `Glib::filename_to_utf8(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
/usr/local/bin/ld: <artificial>:(.text+0x3b80): undefined reference to `Glib::file_test(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, Glib::FileTest)'
/usr/local/bin/ld: <artificial>:(.text+0x3d69): undefined reference to `Glib::path_get_basename(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
/usr/local/bin/ld: <artificial>:(.text+0x3dea): undefined reference to `Glib::path_get_basename(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
/usr/local/bin/ld: <artificial>:(.text+0x3e8f): undefined reference to `Glib::path_get_basename(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
/usr/local/bin/ld: <artificial>:(.text+0x3fa3): undefined reference to `Glib::operator<<(std::ostream&, Glib::ustring const&)'
/usr/local/bin/ld: <artificial>:(.text+0x406d): undefined reference to `Glib::operator<<(std::ostream&, Glib::ustring const&)'
/usr/local/bin/ld: <artificial>:(.text+0x43a7): undefined reference to `Glib::operator<<(std::ostream&, Glib::ustring const&)'
/usr/local/bin/ld: <artificial>:(.text+0x459c): undefined reference to `Glib::filename_to_utf8(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
/usr/local/bin/ld: <artificial>:(.text+0x479c): undefined reference to `Glib::filename_to_utf8(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
/usr/local/bin/ld: <artificial>:(.text+0x4802): undefined reference to `Glib::file_test(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, Glib::FileTest)'
/usr/local/bin/ld: <artificial>:(.text+0x4874): undefined reference to `Glib::file_test(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, Glib::FileTest)'
/usr/local/bin/ld: <artificial>:(.text+0x48dc): undefined reference to `Glib::operator<<(std::ostream&, Glib::ustring const&)'
/usr/local/bin/ld: <artificial>:(.text+0x4b46): undefined reference to `Glib::operator<<(std::ostream&, Glib::ustring const&)'
/usr/local/bin/ld: <artificial>:(.text+0x4bf9): undefined reference to `Glib::file_test(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, Glib::FileTest)'
/usr/local/bin/ld: <artificial>:(.text+0x4c3c): undefined reference to `Gio::File::create_for_path(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
/usr/local/bin/ld: <artificial>:(.text+0x4cd8): undefined reference to `Glib::operator<<(std::ostream&, Glib::ustring const&)'
/usr/local/bin/ld: <artificial>:(.text+0x4d51): undefined reference to `Glib::operator<<(std::ostream&, Glib::ustring const&)'
/usr/local/bin/ld: <artificial>:(.text+0x4db0): undefined reference to `Glib::filename_to_utf8(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
/usr/local/bin/ld: <artificial>:(.text+0x5252): undefined reference to `Glib::ustring::ustring(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
/usr/local/bin/ld: <artificial>:(.text+0x532b): undefined reference to `Glib::file_test(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, Glib::FileTest)'
/usr/local/bin/ld: <artificial>:(.text+0x5352): undefined reference to `Glib::operator<<(std::ostream&, Glib::ustring const&)'
/usr/local/bin/ld: <artificial>:(.text+0x54ac): undefined reference to `Glib::ustring::ustring(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
/usr/local/bin/ld: <artificial>:(.text+0x554c): undefined reference to `Glib::path_get_basename(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
/usr/local/bin/ld: <artificial>:(.text+0x555e): undefined reference to `Glib::ustring::ustring(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&&)'
/usr/local/bin/ld: <artificial>:(.text+0x559f): undefined reference to `Glib::ustring::ustring(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
/usr/local/bin/ld: <artificial>:(.text+0x5605): undefined reference to `Glib::ustring::operator=(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&&)'
/usr/local/bin/ld: <artificial>:(.text+0x564d): undefined reference to `Glib::ustring::operator=(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
/usr/local/bin/ld: <artificial>:(.text+0x571b): undefined reference to `Glib::operator<<(std::ostream&, Glib::ustring const&)'
/usr/local/bin/ld: <artificial>:(.text+0x5737): undefined reference to `Glib::ustring::operator=(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
/usr/local/bin/ld: <artificial>:(.text+0x5892): undefined reference to `Gio::File::enumerate_children(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, Gio::FileQueryInfoFlags)'
/usr/local/bin/ld: <artificial>:(.text+0x58d3): undefined reference to `Gio::FileInfo::get_name[abi:cxx11]() const'
/usr/local/bin/ld: <artificial>:(.text+0x5927): undefined reference to `Glib::ustring::ustring(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
/usr/local/bin/ld: <artificial>:(.text+0x5a65): undefined reference to `Glib::ustring::ustring(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
/usr/local/bin/ld: <artificial>:(.text+0x5aca): undefined reference to `Glib::operator<<(std::ostream&, Glib::ustring const&)'
/usr/local/bin/ld: <artificial>:(.text+0x5c88): undefined reference to `Glib::operator<<(std::ostream&, Glib::ustring const&)'
/usr/local/bin/ld: <artificial>:(.text+0x5cbe): undefined reference to `Glib::ustring::ustring(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
/usr/local/bin/ld: <artificial>:(.text+0x5d16): undefined reference to `Glib::file_test(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, Glib::FileTest)'
/usr/local/bin/ld: <artificial>:(.text+0x5d61): undefined reference to `Glib::ustring::ustring(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
/usr/local/bin/ld: <artificial>:(.text+0x5e9a): undefined reference to `Glib::operator<<(std::ostream&, Glib::ustring const&)'
/usr/local/bin/ld: <artificial>:(.text+0x6128): undefined reference to `Glib::operator<<(std::ostream&, Glib::ustring const&)'
/usr/local/bin/ld: <artificial>:(.text+0x6243): undefined reference to `Glib::ustring::ustring(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
/usr/local/bin/ld: <artificial>:(.text+0x641d): undefined reference to `Glib::ustring::ustring(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&&)'
/usr/local/bin/ld: <artificial>:(.text+0x64de): undefined reference to `Glib::ustring::ustring(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&&)'
/usr/local/bin/ld: <artificial>:(.text+0x65ac): undefined reference to `Glib::operator<<(std::ostream&, Glib::ustring const&)'
/usr/local/bin/ld: <artificial>:(.text+0x664c): undefined reference to `Glib::path_get_basename(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
/usr/local/bin/ld: <artificial>:(.text+0x665e): undefined reference to `Glib::ustring::ustring(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&&)'
/usr/local/bin/ld: <artificial>:(.text+0x66de): undefined reference to `Glib::path_get_basename(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
/usr/local/bin/ld: <artificial>:(.text+0x66f4): undefined reference to `Glib::ustring::ustring(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&&)'
[...]
/usr/local/bin/ld: /tmp//ccQ2Rb2v.ltrans2.ltrans.o: in function `rtengine::Exiv2Metadata::xmpSidecarPath(Glib::ustring const&)':
<artificial>:(.text+0x3ba): undefined reference to `Glib::path_get_basename(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
/usr/local/bin/ld: <artificial>:(.text+0x3cc): undefined reference to `Glib::ustring::ustring(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&&)'
/usr/local/bin/ld: /tmp//ccQ2Rb2v.ltrans2.ltrans.o: in function `rtengine::Exiv2Metadata::remove_unwanted(Exiv2::ExifData&) const':
<artificial>:(.text+0xf90): undefined reference to `Exiv2::ExifData::erase(std::_List_iterator<Exiv2::Exifdatum>)'
/usr/local/bin/ld: <artificial>:(.text+0x146c): undefined reference to `Exiv2::ExifData::operator[](std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
/usr/local/bin/ld: <artificial>:(.text+0x1cc9): undefined reference to `Exiv2::ExifData::operator[](std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
/usr/local/bin/ld: <artificial>:(.text+0x20b2): undefined reference to `Exiv2::ExifData::operator[](std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
/usr/local/bin/ld: <artificial>:(.text+0x20c1): undefined reference to `Exiv2::Exifdatum::operator=(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
[...]


Now, if I add -stdlib=libc++ conditionally as gcc-c++11-lib would do, it fails sooner with a compilation failure already:

FAILED: rtengine/CMakeFiles/rtengine.dir/profilestore.cc.o 
/usr/local/bin/ccache /usr/local/bin/g++13 -DAUTO_GDK_FLUSH=0 -DCMS_NO_REGISTER_KEYWORD -DMYFILE_MMAP -DNDEBUG -DRT_FFTW3F_OMP -DSTRICT_MUTEX=1 -DTRACE_MYRWMUTEX=0 -DUSE_CANBERRA -D_DNDEBUG -I/usr/ports/graphics/rawtherapee/work/.build/rtengine -I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include -I/usr/local/include/glibmm-2.4 -I/usr/local/lib/glibmm-2.4/include -I/usr/local/include/sigc++-2.0 -I/usr/local/lib/sigc++-2.0/include -I/usr/local/include/gtkmm-3.0 -I/usr/local/lib/gtkmm-3.0/include -I/usr/local/include/atkmm-1.6 -I/usr/local/include/gtk-3.0 -I/usr/local/include/pango-1.0 -I/usr/local/include/gtk-3.0/unix-print -I/usr/local/include/cairo -I/usr/local/include/gdkmm-3.0 -I/usr/local/lib/gdkmm-3.0/include -I/usr/local/include/giomm-2.4 -I/usr/local/lib/giomm-2.4/include -I/usr/local/include/pangomm-1.4 -I/usr/local/lib/pangomm-1.4/include -I/usr/local/include/cairomm-1.0 -I/usr/local/lib/cairomm-1.0/include -I/usr/local/include/gdk-pixbuf-2.0 -I/usr/local/include/dbus-1.0 -I/usr/local/lib/dbus-1.0/include -I/usr/local/include/atk-1.0 -I/usr/local/include/harfbuzz -I/usr/local/include/freetype2 -I/usr/local/include/gio-unix-2.0 -I/usr/local/include/libepoll-shim -I/usr/local/include/at-spi2-atk/2.0 -I/usr/local/include/at-spi-2.0 -I/usr/local/include/fribidi -I/usr/local/include/libpng16 -I/usr/local/include/pixman-1 -I/usr/local/include/libiptcdata -I/usr/local/include/lensfun -I/usr/local/include/librsvg-2.0 -I/usr/ports/graphics/rawtherapee/work/rawtherapee-5.10/rtengine/klt -O2 -pipe -march=znver1  -I/usr/local/include -fPIC -O3 -funroll-loops -flto=16 -fstack-protector-strong -Wl,-rpath=/usr/local/lib/gcc13  -stdlib=libc++ -Wl,-rpath=/usr/local/lib/gcc13 -isystem /usr/local/include -std=c++11 -ffp-contract=off -march=native -Werror=unused-label -Werror=delete-incomplete -fno-math-errno -Wno-attributes -Wall -Wuninitialized -Wcast-qual -Wno-deprecated-declarations -Wno-unused-result -Wunused-macros -fopenmp -Werror=unknown-pragmas -O2 -pipe -march=znver1  -I/usr/local/include -fPIC -O3 -funroll-loops -flto=16 -fstack-protector-strong -Wl,-rpath=/usr/local/lib/gcc13  -stdlib=libc++ -Wl,-rpath=/usr/local/lib/gcc13 -isystem /usr/local/include  -DNDEBUG -ftree-vectorize -MD -MT rtengine/CMakeFiles/rtengine.dir/profilestore.cc.o -MF rtengine/CMakeFiles/rtengine.dir/profilestore.cc.o.d -o rtengine/CMakeFiles/rtengine.dir/profilestore.cc.o -c /usr/ports/graphics/rawtherapee/work/rawtherapee-5.10/rtengine/profilestore.cc
In file included from /usr/include/c++/v1/__algorithm/adjacent_find.h:14,
                 from /usr/include/c++/v1/algorithm:1713,
                 from /usr/ports/graphics/rawtherapee/work/rawtherapee-5.10/rtengine/profilestore.cc:20:
/usr/include/c++/v1/__algorithm/iterator_operations.h: In instantiation of 'static std::__1::__remove_cvref_t<_Tp> std::__1::_IterOps<std::__1::_ClassicAlgPolicy>::prev(_Iter&&, typename std::__1::iterator_traits<__remove_cvref(_Tp)>::difference_type) [with _Iter = std::__1::__wrap_iter<const ProfileStoreEntry**>&]':
/usr/include/c++/v1/__algorithm/iterator_operations.h:161:27: error: use of built-in trait '__remove_cvref(_Tp)' in function signature; use library traits instead
  161 |   __remove_cvref_t<_Iter> prev(_Iter&& __iter,
      |                           ^~~~
/usr/include/c++/v1/__algorithm/iterator_operations.h: In instantiation of 'static std::__1::__remove_cvref_t<_Tp> std::__1::_IterOps<std::__1::_ClassicAlgPolicy>::next(_Iter&&, typename std::__1::iterator_traits<__remove_cvref(_Tp)>::difference_type) [with _Iter = std::__1::__wrap_iter<const ProfileStoreEntry**>&]':
/usr/include/c++/v1/__algorithm/iterator_operations.h:153:27: error: use of built-in trait '__remove_cvref(_Tp)' in function signature; use library traits instead
  153 |   __remove_cvref_t<_Iter> next(_Iter&& __it,
      |                           ^~~~
ninja: build stopped: subcommand failed.
*** Error code 1


Do I read this right that our FreeBSD 14 (clang 16) C++ standard (template) library headers are incompatible with GCC 13, or am I missing something else?
Comment 10 Matthias Andree freebsd_committer freebsd_triage 2024-02-23 17:15:23 UTC
Comment on attachment 244775 [details]
prototypical patch to remove GCC dependency from rawtherapee

Let's mark the patch obsolete. clang-compiled code is far too slow. Let me try if I can pin GCC to version 12 instead.
Comment 11 commit-hook freebsd_committer freebsd_triage 2024-02-23 17:37:34 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=7e027ece12342fab2bd29ce325c4a6109677ae8a

commit 7e027ece12342fab2bd29ce325c4a6109677ae8a
Author:     Matthias Andree <mandree@FreeBSD.org>
AuthorDate: 2024-02-20 23:24:23 +0000
Commit:     Matthias Andree <mandree@FreeBSD.org>
CommitDate: 2024-02-23 17:37:09 +0000

    graphics/rawtherapee: update to 5.10

    ChangeLog:      https://rawtherapee.com/downloads/5.10/#new-features

    We need to stick to GCC because LLVM-compiled code may take more than
    twice as much processing time as GCC-compiled does, for my test set
    comparing a few images with denoising and stuff on FreeBSD-14.0-RELEASE
    amd64 comparing GCC 12.3 to clang 16.0, and similar values on
    FreeBSD-13.2-RELEASE.

    Pin GCC to 12 and override -stdlib accordingly, to fix
    PR:             273682

    Clean up Makefile a bit, but we cannot let go of the CCACHE
    workarounds yet, which we need when enforcing GCC compile.
    Convert some .if branches to options helpers.

    Make LTO an option that defaults to on. For some strange reason,
    massively-parallel compilation WITHOUT LTO appears to trigger
    OOM kills much more than an LTO-enabled build.  Upstream states
    that LTO build should run faster.

    For one self-test that fails frequently with SIGPIPE (Exit code 141 is
    128 for core dump + 13 for SIGPIPE), pipe through dd with bigger input
    buffer to avoid SIGPIPE/exit code 141 test failures.

    Replace echo by ${ECHO_CMD} in self-tests to appease portlint.
    Portlint misdetects "file system" as bare use of file though and
    suggests ${FILE}, which is wrong.

    Revise warnings around the CCACHE hacks because
    https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=277204
    strives to move ports to CCACHE_ENABLED, which does not work for this
    port.

    Also, 5.10 should fix the profile/locale related crash
    PR:             257255
    by switching the std::map variable to use std::string as index,
    rather than Glib::ustring, which caused inconsistencies with locales.
    Upstream references (two bug reports, and the fix, in order):
    https://github.com/Beep6581/RawTherapee/issues/6357
    https://github.com/Beep6581/RawTherapee/issues/6876
    https://github.com/Beep6581/RawTherapee/pull/6889/commits/a95a58a8a399173e6947ff12a4b82b5d83ae80d9

 graphics/rawtherapee/Makefile  | 88 +++++++++++++++++++++---------------------
 graphics/rawtherapee/distinfo  |  6 +--
 graphics/rawtherapee/pkg-plist | 20 ++++++++++
 3 files changed, 68 insertions(+), 46 deletions(-)
Comment 12 Matthias Andree freebsd_committer freebsd_triage 2024-02-23 17:42:21 UTC
While I think that the port should now no longer be a blocker because it is pinned to GCC 12, I really would like to understand why GCC13 complains about our /usr/include, or what other include set I could use that is compatible with all the C++ libraries we compile that rawtherapee requires, so that we can move forward to newer GCC versions.

Reassigning to reporter.
Comment 13 Lorenzo Salvadore freebsd_committer freebsd_triage 2024-02-24 08:39:32 UTC
The block for the GCC_DEFAULT update can indeed be removed.