From 747a9bcb98c23f1da6a4315cad3e0929747c3a38 Mon Sep 17 00:00:00 2001 From: Wojtek Figat Date: Tue, 23 Feb 2021 22:24:24 +0100 Subject: [PATCH] Fix shared library building on Linux for proper loading at runtime with default soname --- Source/Tools/Flax.Build/Platforms/Linux/LinuxToolchain.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Source/Tools/Flax.Build/Platforms/Linux/LinuxToolchain.cs b/Source/Tools/Flax.Build/Platforms/Linux/LinuxToolchain.cs index 64cd88926..23a3a20ed 100644 --- a/Source/Tools/Flax.Build/Platforms/Linux/LinuxToolchain.cs +++ b/Source/Tools/Flax.Build/Platforms/Linux/LinuxToolchain.cs @@ -74,7 +74,10 @@ namespace Flax.Build.Platforms if (options.LinkEnv.Output == LinkerOutput.SharedLibrary) { args.Add("-shared"); - args.Add(string.Format("-Wl,-soname=\"{0}\"", Path.GetFileNameWithoutExtension(outputFilePath))); + var soname = Path.GetFileNameWithoutExtension(outputFilePath); + if (soname.StartsWith("lib")) + soname = soname.Substring(3); + //args.Add(string.Format("-Wl,-soname=\"{0}\"", soname)); } args.Add(string.Format("-target {0}", ArchitectureName));