--- CMakeLists.txt.orig	2021-06-02 10:40:14 UTC
+++ CMakeLists.txt
@@ -166,18 +166,18 @@ else()
   endif()
   set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -ggdb -O0")
 
-  set(CMAKE_C_FLAGS_RELEASE "-O3 -Wfatal-errors -fomit-frame-pointer -fno-stack-check -fno-stack-protector") #-fno-inline
+  set(CMAKE_C_FLAGS_RELEASE "-Wfatal-errors -fomit-frame-pointer -fno-stack-check -fno-stack-protector") #-fno-inline
 
   if(BUILD_NATIVE)
     if(APPLE AND CMAKE_C_COMPILER_ID MATCHES "Clang" AND CMAKE_HOST_SYSTEM_PROCESSOR MATCHES "arm64")
       set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -mcpu=native")
     else()
-      set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -march=native")
+      set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -mcpu=native")
     endif()
   endif()
 
   set(CMAKE_EXE_LINKER_FLAGS_DEBUG "-O0")
-  set(CMAKE_EXE_LINKER_FLAGS_RELEASE "-O3")
+#  set(CMAKE_EXE_LINKER_FLAGS_RELEASE "-O3")
 
   target_link_libraries(${OUT_FILE} m)
 
@@ -188,21 +188,10 @@ if(BUILD_WASI MATCHES "simple")
 elseif(BUILD_WASI MATCHES "metawasi")
   set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Dd_m3HasMetaWASI")
 elseif(BUILD_WASI MATCHES "uvwasi")
-  include(FetchContent)
-  FetchContent_Declare(
-    uvwasi
-    GIT_REPOSITORY https://github.com/vshymanskyy/uvwasi.git
-    GIT_TAG b063d686848c32a26119513056874f051c74258a
-  )
-
-  FetchContent_GetProperties(uvwasi)
-  if(NOT uvwasi_POPULATED)
-    FetchContent_Populate(uvwasi)
-    include_directories("${uvwasi_SOURCE_DIR}/include")
-    add_subdirectory(${uvwasi_SOURCE_DIR} ${uvwasi_BINARY_DIR} EXCLUDE_FROM_ALL)
-  endif()
+  add_subdirectory("_deps/uvwasi-src")
+  include_directories("_deps/uvwasi-src/include")
   set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Dd_m3HasUVWASI")
-  target_link_libraries(${OUT_FILE} uvwasi_a uv_a)
+  target_link_libraries(${OUT_FILE} uvwasi_a)
 endif()
 
 check_ipo_supported(RESULT result)
