Laurent GUERBY <laur...@guerby.net> writes:

> Next issue is that gnat1 link fails on many missing symbols:
>
> ada/b_gnat1.o: In function `adainit()':
> ada/b_gnat1.c:287: undefined reference to `system__soft_links___elabb()'
> ada/b_gnat1.c:291: undefined reference to
> `system__secondary_stack___elabb()'
> ....
> ada/b_gnat1.c:89: undefined reference to
> `system__standard_library__adafinal()'
> ada/b_gnat1.o:(.eh_frame+0x12): undefined reference to
> `__gxx_personality_v0'
> ada/adadecode.o:(.eh_frame+0x12): undefined reference to
> `__gxx_personality_v0'
> ...
>
> (full log attached as b.log.gz)
>
> I suspect some Makefile+gnatbind work specific to this branch is needed
> to go past this issue but I've no idea on what is the exact source
> of the issue and how to fix it, I've no experience in C++/Ada code
> mixing. Help welcomed :).

I don't really know how the Ada compiler works, but it looks like this
code is generated by the gnatbind program.  I bet it would work if
gnatbind -C emitted this at the start of the output:

#ifdef __cplusplus
extern "C" {
#endif

and emitted this at the end:

#ifdef __cplusplus
}
#endif

I think the function to change is Gen_Output_File_C in bindgen.adb.

Ian

Reply via email to