[llvm-bugs] [Bug 50304] New: lld/mac pulls in too many frameworks, making executables not run on older macOS versions

via llvm-bugs llvm-bugs at lists.llvm.org
Tue May 11 10:25:50 PDT 2021


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

            Bug ID: 50304
           Summary: lld/mac pulls in too many frameworks, making
                    executables not run on older macOS versions
           Product: lld
           Version: unspecified
          Hardware: PC
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: MachO
          Assignee: unassignedbugs at nondot.org
          Reporter: nicolasweber at gmx.de
                CC: gkm at fb.com, jezreel at gmail.com,
                    llvm-bugs at lists.llvm.org, smeenai at fb.com

https://drive.google.com/file/d/1Alaz9ZtJ8QhoXdzJAFlt3UPiN02VLN-t/view?usp=sharing

% ld @response.txt
% otool -L gl_unittests | grep PDF
% ~/src/llvm-project/out/gn/bin/ld64.lld @response.txt
ld64.lld: warning: Option `-dead_strip' is not yet implemented. Stay tuned...
% otool -L gl_unittests | grep PDF
        /System/Library/Frameworks/PDFKit.framework/Versions/A/PDFKit
(compatibility version 1.0.0, current version 1.0.0)


This causes the binary to not run on macOS 10.14, where PDFKit apparently
doesn't exist at that path (?)

Not sure yet why this framework gets pulled in.

 % otool -vh /System/Library/Frameworks/PDFKit.framework/Versions/A/PDFKit
/System/Library/Frameworks/PDFKit.framework/Versions/A/PDFKit:
Mach header
      magic  cputype cpusubtype  caps    filetype ncmds sizeofcmds      flags
MH_MAGIC_64   X86_64        ALL  0x00       DYLIB    27       4120   NOUNDEFS
DYLDLINK TWOLEVEL NO_REEXPORTED_DYLIBS APP_EXTENSION_SAFE



That doesn't include DEAD_STRIPPABLE_DYLIB, so it's not just us not yet
stripping dylibs with that set.


(I believe this bug is the cause for the majority of the failures on
https://ci.chromium.org/ui/p/chromium/builders/try/mac-rel/677679/overview -- a
run where I run chromium's unit tests with the linker set to lld. Lots of green
already!)

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20210511/f42d1fe2/attachment.html>


More information about the llvm-bugs mailing list