diff options
author | Paolo Bonzini <pbonzini@redhat.com> | 2023-09-07 12:38:39 +0200 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2023-09-07 13:32:14 +0200 |
commit | f6feb021e254054c2d50db5392c8b0dfbc932243 (patch) | |
tree | 9ec28a0464e78fd4e51d45f85d726318e2ace15c /contrib | |
parent | 3045019fc9d4fbfe62a23b9c4eacb2a5ee944d4d (diff) |
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 <pbonzini@redhat.com>
Diffstat (limited to 'contrib')
-rw-r--r-- | contrib/plugins/Makefile | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/contrib/plugins/Makefile b/contrib/plugins/Makefile index db1bd04dfa..c26fa08441 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 |