[all-commits] [llvm/llvm-project] 021056: [LLVMgold.so] -plugin-opt=save-temps: save combine...

Fangrui Song via All-commits all-commits at lists.llvm.org
Tue Jul 21 10:24:26 PDT 2020


  Branch: refs/heads/release/11.x
  Home:   https://github.com/llvm/llvm-project
  Commit: 021056563632ca625dab6e8270cec2e2fae7a8cb
      https://github.com/llvm/llvm-project/commit/021056563632ca625dab6e8270cec2e2fae7a8cb
  Author: Fangrui Song <i at maskray.me>
  Date:   2020-07-21 (Tue, 21 Jul 2020)

  Changed paths:
    M llvm/test/tools/gold/X86/parallel.ll
    M llvm/test/tools/gold/X86/relocation-model-pic.ll
    M llvm/test/tools/gold/X86/thinlto.ll
    M llvm/tools/gold/gold-plugin.cpp

  Log Message:
  -----------
  [LLVMgold.so] -plugin-opt=save-temps: save combined module to .lto.o instead of .o

This matches LLD and fixes https://sourceware.org/bugzilla/show_bug.cgi?id=26262#c1

.o is a bad choice for save-temps output because it is easy to override the bitcode file (*.o)

```
 # Use bfd for the example, -fuse-ld=gold is similar.
clang -flto -c a.c  # generate bitcode file a.o
clang -fuse-ld=bfd -flto a.o -o a -Wl,-plugin-opt=save-temps  # override a.o

 # The user repeats the command but get surprised, because a.o is now a combined module.
clang -fuse-ld=bfd -flto a.o -o a -Wl,-plugin-opt=save-temps
```

Reviewed By: tejohnson

Differential Revision: https://reviews.llvm.org/D84132

(cherry picked from commit 55fa315b0352b63454206600d6803fafacb42d5e)


  Commit: 8f8ec9927623eb54f003993b3d8411fc0130ca90
      https://github.com/llvm/llvm-project/commit/8f8ec9927623eb54f003993b3d8411fc0130ca90
  Author: Fangrui Song <i at maskray.me>
  Date:   2020-07-21 (Tue, 21 Jul 2020)

  Changed paths:
    M llvm/test/tools/gold/X86/cache.ll
    M llvm/test/tools/gold/X86/emit-llvm.ll
    M llvm/test/tools/gold/X86/relax-relocs.ll

  Log Message:
  -----------
  [LLVMgold.so][test] Fix tests after D84132/55fa315b0352

(cherry picked from commit aa830e9768303ff8d27c015759294c4ce704d50c)


Compare: https://github.com/llvm/llvm-project/compare/cebd637c8862...8f8ec9927623


More information about the All-commits mailing list