]> git.baikalelectronics.ru Git - kernel.git/commit
tools build: Use the same CC for feature detection and actual build
authorArnaldo Carvalho de Melo <acme@redhat.com>
Thu, 2 Mar 2017 19:00:26 +0000 (16:00 -0300)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Fri, 3 Mar 2017 22:07:19 +0000 (19:07 -0300)
commitd1d02825ab71c2061cbd4cfd86360b35868179dc
tree3f665b2ebb5e1cb712b934a1106b40be72a8b371
parent9212a930ffd0ba64cea9abcaf35ce10cf25ac676
tools build: Use the same CC for feature detection and actual build

When build with: 'make CC=clang' we were not using that CC to do
feature detection, which resulted in features being detected with gcc
and then the actual tools being built with clang.

Most of the time these compilers are compatible enough, so no
problem was being noticed.

As soon as a system with an old enough clang, one that hasn't
the cpuid.h header is used, and a gcc with it, the "get_cpuid" feature
will be found available but then code that will use can't be compiled.

Noticed with this combination:

  / $ gcc --version | head -1
  gcc (Alpine 6.3.0) 6.3.0
  / $ clang --version | head -1
  clang version 3.8.1 (tags/RELEASE_381/final)
  / $ cat /etc/alpine-release
  3.5.0
  / $

Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Wang Nan <wangnan0@huawei.com>
Link: http://lkml.kernel.org/n/tip-60q18nvlvgpyfv7e2qqgx4ou@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/build/feature/Makefile