Does specifying -O2 affect *0.0.preopt.bc when LDFLAGS=" -flto -fuse-ld=gold -Wl, -plugin-opt=save-temps "?

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

Does specifying -O2 affect *0.0.preopt.bc when LDFLAGS=" -flto -fuse-ld=gold -Wl, -plugin-opt=save-temps "?

David Blaikie via cfe-dev
I use the following environment variables to hijack exiting make
toolchain to generate bitcode files.

CC=clang CXX=clang++ RANLIB=llvm-ranlib CPPFLAGS=" -g -flto "
CFLAGS="-std=gnu99 " LDFLAGS=" -flto -fuse-ld=gold
-Wl,-plugin-opt=save-temps "

For the final executable myprog, I got the following files. But the
original make toolchain may specify options like -O2. In this case, is
myprog.0.0.preopt.bc still the same as if -O2 were not specified? Or
myprog.0.0.preopt.bc would not be the same whether -O2 is specified or

- myprog.0.0.preopt.bc
- myprog.0.2.internalize.bc
- myprog.0.4.opt.bc
- myprog.0.5.precodegen.bc
- myprog.o
- myprog.resolution.txt

cfe-dev mailing list
[hidden email]