https://bugs.llvm.org/show_bug.cgi?id=43681

            Bug ID: 43681
           Summary: dead_strip_dylibs does not eliminate dylibs referenced
                    by code removed with dead_strip
           Product: lld
           Version: unspecified
          Hardware: Macintosh
                OS: MacOS X
            Status: NEW
          Severity: normal
          Priority: P
         Component: MachO
          Assignee: unassignedb...@nondot.org
          Reporter: szinuk...@parallels.com
                CC: llvm-bugs@lists.llvm.org

dead_strip_dylib does not produce expected effect when combined with
dead_strip, as dynamic libraries referenced by eliminated code are not removed.

Only dynamic libraries removed by dead_strip_dylibs are those which are not
referenced at all.

Example
#include <cups/cups.h>

void unused() {
        cupsGetDefault();
}

int main(int argc, const char * argv[]) {
        return 0;
}

Invoking
clang -o binary main.c -lcups -framework CoreFoundation -Wl,-dead_strip
-Wl,-dead_strip_dylibs

Will produce binary without code referencing cups but still with LC_LOAD_DYLIB
libcups.2.dylib in.
(Note that CoreFoundation reference was correctly stripped - no code is using
it)

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to