What are use cases for GCC's `-fuse-linker-plugin`?

423 Views Asked by At

I am trying to better understand link-time optimization in GCC and -fuse-linker-plugin seems to matter in that context. However, I do not exactly understand how.

Suppose my compilation with link-time optimization looks like this:

gcc a.c -c -o a.o -flto -fno-fat-lto-objects
gcc b.c -c -o b.o -flto -fno-fat-lto-objects
gcc main.c -o main.out a.o b.o

What would be a good use case for enabling -fuse-linker-plugin?

I found the official GCC documentation somewhat confusing on that point. They suggest that -fuse-linker-plugin matters only for archive files (.a) but most conversation I have seen mentions that option without discussing archive files.

0

There are 0 best solutions below