Skip to content

Commit 22e0bef

Browse files
evgeniy-paltsevgalak
authored andcommitted
ARC: MWDT: link mwdt libc only if it is required
We don't need MWDT libc if we are using minimal one provided by Zephyr. So let's avoid linking mwdt libc if CONFIG_MINIMAL_LIBC is enabled. Signed-off-by: Eugeniy Paltsev <[email protected]> Signed-off-by: Evgeniy Paltsev <[email protected]>
1 parent ce47512 commit 22e0bef

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

cmake/linker/arcmwdt/target.cmake

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,18 @@ macro(toolchain_ld_baremetal)
125125
zephyr_ld_options(-Hnocrt)
126126
endif()
127127

128+
# There are two options:
129+
# - We have full MWDT libc support and we link MWDT libc - this is default
130+
# behavior and we don't need to do something for that.
131+
# - We use minimal libc provided by Zephyr itself. In that case we must not
132+
# link MWDT libc, but we still need to link libmw
133+
if(CONFIG_MINIMAL_LIBC)
134+
zephyr_ld_options(
135+
-Hnolib
136+
-Hldopt=-lmw
137+
)
138+
endif()
139+
128140
# Funny thing is if this is set to =error, some architectures will
129141
# skip this flag even though the compiler flag check passes
130142
# (e.g. ARC and Xtensa). So warning should be the default for now.

0 commit comments

Comments
 (0)