cmake: xcc: fix compile warnings and errors

XCC does not support the "-undef" flag so set NOSYSDEF_CFLAGS to
empty string to fix compile warning.

Also, XCC does not supply the macro __SIZEOF_LONG__ which breaks
the build. So define it.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
This commit is contained in:
Daniel Leung 2018-11-01 09:46:00 -07:00 committed by Anas Nashif
commit 2ce9d81a88
2 changed files with 10 additions and 0 deletions

View file

@ -15,4 +15,12 @@ set(OPTIMIZE_FOR_DEBUG_FLAG "-O0")
set(CC xcc)
set(C++ xc++)
set(NOSYSDEF_CFLAG "")
list(APPEND TOOLCHAIN_C_FLAGS -fms-extensions)
# xcc doesn't have this, so we need to define it here.
# This is the same as in the xcc toolchain spec files.
list(APPEND TOOLCHAIN_C_FLAGS
-D__SIZEOF_LONG__=4
)

View file

@ -11,6 +11,8 @@
#include <xtensa/hal.h>
#include <init.h>
#include "soc.h"
#define LOG_LEVEL CONFIG_SOC_LOG_LEVEL
#include <logging/log.h>
LOG_MODULE_REGISTER(soc);