Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
bonzini committed Sep 7, 2023
1 parent 3045019 commit f6feb02
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions contrib/plugins/Makefile
Expand Up @@ -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
Expand Down

0 comments on commit f6feb02

Please sign in to comment.