From 9d689b3a22d3ccd341393b5f76a071c89879371e Mon Sep 17 00:00:00 2001 From: Xu Jun Date: Mon, 18 Jul 2022 18:47:44 +0800 Subject: [PATCH] Set noexecstack CXX link flags for wamrc (#1303) Set noexecstack CXX link flags for wamrc to avoid generating binary with exec stack. --- wamr-compiler/CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/wamr-compiler/CMakeLists.txt b/wamr-compiler/CMakeLists.txt index d38157fb..978b4e0a 100644 --- a/wamr-compiler/CMakeLists.txt +++ b/wamr-compiler/CMakeLists.txt @@ -226,6 +226,7 @@ if (NOT MSVC) endif() if (NOT (MSVC OR CMAKE_C_COMPILER MATCHES ".*clang.*" OR CMAKE_C_COMPILER_ID MATCHES ".*Clang")) set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wl,-z,noexecstack,-z,relro,-z,now") + set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wl,-z,noexecstack,-z,relro,-z,now") endif() # We disable these flags by default to stay the same with wasm runtime