Summary: | graphics/rawtherapee: GCC14 build on FreeBSD 13.4-RELEASE causes "undefined reference to `__cxa_call_terminate'" | ||||||
---|---|---|---|---|---|---|---|
Product: | Ports & Packages | Reporter: | Lorenzo Salvadore <salvadore> | ||||
Component: | Individual Port(s) | Assignee: | Matthias Andree <mandree> | ||||
Status: | Open --- | ||||||
Severity: | Affects Only Me | CC: | gerald, salvadore | ||||
Priority: | --- | Flags: | mandree:
maintainer-feedback+
|
||||
Version: | Latest | ||||||
Hardware: | Any | ||||||
OS: | Any | ||||||
URL: | https://pkg-status.freebsd.org/gohan06/data/134amd64-default-foo/2025-01-24_09h47m14s/logs/rawtherapee-5.11_1.log | ||||||
Bug Depends on: | 284499 | ||||||
Bug Blocks: | 281091 | ||||||
Attachments: |
|
Description
Lorenzo Salvadore
![]() ![]() At first glance this looks like an incompatibility with (y)our base system's C++ stack with GCC14. The porting_to link doesn't help. Googling suggests that there have been GCC14 related changes that may now cause __cxa_call_terminate to be called in places where GCC13 might not have triggered that, and this would require recompiling the world and its brother for libstdc++. It seems there's a __clang_call_terminate, but more importantly, THIS IS A SHOWSTOPPER FOR MAKING GCC14 THE DEFAULT FOR ALL C++ STUFF IN PORTS! Either patch GCC14 so it generates code that is compatible with our base system C++ stuff on all supported releases. To make this a bit more constructive, this was discussed in the GCC context for libstdc++ here: https://gcc.gnu.org/pipermail/libstdc++/2023-May/056011.html What this boils down to is that GCC14 some way references libstdc++ ABI stuff when building other components, and rawtherapee than barfs when the latter cannot find the libstdc++ specific function in the Base libc++. And we cannot easily use libstdc++ in rawtherapee (instead of libc++) because that means that all C++ libraries also must have been compiled with libstdc++. We've been there before, and rawtherapee has frequently shown clang++ to be troublesome. For the time being, I'll pin GCC. A commit in branch main references this bug: URL: https://cgit.FreeBSD.org/ports/commit/?id=7c091b1abc84f4246e557aaf7d04d111e4db9b8f commit 7c091b1abc84f4246e557aaf7d04d111e4db9b8f Author: Matthias Andree <mandree@FreeBSD.org> AuthorDate: 2025-01-31 21:37:37 +0000 Commit: Matthias Andree <mandree@FreeBSD.org> CommitDate: 2025-01-31 21:42:11 +0000 graphics/rawtherapee: pin GCC version to 13. Apparently GCC 14 has new libstdc++ bits spill over somewhere, and this would break rawtherapee's build at link time, salvadore@ wrote /usr/local/bin/ld: /tmp/ccgto6pJ.ltrans65.ltrans.o: in function `Spot::~Spot() [clone .cold]': <artificial>:(.text.unlikely+0x89d): undefined reference to `__cxa_call_terminate' /usr/local/bin/ld: /tmp/ccgto6pJ.ltrans76.ltrans.o: in function `(anonymous namespace)::dfInfo::updateBadPixelList(rtengine::RawImage const*) [clone ._omp_fn.0] [clone .cold]': <artificial>:(.text.unlikely+0x93): undefined reference to `__cxa_call_terminate' /usr/local/bin/ld: /tmp/ccgto6pJ.ltrans77.ltrans.o: in function `rtengine::ImProcFunctions::RGB_denoise(int, rtengine::Imagefloat*, rtengine::Imagefloat*, rtengine::Imagefloat*, float*, float*, float*, bool, rtengine::procparams::DirPyrDenoiseParams const&, double, rtengine::NoiseCurve const&, rtengine::NoiseCurve const&, float&, float&) [clone ._omp_fn.2] [clone .cold]': <artificial>:(.text.unlikely+0x1d9): undefined reference to `__cxa_call_terminate' /usr/local/bin/ld: /tmp/ccgto6pJ.ltrans81.ltrans.o: in function `rtengine::init(rtengine::Settings const*, Glib::ustring const&, Glib::ustring const&, bool) [clone ._omp_fn.0] [clone .lto_priv.0] [clone .cold]': <artificial>:(.text.unlikely+0x4be): undefined reference to `__cxa_call_terminate' /usr/local/bin/ld: /tmp/ccgto6pJ.ltrans84.ltrans.o: in function `rtengine::ImProcFunctions::ciecamloc_02float(rtengine::local_params&, int, rtengine::LabImage*, int, int, int, int, LUT<float> const&, bool, LUT<float> const&, bool, LUT<float> const&, bool, LUT<float> const&, bool, LUT<float> const&, bool, rtengine::LocCHCurve const&, rtengine::LocHHCurve const&, rtengine::LocLHCurve const&, bool, bool, bool, rtengine::LocwavCurve const&, bool, float&, float&, float&) [clone ._omp_fn.11] [clone .lto_priv.0] [clone .cold]': <artificial>:(.text.unlikely+0x5f): undefined reference to `__cxa_call_terminate' And this seems to be https://gcc.gnu.org/pipermail/libstdc++/2023-May/056011.html related to C++ standards compliance - however __cxa_call_terminate specifically is a libstdc++ export function, unavailable in libc++. Rawtherapee needs to link against libc++ because otherwise all C++ libraries it imports would also have to be compiled against libstdc++. Reported by: Lorenzo salvadore@ PR: 284487 graphics/rawtherapee/Makefile | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) So, can we somehow identify how "GCC 14" makes libstd++'s __cxa_call_terminate spill over? Is this through some library we link against that should have used the base system's libc++? I have had this in my graphics/rawtherapee/Makefile for a long time, I would like another pair of eyeballs and comments on this: .include <bsd.port.pre.mk> .if ${COMPILER_FEATURES:Mlibc++} CXXFLAGS+= -stdlib=libc++ .endif The idea is checking "if base system uses libc++, so should rawtherapee". Does that work as intended? Did I overlook something? Let me retitle and reopen this. See 281091 comments for why. A commit in branch main references this bug: URL: https://cgit.FreeBSD.org/ports/commit/?id=3aaa6f4874aec6faa1f51dce405cfaf430bbc9c1 commit 3aaa6f4874aec6faa1f51dce405cfaf430bbc9c1 Author: Matthias Andree <mandree@FreeBSD.org> AuthorDate: 2025-01-31 23:49:21 +0000 Commit: Matthias Andree <mandree@FreeBSD.org> CommitDate: 2025-01-31 23:52:59 +0000 graphics/rawtherapee: Revert "pin GCC version to 13." This reverts commit 7c091b1abc84f4246e557aaf7d04d111e4db9b8f. Reason I am reverting this is that I can set USE_GCC=14 and happily compile, without or with LTO and/or native. My conclusion is that rawtherapee is doing its things right, but one of its libraries gets compiled for libstdc++, and pollutes rawtherapee's program space but we don't give rawtherapee libstdc++ but libc++ on systems where the default compiler uses the latter. PR: 284487 graphics/rawtherapee/Makefile | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) Created attachment 257159 [details]
compressed 134amd64 exp-run log for rawtherapee
|