https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=215193

--- Comment #19 from Mark Millard <[email protected]> ---
(In reply to Matthias Andree from comment #17)

The Makefile change later below lets compiler:gcc-c++11-lib have gcc15 as the
default it will use for the specific port.

But for g++15 vs. the existing system libc++ source code: they are
incompatible.

error: use of built-in trait . . . in function signature; use library traits
instead

It referenced: /usr/include/c++/v1/__memory/pointer_traits.h:216

  216 | __to_address(const _Pointer& __p) _NOEXCEPT {
      | ^~~~~~~~~~~~

That is in the libc++ code:

// enable_if is needed here to avoid instantiating checks for fancy pointers on
raw pointers
template <class _Pointer, __enable_if_t< _And<is_class<_Pointer>,
_IsFancyPointer<_Pointer> >::value, int> = 0>
_LIBCPP_HIDE_FROM_ABI
_LIBCPP_CONSTEXPR
__decay_t<decltype(__to_address_helper<_Pointer>::__call(std::declval<const
_Pointer&>()))>
__to_address(const _Pointer& __p) _NOEXCEPT {
  return __to_address_helper<_Pointer>::__call(__p);
}


A basic way to trying such builds is:
(I did not change comments to match.)

# git -C /usr/ports/ diff graphics/rawtherapee | cat
diff --git a/graphics/rawtherapee/Makefile b/graphics/rawtherapee/Makefile
index 98a3feb6893f..fea79de1175b 100644
--- a/graphics/rawtherapee/Makefile
+++ b/graphics/rawtherapee/Makefile
@@ -31,7 +31,7 @@ LIB_DEPENDS=  \
 # We cannot use gcc-c++11-lib as of 2024-02-23 because
 # Uses/compiler.mk would use the default compiler instead
 # as though USE_GCC=yes had been set.
-USES=          autoreconf:build cmake desktop-file-utils compiler:c++11-lib
gnome \
+USES=          autoreconf:build cmake desktop-file-utils
compiler:gcc-c++11-lib gnome \
                jpeg libtool:build localbase:ldflags pkgconfig tar:xz

 USE_GNOME=     gtkmm30 librsvg2
@@ -113,6 +113,7 @@ OPENMP_LDFLAGS=             -lm -lomp
 # up to twice as fast as clang-16.0 compiled code.
 # So we shall stick to a modern GCC for now.
 #
+GCC_DEFAULT=   15
 USE_GCC=       yes  # default

 .if (${OPSYS} == FreeBSD) && (${OSVERSION} >= 1500000)
@@ -141,9 +142,9 @@ _OPT_FLAGS+=        -mstackrealign

 .include <bsd.port.pre.mk>

-.if ${COMPILER_FEATURES:Mlibc++}
-CXXFLAGS+=     -stdlib=libc++
-.endif
+#.if ${COMPILER_FEATURES:Mlibc++}
+#CXXFLAGS+=    -stdlib=libc++
+#.endif

 post-patch:
        ${REINPLACE_CMD} -e '/COMMAND.*SHELL/s/-l -c/-c/'
${WRKSRC}/rtengine/LibRaw.cmake


The resulting build (once lang/gcc15 had built just before) got the failure:

FAILED: [code=1] rtengine/CMakeFiles/rtengine.dir/FTblockDN.cc.o
/usr/local/bin/g++15 -DAUTO_GDK_FLUSH=0 -DCMS_NO_REGISTER_KEYWORD -DLIBJXL
-DMYFILE_MMAP -DNDEBUG -DSTRICT_MUTEX=1 -DTRACE_MYRWMUTEX=0 -DUSE_CANBERRA
-D_DNDEBUG -I/wrkdirs/usr/ports/graphics/rawtherap
ee/work/.build -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/lib/atkmm-1.6/include -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/gtk-3.0 -I/usr/local/include/cairo
-I/usr/local/include/at-s
pi2-atk/2.0 -I/usr/local/include/at-spi-2.0 -I/usr/local/include/atk-1.0
-I/usr/local/libdata/pkgconfig/../../include/dbus-1.0
-I/usr/local/libdata/pkgconfig/../../lib/dbus-1.0/include -I/usr/local/in
clude/libepoll-shim -I/usr/local/include/gio-unix-2.0
-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/pango-1.0 -I/usr/local/include/pixman-1
-I/usr/local/include/fribidi -I/usr/local/include/harfbuzz
-I/usr/local/include/freetype2 -I/usr/local/include/libpng16
-I/usr/local/include/gdk-
pixbuf-2.0 -I/usr/local/include/libiptcdata -I/usr/local/include/lensfun
-I/usr/local/include/librsvg-2.0 -I/usr/local/include/libxml2
-I/wrkdirs/usr/ports/graphics/rawtherapee/work/rawtherapee-5.12/r
tengine/klt
-I/wrkdirs/usr/ports/graphics/rawtherapee/work/rawtherapee-5.12/rtengine/libraw
-I/wrkdirs/usr/ports/graphics/rawtherapee/work/rawtherapee-5.12
-I/wrkdirs/usr/ports/graphics/rawtherapee/wo
rk/rawtherapee-5.12/rtengine -O2 -pipe  -I/usr/local/include -fPIC -O3
-funroll-loops -flto=32 -fstack-protector-strong
-Wl,-rpath=/usr/local/lib/gcc15  -stdlib=libc++ -Wl,-rpath=/usr/local/lib/gcc15
-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 -O2 -pipe 
-I/usr/local/include -fPIC -O3 -funroll-loops -flto=32 -fstack-protector-strong
-Wl,-rpath=/usr/local/lib/gcc15  -stdlib=libc++ -Wl,-rpath=/
usr/local/lib/gcc15 -isystem /usr/local/include  -DNDEBUG -ftree-vectorize -MD
-MT rtengine/CMakeFiles/rtengine.dir/FTblockDN.cc.o -MF
rtengine/CMakeFiles/rtengine.dir/FTblockDN.cc.o.d -o rtengine/CMa
keFiles/rtengine.dir/FTblockDN.cc.o -c
/wrkdirs/usr/ports/graphics/rawtherapee/work/rawtherapee-5.12/rtengine/FTblockDN.cc
In file included from /usr/include/c++/v1/__iterator/concepts.h:34,
                 from
/usr/include/c++/v1/__algorithm/ranges_iterator_concept.h:13,
                 from /usr/include/c++/v1/__algorithm/iterator_operations.h:13,
                 from /usr/include/c++/v1/__algorithm/copy_move_common.h:12,
                 from /usr/include/c++/v1/__algorithm/copy.h:12,
                 from /usr/include/c++/v1/vector:308,
                 from
/wrkdirs/usr/ports/graphics/rawtherapee/work/rawtherapee-5.12/rtengine/array2D.h:58,
                 from
/wrkdirs/usr/ports/graphics/rawtherapee/work/rawtherapee-5.12/rtengine/FTblockDN.cc:29:
/usr/include/c++/v1/__memory/pointer_traits.h: In instantiation of 'constexpr
std::__1::__decay_t<decltype
(std::__1::__to_address_helper<_Pointer>::__call(declval<const _Pointer&>()))>
std::__1::__to
_address(const _Pointer&) [with _Pointer = __wrap_iter<const Glib::ustring*>;
typename enable_if<decltype (__and_helper<is_class<_Pointer>,
_IsFancyPointer<_Pointer> >(0))::value, int>::type <anonymou
s> = 0]':
/usr/include/c++/v1/__memory/pointer_traits.h:216:1: error: use of built-in
trait '__decay(decltype((std::__1::__to_address_helper<_Pointer,
void>::__call)((declval<const _Pointer&>)())))' in function
 signature; use library traits instead
  216 | __to_address(const _Pointer& __p) _NOEXCEPT {
      | ^~~~~~~~~~~~
/usr/include/c++/v1/__memory/pointer_traits.h: In instantiation of 'constexpr
std::__1::__decay_t<decltype
(std::__1::__to_address_helper<_Pointer>::__call(declval<const _Pointer&>()))>
std::__1::__to
_address(const _Pointer&) [with _Pointer = reverse_iterator<float**>; typename
enable_if<decltype (__and_helper<is_class<_Pointer>, _IsFancyPointer<_Pointer>
>(0))::value, int>::type <anonymous> = 0]'
:
/usr/include/c++/v1/__memory/pointer_traits.h:216:1: error: use of built-in
trait '__decay(decltype((std::__1::__to_address_helper<_Pointer,
void>::__call)((declval<const _Pointer&>)())))' in function
 signature; use library traits instead
