From 5c13bbbde7516838cb757e2ad56ef715a8e09451 Mon Sep 17 00:00:00 2001 From: YAMAMOTO Takashi Date: Thu, 29 Jun 2023 15:57:27 +0900 Subject: [PATCH] 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. --- product-mini/platforms/linux/CMakeLists.txt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/product-mini/platforms/linux/CMakeLists.txt b/product-mini/platforms/linux/CMakeLists.txt index 97771a92..ecd08655 100644 --- a/product-mini/platforms/linux/CMakeLists.txt +++ b/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)