Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1220415
| From | Sedat Dilek <sedat.dilek@gmail.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: Use (two) different compilers at build-time? |
| Date | 2015-09-08 00:40 +0200 |
| Message-ID | <q6deV-2in-11@gated-at.bofh.it> (permalink) |
| References | (2 earlier) <q6bmO-7UI-13@gated-at.bofh.it> <q6bwu-863-19@gated-at.bofh.it> <q6bG9-8hQ-9@gated-at.bofh.it> <q6bG9-8hQ-7@gated-at.bofh.it> <q6c9c-EL-9@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
On Mon, Sep 7, 2015 at 11:20 PM, Sedat Dilek <sedat.dilek@gmail.com> wrote: > On Mon, Sep 7, 2015 at 10:59 PM, Linus Torvalds > <torvalds@linux-foundation.org> wrote: >> On Mon, Sep 7, 2015 at 1:53 PM, Sedat Dilek <sedat.dilek@gmail.com> wrote: >>> >>> That does not work. >> >> .. because you didn't do what I told you to do. >> >>> I copied a gcc-compiled percpu.o OR deleted/renamed percpu.o and >>> re-invoked make - this starts a complete new build from scratch. >> >> Right. Because you changed the compiler name, so now the build system >> realizes that the old build instructions are stale. >> >> Which is why you have to: >> >>>> 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. >> >> Literally just do something like this: >> >> - have a shell script call "mycompiler" and make it do gcc/llvm "$@". >> >> - or even just use a symlink (the script has the advantage that you >> can play with the options etc too) >> >> - change the shell script (or symlink) itself, and make sure to use >> the same CC for "make" at all times, so that the build script never >> sees that the underlying command is now different. >> >> It should work fine, I've done it a couple of times (although >> admittedly not recently) >> > > OK, I have created a mycompiler shell-script and use that for CC and > HOSTCC in my own build-script. > > Using CLANG... > > [ /usr/bin/mycompiler ] > > #!/bin/bash > > clang "$@" > - EOF - > > $ mycompiler --version > clang version 3.7.0 (tags/RELEASE_370/final) > Target: x86_64-unknown-linux-gnu > Thread model: posix > > Switching to GCC... > > [ /usr/bin/mycompiler ] > > #!/bin/bash > > gcc-4.9 "$@" > - EOF - > > $ mycompiler --version > gcc-4.9 (Ubuntu 4.9.2-0ubuntu1~12.04) 4.9.2 > Copyright (C) 2014 Free Software Foundation, Inc. > This is free software; see the source for copying conditions. There is NO > warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. > > Thanks, that helped me a lot. > Sadly, this trick does not work here with Linux v4.2. - Sedat - -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Use (two) different compilers at build-time? Sedat Dilek <sedat.dilek@gmail.com> - 2015-09-07 21:20 +0200
Re: Use (two) different compilers at build-time? Linus Torvalds <torvalds@linux-foundation.org> - 2015-09-07 22:20 +0200
Re: Use (two) different compilers at build-time? Sedat Dilek <sedat.dilek@gmail.com> - 2015-09-07 22:40 +0200
Re: Use (two) different compilers at build-time? Linus Torvalds <torvalds@linux-foundation.org> - 2015-09-07 22:50 +0200
Re: Use (two) different compilers at build-time? Linus Torvalds <torvalds@linux-foundation.org> - 2015-09-07 23:00 +0200
Re: Use (two) different compilers at build-time? Sedat Dilek <sedat.dilek@gmail.com> - 2015-09-07 23:30 +0200
Re: Use (two) different compilers at build-time? Sedat Dilek <sedat.dilek@gmail.com> - 2015-09-08 00:40 +0200
Re: Use (two) different compilers at build-time? Sedat Dilek <sedat.dilek@gmail.com> - 2015-09-08 07:50 +0200
Re: Use (two) different compilers at build-time? Sedat Dilek <sedat.dilek@gmail.com> - 2015-09-08 08:00 +0200
Re: Use (two) different compilers at build-time? Sedat Dilek <sedat.dilek@gmail.com> - 2015-09-07 23:00 +0200
Re: Use (two) different compilers at build-time? Fengguang Wu <fengguang.wu@intel.com> - 2015-09-10 02:30 +0200
Re: Use (two) different compilers at build-time? Sedat Dilek <sedat.dilek@gmail.com> - 2015-09-13 17:30 +0200
Re: Use (two) different compilers at build-time? Fengguang Wu <fengguang.wu@intel.com> - 2015-09-14 04:20 +0200
csiph-web