@@ -28,6 +28,7 @@ option(WASI_SDK_LTO "Whether or not to build LTO assets" ON)
28
28
set (wasi_tmp_install ${CMAKE_CURRENT_BINARY_DIR} /install )
29
29
set (wasi_sysroot ${wasi_tmp_install} /share/wasi-sysroot)
30
30
set (wasi_resource_dir ${wasi_tmp_install} /wasi-resource -dir)
31
+ set (cpu_cflags "-mcpu=lime1 -mno-extended-const" )
31
32
32
33
if (WASI_SDK_DEBUG_PREFIX_MAP)
33
34
add_compile_options (
@@ -84,6 +85,7 @@ ExternalProject_Add(compiler-rt-build
84
85
-DCOMPILER_RT_BUILD_ORC=OFF
85
86
-DCOMPILER_RT_BUILD_GWP_ASAN=OFF
86
87
-DCMAKE_C_COMPILER_TARGET=wasm32-wasi
88
+ -DCMAKE_C_FLAGS=${cpu_cflags}
87
89
-DCOMPILER_RT_OS_DIR=wasi
88
90
-DCMAKE_INSTALL_PREFIX=${wasi_resource_dir}
89
91
EXCLUDE_FROM_ALL ON
@@ -151,7 +153,7 @@ function(define_wasi_libc_sub target target_suffix lto)
151
153
get_property (directory_cflags DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} PROPERTY COMPILE_OPTIONS)
152
154
list (APPEND directory_cflags -resource -dir ${wasi_resource_dir} )
153
155
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} }" )
155
157
list (JOIN extra_cflags_list " " extra_cflags)
156
158
157
159
ExternalProject_Add(wasi-libc-${target}${target_suffix} -build
@@ -223,6 +225,7 @@ function(define_libcxx_sub target target_suffix extra_target_flags extra_libdir_
223
225
get_property (dir_compile_opts DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} PROPERTY COMPILE_OPTIONS)
224
226
get_property (dir_link_opts DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} PROPERTY LINK_OPTIONS)
225
227
set (extra_flags
228
+ ${cpu_cflags}
226
229
${target_flags}
227
230
--target =${target}
228
231
${dir_compile_opts}
0 commit comments