Skip to content

Commit

Permalink
os/syscall: Fixes build error when sched info logs enabled from menuc…
Browse files Browse the repository at this point in the history
…onfig for rtl8730e

Building loadable apps or loadable ext with sched info logs enabled for RTL8730e results in error for undefined symbol g_funcnames:

arm-none-eabi-ld: /root/tizenrt/os/../build/output/libraries/libkarch.a(arm_syscall.o): in function `dump_syscall':
/root/tizenrt/os/arch/arm/src/armv7-a/arm_syscall.c:93: undefined reference to `g_funcnames'

This commit fixes the error by removing enclosing #if defined __KERNEL__ directive and unused headers so that g_funcnames definitions is not excluded by the pre-processor.
  • Loading branch information
agnel-samsung authored and kishore-sn committed Sep 12, 2024
1 parent 94797b9 commit 10ad626
Showing 1 changed file with 2 additions and 43 deletions.
45 changes: 2 additions & 43 deletions os/syscall/syscall_names.c
Original file line number Diff line number Diff line change
Expand Up @@ -41,49 +41,8 @@

#include <tinyara/config.h>

#if defined(CONFIG_LIB_SYSCALL) && defined(__KERNEL__)
#if defined(CONFIG_LIB_SYSCALL)
#include <syscall.h>
#include <sys/stat.h>
#include <sys/wait.h>
#include <sys/ioctl.h>
#include <sys/time.h>
#include <sys/select.h>
#include <sys/mman.h>
#include <sys/stat.h>
#include <sys/statfs.h>
#include <sys/prctl.h>
#include <sys/socket.h>
#include <sys/mount.h>
#include <sys/boardctl.h>

#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <fcntl.h>
#include <dirent.h>
#include <poll.h>
#include <time.h>
#include <sched.h>
#include <pthread.h>
#include <semaphore.h>
#include <signal.h>
#include <mqueue.h>
#include <assert.h>

/* Errno access is awkward. We need to generate get_errno() and set_errno()
* interfaces to support the system calls, even though we don't use them
* ourself.
*
* The "normal" pre-processor definitions for these functions is in errno.h
* but we need the internal function prototypes in include/errno.h.
*/

#undef get_errno
#undef set_errno

#include <tinyara/errno.h>
#include <tinyara/clock.h>


/****************************************************************************
* Public Data
Expand All @@ -102,4 +61,4 @@ const char *g_funcnames[SYS_nsyscalls] =
# define SYSCALL_LOOKUP(f, n, p) #f
# include "syscall_lookup.h"
};
#endif /* CONFIG_LIB_SYSCALL && __KERNEL__ */
#endif /* CONFIG_LIB_SYSCALL */

0 comments on commit 10ad626

Please sign in to comment.