From: greg@kroah.com (Greg KH) Date: Sat, 13 Aug 2016 21:12:03 +0200 Subject: How to compile Linux kernel with -O0 flag In-Reply-To: <20160813215605.1749468e@e733> References: <20160813211516.7a8dace1@e733> <20160813183534.GA22784@kroah.com> <20160813215605.1749468e@e733> Message-ID: <20160813191203.GB24973@kroah.com> To: kernelnewbies@lists.kernelnewbies.org List-Id: kernelnewbies.lists.kernelnewbies.org On Sat, Aug 13, 2016 at 09:56:05PM +0300, Aleksander Alekseev wrote: > > The kernel will not run with -O0, sorry, just live with the build > > optimization levels that is currently used and you should be fine. > > Oh, I see. Fortunately I'm not afraid of assembler :) Thanks. > > Just out of curiosity - is there a technical reason why -O0 couldn't > be used in Linux kernel? Yes, it doesn't work :) > I don't know, spinlocks would not work in this > case because it's how GCC was written or something. Or just nobody > compiles and tests kernel like this so it most likely would not work? Try it, it will not work :) good luck! greg k-h