Copyright © https://mongoose-os.com

Mongoose OS Forum

frame

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

Hi,

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;
    data_layer(){}
};

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

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
     data_layer(){}
                  ^
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.
make[1]: *** [main.o] Error 1
/mongoose-os/fw/platforms/esp32/src/esp32_src.mk:130: recipe for target 'main.o' failed
make[1]: Leaving directory '/app/build/objs/mosapp'
/opt/Espressif/esp-idf/make/project.mk:450: 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?

regards

Comments

Sign In or Register to comment.