From e76be6810a1d05dd0d6ee584ad3f9dd41a8b0bae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lukas=20H=C3=B6ppner?= Date: Thu, 20 Aug 2026 01:11:24 +0200 Subject: [PATCH] linux fixes --- .vscode/settings.json | 2 +- core/CMakeLists.txt | 14 +++++++++++++- core/include/nova64_framebuffer.h | 2 +- 3 files changed, 15 insertions(+), 3 deletions(-) diff --git a/.vscode/settings.json b/.vscode/settings.json index 8c3b338..a27524a 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -4,7 +4,7 @@ "cmake.configureOnOpen": true, "C_Cpp.default.configurationProvider": "ms-vscode.cmake-tools", - "cmake.cmakePath": "C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\Common7\\IDE\\CommonExtensions\\Microsoft\\CMake\\CMake\\bin\\cmake.exe", + //"cmake.cmakePath": "C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\Common7\\IDE\\CommonExtensions\\Microsoft\\CMake\\CMake\\bin\\cmake.exe", "cmake.configureSettings": { "BUILD_SIMULATOR": "ON" } diff --git a/core/CMakeLists.txt b/core/CMakeLists.txt index 4bb0cb6..88a7baa 100644 --- a/core/CMakeLists.txt +++ b/core/CMakeLists.txt @@ -64,7 +64,7 @@ else() if(WIN32) set(FREERTOS_PORT "MSVC_MINGW" CACHE STRING "") else() - set(FREERTOS_PORT "GCC/POSIX" CACHE STRING "") + set(FREERTOS_PORT "GCC_POSIX" CACHE STRING "") endif() # Select FreeRTOS heap implementation (provides pvPortMalloc/vPortFree) set(FREERTOS_HEAP 4 CACHE STRING "FreeRTOS Heap Implementation") @@ -102,6 +102,18 @@ else() FetchContent_MakeAvailable(FreeRTOS_Kernel wamr_runtime) + # -------------------------------------------------------------------------- + # Force -fPIC for FreeRTOS targets (required for linking into .so) + # -------------------------------------------------------------------------- + if(NOT WIN32) + if(TARGET freertos_kernel) + set_target_properties(freertos_kernel PROPERTIES POSITION_INDEPENDENT_CODE ON) + endif() + if(TARGET freertos_kernel_port) + set_target_properties(freertos_kernel_port PROPERTIES POSITION_INDEPENDENT_CODE ON) + endif() + endif() + # -------------------------------------------------------------------------- # Nova64 Core Target # -------------------------------------------------------------------------- diff --git a/core/include/nova64_framebuffer.h b/core/include/nova64_framebuffer.h index 6898560..690c034 100644 --- a/core/include/nova64_framebuffer.h +++ b/core/include/nova64_framebuffer.h @@ -28,7 +28,7 @@ typedef struct { } nova64_framebuffer_t; // Global instance access -NOVA64_API nova64_framebuffer_t nova64_framebuffer; +NOVA64_API extern nova64_framebuffer_t nova64_framebuffer; // Function prototypes bool nova64_framebuffer_init(void);