GISample-1.0.gir link problem when requiring additional custom ldflagsd

Re-opening a question asked here :
https://gitlab.gnome.org/GNOME/gobject-introspection/-/issues/426

To summarize:
gobject-introspection has an example project named that build a library named libgi_sample and an introspection target named GISample-1.0.gir.

If one slightly modify the build of this sample project by adding for example sanitizing flags (e.g. -fsanitize=address), which must appear in both compile and link command line, one can notice that
the build of the library still succeeds but the build of the introspection target fails, and the reason is that the link flags are not transferred from the library target to the introspection target.

Just quoting the answered from the link above the developpers of gobect-introspection:
“At the moment, gobject-introspection is incompatible with sanitizers like ASan/UBSan.”

Ok, agreed, but this doesn’t fully answer the original question, the sanitizing flags were just an example of additional link flag transfer between target libgi_sample and GISample-1.0.

From what I can see, using the autotool/libtool build, any additional flags that are set in libgi_sample_la_LDFLAGS will be filtered out by libtool, which explains why the link of GISample-1.0 fails.

Actually the problem can solved if libtool wouldn’t filtered out theses flags, but just add them to inherited_linker_flags. So to me, this not specific to sanitizing flags, but to any link flag that need to be transfered transitively between the two targets.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.