https://sourceware.org/bugzilla/show_bug.cgi?id=20070

Steven Shi <steven.shi at intel dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |REOPENED
         Resolution|FIXED                       |---

--- Comment #6 from Steven Shi <steven.shi at intel dot com> ---
Hello,
You know I’m debugging and I hope to disable all optimizations in the LTO
firstly, then enable them one by one later. But when I try to disable the
optimization by enforcing –O0 in the LTO build, I find the ld fails to
recognize some clang  bitcode library, and fail to link. 

e.g. use the Clang_LTO_Fails_On_LD example in below bug attachment
https://sourceware.org/bugzilla/show_bug.cgi?id=20070

If I enforce the –O0 to disable the optimization in LTO, the ld fail to link:
~/clang38/bin/clang -o Hello.dll -flto -O0 -nostdlib -Wl,-n -Wl,-q
-Wl,--gc-sections -Wl,-z,common-page-size=0x40 -Wl,--entry,_ModuleEntryPoint
-Wl,-u,_ModuleEntryPoint -Wl,-Map,Hello.map -Wl,-melf_x86_64
-Wl,--oformat=elf64-x86-64 -Wl,--start-group,,@static_library_files.lst
-Wl,--end-group
BaseLib.lib: error adding symbols: File format not recognized
clang-3.8: error: linker command failed with exit code 1 (use -v to see
invocation)

But if I enable the –O1,  the ld  link pass:
~/clang38/bin/clang -o Hello.dll -flto –O1 -nostdlib -Wl,-n -Wl,-q
-Wl,--gc-sections -Wl,-z,common-page-size=0x40 -Wl,--entry,_ModuleEntryPoint
-Wl,-u,_ModuleEntryPoint -Wl,-Map,Hello.map -Wl,-melf_x86_64
-Wl,--oformat=elf64-x86-64 -Wl,--start-group,,@static_library_files.lst
-Wl,--end-group

So, I cannot correctly disable the the optimization in ld LTO. Please help to
fix it. Thanks!

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

Reply via email to