[llvm-bugs] [Bug 42445] New: clang -flto -Os/-Oz passes -Os/-Oz to lld (but lld doesn't know what to do with it)

via llvm-bugs llvm-bugs at lists.llvm.org
Sat Jun 29 04:27:46 PDT 2019


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

            Bug ID: 42445
           Summary: clang -flto -Os/-Oz passes -Os/-Oz to lld (but lld
                    doesn't know what to do with it)
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: -New Bugs
          Assignee: unassignedclangbugs at nondot.org
          Reporter: bero at lindev.ch
                CC: htmldeveloper at gmail.com, llvm-bugs at lists.llvm.org,
                    neeilans at live.com, richard-llvm at metafoo.co.uk

clang with -flto passes optimization levels to lld unmodified -- even if the
optimization level is one lld doesn't understand, such as -Os or -Oz.

This makes -flto with -Os/-Oz unusable.

$ clang -Os -fuse-ld=lld -flto test.c
ld.lld: error: -plugin-opt=Os: number expected, but got 's'
clang-9: error: linker command failed with exit code 1 (use -v to see
invocation)
$ clang -Oz -fuse-ld=lld -flto test.c
ld.lld: error: -plugin-opt=Oz: number expected, but got 'z'
clang-9: error: linker command failed with exit code 1 (use -v to see
invocation)

-- 
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/20190629/5273ad02/attachment-0001.html>


More information about the llvm-bugs mailing list