File tree Expand file tree Collapse file tree
product-mini/platforms/linux Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -80,8 +80,9 @@ elseif (WAMR_BUILD_TARGET MATCHES "THUMB.*")
8080 set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -mthumb" )
8181 set (CMAKE_ASM_FLAGS "${CMAKE_ASM_FLAGS} -Wa,-mthumb" )
8282elseif (WAMR_BUILD_TARGET MATCHES "X86_.*" OR WAMR_BUILD_TARGET STREQUAL "AMD_64" )
83- if (CMAKE_C_COMPILER MATCHES ".*gcc.*" OR CMAKE_C_COMPILER_ID MATCHES ".*GNU" )
83+ if (CMAKE_C_COMPILER_ID MATCHES ".*GNU" )
8484 set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -mindirect-branch-register" )
85+ set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mindirect-branch-register" )
8586 endif ()
8687endif ()
8788
Original file line number Diff line number Diff line change @@ -139,13 +139,6 @@ check_pie_supported()
139139
140140set (CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,--gc-sections" )
141141
142- if (WAMR_BUILD_TARGET MATCHES "X86_.*" OR WAMR_BUILD_TARGET STREQUAL "AMD_64" )
143- if (CMAKE_C_COMPILER MATCHES ".*gcc.*" OR CMAKE_C_COMPILER_ID MATCHES ".*GNU" )
144- set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -mindirect-branch-register" )
145- # UNDEFINED BEHAVIOR, refer to https://en.cppreference.com/w/cpp/language/ub
146- endif ()
147- endif ()
148-
149142# The following flags are to enhance security, but it may impact performance,
150143# we disable them by default.
151144#if (WAMR_BUILD_TARGET MATCHES "X86_.*" OR WAMR_BUILD_TARGET STREQUAL "AMD_64")
You can’t perform that action at this time.
0 commit comments