[llvm-bugs] [Bug 42132] New: clang driver passes -plugin-opt=Oz instead of -plugin-opt=O3 for "-Oz -flto"

via llvm-bugs llvm-bugs at lists.llvm.org
Tue Jun 4 23:33:03 PDT 2019


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

            Bug ID: 42132
           Summary: clang driver passes -plugin-opt=Oz instead of
                    -plugin-opt=O3 for "-Oz -flto"
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: Driver
          Assignee: unassignedclangbugs at nondot.org
          Reporter: balarishi.bhogadi at amd.com
                CC: llvm-bugs at lists.llvm.org, neeilans at live.com,
                    richard-llvm at metafoo.co.uk

$ clang -v -Oz -flto foo.c
...
...
...
 "/home/LLVM/bin/ld.lld" -z relro --hash-style=gnu --eh-frame-hdr -m elf_x86_64
-dynamic-linker /lib64/ld-linux-x86-64.so.2 -o a.out
/usr/lib/gcc/x86_64-linux-gnu/5.4.0/../../../x86_64-linux-gnu/crt1.o
/usr/lib/gcc/x86_64-linux-gnu/5.4.0/../../../x86_64-linux-gnu/crti.o
/usr/lib/gcc/x86_64-linux-gnu/5.4.0/crtbegin.o
-L/usr/lib/gcc/x86_64-linux-gnu/5.4.0
-L/usr/lib/gcc/x86_64-linux-gnu/5.4.0/../../../x86_64-linux-gnu
-L/usr/lib/gcc/x86_64-linux-gnu/5.4.0/../../../../lib64 -L/lib/x86_64-linux-gnu
-L/lib/../lib64 -L/usr/lib/x86_64-linux-gnu -L/usr/lib/../lib64
-L/usr/lib/x86_64-linux-gnu/../../lib64
-L/usr/lib/gcc/x86_64-linux-gnu/5.4.0/../../.. -L/home/LLVM/bin/../lib -L/lib
-L/usr/lib -plugin /home/LLVM/bin/../lib/LLVMgold.so -plugin-opt=mcpu=x86-64
-plugin-opt=Oz -plugin-opt=-disable-itodcalls=false
-plugin-opt=-disable-itodcallsbyclone=false /tmp/foo-b672c1.o -lgcc --as-needed
-lgcc_s --no-as-needed -lc -lgcc --as-needed -lgcc_s --no-as-needed
/usr/lib/gcc/x86_64-linux-gnu/5.4.0/crtend.o
/usr/lib/gcc/x86_64-linux-gnu/5.4.0/../../../x86_64-linux-gnu/crtn.o
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)

The above error is due to passing "-plugin-opt=Oz" to lld by clang driver.

But for "-Ofast -flto", "-plugin-opt=O3" was passed to lld by clang driver.

-- 
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/20190605/2652f409/attachment.html>


More information about the llvm-bugs mailing list