Skip to content

Commit c6d8505

Browse files
committed
lime1
cf. #525
1 parent 5e4756e commit c6d8505

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

cmake/wasi-sdk-sysroot.cmake

+4-1
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ option(WASI_SDK_LTO "Whether or not to build LTO assets" ON)
2828
set(wasi_tmp_install ${CMAKE_CURRENT_BINARY_DIR}/install)
2929
set(wasi_sysroot ${wasi_tmp_install}/share/wasi-sysroot)
3030
set(wasi_resource_dir ${wasi_tmp_install}/wasi-resource-dir)
31+
set(cpu_cflags "-mcpu=lime1 -mno-extended-const")
3132

3233
if(WASI_SDK_DEBUG_PREFIX_MAP)
3334
add_compile_options(
@@ -84,6 +85,7 @@ ExternalProject_Add(compiler-rt-build
8485
-DCOMPILER_RT_BUILD_ORC=OFF
8586
-DCOMPILER_RT_BUILD_GWP_ASAN=OFF
8687
-DCMAKE_C_COMPILER_TARGET=wasm32-wasi
88+
-DCMAKE_C_FLAGS=${cpu_cflags}
8789
-DCOMPILER_RT_OS_DIR=wasi
8890
-DCMAKE_INSTALL_PREFIX=${wasi_resource_dir}
8991
EXCLUDE_FROM_ALL ON
@@ -151,7 +153,7 @@ function(define_wasi_libc_sub target target_suffix lto)
151153
get_property(directory_cflags DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} PROPERTY COMPILE_OPTIONS)
152154
list(APPEND directory_cflags -resource-dir ${wasi_resource_dir})
153155
set(extra_cflags_list
154-
"${CMAKE_C_FLAGS} ${directory_cflags} ${CMAKE_C_FLAGS_${CMAKE_BUILD_TYPE_UPPER}}")
156+
"${cpu_cflags} ${CMAKE_C_FLAGS} ${directory_cflags} ${CMAKE_C_FLAGS_${CMAKE_BUILD_TYPE_UPPER}}")
155157
list(JOIN extra_cflags_list " " extra_cflags)
156158

157159
ExternalProject_Add(wasi-libc-${target}${target_suffix}-build
@@ -223,6 +225,7 @@ function(define_libcxx_sub target target_suffix extra_target_flags extra_libdir_
223225
get_property(dir_compile_opts DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} PROPERTY COMPILE_OPTIONS)
224226
get_property(dir_link_opts DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} PROPERTY LINK_OPTIONS)
225227
set(extra_flags
228+
${cpu_cflags}
226229
${target_flags}
227230
--target=${target}
228231
${dir_compile_opts}

0 commit comments

Comments
 (0)