ARC: MWDT: generate access to builtin funcs only if ARCMWDT_LIBC is used

The MWDT compiler can replace some code with call to builtin
functions. We can't rely on these functions presence if we
don't use MWDT libc.

Signed-off-by: Eugeniy Paltsev <Eugeniy.Paltsev@synopsys.com>
Signed-off-by: Evgeniy Paltsev <PaltsevEvgeniy@gmail.com>
This commit is contained in:
Evgeniy Paltsev 2021-08-12 01:43:22 +03:00 committed by Kumar Gala
parent 22e0bef358
commit 33d5be8656

View file

@ -39,3 +39,11 @@ endforeach()
# common compile options, no copyright msg, little-endian, no small data,
# no MWDT stack checking
list(APPEND TOOLCHAIN_C_FLAGS -Hnocopyr -HL -Hnosdata -Hoff=Stackcheck_alloca)
# The MWDT compiler can replace some code with call to builtin functions.
# We can't rely on these functions presence if we don't use MWDT libc.
# NOTE: the option name '-fno-builtin' is misleading a bit - we still can
# manually call __builtin_** functions even if we specify it.
if(NOT CONFIG_ARCMWDT_LIBC)
list(APPEND TOOLCHAIN_C_FLAGS -fno-builtin)
endif()