toolchain-funcs.eclass: fix tc-ld-disable-gold when using clang
authorRahul Chaudhry <rahulchaudhry@chromium.org>
Thu, 24 May 2018 23:05:04 +0000 (16:05 -0700)
committerAnthony G. Basile <blueness@gentoo.org>
Sat, 26 May 2018 21:32:48 +0000 (17:32 -0400)
commit1b4a99913beba2fb4edccb58481a92e8ab6a7d9f
tree1fc8a84ece671be7571e54e11fd10e7481abc5f6
parent5c991b4036bda4d39f489868677fd590de41673a
toolchain-funcs.eclass: fix tc-ld-disable-gold when using clang

tc-ld-disable-gold checks gcc version to see if we have gcc-4.8+
The version check fails if clang is set as the compiler.
  $ clang -E -P - <<<"__GNUC__ __GNUC_MINOR__ __GNUC_PATCHLEVEL__"
  4 2 1
i.e. clang returns a gcc version of 4.2.1
This results in incorrectly adding -B ... to LDFLAGS, when clang
supports "-fuse-ld" just fine.

Support for "-fuse-ld" first appeared in clang-3.5, so check clang
version and use the flag if supported.
eclass/toolchain-funcs.eclass