From: Randy Dunlap <rdunlap@xenotime.net>
To: Zhihua Che <zhihua.che@gmail.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: How can I turn off/disable -O2/-Os optimization?
Date: Sun, 01 Apr 2012 09:49:53 -0700 [thread overview]
Message-ID: <4F788731.8020708@xenotime.net> (raw)
In-Reply-To: <CABexPfEdd0k9UGTJL9Ae5B=e_dDZMsTGg-LNYrOjLKzHBxuPwg@mail.gmail.com>
On 04/01/2012 09:31 AM, Zhihua Che wrote:
> Hi, everyone
>
> I'm debugging linux kernel using kgdb/qemu, but I find that the
> execution order didn't math the program order usually. I guess it was
> because the compiling optimization. So I decided to remove -O options
> in Makefiles.
> First I removed -Ox in variables HOSTCFLAGS/HOSTCXXFLAGS in
> <src_root_dir>/Makefile around line 248 and -Ox in variable
> KBUILD_CFLAGS in <src_root_dir>/arch/x86/boot/Makefile around line 55.
> But it didn't work, the step execution still didn't follow the program
> order. Then I found I missed -Ox in KBUILD_CFLAGS in
> <src_root_dir>/Makefile around line 562, so I removed them, but this
> time, the compiling failed, complaining
> rcupdate.h:917:2: error: size of unnamed array is negative
> And finally, after grep, I find there are a load of -O2 option are
> assigned in a load of Makefiles. So, How could I disable -O
> optimization for debugging?
>
> Thanks for any tips
> --
You could try the new CONFIG_READABLE_ASM patch:
http://marc.info/?l=linux-kernel&m=133296079716268&w=2
--
~Randy
next prev parent reply other threads:[~2012-04-01 16:50 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-04-01 16:31 Zhihua Che
2012-04-01 16:49 ` Randy Dunlap [this message]
2012-04-02 8:44 ` Zhihua Che
2012-05-06 2:00 ` Renato Westphal
2012-05-06 13:28 ` Hagen Paul Pfeifer
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4F788731.8020708@xenotime.net \
--to=rdunlap@xenotime.net \
--cc=linux-kernel@vger.kernel.org \
--cc=zhihua.che@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome