[lld] [LLD] [MinGW] Ignore the -rpath option (PR #102886)
via llvm-commits
llvm-commits at lists.llvm.org
Mon Aug 12 05:08:01 PDT 2024
llvmbot wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-lld
Author: Martin Storsjö (mstorsjo)
<details>
<summary>Changes</summary>
GNU ld silently accepts the -rpath option for Windows targets, as a no-op.
This has lead to some build systems (and users) passing this option while building for Windows/MinGW, even if Windows doesn't have any concept like rpath.
Older versions of Conan did include -rpath in the pkg-config files it generated, see e.g.
https://github.com/conan-io/conan/blob/17c58f0c61931f9de218ac571cd97a8e0befa68e/conans/client/generators/pkg_config.py#L104-L114 and
https://github.com/conan-io/conan/blob/17c58f0c61931f9de218ac571cd97a8e0befa68e/conans/client/build/compiler_flags.py#L26-L34 - and see https://github.com/mstorsjo/llvm-mingw/issues/300 for user reports about this issue.
Silently ignore the option in LLD for MinGW targets, to improve drop-in compatibility compared to GNU ld.
---
Full diff: https://github.com/llvm/llvm-project/pull/102886.diff
1 Files Affected:
- (modified) lld/MinGW/Options.td (+1)
``````````diff
diff --git a/lld/MinGW/Options.td b/lld/MinGW/Options.td
index 56f67e3dd96c42..1d2e03cbae9393 100644
--- a/lld/MinGW/Options.td
+++ b/lld/MinGW/Options.td
@@ -239,6 +239,7 @@ defm: EqNoHelp<"minor-image-version">;
def: F<"no-undefined">;
def: F<"pic-executable">;
defm: EqNoHelp<"plugin">;
+defm: EqNoHelp<"rpath">;
defm: EqNoHelp<"sysroot">;
def: F<"sort-common">;
def: F<"start-group">;
``````````
</details>
https://github.com/llvm/llvm-project/pull/102886
More information about the llvm-commits
mailing list