From: Paolo Bonzini Date: Thu, 7 Sep 2023 10:38:39 +0000 (+0200) Subject: contrib/plugins: add Darwin support X-Git-Tag: v8.2.0-rc0~138^2~32 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=f6feb021e254054c2d50db5392c8b0dfbc932243;p=thirdparty%2Fqemu.git contrib/plugins: add Darwin support Under Darwin, using -shared makes it impossible to have undefined symbols and -bundle has to be used instead; so detect the OS and use different options. Based-on: <20230907101811.469236-1-pbonzini@redhat.com> Signed-off-by: Paolo Bonzini --- diff --git a/contrib/plugins/Makefile b/contrib/plugins/Makefile index db1bd04dfa6..c26fa08441e 100644 --- a/contrib/plugins/Makefile +++ b/contrib/plugins/Makefile @@ -37,7 +37,11 @@ all: $(SONAMES) $(CC) $(CFLAGS) -c -o $@ $< lib%.so: %.o +ifeq ($(CONFIG_DARWIN),y) + $(CC) -bundle -Wl,-undefined,dynamic_lookup -o $@ $^ $(LDLIBS) +else $(CC) -shared -o $@ $^ $(LDLIBS) +endif clean: rm -f *.o *.so *.d