lkml.org 
[lkml]   [2015]   [Sep]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: Use (two) different compilers at build-time?
From
On Mon, Sep 7, 2015 at 10:42 PM, Linus Torvalds
<torvalds@linux-foundation.org> wrote:
> On Mon, Sep 7, 2015 at 1:31 PM, Sedat Dilek <sedat.dilek@gmail.com> wrote:
>>
>> So, how do I do that conveniently?
>
> For a single file? Just compile everything with the primary compiler,
> and then delete the single object file, and do "make" again.
>

That does not work.

I copied a gcc-compiled percpu.o OR deleted/renamed percpu.o and
re-invoked make - this starts a complete new build from scratch.

$ cd $KERNEL_BUILD_DIR
$ mv mm/percpu.o mm/percpu.o_CLANG
$ make CC=gcc HOSTCC=gcc

> Use a wrapper around the compiler (and point to that wrapper with the
> "to switch compilers from under the make, without the build paths
> changing (because otherwise our makefile auto-machinery notices that
> flags and command changed).
>
> Use CC (or CROSS_COMPILE) to point at your wrapper.
>

No idea how to realize that, sorry.

> What we've occasionally wanted to do for compiler bugs is to have
> something that can do the above not for single files, but some kind of
> file bisection thing (so bisect not in history, but in the list of
> files compiled). Sadly I don't think anybody has ever made that work.
>

Sounds like a nice feature.

- Sedat -


\
 
 \ /
  Last update: 2015-09-07 23:21    [W:4.711 / U:0.000 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site