From a628dde85c3567b543efb97fc390062410c03637 Mon Sep 17 00:00:00 2001 From: Arnaud Pouliquen Date: Fri, 25 Oct 2024 09:44:11 +0200 Subject: [PATCH] legacy_apps: Fix rpc demo dynamic library build Add the missing -fPIC option for dynamic library generation to fix the following error: /usr/bin/ld: CMakeFiles/rpc_demod-shared.dir/__/__/system/linux/machine/generic/rsc_table.c.o: relocation R_X86_64_PC32 against symbol `resources' can not be used when making a shared object; recompile with -fPIC Signed-off-by: Arnaud Pouliquen --- examples/legacy_apps/examples/rpc_demo/CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/examples/legacy_apps/examples/rpc_demo/CMakeLists.txt b/examples/legacy_apps/examples/rpc_demo/CMakeLists.txt index cb22472..a8b486d 100644 --- a/examples/legacy_apps/examples/rpc_demo/CMakeLists.txt +++ b/examples/legacy_apps/examples/rpc_demo/CMakeLists.txt @@ -29,6 +29,7 @@ foreach (_app ${app_list}) if (WITH_SHARED_LIB) add_executable (${_app}-shared ${_sources}) + target_compile_options (${_app}-shared PRIVATE "-fPIC") target_link_libraries (${_app}-shared -shared ${OPENAMP_LIB} ${_deps}) install (TARGETS ${_app}-shared RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) endif (WITH_SHARED_LIB)