[llvm-bugs] [Bug 52388] New: lld/mac should ignore invalid LC_LINKER_OPTIONS on successful links

via llvm-bugs llvm-bugs at lists.llvm.org
Wed Nov 3 11:19:41 PDT 2021


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

            Bug ID: 52388
           Summary: lld/mac should ignore invalid LC_LINKER_OPTIONS on
                    successful links
           Product: lld
           Version: unspecified
          Hardware: PC
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: MachO
          Assignee: unassignedbugs at nondot.org
          Reporter: keithbsmiley at gmail.com
                CC: gkm at fb.com, jezreel at gmail.com,
                    llvm-bugs at lists.llvm.org, smeenai at fb.com

In our iOS project we have an invalid modulemap file that specifies `link
"stdc++"` as well as `link "c++"`. The former is invalid on iOS so ld64.lld
fails with `ld64.lld: error: library not found for -lstdc++`

I traced back why this doesn't fail in ld64 and found that in this case ld64
ignores invalid LC_LOAD_COMMAND options (but not command line options) unless
the link fails, in which case it warns about the invalid option.

Reference:
https://github.com/keith/ld64/blob/2ff40b093f1b20dad35d48480da016bc380707dd/src/ld/InputFiles.cpp#L764-L765

I think it's unlikely that many other folks hit this exact same issue, since it
requires an arguably broken build, but if the goal is to reproduce ld64 as
close as possible, we might want to mirror this behavior.

-- 
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/20211103/26c0e5c3/attachment.html>


More information about the llvm-bugs mailing list