From 6e3c3fe9ec08faf0f28db91fd952d6bbe2334935 Mon Sep 17 00:00:00 2001 From: YAMAMOTO Takashi Date: Tue, 6 Jun 2023 14:45:18 +0900 Subject: [PATCH] Fix build error with LLVM 16 (#2259) --- core/iwasm/compilation/aot_llvm_extra.cpp | 2 ++ core/iwasm/compilation/aot_llvm_extra2.cpp | 2 ++ core/iwasm/compilation/aot_orc_extra.cpp | 2 ++ core/iwasm/libraries/wasi-nn/test/CMakeLists.txt | 2 +- product-mini/platforms/darwin/CMakeLists.txt | 2 +- product-mini/platforms/freebsd/CMakeLists.txt | 2 +- product-mini/platforms/ios/CMakeLists.txt | 2 +- product-mini/platforms/linux/CMakeLists.txt | 2 +- samples/wasm-c-api/CMakeLists.txt | 2 +- wamr-compiler/CMakeLists.txt | 2 +- 10 files changed, 13 insertions(+), 7 deletions(-) diff --git a/core/iwasm/compilation/aot_llvm_extra.cpp b/core/iwasm/compilation/aot_llvm_extra.cpp index 27a014d8..a8843cce 100644 --- a/core/iwasm/compilation/aot_llvm_extra.cpp +++ b/core/iwasm/compilation/aot_llvm_extra.cpp @@ -5,6 +5,8 @@ #include #include +#include +#include #include #include #include diff --git a/core/iwasm/compilation/aot_llvm_extra2.cpp b/core/iwasm/compilation/aot_llvm_extra2.cpp index 2d665c5f..8c3f3a39 100644 --- a/core/iwasm/compilation/aot_llvm_extra2.cpp +++ b/core/iwasm/compilation/aot_llvm_extra2.cpp @@ -4,6 +4,8 @@ */ #include +#include +#include #if LLVM_VERSION_MAJOR >= 14 #include #else diff --git a/core/iwasm/compilation/aot_orc_extra.cpp b/core/iwasm/compilation/aot_orc_extra.cpp index 8cf253e9..b778b634 100644 --- a/core/iwasm/compilation/aot_orc_extra.cpp +++ b/core/iwasm/compilation/aot_orc_extra.cpp @@ -8,6 +8,8 @@ #include "llvm-c/OrcEE.h" #include "llvm-c/TargetMachine.h" +#include "llvm/ADT/None.h" +#include "llvm/ADT/Optional.h" #include "llvm/ExecutionEngine/Orc/JITTargetMachineBuilder.h" #include "llvm/ExecutionEngine/Orc/LLJIT.h" #include "llvm/ExecutionEngine/Orc/ObjectTransformLayer.h" diff --git a/core/iwasm/libraries/wasi-nn/test/CMakeLists.txt b/core/iwasm/libraries/wasi-nn/test/CMakeLists.txt index 33fad71e..30be48a2 100644 --- a/core/iwasm/libraries/wasi-nn/test/CMakeLists.txt +++ b/core/iwasm/libraries/wasi-nn/test/CMakeLists.txt @@ -8,7 +8,7 @@ project (iwasm) set (CMAKE_VERBOSE_MAKEFILE OFF) # Reset default linker flags set (CMAKE_C_STANDARD 99) -set (CMAKE_CXX_STANDARD 14) +set (CMAKE_CXX_STANDARD 17) set (CMAKE_SHARED_LIBRARY_LINK_C_FLAGS "") set (CMAKE_SHARED_LIBRARY_LINK_CXX_FLAGS "") diff --git a/product-mini/platforms/darwin/CMakeLists.txt b/product-mini/platforms/darwin/CMakeLists.txt index 4d68066b..865e516f 100644 --- a/product-mini/platforms/darwin/CMakeLists.txt +++ b/product-mini/platforms/darwin/CMakeLists.txt @@ -34,7 +34,7 @@ if (NOT CMAKE_BUILD_TYPE) set(CMAKE_BUILD_TYPE Release) endif () -set(CMAKE_CXX_STANDARD 14) +set(CMAKE_CXX_STANDARD 17) if (NOT DEFINED WAMR_BUILD_INTERP) # Enable Interpreter by default diff --git a/product-mini/platforms/freebsd/CMakeLists.txt b/product-mini/platforms/freebsd/CMakeLists.txt index fee2934c..dd1bbc41 100644 --- a/product-mini/platforms/freebsd/CMakeLists.txt +++ b/product-mini/platforms/freebsd/CMakeLists.txt @@ -34,7 +34,7 @@ if (NOT CMAKE_BUILD_TYPE) set(CMAKE_BUILD_TYPE Release) endif () -set(CMAKE_CXX_STANDARD 14) +set(CMAKE_CXX_STANDARD 17) if (NOT DEFINED WAMR_BUILD_INTERP) # Enable Interpreter by default diff --git a/product-mini/platforms/ios/CMakeLists.txt b/product-mini/platforms/ios/CMakeLists.txt index 764bc7f6..4bbff4cf 100644 --- a/product-mini/platforms/ios/CMakeLists.txt +++ b/product-mini/platforms/ios/CMakeLists.txt @@ -41,7 +41,7 @@ if (NOT CMAKE_BUILD_TYPE) set(CMAKE_BUILD_TYPE Release) endif () -set(CMAKE_CXX_STANDARD 14) +set(CMAKE_CXX_STANDARD 17) if (NOT DEFINED WAMR_BUILD_INTERP) # Enable Interpreter by default diff --git a/product-mini/platforms/linux/CMakeLists.txt b/product-mini/platforms/linux/CMakeLists.txt index 83ccd745..13efe27a 100644 --- a/product-mini/platforms/linux/CMakeLists.txt +++ b/product-mini/platforms/linux/CMakeLists.txt @@ -16,7 +16,7 @@ set (CMAKE_SHARED_LIBRARY_LINK_C_FLAGS "") set (CMAKE_SHARED_LIBRARY_LINK_CXX_FLAGS "") set (CMAKE_C_STANDARD 99) -set (CMAKE_CXX_STANDARD 14) +set (CMAKE_CXX_STANDARD 17) # Set WAMR_BUILD_TARGET, currently values supported: # "X86_64", "AMD_64", "X86_32", "AARCH64[sub]", "ARM[sub]", "THUMB[sub]", diff --git a/samples/wasm-c-api/CMakeLists.txt b/samples/wasm-c-api/CMakeLists.txt index a0f267c5..4dab0185 100644 --- a/samples/wasm-c-api/CMakeLists.txt +++ b/samples/wasm-c-api/CMakeLists.txt @@ -16,7 +16,7 @@ if(NOT CMAKE_BUILD_TYPE) set(CMAKE_BUILD_TYPE Release) endif() -set(CMAKE_CXX_STANDARD 14) +set(CMAKE_CXX_STANDARD 17) ################ runtime settings ################ string (TOLOWER ${CMAKE_HOST_SYSTEM_NAME} WAMR_BUILD_PLATFORM) diff --git a/wamr-compiler/CMakeLists.txt b/wamr-compiler/CMakeLists.txt index 0ae821af..08f935bb 100644 --- a/wamr-compiler/CMakeLists.txt +++ b/wamr-compiler/CMakeLists.txt @@ -21,7 +21,7 @@ else() add_definitions(-DCOMPILING_WASM_RUNTIME_API=1) endif() -set (CMAKE_CXX_STANDARD 14) +set (CMAKE_CXX_STANDARD 17) if (NOT DEFINED WAMR_BUILD_PLATFORM) set (WAMR_BUILD_PLATFORM "linux")