[llvm-dev] plugin-opt=save-temps doesn't work in LLVM Gold 5.0.0

134 views
Skip to first unread message

Dipanjan Das via llvm-dev

unread,
Sep 10, 2017, 11:08:26 AM9/10/17
to llvm-dev

To compile an auto-tooled project to bitcode, I used to use plugin-opt=save-temps switch as explained in: http://gbalats.github.io/2015/12/10/compiling-autotooled-projects-to-LLVM-bitcode.html. This switch works with LLVM 3.8.0.

However, it seems to have no effect with LLVM 5.0.0. I can see intermediate bitcode files on disk, but not the final one. Is the option removed altogether? Has the switch changed?

--

Thanks & Regards,

Dipanjan

Teresa Johnson via llvm-dev

unread,
Sep 11, 2017, 9:44:21 AM9/11/17
to mail.dip...@gmail.com, llvm-dev
That documentation is a bit out of date.

The LLVM gold plugin (and the lld linker) now use a different LTO API (as of a year ago). There is actually a richer set of intermediate files emitted when you do save-temps. E.g.:

$ clang -flto main.c foo.c -Wl,-plugin-opt=save-temps -o testsavetemps
$ file testsavetemps*
testsavetemps:                    ELF 64-bit LSB  executable, x86-64, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.24, not stripped
testsavetemps.0.0.preopt.bc:      LLVM IR bitcode
testsavetemps.0.2.internalize.bc: LLVM IR bitcode
testsavetemps.0.4.opt.bc:         LLVM IR bitcode
testsavetemps.0.5.precodegen.bc:  LLVM IR bitcode
testsavetemps.o:                  ELF 64-bit LSB  relocatable, x86-64, version 1 (SYSV), not stripped
testsavetemps.resolution.txt:     ASCII text

Likely what you want is testsavetemps.0.5.precodegen.bc - the bitcode just before generating the native object (testsavetemps.o).

Teresa


_______________________________________________
LLVM Developers mailing list
llvm...@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev




--
Teresa Johnson | Software Engineer | tejo...@google.com | 408-460-2413

Dipanjan Das via llvm-dev

unread,
Sep 11, 2017, 10:20:19 AM9/11/17
to llvm-dev

Thank you so much, Teresa.
Reply all
Reply to author
Forward
0 new messages