mirror of
				https://github.com/bytecodealliance/wasm-micro-runtime.git
				synced 2025-10-31 05:11:19 +00:00 
			
		
		
		
	 dfd16f8e4f
			
		
	
	
		dfd16f8e4f
		
			
		
	
	
	
	
		
			
			This PR integrates an Intel SGX feature called Intel Protection File System Library (IPFS) into the runtime to create, operate and delete files inside the enclave, while guaranteeing the confidentiality and integrity of the data persisted. IPFS can be referred to here: https://www.intel.com/content/www/us/en/developer/articles/technical/overview-of-intel-protected-file-system-library-using-software-guard-extensions.html Introduce a cmake variable `WAMR_BUILD_SGX_IPFS`, when enabled, the files interaction API of WASI will leverage IPFS, instead of the regular POSIX OCALLs. The implementation has been written with light changes to sgx platform layer, so all the security aspects WAMR relies on are conserved. In addition to this integration, the following changes have been made: - The CI workflow has been adapted to test the compilation of the runtime and sample with the flag `WAMR_BUILD_SGX_IPFS` set to true - Introduction of a new sample that demonstrates the interaction of the files (called `file`), - Documentation of this new feature
		
			
				
	
	
		
			27 lines
		
	
	
		
			769 B
		
	
	
	
		
			CMake
		
	
	
	
	
	
			
		
		
	
	
			27 lines
		
	
	
		
			769 B
		
	
	
	
		
			CMake
		
	
	
	
	
	
| # Copyright (C) 2022 Intel Corporation.  All rights reserved.
 | |
| # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 | |
| 
 | |
| cmake_minimum_required(VERSION 3.0)
 | |
| project(wasm-app)
 | |
| 
 | |
| set (WAMR_ROOT_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../../..)
 | |
| 
 | |
| if (APPLE)
 | |
|     set (HAVE_FLAG_SEARCH_PATHS_FIRST 0)
 | |
|     set (CMAKE_C_LINK_FLAGS "")
 | |
|     set (CMAKE_CXX_LINK_FLAGS "")
 | |
| endif ()
 | |
| 
 | |
| set (CMAKE_SYSTEM_PROCESSOR wasm32)
 | |
| 
 | |
| if (NOT DEFINED WASI_SDK_DIR)
 | |
|     set (WASI_SDK_DIR               "/opt/wasi-sdk")
 | |
| endif ()
 | |
| 
 | |
| set (CMAKE_C_COMPILER_TARGET        "wasm32-wasi")
 | |
| set (CMAKE_C_COMPILER               "${WASI_SDK_DIR}/bin/clang")
 | |
| set (CMAKE_C_FLAGS                  "${CMAKE_C_FLAGS} -O3 -Wno-unused-command-line-argument")
 | |
| 
 | |
| add_executable(file.wasm main.c)
 | |
| target_link_libraries(file.wasm)
 |