[llvm-branch-commits] [lld] e70d79f - [ELF] Ignore --no-add-needed

Tom Stellard via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Wed May 18 20:31:10 PDT 2022


Author: Fangrui Song
Date: 2022-05-18T20:28:53-07:00
New Revision: e70d79f1e8c0802c4039d2d66131c00590d49722

URL: https://github.com/llvm/llvm-project/commit/e70d79f1e8c0802c4039d2d66131c00590d49722
DIFF: https://github.com/llvm/llvm-project/commit/e70d79f1e8c0802c4039d2d66131c00590d49722.diff

LOG: [ELF] Ignore --no-add-needed

It is used by a few projects like keepassxc and mumble.
Also see https://bugzilla.redhat.com/show_bug.cgi?id=2070813 that Fedora gcc has
an (unneeded) gcc12-no-add-needed.patch which adds --no-add-needed, although
--[no-]add-needed has been deprecated in GNU ld since 2009. Adding this has low
costs and makes several folks happy.

This basically restores 8f13bef575c97db4d6c146c3bb647ac9e73a9248.

Fixes https://github.com/llvm/llvm-project/issues/54756

(cherry picked from commit c29c19cb5327624dd31fcb776f8fbe66ca1011bb)

Added: 
    

Modified: 
    lld/ELF/Options.td
    lld/test/ELF/silent-ignore.test

Removed: 
    


################################################################################
diff  --git a/lld/ELF/Options.td b/lld/ELF/Options.td
index ca9fdcde791f0..cf2013a5f8204 100644
--- a/lld/ELF/Options.td
+++ b/lld/ELF/Options.td
@@ -695,6 +695,7 @@ def plugin_opt_eq : J<"plugin-opt=">;
 def: F<"detect-odr-violations">;
 def: Flag<["-"], "g">;
 def: F<"long-plt">;
+def: FF<"no-add-needed">;
 def: F<"no-copy-dt-needed-entries">;
 def: F<"no-ctors-in-init-array">;
 def: F<"no-keep-memory">;

diff  --git a/lld/test/ELF/silent-ignore.test b/lld/test/ELF/silent-ignore.test
index 91b57434765f2..923afb2b5021e 100644
--- a/lld/test/ELF/silent-ignore.test
+++ b/lld/test/ELF/silent-ignore.test
@@ -2,6 +2,7 @@ RUN: ld.lld --version \
 RUN:   -detect-odr-violations \
 RUN:   -g \
 RUN:   -long-plt \
+RUN:   --no-add-needed \
 RUN:   -no-copy-dt-needed-entries \
 RUN:   -no-ctors-in-init-array \
 RUN:   -no-keep-memory \


        


More information about the llvm-branch-commits mailing list