toolchain: xcc: use Clang if exists
The XCC toolchain may come with Clang front-end depending on how it's built. Currently, the only SoC/board using XCC is the intel_s1000_crb and its XCC toolchain comes with Clang 3.9.0 which has a lot better support for C99 and C++11 than the portion based on GCC 4.2 (which does not even support C++11). So this change attempts to use the Clang portion instead of GCC if the Clang executable exists. Signed-off-by: Daniel Leung <daniel.leung@intel.com>
This commit is contained in:
parent
e6cf37a857
commit
e73231f7f0
4 changed files with 35 additions and 8 deletions
|
@ -11,10 +11,18 @@
|
|||
* there. However, __BYTE_ORDER__ is actually being defined later in
|
||||
* this file. So define __BYTE_ORDER__ to skip the check in gcc.h
|
||||
* and undefine after including gcc.h.
|
||||
*
|
||||
* Clang has it defined so there is no need to work around.
|
||||
*/
|
||||
#ifndef __clang__
|
||||
#define __BYTE_ORDER__
|
||||
#endif
|
||||
|
||||
#include <toolchain/gcc.h>
|
||||
|
||||
#ifndef __clang__
|
||||
#undef __BYTE_ORDER__
|
||||
#endif
|
||||
|
||||
#include <stdbool.h>
|
||||
|
||||
|
@ -22,8 +30,12 @@
|
|||
#define UINT32_C(x) x ## U
|
||||
#endif
|
||||
|
||||
/* XCC doesn't support __COUNTER__ but this should be good enough */
|
||||
#ifndef __COUNTER__
|
||||
/* XCC (GCC-based compiler) doesn't support __COUNTER__
|
||||
* but this should be good enough
|
||||
*/
|
||||
#define __COUNTER__ __LINE__
|
||||
#endif
|
||||
|
||||
#undef __in_section_unique
|
||||
#define __in_section_unique(seg) \
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue