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

Teresa Johnson via llvm-dev llvm-dev at lists.llvm.org
Mon Sep 11 06:44:10 PDT 2017


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


On Sun, Sep 10, 2017 at 8:07 AM, Dipanjan Das via llvm-dev <
llvm-dev at lists.llvm.org> wrote:

>
> 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
>
> _______________________________________________
> LLVM Developers mailing list
> llvm-dev at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
>
>


-- 
Teresa Johnson |  Software Engineer |  tejohnson at google.com |  408-460-2413
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20170911/6545867e/attachment.html>


More information about the llvm-dev mailing list