Issue 71361
Summary `clang` does not support `-fwhole-program`
Labels clang
Assignees
Reporter matheusmoreira
    Compiling a program with `-fwhole-program` results in the following warning:

 warning: optimization flag '-fwhole-program' is not supported [-Wignored-optimization-argument]

It is documented [here][gcc-docs]:

> Assume that the current compilation unit represents the whole program being compiled.
> All public functions and variables with the exception of `main` and those merged by attribute `externally_visible` become static functions and in effect are optimized more aggressively by interprocedural optimizers.

Even if no additional optimizations are performed, it should at least make all the symbols static. This is a useful transformation to apply when building the final executable.

[gcc-docs]: https://gcc.gnu.org/onlinedocs/gcc/Optimize-Options.html
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to