Copyright ©

Mongoose OS Forum


internal compiler error: in add_to_same_comdat_group, at symtab.c:421


I'm trying to compile a simple exemple with variadic templates and virtual inheritance. My exemple compile well with the native esp32 sdk (it's the minimal code to reproduce the error not my working code):

#include "mgos.h"

template<typename T, typename... TOptions>
struct adapter;

template<typename T>
struct adapter<T>
    using value_type = T;

struct layer_iface

template<typename TAdapter>
struct data_layer
: public virtual layer_iface
    using adapter_type = TAdapter;

enum mgos_app_init_result mgos_app_init(void) {
    data_layer<adapter<int>> layer;

But when I try to compile with mos (locally with the docker image, or remotely) I got the following issue :

/app/src/main.cpp: In instantiation of 'data_layer<TAdapter>::data_layer() [with TAdapter = adapter<int>]':
/app/src/main.cpp:28:30:   required from here
/app/src/main.cpp:24:18: internal compiler error: in add_to_same_comdat_group, at symtab.c:421
Please submit a full bug report,
with preprocessed source if appropriate.
See <> for instructions.
make[1]: *** [main.o] Error 1
/mongoose-os/fw/platforms/esp32/src/ recipe for target 'main.o' failed
make[1]: Leaving directory '/app/build/objs/mosapp'
/opt/Espressif/esp-idf/make/ recipe for target 'component-mosapp-build' failed
make: *** [component-mosapp-build] Error 2
make: Leaving directory '/app'
Error: exit status 2

Is someone has an idea to solve this problem?



Sign In or Register to comment.