On 24/03/2026 3:13 pm, Chris Jones wrote:
On 24/03/2026 3:02 pm, Sergey Fedorov wrote:
To be clear: on powerpc (and by default outside of MacPorts generally)
gcc uses libstdc++, and that works fine.
MacPorts uses libc++ with gcc on archs other than powerpc, which is
what fails. It is not a fault of gcc, it is a fault of libc++ being
outdated.
This should work fine on 10.5 out of the box.
Wrong. By default building c++ with gcc will always link against
libstdc++, not libc++ . MacPorts GCC version have the option to use
libc++, but how well this works in practice is pretty flaky.
This is why we don't in general allow gcc as a fallback compiler for C++
builds, as doing so would result in binaries ABI incompatble with other
binaries built with clang++. Forcing the use of gcc for this, with
configure.compiler=macports-gcc-15 is very much in-advised on any
platform where libc++ is the default runtime (i.e. all but the very
oldest ancient OSes).
Actually, a small correction. gcc supports libc++ via the -stdlib=libc++
command line flag. It could be in some port builds MacPorts inserts
this, so yes, it could be some port builds will attempt to use libc++
with gcc. But, as I say, whilst support for this is in principle there
upstream GCC has been very poor in maintaining it (IMHO) and thus
whether it works or not is very hit or miss. Its not really advised in
general.
Chris
Chris