[Bug lto/70611] Compiling binutils with -flto -Wstack-usage fails.
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70611 --- Comment #7 from Mark Wielaard --- (In reply to Mark Wielaard from comment #6) > Sorry, commented on the wrong bug, the above was meant for bug #93865 Groan, I seem very confused today. That comment was fine. It was me who got confused because I have "After changing a bug" set to "Show next bug in my list". I'll set my preferences to confuse myself less. Apologies.
[Bug lto/70611] Compiling binutils with -flto -Wstack-usage fails.
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70611 --- Comment #6 from Mark Wielaard --- (In reply to Mark Wielaard from comment #5) > This is also one of the issues that prevent elfutils to build with LTO. > The workaround is to compile with -Wno-error=stack-usage= added to CFLAGS: > https://sourceware.org/pipermail/elfutils-devel/2020q2/002733.html Sorry, commented on the wrong bug, the above was meant for bug #93865
[Bug lto/70611] Compiling binutils with -flto -Wstack-usage fails.
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70611 Mark Wielaard changed: What|Removed |Added CC||mark at gcc dot gnu.org --- Comment #5 from Mark Wielaard --- This is also one of the issues that prevent elfutils to build with LTO. The workaround is to compile with -Wno-error=stack-usage= added to CFLAGS: https://sourceware.org/pipermail/elfutils-devel/2020q2/002733.html
[Bug lto/70611] Compiling binutils with -flto -Wstack-usage fails.
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70611 --- Comment #4 from Manuel López-Ibáñez --- (In reply to Andrew Pinski from comment #3) > There is no internals of GCC here. Rather the user specified all warnings > at link time. If the user did not want that then they did not need to > supply those options ... That is very user-unfriendly and another reason why people might just rationally decide that LTO is still not worth the pain. If I understand correctly, the non-LTO compilation works without warning. Adding -flto to your CFLAGS should not make your compilation fail in unexplained ways unless your code is wrong. If LTO is not meant to handle (some) warnings, then it should disable warnings internally (which would speed-up compilation). GCC, not the user, should know which warnings work with LTO and which ones don't, and ignore/disable them.
[Bug lto/70611] Compiling binutils with -flto -Wstack-usage fails.
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70611 --- Comment #3 from Andrew Pinski --- (In reply to Manuel López-Ibáñez from comment #2) > (In reply to Andrew Pinski from comment #1) > > If you are going to be using lto you need to disable warnings as some > > warnings don't happen until end of compiling. stack usage is one of these > > warnings. > > How can a user know which warnings are those? GCC should disable on its own > those warnings that cannot be handled by LTO (or emit a clear error that the > warning is not valid with LTO). Same with invalid optimization options and > attributes. > > If LTO is ever going to be usable by anyone who is not a GCC developer, it > needs to be usable without knowing the internals of the compiler. There is no internals of GCC here. Rather the user specified all warnings at link time. If the user did not want that then they did not need to supply those options ...
[Bug lto/70611] Compiling binutils with -flto -Wstack-usage fails.
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70611 Manuel López-Ibáñez changed: What|Removed |Added Status|RESOLVED|REOPENED Last reconfirmed||2016-05-01 CC||manu at gcc dot gnu.org Resolution|INVALID |--- Ever confirmed|0 |1 --- Comment #2 from Manuel López-Ibáñez --- (In reply to Andrew Pinski from comment #1) > If you are going to be using lto you need to disable warnings as some > warnings don't happen until end of compiling. stack usage is one of these > warnings. How can a user know which warnings are those? GCC should disable on its own those warnings that cannot be handled by LTO (or emit a clear error that the warning is not valid with LTO). Same with invalid optimization options and attributes. If LTO is ever going to be usable by anyone who is not a GCC developer, it needs to be usable without knowing the internals of the compiler.
[Bug lto/70611] Compiling binutils with -flto -Wstack-usage fails.
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70611 Andrew Pinski changed: What|Removed |Added Status|UNCONFIRMED |RESOLVED Resolution|--- |INVALID --- Comment #1 from Andrew Pinski --- If you are going to be using lto you need to disable warnings as some warnings don't happen until end of compiling. stack usage is one of these warnings.