Kaynağa Gözat

product-mini/platforms/linux: Mark vmlib POSITION_INDEPENDENT_CODE (#2323)

This fixes armhf build:
https://github.com/bytecodealliance/wasm-micro-runtime/issues/2315

Note: This is not the only place which seems to have the same problem.
For example, many of examples sharing the similar structure probably
have the same problem. This commit leaves them for now.
YAMAMOTO Takashi 2 yıl önce
ebeveyn
işleme
5c13bbbde7
1 değiştirilmiş dosya ile 3 ekleme ve 1 silme
  1. 3 1
      product-mini/platforms/linux/CMakeLists.txt

+ 3 - 1
product-mini/platforms/linux/CMakeLists.txt

@@ -121,7 +121,10 @@ endif ()
 set (WAMR_ROOT_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../../..)
 
 include (${WAMR_ROOT_DIR}/build-scripts/runtime_lib.cmake)
+
+check_pie_supported()
 add_library(vmlib ${WAMR_RUNTIME_LIB_SOURCE})
+set_target_properties (vmlib PROPERTIES POSITION_INDEPENDENT_CODE ON)
 
 set (CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,--gc-sections")
 
@@ -150,7 +153,6 @@ include (${SHARED_DIR}/utils/uncommon/shared_uncommon.cmake)
 
 add_executable (iwasm main.c ${UNCOMMON_SHARED_SOURCE})
 
-check_pie_supported()
 set_target_properties (iwasm PROPERTIES POSITION_INDEPENDENT_CODE ON)
 
 install (TARGETS iwasm DESTINATION bin)