mirror of
https://github.com/apache/nuttx.git
synced 2026-05-21 21:34:07 +08:00
sim: Fix linker support and macOS host build issues
Update SIM configuration and CMake toolchain to resolve linker errors when building on macOS. Adjust POSIX host implementation to ensure successful compilation and proper behavior of the sim target. Modified: - arch/sim/Kconfig - arch/sim/src/cmake/Toolchain.cmake - arch/sim/src/sim/posix/sim_hostmisc.c Signed-off-by: Aditya Yadav <166515021+aditya0yadav@users.noreply.github.com>
This commit is contained in:
@@ -37,6 +37,7 @@ config ARCH_CHIP
|
||||
|
||||
choice
|
||||
prompt "Toolchain Selection"
|
||||
default SIM_TOOLCHAIN_CLANG if HOST_MACOS
|
||||
default SIM_TOOLCHAIN_GCC
|
||||
|
||||
config SIM_TOOLCHAIN_GCC
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
#
|
||||
# ##############################################################################
|
||||
|
||||
if(APPLE)
|
||||
if(APPLE AND CONFIG_SIM_TOOLCHAIN_GCC)
|
||||
find_program(CMAKE_C_ELF_COMPILER x86_64-elf-gcc)
|
||||
find_program(CMAKE_CXX_ELF_COMPILER x86_64-elf-g++)
|
||||
endif()
|
||||
@@ -121,7 +121,12 @@ if(CONFIG_STACK_USAGE_WARNING)
|
||||
endif()
|
||||
|
||||
if(CONFIG_COVERAGE_ALL)
|
||||
add_compile_options(-fprofile-arcs -ftest-coverage -fno-inline)
|
||||
if(CONFIG_ARCH_TOOLCHAIN_GCC)
|
||||
add_compile_options(-fprofile-arcs -ftest-coverage -fno-inline)
|
||||
elseif(CONFIG_ARCH_TOOLCHAIN_CLANG)
|
||||
add_compile_options(-fprofile-instr-generate -fcoverage-mapping)
|
||||
add_link_options(-fprofile-instr-generate)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(CONFIG_PROFILE_ALL OR CONFIG_SIM_PROFILE)
|
||||
|
||||
@@ -24,6 +24,7 @@
|
||||
* Included Files
|
||||
****************************************************************************/
|
||||
|
||||
#include <signal.h>
|
||||
#include <errno.h>
|
||||
#include <limits.h>
|
||||
#include <stdio.h>
|
||||
|
||||
Reference in New Issue
Block a user