lkml.org 
[lkml]   [2016]   [Jan]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: Thoughts about introducing OPTIMIZATION_CFLAG
From
Date
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

\
 
 \ /
  Last update: 2016-01-08 12:41    [W:0.050 / U:0.376 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site