From c51a9231602c12d0ad4c1591d5b62ddbff2d4886 Mon Sep 17 00:00:00 2001 From: Ari Vuollet Date: Sun, 5 Feb 2023 13:38:29 +0200 Subject: [PATCH] Only pass --copy-dt-needed-entries with GNU linker --- Source/Tools/Flax.Build/Platforms/Linux/LinuxToolchain.cs | 3 ++- Source/Tools/Flax.Build/Platforms/Unix/UnixToolchain.cs | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/Source/Tools/Flax.Build/Platforms/Linux/LinuxToolchain.cs b/Source/Tools/Flax.Build/Platforms/Linux/LinuxToolchain.cs index 9bc9aab33..96ef470e4 100644 --- a/Source/Tools/Flax.Build/Platforms/Linux/LinuxToolchain.cs +++ b/Source/Tools/Flax.Build/Platforms/Linux/LinuxToolchain.cs @@ -75,7 +75,8 @@ namespace Flax.Build.Platforms args.Add("-Wl,-rpath,\"\\$ORIGIN\""); //args.Add("-Wl,--as-needed"); - args.Add("-Wl,--copy-dt-needed-entries"); + if (LdKind == "bfd") + args.Add("-Wl,--copy-dt-needed-entries"); args.Add("-Wl,--hash-style=gnu"); //args.Add("-Wl,--build-id"); diff --git a/Source/Tools/Flax.Build/Platforms/Unix/UnixToolchain.cs b/Source/Tools/Flax.Build/Platforms/Unix/UnixToolchain.cs index 53e20db63..6bbb8707f 100644 --- a/Source/Tools/Flax.Build/Platforms/Unix/UnixToolchain.cs +++ b/Source/Tools/Flax.Build/Platforms/Unix/UnixToolchain.cs @@ -107,8 +107,8 @@ namespace Flax.Build.Platforms } if (LdPath == null) { - LdPath = UnixPlatform.Which("ld"); - LdKind = null; + LdPath = UnixPlatform.Which("ld"); // ld.bfd + LdKind = "bfd"; } } else