All of lore.kernel.org
 help / color / mirror / Atom feed
From: Masahiro Yamada <yamada.masahiro@socionext.com>
To: Changbin Du <changbin.du@gmail.com>
Cc: Arnd Bergmann <arnd@arndb.de>,
	Randy Dunlap <rdunlap@infradead.org>,
	Stephen Rothwell <sfr@canb.auug.org.au>,
	Linux-Next Mailing List <linux-next@vger.kernel.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Steven Rostedt <rostedt@goodmis.org>,
	Hans de Goede <hdegoede@redhat.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Subject: Re: linux-next: Tree for Oct 31 (vboxguest)
Date: Mon, 5 Nov 2018 12:00:11 +0900	[thread overview]
Message-ID: <CAK7LNAQeHqKQr8puhr=qz9FY9L48_b2uLv5AHWW3M-98b3EunA@mail.gmail.com> (raw)
In-Reply-To: <20181104233857.b4ou3b7doclw2vi2@mail.google.com>

On Mon, Nov 5, 2018 at 9:54 AM Changbin Du <changbin.du@gmail.com> wrote:
>
> On Sun, Nov 04, 2018 at 11:43:44AM +0900, Masahiro Yamada wrote:
> > On Sat, Nov 3, 2018 at 12:55 AM Arnd Bergmann <arnd@arndb.de> wrote:
> > >
> > > On 11/2/18, Masahiro Yamada <yamada.masahiro@socionext.com> wrote:
> > > > On Thu, Nov 1, 2018 at 11:32 PM Changbin Du <changbin.du@gmail.com> wrote:
> > > >> On Thu, Nov 01, 2018 at 12:32:48PM +0900, Masahiro Yamada wrote:
> > > >
> > > > How about clang?
> > > >
> > > > For clang, -Og might be equivalent to -O1 at this moment, but I am not
> > > > sure.
> > > >
> > > > In my understanding, Clang does not inline functions marked with 'static
> > > > inline'
> > > > for -Og (or -O1) optimization level.
> > > >
> > > > Theoretically, 'inline' keyword is a just hint for the compiler, after all.
> > >
> > > I think this means that we cannot build the kernel in that configuration,
> > > at least with CONFIG_OPTIMIZE_INLINING=y. Without that option,
> > > every 'inline' becomes 'always_inline'.
> > >
> >
> > Sorry, I missed that fact.
> >
> >
> > At this moment of time, it is OK given the following:
> >
> >  - CONFIG_OPTIMIZE_INLINING is defined only for x86
> >  - Clang cannot build x86 due to missing asm-goto
> >
> >
> > However, Clang with -Og
> > does not inline even such simple code like this:
> >
> >
> > -----test code------
> > static inline int foo(int x)
> > {
> >         return x;
> > }
> >
> > int bar(int x)
> > {
> >         return foo(x);
> > }
> > -------------------
> >
> >
> >
> > $ clang -Og -c -o bar.o  bar.c
> > $ objdump -d  bar.o
> > bar.o:     file format elf64-x86-64
> >
> >
> > Disassembly of section .text:
> >
> > 0000000000000000 <bar>:
> >    0: eb 0e                jmp    10 <foo>
> >    2: 66 2e 0f 1f 84 00 00 nopw   %cs:0x0(%rax,%rax,1)
> >    9: 00 00 00
> >    c: 0f 1f 40 00          nopl   0x0(%rax)
> >
> > 0000000000000010 <foo>:
> >   10: 89 f8                mov    %edi,%eax
> >   12: c3                    retq
> >
> >
> I see. Thanks for your explanation. So I think we should disable
> CONFIG_DEBUG_EXPERIENCE for clang. Do you know how to distinguish
> different copmilers in Kconfig?
>


You can add 'depends on CC_IS_GCC'
to make sure this option is visible only when you use GCC.


config CC_OPTIMIZE_FOR_DEBUGGING
        bool "Optimize for better debugging experience (-Og)"
        depends on CC_IS_GCC
        depends on $(cc-option,-Og)
        select NO_AUTO_INLINE



--
Best Regards
Masahiro Yamada

  reply	other threads:[~2018-11-05  3:00 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-31  3:59 linux-next: Tree for Oct 31 Stephen Rothwell
2018-10-31 15:51 ` linux-next: Tree for Oct 31 (vboxguest) Randy Dunlap
2018-10-31 16:50   ` Hans de Goede
2018-10-31 19:06     ` Randy Dunlap
2018-10-31 21:41   ` Arnd Bergmann
2018-10-31 21:41     ` Arnd Bergmann
2018-10-31 21:45     ` Randy Dunlap
2018-11-01  3:32     ` Masahiro Yamada
2018-11-01 14:29       ` Changbin Du
2018-11-02  8:25         ` Masahiro Yamada
2018-11-02 15:54           ` Arnd Bergmann
2018-11-02 23:59             ` Changbin Du
2018-11-04  2:43             ` Masahiro Yamada
2018-11-04 23:38               ` Changbin Du
2018-11-05  3:00                 ` Masahiro Yamada [this message]
2018-11-02 23:59           ` Changbin Du

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='CAK7LNAQeHqKQr8puhr=qz9FY9L48_b2uLv5AHWW3M-98b3EunA@mail.gmail.com' \
    --to=yamada.masahiro@socionext.com \
    --cc=arnd@arndb.de \
    --cc=changbin.du@gmail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=hdegoede@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-next@vger.kernel.org \
    --cc=rdunlap@infradead.org \
    --cc=rostedt@goodmis.org \
    --cc=sfr@canb.auug.org.au \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.