qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] contrib/plugins: remove -soname argument


From: Philippe Mathieu-Daudé
Subject: Re: [PATCH] contrib/plugins: remove -soname argument
Date: Thu, 7 Sep 2023 12:47:58 +0200
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.15.0

On 7/9/23 12:18, Paolo Bonzini wrote:
-soname is not needed for runtime-loaded modules.  For example, Meson says:

             if not isinstance(target, build.SharedModule) or 
target.force_soname:
                 # Add -Wl,-soname arguments on Linux, -install_name on OS X
                 commands += linker.get_soname_args(
                     self.environment, target.prefix, target.name, 
target.suffix,
                     target.soversion, target.darwin_versions)

(force_soname is set is shared modules are linked into a build target, which is 
not
the case here.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
  contrib/plugins/Makefile | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/contrib/plugins/Makefile b/contrib/plugins/Makefile
index b2b9db9f51a..db1bd04dfa6 100644
--- a/contrib/plugins/Makefile
+++ b/contrib/plugins/Makefile
@@ -37,7 +37,7 @@ all: $(SONAMES)
        $(CC) $(CFLAGS) -c -o $@ $<
lib%.so: %.o
-       $(CC) -shared -Wl,-soname,$@ -o $@ $^ $(LDLIBS)
+       $(CC) -shared -o $@ $^ $(LDLIBS)

This fixes on Darwin:

ld: unknown option: -soname
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [plugins] Error 2

Tested-by: Philippe Mathieu-Daudé <philmd@linaro.org>




reply via email to

[Prev in Thread] Current Thread [Next in Thread]