From 48069b9d256cd700a81fbb6421305515b0203244 Mon Sep 17 00:00:00 2001 From: Dan Green Date: Thu, 12 Dec 2024 13:18:13 -0800 Subject: [PATCH] Remove -ffreestanding link and compile flags, and have main return int --- firmware/cmake/arch_mp15xa7.cmake | 1 - firmware/cmake/arch_mp15xm4.cmake | 4 +--- firmware/src/CMakeLists.txt | 1 - firmware/src/core_a7/main.cc | 2 +- firmware/src/core_m4/main_m4.cc | 2 +- 5 files changed, 3 insertions(+), 7 deletions(-) diff --git a/firmware/cmake/arch_mp15xa7.cmake b/firmware/cmake/arch_mp15xa7.cmake index 859cc125d..1757bf8ac 100644 --- a/firmware/cmake/arch_mp15xa7.cmake +++ b/firmware/cmake/arch_mp15xa7.cmake @@ -39,7 +39,6 @@ add_compile_options( -fdata-sections -ffunction-sections -nostartfiles - -ffreestanding -fno-unwind-tables -Wall -Werror=return-type diff --git a/firmware/cmake/arch_mp15xm4.cmake b/firmware/cmake/arch_mp15xm4.cmake index 099c27381..0001dd2ed 100644 --- a/firmware/cmake/arch_mp15xm4.cmake +++ b/firmware/cmake/arch_mp15xm4.cmake @@ -34,7 +34,6 @@ add_compile_options( -fdata-sections -ffunction-sections -nostartfiles - -ffreestanding -fno-unwind-tables -Wall -Werror=return-type @@ -50,8 +49,7 @@ add_compile_options( add_link_options( -Wl,--gc-sections - -ffreestanding -nostartfiles ${MCU_FLAGS} ) -endmacro() \ No newline at end of file +endmacro() diff --git a/firmware/src/CMakeLists.txt b/firmware/src/CMakeLists.txt index cc01909b0..3b0106287 100644 --- a/firmware/src/CMakeLists.txt +++ b/firmware/src/CMakeLists.txt @@ -268,7 +268,6 @@ target_link_script( -L${FWDIR} -Wl,--gc-sections -Wno-psabi - -ffreestanding -nostartfiles ) diff --git a/firmware/src/core_a7/main.cc b/firmware/src/core_a7/main.cc index 9bc49e32a..4352e84b2 100644 --- a/firmware/src/core_a7/main.cc +++ b/firmware/src/core_a7/main.cc @@ -41,7 +41,7 @@ struct SystemInit : AppStartup, UartLog, Debug, Hardware { } // namespace MetaModule -void main() { +int main() { using namespace MetaModule; StaticBuffers::init(); diff --git a/firmware/src/core_m4/main_m4.cc b/firmware/src/core_m4/main_m4.cc index 470608c43..fb736a7b8 100644 --- a/firmware/src/core_m4/main_m4.cc +++ b/firmware/src/core_m4/main_m4.cc @@ -39,7 +39,7 @@ static void app_startup() { } // namespace MetaModule -void main() { +int main() { using namespace MetaModule; using namespace mdrivlib;