From: Michal Marek <mmarek@suse.cz>
To: sedat.dilek@gmail.com
Cc: One Thousand Gnomes <gnomes@lxorguk.ukuu.org.uk>,
Linus Torvalds <torvalds@linux-foundation.org>,
Andrew Morton <akpm@linux-foundation.org>,
Sam Ravnborg <sam@ravnborg.org>,
"Rafael J. Wysocki" <rafael.j.wysocki@intel.com>,
Arnd Bergmann <arnd@arndb.de>, Ingo Molnar <mingo@redhat.com>,
linux-kbuild@vger.kernel.org,
Linux ACPI <linux-acpi@vger.kernel.org>,
LKML <linux-kernel@vger.kernel.org>,
the arch/x86 maintainers <x86@kernel.org>
Subject: Re: Thoughts about introducing OPTIMIZATION_CFLAG
Date: Fri, 8 Jan 2016 12:31:42 +0100 [thread overview]
Message-ID: <568F9E1E.7030406@suse.cz> (raw)
In-Reply-To: <CA+icZUWxfbPN4URoVdBAwm22sdKqGmTtiNBEg-KoHi-vgGqzqg@mail.gmail.com>
On 2016-01-08 11:03, Sedat Dilek wrote:
> On Mon, Jan 4, 2016 at 11:37 PM, Michal Marek <mmarek@suse.cz> wrote:
>> Dne 4.1.2016 v 12:47 Sedat Dilek napsal(a):
>>> But I think you did not get my problem - to have two different
>>> optimization-levels for a compiler in *one* make-line makes no sense
>>> to me.
>>
>> That we sometimes have -O2 ... -Os on the command line is not a problem,
>> since any same unix tool parses its options so that the last one of
>> mutually exclusive options wins.
>
> That is new to me and I haven't tested this by dropping arguments in
> my make-line(s).
>
> From where do have this information - sort of "business-life-experience" :-)?
> Is that documented somewhere in the Linux-sources?
You override a previously set option by appending one with different value:
$ yes | head -n 10 -n 999 -n 2
y
y
$
This pattern is used all over in Makefiles.
> Do you agree that it is confusing to have two optlevel arguments in
> one make-line?
It probably is, but fixing this problem would make the Makefiles unreadable.
> Linus suggested me to use a wrapper-script in case of using two
> different compiler and passing arguments...
>
> [ /usr/bin/mycompiler ]
> #!/bin/bash
>
> gcc-4.9 "$@"
> - EOF -
>
> According to your statement passing an optlevel here in this script
> will never-ever be recognized - as it is at the begin-of-(make)-line.
Pass it as the last argument.
> So how should someone change the Linux-sources to test a different
> optlevel than -O2?
make KCFLAGS=-O3
However, per-directory and per-file cflags set in Makefiles will take
precedence. If you want to override these as well, use the wrapper.
Michal
next prev parent reply other threads:[~2016-01-08 11:31 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-01-04 10:54 Thoughts about introducing OPTIMIZATION_CFLAG Sedat Dilek
2016-01-04 11:25 ` Sedat Dilek
2016-01-04 11:33 ` One Thousand Gnomes
2016-01-04 11:47 ` Sedat Dilek
2016-01-04 22:37 ` Michal Marek
2016-01-08 10:03 ` Sedat Dilek
2016-01-08 11:31 ` Michal Marek [this message]
2016-01-08 11:49 ` Sedat Dilek
2016-01-08 12:30 ` Michal Marek
2016-01-08 13:25 ` Sedat Dilek
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=568F9E1E.7030406@suse.cz \
--to=mmarek@suse.cz \
--cc=akpm@linux-foundation.org \
--cc=arnd@arndb.de \
--cc=gnomes@lxorguk.ukuu.org.uk \
--cc=linux-acpi@vger.kernel.org \
--cc=linux-kbuild@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=rafael.j.wysocki@intel.com \
--cc=sam@ravnborg.org \
--cc=sedat.dilek@gmail.com \
--cc=torvalds@linux-foundation.org \
--cc=x86@kernel.org \
/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