/usr/include/c++/v1/__memory/pointer_traits.h: In instantiation of 'constexpr
std::__1::__decay_t<decltype
(std::__1::__to_address_helper<_Pointer>::__call(declval<const _Pointer&>()))>
std::__1::__to
_address(const _Pointer&) [with _Pointer = reverse_iterator<float*>; typename
enable_if<decltype (__and_helper<is_class<_Pointer>, _IsFancyPointer<_Pointer>
>(0))::value, int>::type <anonymous> = 0]':
/usr/include/c++/v1/__memory/pointer_traits.h:216:1: error: use of built-in
trait '__decay(decltype((std::__1::__to_address_helper<_Pointer,
void>::__call)((declval<const _Pointer&>)())))' in function
 signature; use library traits instead
/usr/include/c++/v1/__memory/pointer_traits.h: In instantiation of 'constexpr
std::__1::__decay_t<decltype
(std::__1::__to_address_helper<_Pointer>::__call(declval<const _Pointer&>()))>
std::__1::__to
_address(const _Pointer&) [with _Pointer =
reverse_iterator<basic_string<char>*>; typename enable_if<decltype
(__and_helper<is_class<_Pointer>, _IsFancyPointer<_Pointer> >(0))::value,
int>::type <anon
ymous> = 0]':
/usr/include/c++/v1/__memory/pointer_traits.h:216:1: error: use of built-in
trait '__decay(decltype((std::__1::__to_address_helper<_Pointer,
void>::__call)((declval<const _Pointer&>)())))' in function
 signature; use library traits instead
ninja: build stopped: subcommand failed.
===> Compilation failed unexpectedly.
Try to set MAKE_JOBS_UNSAFE=yes and rebuild before reporting the failure to
the maintainer.
*** Error code 1

-- 
You are receiving this mail because:
You are the assignee for the bug.

Reply via email to