diff mbox series

[5/5] contrib/plugins: Link with GLib

Message ID 20230907105004.88600-6-philmd@linaro.org
State New
Headers show
Series contrib/plugins: Build fixes for Darwin | expand

Commit Message

Philippe Mathieu-Daudé Sept. 7, 2023, 10:50 a.m. UTC
This fixes on Darwin:

  ld: symbol(s) not found for architecture arm64
    "_g_string_append_printf", referenced from:
        _log_stats in cache.o
        _log_top_insns in cache.o
        _append_stats_line in cache.o
  ld: symbol(s) not found for architecture arm64
    "_g_string_free", referenced from:
        _g_autoptr_cleanup_gstring_free in cache.o
    "_g_string_insert_len", referenced from:
        _log_stats in cache.o
        _append_stats_line in cache.o
  ld: symbol(s) not found for architecture arm64
    "_g_string_new", referenced from:
        _log_stats in cache.o
        _log_top_insns in cache.o
    "_g_strsplit", referenced from:
        _qemu_plugin_install in cache.o
    ...

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
Note LIBS was unused.
---
 contrib/plugins/Makefile | 1 +
 1 file changed, 1 insertion(+)
diff mbox series

Patch

diff --git a/contrib/plugins/Makefile b/contrib/plugins/Makefile
index b2b9db9f51..e9173972eb 100644
--- a/contrib/plugins/Makefile
+++ b/contrib/plugins/Makefile
@@ -26,6 +26,7 @@  SONAMES := $(addsuffix .so,$(addprefix lib,$(NAMES)))
 
 # The main QEMU uses Glib extensively so it's perfectly fine to use it
 # in plugins (which many example do).
+LDLIBS += $(shell $(PKG_CONFIG) --libs glib-2.0)
 CFLAGS := $(shell $(PKG_CONFIG) --cflags glib-2.0)
 CFLAGS += -fPIC -Wall
 CFLAGS += $(if $(CONFIG_DEBUG_TCG), -ggdb -O0)