Re: [PATCH 2/2] Add CONFIG_READABLE_ASM

From: Geert Uytterhoeven
Date: Thu Apr 12 2012 - 15:47:19 EST


Hi Sam,

On Thu, Apr 12, 2012 at 21:40, Sam Ravnborg <sam@xxxxxxxxxxxx> wrote:
> On Thu, Apr 12, 2012 at 09:08:36PM +0200, Geert Uytterhoeven wrote:
>> On Wed, Mar 28, 2012 at 20:51, Andi Kleen <andi@xxxxxxxxxxxxxx> wrote:
>> > +ifdef CONFIG_READABLE_ASM
>> > +# Disable optimizations that make assembler listings hard to read.
>> > +# reorder blocks reorders the control in the function
>> > +# ipa clone creates specialized cloned functions
>> > +# partial inlining inlines only parts of functions
>> > +KBUILD_CFLAGS += $(call cc-option,-fno-reorder-blocks,) \
>> > + Â Â Â Â Â Â Â Â $(call cc-option,-fno-ipa-cp-clone,) \
>> > + Â Â Â Â Â Â Â Â $(call cc-option,-fno-partial-inlining)
>> > +endif
>
> Could people move to this century and drop these ugly "\" line-continuations please...
> People seems to get along in C without but think they should be used in Makefiles..

Not without an additional patch for make:

Makefile:575: *** missing separator (did you mean TAB instead of 8
spaces?). Stop.

>> cc1: error: unrecognized command line option "-fno-ipa-cp-clone"
>>
>> Somehow, "$(call cc-option,-fno-ipa-cp-clone,)" doesn't detect that my
>> toolchain (gcc version 4.1.2 20061115 (prerelease) (Ubuntu 4.1.1-21))
>> doesn't support this option.

> You should try cc-diasable-warning like this:
>
> KBUILD_CFLAGS += $(call cc-disable-warning, ipa-cp-clone)

That works, thanks!
Andi, does it still work as expected for you?

> from Documentation/kbuild/makefiles.txt:
>
> Â Âcc-disable-warning
> Â Â Â Âcc-disable-warning checks if gcc supports a given warning and returns
> Â Â Â Âthe commandline switch to disable it. This special function is needed,
> Â Â Â Âbecause gcc 4.4 and later accept any unknown -Wno-* option and only
> Â Â Â Âwarn about it if there is another warning in the source file.
>
> Â Â Â ÂExample:
> Â Â Â Â Â Â Â ÂKBUILD_CFLAGS += $(call cc-disable-warning, unused-but-set-variable)
>
> Â Â Â ÂIn the above example, -Wno-unused-but-set-variable will be added to
> Â Â Â ÂKBUILD_CFLAGS only if gcc really accepts it.
>
>
> The documentation refer to gcc 4.4 - but maybe the older gcc you have
> has the same behaviour.

Seems to be that case. Thx!

Gr{oetje,eeting}s,

            Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@xxxxxxxxxxxxxx

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
             Â Â -- Linus Torvalds
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/