[lld] c29c19c - [ELF] Ignore --no-add-needed

Fangrui Song via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 6 22:41:32 PDT 2022


Author: Fangrui Song
Date: 2022-04-06T22:41:27-07:00
New Revision: c29c19cb5327624dd31fcb776f8fbe66ca1011bb

URL: https://github.com/llvm/llvm-project/commit/c29c19cb5327624dd31fcb776f8fbe66ca1011bb
DIFF: https://github.com/llvm/llvm-project/commit/c29c19cb5327624dd31fcb776f8fbe66ca1011bb.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

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 92846811924b0..5ed59af4a4fa4 100644
--- a/lld/ELF/Options.td
+++ b/lld/ELF/Options.td
@@ -692,6 +692,7 @@ def: Flag<["-"], "d">;
 def: Flag<["-"], "dc">;
 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 c9289b5ab716e..47d730c1b93a8 100644
--- a/lld/test/ELF/silent-ignore.test
+++ b/lld/test/ELF/silent-ignore.test
@@ -4,6 +4,7 @@ RUN:   -dc \
 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-commits mailing list