Skip to content

Commit 33d5be8

Browse files
evgeniy-paltsevgalak
authored andcommitted
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 <[email protected]> Signed-off-by: Evgeniy Paltsev <[email protected]>
1 parent 22e0bef commit 33d5be8

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

cmake/compiler/arcmwdt/target.cmake

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,3 +39,11 @@ endforeach()
3939
# common compile options, no copyright msg, little-endian, no small data,
4040
# no MWDT stack checking
4141
list(APPEND TOOLCHAIN_C_FLAGS -Hnocopyr -HL -Hnosdata -Hoff=Stackcheck_alloca)
42+
43+
# The MWDT compiler can replace some code with call to builtin functions.
44+
# We can't rely on these functions presence if we don't use MWDT libc.
45+
# NOTE: the option name '-fno-builtin' is misleading a bit - we still can
46+
# manually call __builtin_** functions even if we specify it.
47+
if(NOT CONFIG_ARCMWDT_LIBC)
48+
list(APPEND TOOLCHAIN_C_FLAGS -fno-builtin)
49+
endif()

0 commit comments

Comments
 (0)