mesonbuild / meson

The Meson Build System
http://mesonbuild.com
Apache License 2.0
5.57k stars 1.62k forks source link

gnome.generate_gir uses improper shared-library with executable and ASAN #4541

Open chergert opened 5 years ago

chergert commented 5 years ago

If you pass an executable() to gnome.generate_gir() and -Db_sanitize=address is enabled, you can end up with a .gir file that has shared-library="libasan.so.5" or similar.

This causes a problem at runtime as GObject Introspection will fail to locate the proper symbols.

chergert commented 5 years ago

The correct value is just shared-library="", which is what I get with ASAN disabled.

arrowd commented 1 year ago

Looks like I bumped into this too. I configured the PackageKit project with -Db_sanitize=address and getting this:

[1/21] Linking target lib/packagekit-glib2/libpackagekit-glib2.so.18.1.3
ld: error: undefined symbol: __asan_init
referenced by pk-enum-types.c

The -lasan part is only occurs in the

build lib/packagekit-glib2/PackageKitGlib-1.0.gir: ...

ninja rule, but not in build lib/packagekit-glib2/libpackagekit-glib2.so.18.1.3.