Ist es möglich, dass abhängig von den enthaltenen Headern ein interner GCC-Compiler-Fehler (ICE) auftritt?C++

Programme in C++. Entwicklerforum
Guest
 Ist es möglich, dass abhängig von den enthaltenen Headern ein interner GCC-Compiler-Fehler (ICE) auftritt?

Post by Guest »

Ich entwickle zwei leicht unterschiedliche IOT-Projekte, die einen großen Teil der Codebasis teilen, und wir verwenden aus Kompatibilitätsgründen GCC 6.3.0. Um einen Teil des Codes zu unterstützen, habe ich die fmt-Bibliothek in die vorgeschlagene CMake-Methode eingebunden:

Code: Select all

include(FetchContent)

FetchContent_Declare(
fmt
GIT_REPOSITORY https://github.com/fmtlib/fmt
GIT_TAG        11.0.2)
FetchContent_MakeAvailable(fmt)

# later ...

target_link_libraries( PRIVATE fmt)
Die Kompilierung gelingt jedoch in einem Projekt und schlägt im anderen fehl mit

Code: Select all

[8/17] Building CXX object _deps/fmt-build/CMakeFiles/fmt.dir/src/format.cc.o
FAILED: _deps/fmt-build/CMakeFiles/fmt.dir/src/format.cc.o
/opt/cross/bin/arm-linux-gnueabihf-g++ --sysroot=/opt/box-root-fs  -I/opt/box-root-fs/usr/include -I/opt/box-root-fs/usr/local/include -I/home/abertulli/
/build/_deps/fmt-src/include -fdiagnostics-color=always -pthread -g -MD -MT _deps/fmt-build/CMakeFiles/fmt.dir/src/format.cc.o -MF _deps/fmt-build/CMakeFiles/fmt.dir/src/format.cc.o.d -o _deps/fmt-build/CMakeFiles/fmt.dir/src/format.cc.o -c /home/abertulli//build/_deps/fmt-src/src/format.cc
In file included from /home/abertulli//build/_deps/fmt-src/include/fmt/format.h:41:0,
from /home/abertulli//build/_deps/fmt-src/include/fmt/format-inl.h:27,
from /home/abertulli//build/_deps/fmt-src/src/format.cc:8:
/home/abertulli//build/_deps/fmt-src/include/fmt/base.h: In instantiation of ‘void fmt::v11::detail::check_format_string(S) [with Args = {unsigned int&}; S = fmt::v11::formatter::format(const fmt::v11::detail::bigint&, fmt::v11::format_context&) const::::FMT_COMPILE_STRING; typename std::enable_if::type  = 0]’:
/home/abertulli//build/_deps/fmt-src/include/fmt/base.h:2887:41:   required from ‘fmt::v11::basic_format_string::basic_format_string(const S&) [with S = fmt::v11::formatter::format(const fmt::v11::detail::bigint&, fmt::v11::format_context&) const::::FMT_COMPILE_STRING; typename std::enable_if::type  = 0; Char = char; Args = {unsigned int&}]’
/home/abertulli//build/_deps/fmt-src/include/fmt/format-inl.h:1391:60:   required from here
/home/abertulli//build/_deps/fmt-src/include/fmt/base.h:2792:56:   in constexpr expansion of ‘fmt::v11::detail::parse_format_string(s, fmt::v11::detail::format_string_checker(s))’
/home/abertulli//build/_deps/fmt-src/include/fmt/base.h:2613:44:   in constexpr expansion of ‘fmt::v11::detail::parse_replacement_field((p + 4294967295u), end, ((fmt::v11::detail::format_string_checker&)handler))’
/home/abertulli//build/_deps/fmt-src/include/fmt/base.h:2591:13:   in constexpr expansion of ‘(& handler)->fmt::v11::detail::format_string_checker::on_format_specs(adapter.fmt::v11::detail::parse_replacement_field(const Char*, const Char*, Handler&&) [with Char = char; Handler = fmt::v11::detail::format_string_checker&]::id_adapter::arg_id, (begin + 1u), end)’
/home/abertulli//build/_deps/fmt-src/include/fmt/base.h:2763:51:   in constexpr expansion of ‘((fmt::v11::detail::format_string_checker*)this)->fmt::v11::detail::format_string_checker::parse_funcs_[id](((fmt::v11::detail::format_string_checker*)this)->fmt::v11::detail::format_string_checker::context_)’
/home/abertulli//build/_deps/fmt-src/include/fmt/base.h:2677:55:   in constexpr expansion of ‘fmt::v11::formatter().fmt::v11::formatter::.fmt::v11::detail::native_formatter::parse(ctx)’
/home/abertulli//build/_deps/fmt-src/include/fmt/base.h:2829:34:   in constexpr expansion of ‘fmt::v11::detail::parse_format_specs((& ctx)->fmt::v11::detail::compile_parse_context::.fmt::v11::basic_format_parse_context::begin(), (& ctx)->fmt::v11::detail::compile_parse_context::.fmt::v11::basic_format_parse_context::end(), ((fmt::v11::detail::native_formatter*)this)->fmt::v11::detail::native_formatter::specs_, (& ctx)->fmt::v11::detail::compile_parse_context::, (fmt::v11::detail::type)2)’
/home/abertulli//build/_deps/fmt-src/include/fmt/base.h:2792:77: internal compiler error: in cxx_eval_bit_field_ref, at cp/constexpr.c:2360
FMT_CONSTEXPR bool error = (parse_format_string(s, checker(s)), true);
^
Die beiden CMakeLists.txt-Dateien sind beim Einbinden von fmt identisch, sie ändern sich bei der Verwendung nur geringfügig (z. B. bei Verwendung zweier Versionen von target_link_libraries), aber es lässt sich problemlos kompilieren, wenn ich einen nativen Build durchführe (der GCC 11.4 verwendet), und aus der Fehlermeldung geht hervor, dass er nicht mit meiner Quelldatei zusammenhängt, die ihn verwendet (die auf jeden Fall identisch ist). Ich verstehe, dass es sich bei ICE im Grunde um Fehler handelt, die nicht vorhanden sein sollten, da sie beim Kompilieren von gültigem Code auftauchen, aber ich bin verwirrt darüber, warum sie in einem Fall auftauchen, im anderen jedoch nicht. Es tut mir leid, dass ich kein vollständiges MWE bereitstellen kann, ohne meine NDA zu brechen (und der Compiler wurde, da er nicht mehr im Repo enthalten ist, unter Anpassung dieses (gesegneten!) Leitfadens von Grund auf kompiliert

Quick Reply

Change Text Case: 
   
  • Similar Topics
    Replies
    Views
    Last post