Opened 14 months ago
Last modified 4 months ago
#68055 reopened defect
codeblocks fails to build with gcc12 on 10.6 when build as ppc: error: static assertion failed: comparison object must be invocable as const
Reported by: | barracuda156 | Owned by: | barracuda156 |
---|---|---|---|
Priority: | Normal | Milestone: | |
Component: | ports | Version: | 2.8.1 |
Keywords: | snowleopard ppc | Cc: | |
Port: | codeblocks |
Description
:info:build make[3]: Entering directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_codeblocks/codeblocks/work/codeblocks-20.03/src/plugins/openfileslist' :info:build depbase=`echo openfileslistplugin.lo | sed 's|[^/]*$|.deps/&|;s|\.lo$||'`;\ :info:build /bin/sh ../../../libtool --tag=CXX --mode=compile /opt/local/bin/g++-mp-12 -DHAVE_CONFIG_H -I. -I../../../src/include -I/opt/local/Library/Frameworks/wxWidgets.framework/Versions/wxGTK/3.0/lib/wx/include/gtk3-unicode-3.0 -I/opt/local/Library/Frameworks/wxWidgets.framework/Versions/wxGTK/3.0/include/wx-3.0 -D_FILE_OFFSET_BITS=64 -DWXUSINGDLL -D__WXGTK__ -I../../../src/include -I../../../src/sdk/wxscintilla/include -DCB_AUTOCONF -I/opt/local/libexec/boost/1.76/include -I/opt/local/include -DCB_PRECOMP -DPIC -pipe -I/opt/local/libexec/boost/1.76/include -Os -D_GLIBCXX_USE_CXX11_ABI=0 -arch ppc -Winvalid-pch -fPIC -fexceptions -MT openfileslistplugin.lo -MD -MP -MF $depbase.Tpo -c -o openfileslistplugin.lo openfileslistplugin.cpp &&\ :info:build mv -f $depbase.Tpo $depbase.Plo :info:build PWD=`pwd` cd . && zip /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_codeblocks/codeblocks/work/codeblocks-20.03/src/plugins/openfileslist/openfileslist.zip manifest.xml > /dev/null :info:build libtool: compile: /opt/local/bin/g++-mp-12 -DHAVE_CONFIG_H -I. -I../../../src/include -I/opt/local/Library/Frameworks/wxWidgets.framework/Versions/wxGTK/3.0/lib/wx/include/gtk3-unicode-3.0 -I/opt/local/Library/Frameworks/wxWidgets.framework/Versions/wxGTK/3.0/include/wx-3.0 -D_FILE_OFFSET_BITS=64 -DWXUSINGDLL -D__WXGTK__ -I../../../src/include -I../../../src/sdk/wxscintilla/include -DCB_AUTOCONF -I/opt/local/libexec/boost/1.76/include -I/opt/local/include -DCB_PRECOMP -DPIC -pipe -I/opt/local/libexec/boost/1.76/include -Os -D_GLIBCXX_USE_CXX11_ABI=0 -arch ppc -Winvalid-pch -fPIC -fexceptions -MT openfileslistplugin.lo -MD -MP -MF .deps/openfileslistplugin.Tpo -c openfileslistplugin.cpp -fno-common -DPIC -o .libs/openfileslistplugin.o :info:build In file included from /opt/local/include/gcc12/c++/map:60, :info:build from ./manager.h:9, :info:build from ./cbplugin.h:17, :info:build from ./sdk_common.h:110, :info:build from ./sdk_precomp.h:13, :info:build from ./sdk.h:17: :info:build /opt/local/include/gcc12/c++/bits/stl_tree.h: In instantiation of 'static const _Key& std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::_S_key(_Const_Link_type) [with _Key = ProjectFile*; _Val = ProjectFile*; _KeyOfValue = std::_Identity<ProjectFile*>; _Compare = TargetFilesData::compareLess; _Alloc = std::allocator<ProjectFile*>; _Const_Link_type = const std::_Rb_tree_node<ProjectFile*>*]': :info:build /opt/local/include/gcc12/c++/bits/stl_tree.h:2119:47: required from 'std::pair<std::_Rb_tree_node_base*, std::_Rb_tree_node_base*> std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::_M_get_insert_unique_pos(const key_type&) [with _Key = ProjectFile*; _Val = ProjectFile*; _KeyOfValue = std::_Identity<ProjectFile*>; _Compare = TargetFilesData::compareLess; _Alloc = std::allocator<ProjectFile*>; key_type = ProjectFile*]' :info:build /opt/local/include/gcc12/c++/bits/stl_tree.h:2172:4: required from 'std::pair<std::_Rb_tree_iterator<_Val>, bool> std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::_M_insert_unique(_Arg&&) [with _Arg = ProjectFile* const&; _Key = ProjectFile*; _Val = ProjectFile*; _KeyOfValue = std::_Identity<ProjectFile*>; _Compare = TargetFilesData::compareLess; _Alloc = std::allocator<ProjectFile*>]' :info:build /opt/local/include/gcc12/c++/bits/stl_set.h:512:25: required from 'std::pair<typename std::_Rb_tree<_Key, _Key, std::_Identity<_Tp>, _Compare, typename __gnu_cxx::__alloc_traits<_Alloc>::rebind<_Key>::other>::const_iterator, bool> std::set<_Key, _Compare, _Alloc>::insert(const value_type&) [with _Key = ProjectFile*; _Compare = TargetFilesData::compareLess; _Alloc = std::allocator<ProjectFile*>; typename std::_Rb_tree<_Key, _Key, std::_Identity<_Tp>, _Compare, typename __gnu_cxx::__alloc_traits<_Alloc>::rebind<_Key>::other>::const_iterator = std::_Rb_tree<ProjectFile*, ProjectFile*, std::_Identity<ProjectFile*>, TargetFilesData::compareLess, std::allocator<ProjectFile*> >::const_iterator; typename __gnu_cxx::__alloc_traits<_Alloc>::rebind<_Key>::other = std::allocator<ProjectFile*>; typename __gnu_cxx::__alloc_traits<_Alloc>::rebind<_Key> = __gnu_cxx::__alloc_traits<std::allocator<ProjectFile*>, ProjectFile*>::rebind<ProjectFile*>; typename _Alloc::value_type = ProjectFile*; value_type = ProjectFile*]' :info:build openfileslistplugin.cpp:440:57: required from here :info:build /opt/local/include/gcc12/c++/bits/stl_tree.h:772:15: error: static assertion failed: comparison object must be invocable as const :info:build 772 | is_invocable_v<const _Compare&, const _Key&, const _Key&>, :info:build | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ :info:build /opt/local/include/gcc12/c++/bits/stl_tree.h:772:15: note: 'std::is_invocable_v<const TargetFilesData::compareLess&, ProjectFile* const&, ProjectFile* const&>' evaluates to false :info:build make[3]: *** [openfileslistplugin.lo] Error 1
Change History (12)
comment:1 Changed 14 months ago by kencu (Ken)
Summary: | codeblocks fails to build with GCC: error: static assertion failed: comparison object must be invocable as const → codeblocks fails to build with gcc12 on 10.6 when build as ppc: error: static assertion failed: comparison object must be invocable as const |
---|
comment:2 Changed 14 months ago by kencu (Ken)
Keywords: | snowleopard ppc added |
---|
comment:3 follow-ups: 4 5 Changed 14 months ago by kencu (Ken)
relevant:
https://stackoverflow.com/questions/51235355/comparison-object-being-invocable-as-const
I don’t see a c++ standard being set on the build line, and in the absence of one being set gcc-12 will default to gnu++17, which apparently will trigger this error.
It’s probably already fixed in codeblocks-devel, but you’d have to try it to see.
comment:4 Changed 7 months ago by barracuda156
Replying to kencu:
relevant:
https://stackoverflow.com/questions/51235355/comparison-object-being-invocable-as-const
I don’t see a c++ standard being set on the build line, and in the absence of one being set gcc-12 will default to gnu++17, which apparently will trigger this error.
It’s probably already fixed in codeblocks-devel, but you’d have to try it to see.
Thank you, I will try it.
- S. Same error with gcc13, though nothing to be surprised about.
comment:5 Changed 7 months ago by barracuda156
Replying to kencu:
Yeah, codeblocks-devel
installs fine from existing portfile. However, I get this error now:
36-100% /Applications/MacPorts/CodeBlocks.app/Contents/MacOS/CodeBlocks Fatal Error: Mismatch between the program and library build versions detected. The library used 3.0 (wchar_t,compiler with C++ ABI 1002,wx containers,compatible with 2.8), and your program used 3.0 (wchar_t,compiler with C++ ABI 1018,wx containers,compatible with 2.8).
I have seen it earlier with amule
, where I had to fallback to gcc-4.2
. Here that does not work, we need C++11.
What is the right way to address this?
comment:6 Changed 7 months ago by barracuda156
By the way, this wxWidgets pain seems to be but another outcome of mixing two libstdc++. Which is why no one is having these on systems with Clangs.
comment:7 Changed 7 months ago by kencu (Ken)
it might link properly if you forced the build of codeblocks-devel to use the older GXX ABI.
You would do this by setting this:
configure.cxxflags-append -fabi-version=2
This has some potential downsides (the newer ABI has fixes and enhancements), but ... possibly worth a try.
Alternatively, you could probably rebuild wxWidgets using a newer gcc, which it would appear defaults to a newer GXX ABI. However, at that point, you'd be needing to always use that newer gcc to build things against wxWidgets, which might be just fine.
comment:8 Changed 7 months ago by kencu (Ken)
Here is some information on GCC's CXX ABI dialects:
https://gcc.gnu.org/onlinedocs/gcc/C_002b_002b-Dialect-Options.html
comment:9 Changed 4 months ago by barracuda156
Owner: | set to barracuda156 |
---|---|
Resolution: | → fixed |
Status: | new → closed |
comment:10 Changed 4 months ago by kencu (Ken)
Resolution: | fixed |
---|---|
Status: | closed → reopened |
ah, that commit didn’t actually fix the noted error in codeblocks.
it fixed the add-on issue in codeblocks-devel.
argh. the problems you get when conflating tickets
comment:11 follow-up: 12 Changed 4 months ago by kencu (Ken)
nobody is likely to fix the issue with the codeblocks port as it has been fixed in codeblocks- devel and a new release is expected Real Soon Now….
comment:12 Changed 4 months ago by barracuda156
Replying to kencu:
nobody is likely to fix the issue with the codeblocks port as it has been fixed in codeblocks- devel and a new release is expected Real Soon Now….
Yeah, you suggested -devel version, it worked, so there was no point to waste time for trying to fix an old version as well.
I’m not likely to work on this, but you might try codeblocks-devel as it has several years of new commits in it.