From 9798bc1d1fa23e7b3dec300838114f6a66f648de Mon Sep 17 00:00:00 2001 From: Daniel Jasinski Date: Tue, 20 Aug 2024 12:35:21 -0400 Subject: [PATCH] build: fix syscall instrumentation in flat build This fixes syscall instrumentation in flat build: - add syscall_names.c if LIB_SYSCALL=n to 'wraps' subdirectory - change execute_process to add_custom_command - fix typo in wrapper naming convention Signed-off-by: Daniel Jasinski --- syscall/CMakeLists.txt | 8 +++----- syscall/wraps/CMakeLists.txt | 7 ++++--- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/syscall/CMakeLists.txt b/syscall/CMakeLists.txt index 5ad019828e..ed49c7b0f5 100644 --- a/syscall/CMakeLists.txt +++ b/syscall/CMakeLists.txt @@ -42,11 +42,9 @@ endif() if(CONFIG_SCHED_INSTRUMENTATION_SYSCALL) if(CONFIG_LIB_SYSCALL) target_sources(proxies PRIVATE syscall_names.c) + target_sources(stubs PRIVATE syscall_names.c) else() - target_sources(proxies PRIVATE syscall_names.c) + add_subdirectory(wraps) + target_sources(wraps PRIVATE syscall_names.c) endif() endif() - -if(CONFIG_SCHED_INSTRUMENTATION_SYSCALL) - add_subdirectory(wraps) -endif() diff --git a/syscall/wraps/CMakeLists.txt b/syscall/wraps/CMakeLists.txt index 2be30de35e..c252ae6e93 100644 --- a/syscall/wraps/CMakeLists.txt +++ b/syscall/wraps/CMakeLists.txt @@ -19,14 +19,15 @@ # ############################################################################## nuttx_add_kernel_library(wraps) -list(TRANSFORM SYSCALLS PREPEND "${CMAKE_CURRENT_BINARY_DIR}/WRAPS_") +list(TRANSFORM SYSCALLS PREPEND "${CMAKE_CURRENT_BINARY_DIR}/WRAP_") # generate files -execute_process( +add_custom_command( OUTPUT ${SYSCALLS} COMMAND ${CMAKE_BINARY_DIR}/bin/mksyscall -w ${CMAKE_CURRENT_LIST_DIR}/../syscall.csv - WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} DEPENDS nuttx_host_tools) + WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} + DEPENDS mksyscall) # TODO: SYSCALLWRAPS = syscall_wraps.ldcmd $(Q) $(CPP) $(CPPFLAGS) # $(SYSCALLWRAPS:.ldcmd=.h) | \ sed -e '1,/WRAPOPTSTARTS/d' -e '/^#/d' >